Method, device, electronic device, readable storage medium and product for searching
By adaptively adjusting the search distance and range, and combining spatial indexing technology, the problems of data redundancy and insufficient quantity when searching for target objects around the target location are solved, achieving higher search accuracy and efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-15
- Publication Date
- 2026-03-24
AI Technical Summary
Existing technologies suffer from data redundancy or insufficient quantity when searching for target objects around a target location, resulting in poor search accuracy.
By acquiring target location information and a retrieval distance prediction model, the retrieval range is adaptively adjusted. Combined with spatial indexing technology, target objects are quickly retrieved, and the correspondence between object-related information of the target object and sub-regions is established. The retrieval distance is iteratively adjusted until the user's needs are met.
It improves search accuracy, reduces data redundancy and insufficient search recall, and enhances search efficiency and performance.
Smart Images

Figure CN115700532B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of retrieval, in particular to a retrieval method and device, an electronic device, a readable storage medium and a product. BACKGROUND
[0002] With the development of Internet technology, in order to better provide services for users, it is usually necessary to retrieve a plurality of target objects around a target location. For example, when a user takes a taxi, the user can retrieve the nearest 10 idle vehicles around the user, so that the user can know the number of idle vehicles around the user in real time.
[0003] In the prior art, the target objects within a fixed retrieval range around the target location are usually retrieved.
[0004] However, since the density of target objects in different areas is usually different, when the user is in different positions, the retrieval result obtained may have problems of data redundancy or insufficient quantity, and the retrieval accuracy is poor.
[0005] Therefore, when retrieving target objects around a target location, how to improve the retrieval accuracy is a technical problem to be solved. SUMMARY
[0006] The embodiments of the present application aim to provide a retrieval method and device, an electronic device, a readable storage medium and a product, so as to improve the retrieval accuracy when retrieving target objects around a target location.
[0007] In one aspect, a retrieval method is provided, comprising:
[0008] Obtaining target position information in a retrieval request message used for requesting retrieval of target objects;
[0009] Obtaining a target retrieval distance based on the target position information and a retrieval distance estimation model;
[0010] Retrieving the target objects based on the target position information and the target retrieval distance to obtain a retrieval result.
[0011] In the above implementation process, by using the retrieval distance estimation model, the target retrieval distance during retrieval can be adaptively adjusted according to the target position information, so as to adaptively adjust the retrieval range, avoid problems such as retrieval data redundancy and insufficient number of retrieval recalls, and improve the retrieval accuracy.
[0012] In one embodiment, obtaining the target retrieval distance based on the target position information and the retrieval distance estimation model comprises:
[0013] Obtaining a query distance threshold and a query quantity threshold of the target objects;
[0014] determine a maximum query region according to the target position information and the query distance threshold;
[0015] obtain a target object density in the maximum query region;
[0016] input the query number threshold, the query distance threshold, and the target object density into the search distance estimation model, and output a target search distance.
[0017] In the implementation process, different target search distances are estimated according to different query conditions, i.e., the target object density, the query number threshold, and the query distance threshold, so that different search ranges can be used for searching in different regions.
[0018] In an implementation, the target object is searched based on the target position information and the target search distance to obtain a search result, including:
[0019] determine a region to be searched based on the target position information and the target search distance;
[0020] obtain object-related information and a target object number of the target object in the region to be searched;
[0021] if the target object number is not lower than the query number threshold or the target search distance is not lower than the query distance threshold, it is determined that the search condition is met, and the object-related information and the target object number are determined as the search result;
[0022] if it is determined that the target object number and the target search distance do not meet the search condition, the target search distance is increased, and the target object is searched based on the target position information and the increased target search distance until the new target object number obtained by the search or the increased target search distance meets the search condition, and the new target object number and the new object-related information are determined as the search result.
[0023] In the implementation process, if the search result does not meet the search condition, the target search distance is increased until the search result meets the search condition, so that the search range can be adaptively and iteratively increased according to the search result to obtain a search result meeting the user demand.
[0024] In an implementation, the object-related information and the target object number of the target object in the region to be searched are obtained, including:
[0025] obtain a sub-region size output by the search distance estimation model;
[0026] obtain a correspondence between a sub-region with the sub-region size and the object-related information of the target object;
[0027] determine a target sub-region in the region to be searched;
[0028] According to the target sub-region and the corresponding relationship, object-related information and a target object quantity of the target object in the target sub-region are obtained.
[0029] In the implementation process, the corresponding relationship between the sub-region and the object-related information of the target object is established, i.e., a spatial index, so that the object-related information and the target object quantity in the target sub-region, i.e., the range to be searched, can be quickly searched by using the spatial index, and the search efficiency is greatly improved.
[0030] In an implementation, the target search distance is adjusted, and the target object is searched based on the target position information and the increased target search distance until the new target object quantity obtained by searching or the increased target search distance meets the search condition, including:
[0031] The following steps are repeatedly performed until the new target object quantity obtained by searching or the increased target search distance meets the search condition:
[0032] According to the sub-region size, the target search distance is increased to obtain an increased target search distance;
[0033] Based on the target position information and the increased target search distance, the target sub-region covered by searching is updated;
[0034] Based on the updated target sub-region and the corresponding relationship, new object-related information and a new target object quantity in the updated target sub-region are obtained;
[0035] It is determined whether the new target object quantity obtained by searching is not lower than a query quantity threshold value and whether the increased target search distance is not lower than a query distance threshold value.
[0036] In the implementation process, the search range is adaptively and iteratively increased to obtain a search result meeting the user demand.
[0037] In an implementation, after the target object is searched based on the target position information and the target search distance to obtain a search result, the method further includes:
[0038] If the target object quantity in the search result is the query quantity threshold value, the target object obtained by searching is displayed to the user according to the object-related information of the target object in the search result.
[0039] If the target object quantity in the search result is higher than the query quantity threshold value, object position information in the object-related information of each target object is obtained.
[0040] According to the target position information and the object position information of each target object in the search result, a distance between each target object in the search result and the user is determined respectively;
[0041] According to the distance between each target object in the search result and the user, target objects with a number of the query number threshold are selected from the target objects in the search result, wherein the distance between the selected target objects and the user is lower than the distance between the unselected target objects and the user;
[0042] According to the object related information of the selected target objects, the selected target objects are displayed to the user.
[0043] In the above implementation process, the target objects are selected, so that only the selected target objects can be displayed to the user, and the redundancy of the displayed data is reduced.
[0044] In an implementation, before obtaining the target search distance based on the target position information and the search distance estimation model, the method further includes:
[0045] An initial prediction model is constructed based on a random forest algorithm or a deep learning algorithm;
[0046] The initial prediction model is trained based on each search information sample, and the sub-region size sample and the search distance verification sample corresponding to each search information sample, to obtain a trained search distance estimation model.
[0047] In the above implementation process, the model is trained according to the training sample data, so that the trained search distance estimation model can be obtained.
[0048] In one aspect, a search device is provided, including:
[0049] An acquisition unit is configured to acquire target position information in a search request message used to request a search target object;
[0050] An estimation unit is configured to obtain a target search distance based on the target position information and a search distance estimation model;
[0051] A search unit is configured to search a target object based on the target position information and the target search distance, and obtain a search result.
[0052] In one implementation, the estimation unit is configured to:
[0053] Obtain a query distance threshold and a query number threshold of the target object;
[0054] Determine a maximum query region according to the target position information and the query distance threshold;
[0055] acquire a target object density in a maximum query area;
[0056] input the query number threshold, the query distance threshold, and the target object density into a search distance estimation model, and output a target search distance.
[0057] In an implementation, the search unit is configured to:
[0058] determine a target search area based on the target position information and the target search distance;
[0059] acquire object-related information and a target object number of target objects in the target search area;
[0060] if the target object number is not lower than the query number threshold or the target search distance is not lower than the query distance threshold, it is determined that the search condition is met, and the object-related information and the target object number are determined as the search result;
[0061] if it is determined that the target object number and the target search distance do not meet the search condition, the target search distance is increased, and target objects are searched based on the target position information and the increased target search distance until the new target object number or the increased target search distance meets the search condition, and the new target object number and new object-related information are determined as the search result.
[0062] In an implementation, the search unit is configured to:
[0063] acquire a sub-area size output by the search distance estimation model;
[0064] acquire a correspondence between a sub-area of the sub-area size and object-related information of target objects;
[0065] determine a target sub-area in the target search area;
[0066] obtain object-related information and a target object number of target objects in the target sub-area according to the target sub-area and the correspondence.
[0067] In an implementation, the search unit is configured to:
[0068] perform the following steps in a loop until the new target object number or the increased target search distance meets the search condition:
[0069] increase the target search distance according to the sub-area size to obtain an increased target search distance;
[0070] update a target sub-area covered by the search based on the target position information and the increased target search distance;
[0071] Based on the updated target sub-region and the correspondence, new object-related information and a new target object quantity in the updated target sub-region are obtained.
[0072] It is determined whether the new target object quantity obtained by the search is not lower than a query quantity threshold and whether the increased target search distance is not lower than a query distance threshold.
[0073] In an implementation, the searching unit is further configured to:
[0074] If the target object quantity in the search result is the query quantity threshold, the target objects obtained by the search are displayed to the user according to the object-related information of the target objects in the search result.
[0075] If the target object quantity in the search result is higher than the query quantity threshold, object position information in the object-related information of each target object is obtained.
[0076] According to the target position information and the object position information of each target object in the search result, a distance between each target object in the search result and the user is determined.
[0077] According to the distance between each target object in the search result and the user, target objects with a quantity of the query quantity threshold are selected from the target objects in the search result, wherein the distance between the selected target objects and the user is lower than the distance between the unselected target objects and the user.
[0078] According to the object-related information of the selected target objects, the selected target objects are displayed to the user.
[0079] In an implementation, the estimation unit is further configured to:
[0080] Based on a random forest algorithm or a deep learning algorithm, an initial prediction model is constructed.
[0081] Based on each search information sample, and the sub-region size sample and the search distance verification sample corresponding to each search information sample, the initial prediction model is trained to obtain a trained search distance estimation model.
[0082] In one aspect, an electronic device is provided, including a processor and a memory, the memory storing computer-readable instructions that, when executed by the processor, perform the steps of the method provided in any of the various optional implementations of the search described above.
[0083] In one aspect, a readable storage medium is provided, which stores a computer program that, when executed by a processor, performs the steps of the method provided in any of the various optional implementations of the search described above.
[0084] In an aspect, a computer program product is provided, including computer programs / instructions that, when executed by a processor, implement the steps of the method provided in any of the various optional implementations of the search described above.
[0085] In a method, apparatus, electronic device, readable storage medium, and product for searching provided by an embodiment of the present application, target position information in a search request message used for requesting a search target object is acquired; a target search distance is obtained based on the target position information and a search distance estimation model; and the target object is searched based on the target position information and the target search distance, and a search result is obtained. In this way, by using the search distance estimation model, the target search distance during searching can be adaptively adjusted according to the target position information, so that the search range can be adaptively adjusted, and problems such as search data redundancy and a small number of search recalls are avoided, and the search accuracy is improved.
[0086] Other features and advantages of the present application will be set forth in the following description, and in part will be apparent from the description, or can be learned by practice of the present application. The objects and other advantages of the present application will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings. BRIEF DESCRIPTION OF DRAWINGS
[0087] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments of the present application. It should be understood that the following drawings only show some of the embodiments of the present application, and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0088] Figure 1 An application scenario schematic diagram is provided for an embodiment of the present application;
[0089] Figure 2 An implementation flowchart of a model training method is provided for an embodiment of the present application;
[0090] Figure 3 A decision tree schematic diagram is provided for an embodiment of the present application;
[0091] Figure 4 A flowchart of a search method is provided for an embodiment of the present application;
[0092] Figure 5 A grid division example diagram is provided for an embodiment of the present application;
[0093] Figure 6 An example diagram of a grid address coding mapping is provided for an embodiment of the present application;
[0094] Figure 7 A target retrieval distance adjustment schematic diagram provided for an embodiment of the present application;
[0095] Figure 8 A target sub-region schematic diagram provided for an embodiment of the present application;
[0096] Figure 9 An implementation flowchart of an offline model training and online retrieval method provided for an embodiment of the present application;
[0097] Figure 10 A food retrieval example diagram provided for an embodiment of the present application;
[0098] Figure 11 A taxi retrieval example diagram provided for an embodiment of the present application;
[0099] Figure 12 A structural block diagram of a retrieval device provided for an embodiment of the present application;
[0100] Figure 13 A structural schematic diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0101] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. The components of the embodiments of the present application described and shown in the accompanying drawings can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0102] It should be noted that: similar reference numerals and letters represent similar items in the following drawings, therefore, once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. Meanwhile, in the description of the present application, the terms “first”, “second”, etc. are only used for distinguishing description, and cannot be understood as indicating or implying relative importance.
[0103] First, some terms involved in the embodiments of the present application are explained, so as to facilitate the understanding of those skilled in the art.
[0104] Terminal device: can be a mobile terminal, a fixed terminal, or a portable terminal, such as a mobile phone, a station, a unit, a device, a multimedia computer, a multimedia tablet, an Internet node, a communicator, a desktop computer, a laptop computer, a notebook computer, a netbook computer, a tablet computer, a personal communication system device, a personal navigation device, a personal digital assistant, an audio / video player, a digital camera / camcorder, a positioning device, a television receiver, a radio broadcast receiver, an electronic book device, a game device, or any combination thereof, including accessories and peripherals of these devices or any combination thereof. It is also foreseeable that the terminal device can support any type of interface for the user (such as wearable devices) and the like.
[0105] Server: can be a standalone physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, and basic cloud computing services such as big data and artificial intelligence platforms.
[0106] Long Short-Term Memory (LSTM): is a kind of time recurrent neural network, which is specially designed to solve the long-term dependence problem existing in general recurrent neural network.
[0107] Geohash: is a spatial address coding method, which is essentially a method of encoding two-dimensional data into one dimension, which divides the plane into small grids, so that the longitude and latitude data in space can be encoded into a string, which can improve the efficiency of spatial index retrieval.
[0108] Spatial index: as an auxiliary spatial data structure, the spatial index is between the spatial operation algorithm and the spatial object. Through the screening effect, a large number of spatial objects irrelevant to the specific spatial operation are excluded, thereby improving the speed and efficiency of the spatial operation. For example, through Geohash, the spatial address code of each grid is determined, and the corresponding relationship between the grid and the object information (such as vehicle position information) in the grid is established. Then, the object information in the to-be-retrieved area can be quickly obtained by searching the spatial address code of the grid covered by the to-be-retrieved area. Optionally, the spatial index can also be constructed based on Uber h3, Google S2, DIDI DGrid, and k-dimensional-tree (kd-tree).
[0109] Deep learning: is a kind of machine learning technology for establishing, simulating the neural network of human brain for analysis and learning, and imitating the mechanism of human brain to explain data.
[0110] Machine Learning: computers as a tool and committed to real-time simulation of human learning, and the existing content knowledge structure to improve learning efficiency. Machine learning is to use data or past experience, to optimize the performance of the computer program standards.
[0111] Decision Tree: represents a tree structure based on feature parameters to classify instances, containing multiple layers. The generation process of the decision tree is to use the feature parameters that meet the division criteria to constantly divide the data set into subsets with higher purity and smaller uncertainty.
[0112] Information Gain: the difference between the entropy before and after the data set is divided by a certain feature parameter. Entropy is used to measure the uncertainty of a random variable. The greater the entropy, the greater the uncertainty of the sample. Therefore, the difference between the set entropy before and after division can be used to measure the effect of using the current feature to divide.
[0113] In order to improve the retrieval accuracy when retrieving target objects around the target location, the embodiments of the present application provide a retrieval method and device, electronic equipment, readable storage medium and product.
[0114] Referring to Figure 1 As shown in the application scenario provided by the embodiments of the present application. The application scenario includes a server and a user terminal. Optionally, the server and the user terminal can be connected by wire or wirelessly. The user terminal can be one or multiple, which is not limited here. For example, user terminal 1, user terminal 2, …, user terminal n, where n is a positive integer.
[0115] Server: used for model training in the model training stage, training sample data is used for model training, obtaining the retrieval distance estimation model, also used for model application stage, after receiving the retrieval request message sent by the user terminal for requesting the retrieval target object, through the target position information in the retrieval request message, and the retrieval distance estimation model, the target retrieval distance is estimated, and the target position information and the target retrieval distance are used to determine the to-be-retrieved area, and the target object is retrieved in the to-be-retrieved area, and the retrieval result is obtained. The retrieval result is returned to the user terminal.
[0116] User terminal: can be a terminal device, used for sending a retrieval request message for requesting a retrieval target object to the server according to the user's retrieval instruction for the target object, receiving the retrieval result returned by the server, and based on the received retrieval result, showing the target object related information obtained by retrieval to the user.
[0117] For example, a user issues a retrieval instruction for retrieving an idle vehicle (i.e., a target object) through a user terminal (e.g., a mobile phone). The user terminal sends a retrieval request message containing user current location information (i.e., target location information) to a server based on the retrieval instruction. The server obtains the user current location information based on the received retrieval request message, adjusts a target retrieval distance based on the user current location information and a retrieval distance estimation model, and retrieves idle vehicles around the user based on the user location information and the target retrieval distance to obtain vehicle location information (i.e., target object related information) of the retrieved idle vehicles.
[0118] In the embodiments of the present application, the target retrieval distance when retrieving a target object can be adaptively adjusted according to target location information, and then the to-be-retrieved area can be adaptively adjusted, and the target object can be retrieved in the to-be-retrieved area, so that the problem of retrieval data redundancy and insufficient retrieval recall quantity can be reduced by adaptively adjusting the target retrieval distance, and the retrieval accuracy and retrieval performance can be improved.
[0119] It should be noted that in the embodiments of the present application, the execution subject is an electronic device, which can be a server or a terminal device, Figure 1 In the embodiments of the present application, only the model training through the server and the retrieval of the target object based on the trained model are taken as examples for illustration. In actual applications, the model training and the retrieval based on the model can also be performed by the terminal device.
[0120] Referring to Figure 2 FIG. 2 shows an implementation flowchart of a method for model training according to an embodiment of the present application, which is combined with Figure 1 The method for model training will be described in detail. The specific implementation flow of the method is as follows:
[0121] Step 200: Obtain training sample data for model training.
[0122] Specifically, the training sample data includes a plurality of retrieval information samples, and a sub-area size sample and a retrieval distance verification sample corresponding to each retrieval information sample. The retrieval information sample is the model input data, and the sub-area size sample and the retrieval distance verification sample are used to adjust the model parameters in combination with the model output result.
[0123] It should be noted that the training sample data is usually historical retrieval data collected.
[0124] Among the retrieval information sample, at least one of the following feature parameters can be included:
[0125] The target location information, the query distance threshold, the query quantity threshold of the target object, and the target object density.
[0126] In an embodiment, the target position information and the query distance threshold are retrieved.
[0127] In an embodiment, the target object density is retrieved.
[0128] The target position information is the position of the target location, and is used as the center position of the area to be retrieved when retrieval is performed. For example, the target position information can be the coordinates of the current position of the user.
[0129] The target object is the object to be retrieved. For example, the target object can be an idle vehicle, a gas station, a toilet, or the like.
[0130] The query distance threshold is the maximum retrieval distance for retrieving the target object. The query number threshold is the number of target objects to be retrieved. Optionally, the query distance threshold and the query number threshold of the target object can be obtained from a retrieval request message used to request retrieval of the target object, or can be a system default setting.
[0131] For example, the target position information is the current position of the user, the target object is an idle vehicle, the query distance threshold is 1 km, and the query number threshold is 10. This indicates that the user instructs to retrieve idle vehicles within a range of 1 km around the user, and instructs to obtain at least 10 idle vehicles.
[0132] The target object density is the number of target objects in a unit area. For example, the target object density is 10 idle vehicles per 100 square meters.
[0133] In an embodiment, the maximum query area is determined according to the target position information and the query distance threshold, and the target object density is determined according to the number of target objects in the maximum query area.
[0134] In an embodiment, the maximum query area is determined according to the target position information and the query distance threshold, and the target object density in the maximum query area is retrieved from a skiplist.
[0135] The skiplist records the target object density in each area.
[0136] It should be noted that the target object density in different areas is usually different, and therefore, when the target position information and the query distance threshold are different, the obtained target object density can also be different.
[0137] For example, the vehicle density (i.e., the target object density) in the second ring of Beijing is different from the vehicle density in the sixth ring of Beijing.
[0138] In an implementation, the target position information, the query distance threshold, the query quantity threshold of the target object, and the target object density based on the target position information and the query distance threshold are included in the information sample.
[0139] The shape of the sub-region can be a rectangle, a positive direction, a circle, or any other arbitrary shape. For example, the sub-region can be a city, and the shape of the sub-region is the geographical shape of the city. The sub-region size sample is the size of the sub-region division. In actual applications, because the shapes of the sub-regions are different, the definition of the sub-region size can be set according to the actual application scenario. For example, if the sub-region is a positive direction, the sub-region size can be the side length of a square. For another example, if the sub-region is a circle, the sub-region size can be the radius.
[0140] For example, a two-dimensional plane is divided into square sub-regions with a side length of 100 m (sub-region size sample) according to the side length of 100 m. In this way, the object-related information of the target object in each sub-region is recorded, so that in subsequent steps, the target object can be searched through the sub-region, and the search efficiency is improved.
[0141] The search distance verification sample is used to determine the search range when searching for the target object. For example, the search distance verification sample is a search radius R.
[0142] Further, when training the model, the feature parameters input to the model are all non-continuous attributes, so the training sample data can also be divided to obtain divided training sample data, so that the model can be trained through the divided training sample data in subsequent steps.
[0143] In an implementation, for each feature parameter in the training sample data, the following steps are performed: the data corresponding to the feature parameter is divided according to the set step length set for the feature parameter to obtain a plurality of data sets.
[0144] For example, the feature parameter is the query quantity threshold, which is 1, 2, 5, and 10 in turn, and the set step length is 5. The query quantity thresholds are divided according to the set step length 5 to obtain a first query quantity threshold set containing 1, 2, and 5, and a second query quantity threshold set containing 10.
[0145] In actual applications, other ways of data division can also be used, which are not limited herein.
[0146] Step 201: An initial prediction model is constructed based on a random forest algorithm or a deep learning algorithm.
[0147] In an implementation, the initial prediction model is constructed based on LSTM.
[0148] In practical applications, other algorithms can also be used to construct the initial prediction model, which is not limited herein.
[0149] In an implementation, based on the random forest algorithm, the following steps can be used to construct the initial prediction model.
[0150] S2011: Determine the information gain or Gini index between each two feature parameters according to each search information sample, and the corresponding sub-region size sample and search distance verification sample of each search information sample.
[0151] Specifically, the decision tree is a tree structure representing classification of instances based on feature parameters, and includes multiple layers. The generation process of the decision tree is a process of continuously dividing the data set into subsets with higher purity and smaller uncertainty using feature parameters that meet the division criteria. The information gain is the difference in entropy before and after dividing the data set by a certain feature parameter. Entropy is used to measure the uncertainty of a random variable. The greater the entropy, the greater the uncertainty of the sample. Therefore, the difference in set entropy before and after division can be used to measure the effect of using the current feature for division. Similar to information gain, the higher the Gini index, the greater the uncertainty of the sample.
[0152] Wherein, when determining the information gain, the following formula can be used:
[0153] E(p1) = E(-log p1) = -∑p1log(p1);
[0154] E(p2) = E(-log p2) = -∑p2log(p2);
[0155] Gain(p1, p2) = E(p1) - E(p2);
[0156] Wherein, Gain(p1, p2) is the information gain between the two feature parameters. P is the feature parameter weight, representing the degree of influence of the feature parameter on the output result.
[0157] S2012: Construct multiple decision trees according to the information gain or Gini index between each two feature parameters.
[0158] Specifically, the layers of the decision trees are constructed according to the order of the information gain or Gini index between each two feature parameters from high to low. Each layer corresponds to a feature parameter, which is used to divide the subset according to the feature parameter.
[0159] It should be noted that the layer structures of different decision trees can be the same, and the decision trees are independent and do not interfere with each other.
[0160] In this way, the decision tree is constructed in the order of information gain or Gini index from high to low, which can maximize the reduction of entropy and minimize uncertainty.
[0161] S2013: Obtain the initial prediction model based on the constructed decision trees.
[0162] Specifically, the random forest is composed of the plurality of decision trees, and the composed random forest is taken as the initial prediction model.
[0163] In this way, the initial prediction model can be constructed based on the training sample data.
[0164] Step 202: Train the initial prediction model based on the training sample data to obtain the trained search distance estimation model.
[0165] Specifically, the initial prediction model is trained based on the search information samples, the sub-region size samples corresponding to the search information samples, and the search distance verification samples to obtain the trained search distance estimation model.
[0166] Specifically, the following steps are executed in a loop until the search distance estimation model meeting the preset training condition is determined:
[0167] S2021: Input each search information sample into the initial prediction model to output the estimated sub-region size and target search distance.
[0168] Referring to Figure 3 As shown in FIG. 1, the decision tree provided by the embodiment of the present application is a schematic diagram of a decision tree. The decision tree includes a plurality of layers. The first layer is a query distance threshold, the second layer is a query quantity threshold, and the third layer is a target object density. The input of the decision tree is training sample data, and the output is an estimated target search distance. The feature parameter data of each layer is divided into a plurality of data sets. For example, the query distance threshold can be divided according to 1 km. In this way, the decision tree can be used to output the target search distance according to the input query distance threshold, query quantity threshold, and target object density in turn.
[0169] Further, the average value of the target search distances of the decision trees in the initial prediction model is determined as the target search distance output by the initial prediction model. Similarly, the initial prediction model can also output a sub-region size.
[0170] For example, the current coordinates of a user are (x, y), the query distance threshold is 2 km, and the query quantity threshold is 5. Then, the target object density is determined to be 500 through the current coordinates (x, y) of the user and the query distance threshold 2 km. Then Figure 3In the specific implementation, a decision tree is adopted to output an estimated target search distance 100 m according to an input query distance threshold 2 km, a query quantity threshold 5, and a target object density 500. In the specific implementation, x and y are geographic coordinate values.
[0171] In this way, the initial prediction model constructed based on the plurality of decision trees can be used to estimate the sub-region size and the target search distance.
[0172] S2022: Determine a size error between the sub-region size sample and the estimated sub-region size, and a distance error between the search distance verification sample and the target search distance.
[0173] S2023: Determine whether the size error and the distance error meet a preset training condition. If yes, perform S2025; otherwise, perform S2024.
[0174] In actual application, the preset training condition can be set according to an actual application scenario. For example, the size error and the distance error are both 10 m, which is not limited herein.
[0175] S2024: Adjust the model parameters in the initial prediction model according to the determined size error and distance error, to obtain an adjusted initial prediction model, and perform S2021.
[0176] S2025: Use the initial prediction model of the preset training condition as a trained search distance estimation model.
[0177] In this way, the trained search distance estimation model can be obtained by training the model using the training sample data in the model training stage, so that the target search distance corresponding to different target location information can be estimated by using the search distance estimation model in subsequent steps.
[0178] Referring to FIG. 4, Figure 4 The application scenario shown in FIG. 4 is used to specifically describe the method. The specific implementation process of the method is as follows. Figure 1 Step 400: Obtain target location information in a search request message used to request search of a target object.
[0179] Specifically, the user terminal sends, to the server, a search request message used to request search of a target object according to a search instruction of the user for the target object. After receiving the search request message sent by the user terminal, the server parses the search request message to obtain the target location information in the search request message.
[0180]
[0181] For example, the target position information is the coordinate of a travel destination. The target object is a restaurant. The retrieval request message is used to retrieve a plurality of restaurants closest to the travel destination.
[0182] Further, the retrieval request message can further include at least one of the following parameters: a query distance threshold, a query quantity threshold of the target object, and target object identification information.
[0183] Step 401: Obtain a target retrieval distance based on the target position information and a retrieval distance estimation model.
[0184] Specifically, when step 401 is performed, the following steps can be used:
[0185] S4011: Obtain the query distance threshold and the query quantity threshold of the target object.
[0186] Optionally, the query distance threshold and the query quantity threshold of the target object can be obtained from the retrieval request message, or can be a system default setting, that is, the query distance threshold and the query quantity threshold of the target object can be indicated by the user or can be pre-set, and can be a fixed value or a non-fixed value.
[0187] In an embodiment, a query distance threshold R set in advance for the target position information is obtained, and a query quantity threshold limit indicated by the user is obtained from the retrieval request message.
[0188] In this way, the query distance threshold R and the query quantity threshold limit can be obtained.
[0189] S4012: Determine a maximum query area according to the target position information and the query distance threshold.
[0190] In an embodiment, a circular area formed by taking the target position information as the center and the query distance threshold as the radius is taken as the maximum query area.
[0191] In an embodiment, a rectangular area formed by taking the target position information as the center and twice the query distance threshold as the side length is taken as the maximum query area.
[0192] In this way, the maximum query area indicated by the user or the system by default can be obtained.
[0193] S4013: Obtain the target object density in the maximum query area.
[0194] In an embodiment, the target object density in the maximum query area is obtained by skip list retrieval.
[0195] S4014: input the query quantity threshold, the query distance threshold, and the target object density into the retrieval distance estimation model, and output a target retrieval distance.
[0196] Further, the retrieval distance estimation model can also output a sub-region size.
[0197] The sub-region size is used to divide the two-dimensional plane to obtain a plurality of sub-regions, so that the target object can be queried through the sub-regions in the subsequent steps, thereby improving the retrieval efficiency.
[0198] Further, the query quantity threshold, the query distance threshold, and the target object density can also be respectively divided into data sets, and the obtained data sets are input into the retrieval distance estimation model to output the target retrieval distance and the sub-region size.
[0199] Further, since the query distance threshold is an indicated maximum retrieval distance, if the target retrieval distance is higher than the query distance threshold, the target retrieval distance can also be adjusted to the query distance threshold.
[0200] In this way, the initial iteration radius, i.e., the target retrieval distance, can be obtained to determine the range of the initial retrieval.
[0201] Step 402: based on the target position information and the target retrieval distance, the target object is retrieved to obtain a retrieval result.
[0202] Specifically, when step 402 is performed, the following steps can be used:
[0203] S4021: based on the target position information and the target retrieval distance, a to-be-retrieved region is determined.
[0204] In an embodiment, a circular region with the target position information as the center and the target retrieval distance as the radius is determined as the to-be-retrieved region.
[0205] S4022: obtain object-related information and a target object quantity of the target object in the to-be-retrieved region.
[0206] Specifically, when the object-related information and the target object quantity are obtained, the following steps can be used:
[0207] First step: obtain the sub-region size output by the retrieval distance estimation model.
[0208] Second step: obtain the correspondence between the sub-region of the sub-region size and the object-related information of the target object.
[0209] In one implementation, a spatial index is obtained for the sub-region and the object-related information of the target object within the sub-region.
[0210] The sub-regions are obtained by dividing the area according to the aforementioned sub-region dimensions. The object-related information of the target object may include at least one of the following: target object identification information, target object location information, and target object attribute information.
[0211] Optionally, the spatial index can be constructed in real time based on the acquired sub-region size, or it can be pre-constructed before executing S4022. Using the spatial index, object-related information and the number of target objects within any sub-region can be retrieved through the spatial address encoding of the sub-region.
[0212] For example, see Figure 5 The diagram shown is an example of mesh division provided in an embodiment of this application. Figure 5 In this process, the two-dimensional plane is divided according to the size of the sub-region to obtain multiple grids (i.e., sub-regions), and each grid is numbered to obtain the grid address code of each grid, such as grid 1, grid 2... grid 9.
[0213] See Figure 6 The diagram shown is an example of a grid address encoding mapping provided in an embodiment of this application. Figure 6 In the diagram, the horizontal axis represents the grid address code, showing the correspondence between multiple grids and their address codes. It also establishes a correspondence between grid address codes and object-related information of target objects within the grid. Thus, a spatial index can be built using the correspondence between grids and their address codes, as well as the correspondence between grid address codes and object-related information of target objects within the grid. This spatial index can then be used in subsequent steps to retrieve object-related information within a target sub-region.
[0214] Step 3: Determine the target sub-region within the area to be searched.
[0215] Specifically, among the sub-regions obtained in advance based on the sub-region size, the target sub-regions covered by the region to be searched are selected.
[0216] Optionally, there can be one or more target sub-regions; there is no restriction here.
[0217] Step 4: Based on the target sub-region and the above correspondence, obtain the object-related information and the number of target objects within the target sub-region.
[0218] Specifically, based on the above correspondence, we obtain the object-related information and the number of target objects within the target sub-region.
[0219] In an implementation, the target sub-region is used to search in the spatial index to obtain the object-related information and the target object quantity of the target object in the target sub-region.
[0220] In this way, the search can be performed based on the target search distance and the spatial index, and the search efficiency is greatly improved.
[0221] S4023: If the target object quantity is not lower than the query quantity threshold or the target search distance is not lower than the query distance threshold, it is determined that the search condition is met, and the object-related information and the target object quantity are determined as the search result.
[0222] Specifically, if the target object quantity is not lower than the query quantity threshold, it is determined that the search condition is met, and if it is determined that the target search distance is not lower than the query distance threshold, it is also determined that the search condition is met.
[0223] That is, any one of the target object quantity and the target search distance meets the corresponding requirement, that is, it is determined that the search condition is met.
[0224] For example, the query quantity threshold is 10, the query distance threshold is 5 km, the determined target object quantity is 12, and the target search distance is 5 km. Since the target object quantity 12 is not lower than the query quantity threshold 10, it is determined that the search condition is met, and the obtained object position information of the plurality of target objects and the target object quantity 12 are determined as the search result.
[0225] S4024: If the target object quantity is lower than the query quantity threshold and the target search distance is lower than the query distance threshold, the target search distance is increased, and the target object is searched based on the target position information and the increased target search distance until the search condition is met, that is, the newly obtained target object quantity is not lower than the query quantity threshold or the increased target search distance is not lower than the query distance threshold, and the newly obtained target object quantity and the new object-related information are determined as the search result.
[0226] Specifically, the following steps are repeatedly performed until the newly obtained target object quantity is not lower than the query quantity threshold or the increased target search distance is not lower than the query distance threshold:
[0227] First step: increase the target search distance according to the sub-region size to obtain the increased target search distance.
[0228] In an implementation, the sum of the target search distance and the sub-region size is used as the increased target search distance.
[0229] In actual application, other ways can also be used to increase the target search distance, which is not limited here.
[0230] For example, refer to Figure 7 Fig. 4 shows a schematic diagram of target search distance adjustment provided by an embodiment of the present application. Figure 7 In the example shown in Fig. 4, the initial target search distance is 1 km, and the sub-region size is 1 km. Thus, the target search distance can be increased by 1 km each time to obtain target search distances of 2 km, 3 km, and so on.
[0231] Step 2: Based on the target location information and the increased target search distance, update the target sub-regions covered by the search.
[0232] In an embodiment, the sub-region covered by a square region with the target location information as the center and a side length of twice the increased target search distance is the target sub-region.
[0233] In an embodiment, the sub-region covered by a circular region with the target location information as the center and a radius of the increased target search distance is the target sub-region.
[0234] Refer to Figure 8 Fig. 5 shows a schematic diagram of a target sub-region provided by an embodiment of the present application. Figure 8 In the example shown in Fig. 5, a circular region with the target location information as the center and a radius of the increased target search distance is obtained, and each sub-region covered by the circular region is determined as a target sub-region.
[0235] It should be noted that as long as part of a sub-region is covered by the circular region, the sub-region is determined as a target sub-region.
[0236] Step 3: Based on the updated target sub-regions and the corresponding relationship, obtain new object-related information and a new target object quantity in the updated target sub-regions.
[0237] In an embodiment, the new object-related information and the new target object quantity in the updated target sub-regions are searched through spatial indexing.
[0238] Step 4: If the new target object quantity obtained by the search is lower than the query quantity threshold value, and the increased target search distance is lower than the query distance threshold value, perform the first step in S4024, otherwise, stop the loop search.
[0239] In this way, the search condition can be constructed based on the query quantity threshold value and the target search distance, i.e., the target object quantity is not lower than the query quantity threshold value, or the target search distance is not lower than the query distance threshold value, and thus the object-related information and the new target object quantity that meet the search condition can be obtained.
[0240] Further, the search result can be displayed to the user.
[0241] In one implementation, the server displays the search result to the user via a display interface.
[0242] In one implementation, the server sends the search result to a user terminal. The user terminal presents the search result to the user.
[0243] In one implementation, the search result can be displayed in the following two ways:
[0244] Way 1: If the number of target objects in the search result is not higher than the query number threshold, the server or the user terminal displays the target objects obtained by the search to the user according to the object-related information of the target objects in the search result.
[0245] For example, the query number threshold is 10, the number of target objects is 10, the target objects are idle vehicles, and the object-related information is vehicle location information. The server or the user terminal displays the vehicle location information of each idle vehicle obtained by the search to the user, and the number of target objects is 10.
[0246] Way 2: If the number of target objects in the search result is higher than the query number threshold, the server or the user terminal filters the target objects in the search result, and displays the target objects obtained by the search to the user according to the object-related information of the filtered target objects.
[0247] Specifically, when Way 2 is performed, the following steps can be taken:
[0248] Step 1: If the number of target objects in the search result is higher than the query number threshold, obtain the object location information in the object-related information of each target object.
[0249] The object-related information can include the object location information.
[0250] For example, the query number threshold is 10, the number of target objects is 15, the target objects are idle vehicles, and the object location information is vehicle location information. Since the number of target objects is 15, which is higher than the query number threshold of 10, the vehicle location information of each idle vehicle is obtained.
[0251] Step 2: Determine the distance between each target object in the search result and the user according to the target location information and the object location information of each target object in the search result.
[0252] Step 3: From each target object in the search result, filter out target objects with a number equal to the query number threshold according to the distance between each target object in the search result and the user.
[0253] The distance between the filtered target objects and the user is lower than the distance between the unfiltered target objects and the user.
[0254] In an embodiment, the target objects are sorted according to the distance between each target object and the user from near to far, and the target objects with a top query number threshold are filtered according to the sorting.
[0255] For example, the query number threshold is 10, and the first 10 target objects closest to the user are filtered according to the sorting.
[0256] Step 4: The user is shown the target objects after filtering according to the object-related information of the target objects.
[0257] Specifically, the user can be shown the target objects after filtering through a server or a user terminal.
[0258] The object-related information can further include an icon, attributes, a name, identification information, a route between the user and the target object, etc. of the target object, which are not limited herein.
[0259] For example, the target object is a building, and the attributes of the building can be a train station and an airport, etc. The target object is a vehicle, and the attributes of the vehicle can be an idle vehicle and a non-idle vehicle, etc. The target object is a store, and the attributes of the store can be a large supermarket and a convenience store, etc. Custom attributes such as a home, a company, a favorite place, and a collection place, etc. can also be included.
[0260] Further, different icons can be set for different attributes so that the user can quickly obtain the detailed information of the target object.
[0261] In an embodiment, the object-related information of each target object is sequentially shown to the user according to the distance between each target object and the user from near to far.
[0262] In an embodiment, the travel time of the user to each target object is determined according to the route between each target object and the user, and the object-related information of each target object is sequentially shown to the user according to the travel time from small to high.
[0263] In an embodiment, the icon corresponding to the attribute of each target object is shown at the corresponding position in the map according to the object position information and the attribute of each target object, and the route and the travel time of the user to each target object are shown.
[0264] Further, the object-related information of the target objects after filtering according to the filtering indication of the user can be shown to the user.
[0265] In an embodiment, the target objects with a specified attribute are filtered and shown.
[0266] For example, if the specified attribute is a free vehicle, free vehicles can be filtered and displayed from each vehicle obtained by retrieval.
[0267] In actual applications, the object-related information, the display form of the target object, and the display content can be set according to actual application scenarios, which are not limited herein.
[0268] The above embodiments will be described in detail below by taking a specific application scenario. Figure 2 and Figure 4 The embodiments of the present application are described in detail below. Referring to FIG. 7, an implementation flowchart of an offline model training and online retrieval method provided by the embodiments of the present application is shown, which includes an offline model training flow and an online retrieval flow. Figure 9
[0269] The specific implementation flow of the offline model training flow is as follows:
[0270] Step 900: Obtain training sample data used for model training.
[0271] Step 901: Train the initial prediction model based on the training sample data to obtain a trained retrieval distance estimation model, and execute step 913.
[0272] The specific implementation flow of the online retrieval flow is as follows:
[0273] Step 910: Receive a retrieval request message sent by a user terminal for requesting retrieval of a target object.
[0274] Step 911: Analyze the retrieval request message to obtain target position information, a query distance threshold, and a query quantity threshold of the target object.
[0275] Step 912: Query the skip list based on the target position information and the query distance threshold to obtain a target object density around the target position information.
[0276] Step 913: Input the query quantity threshold, the query distance threshold, and the target object density into the retrieval distance estimation model to output a target retrieval distance and a sub-region size.
[0277] In an implementation manner, the query quantity threshold limit, the query distance threshold R, and the target object density num are input into the retrieval distance estimation model to output a target retrieval distance r.
[0278] Step 914: Determine a to-be-retrieved region based on the target position information and the target retrieval distance.
[0279] Step 915: Determine a target sub-region covered by the to-be-retrieved region from each sub-region divided based on the sub-region size.
[0280] Step 916: Use spatial indexing to retrieve object-related information and the number of target objects within the target sub-region.
[0281] In one implementation, if there are multiple target sub-regions, the object-related information and the number of target objects in each target sub-region are obtained respectively, and the object-related information and the number of target objects in each target sub-region are merged to obtain the merged object-related information and the number of target objects.
[0282] Step 917: Determine whether the number of target objects and the target retrieval distance do not meet the retrieval conditions. If yes, proceed to step 918; otherwise, proceed to step 919.
[0283] Specifically, if the number of target objects is not less than the query quantity threshold, or the target retrieval distance is not less than the query distance threshold, then the number of target objects and the target retrieval distance meet the retrieval conditions, and step 919 is executed.
[0284] If the number of target objects is lower than the query quantity threshold and the target retrieval distance is lower than the query distance threshold, then it is determined that the number of target objects and the target retrieval distance do not meet the retrieval conditions, and step 918 is executed.
[0285] Step 918: Increase the target retrieval distance according to the sub-region size to obtain the increased target retrieval distance, and then proceed to step 914.
[0286] Step 919: Use the object-related information and the number of objects of the target object obtained from the retrieval as the retrieval results.
[0287] Step 920: Display the search results to the user.
[0288] For example, see Figure 10 The diagram shown is an example of a food search method provided in this application. When a user enters a food request in a food delivery application and performs a search, the application identifies the target as a restaurant and, based on the user's current location, retrieves the four nearest restaurants, such as a rice noodle shop, a barbecue restaurant, a rice noodle shop, and a coffee shop. The application then displays the restaurant icons and names in order of distance from the user, from closest to furthest. Furthermore, it can also display the detailed address, average price per person, and distance of each restaurant.
[0289] For example, see Figure 11 The image shown is an example diagram of a ride-hailing service provided in an embodiment of this application. When a user performs an available vehicle search operation in a ride-hailing application, the application determines that the target is a private car and, based on the user's current location information, retrieves the two nearest private cars. The user's current location is displayed on a map using a five-pointed star, and the location of the private cars is displayed using a car icon.
[0290] For another example, a plurality of online car-hailing vehicles (i.e., target objects) around a traffic accident site (i.e., a target site) can be retrieved, and the specific progress of the traffic accident can be pushed to the online car-hailing vehicles in real time, so that the drivers of the online car-hailing vehicles can avoid the traffic accident site.
[0291] For another example, a plurality of target objects, such as gas stations, restrooms, and business operators, around the current location (i.e., a target site) of a user can also be retrieved, and the user can select the target object closest to the user according to the distance between the user and each target object.
[0292] Specifically, when steps 900-901 are performed, refer to steps 200-202 described above for specific steps, and when steps 910-920 are performed, refer to steps 400-402 described above for specific steps, which will not be repeated here.
[0293] The above embodiments will be illustrated by using a plurality of specific application scenarios.
[0294] In one application scenario, a plurality of vehicle types around a user are retrieved by a car-hailing software. The vehicle types can be: fast car, taxi, premium, and private car. The vehicle density (target object density) of different types of vehicles in the same maximum query range is different. The query distance threshold is 5 km, and due to the size limitation of the user terminal screen, the query quantity threshold can be set to 10.
[0295] First, the grid size (i.e., the size of the sub-region) and the minimum retrieval distance (i.e., the initial target retrieval distance output by the model) corresponding to each vehicle type are determined.
[0296] For example, based on the current location information of the user and the query distance threshold of 5 km, the vehicle density of each vehicle type is determined, and based on the vehicle density of each vehicle type, the query distance threshold of 5 km, the query quantity threshold of 10, and the retrieval distance estimation model, the grid size and the minimum retrieval distance are output. The minimum retrieval distance of the fast car is 0.5 km, and the grid size is 0.35 km. The minimum retrieval distance of the taxi is 1 km, and the grid size is 0.75 km. The minimum retrieval distance of the premium is 2 km, and the grid size is 1.5 km. The minimum retrieval distance of the private car is 5 km, and the grid size is 3.5 km.
[0297] Then, the minimum retrieval distance is iteratively increased until the retrieval result meets the retrieval condition.
[0298] For example, the minimum search distance of the fast car is 0.5 km, and the grid size is 0.35 km. A circular area with the current location of the user as the center and the minimum search distance 0.5 km as the radius is determined, and the grid size of 0.35 km is determined as the target grid covered by the circular area. The number of fast cars in the target grid is searched by using the spatial index method, and the number of fast cars is 5, which is less than 10. The minimum search distance 0.5 km is increased, and the target search distance obtained after the increase is 0.5 km + 0.35 km = 0.85 km. The fast car is searched based on the target search distance 0.85 km and the grid size 0.35 km. If the number of fast cars obtained is still less than 10, the target search distance is continuously increased until the number of fast cars obtained is still not less than 10, or the target search distance after the increase is higher than the query distance threshold 5 km.
[0299] Similarly, the taxi, the premium, and the private car around the user can also be searched to obtain the optimal target search distance and the search result of each type of vehicle.
[0300] For example, the target search distance of the fast car is 0.85 km, the target search distance of the taxi is 1.75 km, the target search distance of the premium is 2 km, and the target search distance of the private car is 5 km. The 10 fast cars in the range of 0.85 km around the user can be obtained. The 10 taxis in the range of 1.75 km around the user can be obtained. The 10 premiums in the range of 2 km around the user can be obtained. The 10 private cars in the range of 5 km around the user can be obtained.
[0301] Table 1
[0302]
[0303] Referring to Table 1, it is a search range comparison table. When searching, the target search distance and the search area of the search method in the embodiment of the application are compared with the actual search distance and the search area used in the traditional method. Since the search is performed by using the 9-grid method, the search area = 9 * search distance * search distance. When the search is performed by using the search method of the application, the search area of the fast car = 9 * 0.35 * 0.35 = 1.1025 km 2 . The search area of the taxi = 9 * 0.75 * 0.75 = 5.0625 km 2 . The search area of the premium = 9 * 1.5 * 1.5 = 20.25 km 2 . The search area of the private car = 9 * 3.5 * 3.5 = 110.25 km 2Obviously, the target search distance and the search area in the embodiments of the present application are far less than the actual search distance and the search area in the conventional search, which can greatly improve the search efficiency, reduce the data processing amount, and improve the search accuracy.
[0304] Based on the same inventive concept, the embodiments of the present application also provide a search device. Since the principles of the device and the equipment for solving the problem are similar to those of the search method, the implementation of the device can be referred to the implementation of the method, and the repeated parts will not be described here.
[0305] As shown in Figure 12 , it is a structural schematic diagram of a search device provided by the embodiments of the present application, which comprises:
[0306] The acquisition unit 1201 is configured to acquire target position information in a search request message used for requesting to search a target object;
[0307] The estimation unit 1202 is configured to obtain a target search distance based on the target position information and a search distance estimation model;
[0308] The search unit 1203 is configured to search the target object based on the target position information and the target search distance, and obtain a search result.
[0309] In an implementation manner, the estimation unit 1202 is configured to:
[0310] acquire a query distance threshold and a query quantity threshold of the target object;
[0311] determine a maximum query area according to the target position information and the query distance threshold;
[0312] acquire a target object density in the maximum query area;
[0313] input the query quantity threshold, the query distance threshold, and the target object density into the search distance estimation model, and output the target search distance.
[0314] In an implementation manner, the search unit 1203 is configured to:
[0315] determine a to-be-searched area based on the target position information and the target search distance;
[0316] acquire object related information and a target object quantity of the target object in the to-be-searched area;
[0317] if the target object quantity is not less than the query quantity threshold, or the target search distance is not less than the query distance threshold, it is determined that the search condition is met, and the object related information and the target object quantity are determined as the search result;
[0318] If it is determined that the target object quantity and the target search distance do not meet the search condition, the target search distance is increased, and target objects are searched based on the target position information and the increased target search distance until the new target object quantity obtained by the search or the increased target search distance meets the search condition. The new target object quantity and the new object-related information obtained are determined as the search result.
[0319] In an implementation, the searching unit 1203 is configured to:
[0320] obtain the sub-region size output by the search distance estimation model;
[0321] obtain a correspondence between the sub-region size and the object-related information of the target object;
[0322] determine a target sub-region in the to-be-searched region;
[0323] obtain the object-related information of the target object and the target object quantity in the target sub-region according to the target sub-region and the correspondence.
[0324] In an implementation, the searching unit 1203 is configured to:
[0325] perform the following steps in a loop until the new target object quantity obtained by the search or the increased target search distance meets the search condition:
[0326] increase the target search distance according to the sub-region size to obtain the increased target search distance;
[0327] update the target sub-region covered by the search based on the target position information and the increased target search distance;
[0328] obtain new object-related information and a new target object quantity in the updated target sub-region based on the updated target sub-region and the correspondence;
[0329] determine whether the new target object quantity obtained by the search is not lower than the query quantity threshold and whether the increased target search distance is not lower than the query distance threshold.
[0330] In an implementation, the searching unit 1203 is further configured to:
[0331] if the target object quantity in the search result is the query quantity threshold, display the target objects obtained by the search to the user according to the object-related information of the target objects in the search result;
[0332] if the target object quantity in the search result is higher than the query quantity threshold, obtain the object position information in the object-related information of each target object;
[0333] According to the target position information and the object position information of each target object in the search result, the distance between each target object in the search result and the user is determined respectively;
[0334] According to the distance between each target object in the search result and the user, the target objects with the number of the query number threshold are selected from the target objects in the search result, wherein the distance between the selected target objects and the user is lower than the distance between the unselected target objects and the user;
[0335] According to the object related information of the selected target objects, the selected target objects are displayed to the user.
[0336] In an implementation manner, the estimation unit 1202 is further configured to:
[0337] Based on the random forest algorithm or the deep learning algorithm, the initial prediction model is constructed;
[0338] Based on each search information sample, and the sub-region size sample and the search distance verification sample corresponding to each search information sample, the initial prediction model is trained to obtain the trained search distance estimation model.
[0339] In the method, the apparatus, the electronic device, the readable storage medium and the product provided by the embodiments of the present application, the target position information in the search request message used for requesting the search target object is obtained; the target search distance is obtained based on the target position information and the search distance estimation model; and the target object is searched based on the target position information and the target search distance, and the search result is obtained. In this way, by using the search distance estimation model, the target search distance during the search can be adaptively adjusted according to the target position information, so that the search range can be adaptively adjusted, and problems such as search data redundancy and too few search recall quantities are avoided, and the search accuracy is improved.
[0340] Figure 13 A structural schematic diagram of an electronic device 1300 is shown. Referring to Figure 13 As shown, the electronic device 1300 includes a processor 1310, a memory 1320, a power supply 1330, a display unit 1340, and an input unit 1350.
[0341] The processor 1310 is the control center of the electronic device 1300, and connects various components by using various interfaces and lines. By running or executing the software programs and / or data stored in the memory 1320, the processor 1310 performs various functions of the electronic device 1300, and thus monitors the whole electronic device 1300.
[0342] In the embodiments of the present application, when the processor 1310 invokes the computer program stored in the memory 1320, the processor 1310 performs the functions of the electronic device 1300 as described above. Figure 4The method of searching provided by the embodiment shown in the figure.
[0343] Optionally, the processor 1310 can include one or more processing units. Preferably, the processor 1310 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, the user interface, and the application, etc., and the modem processor mainly processes the wireless communication. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 1310. In some embodiments, the processor, the memory, and the like can be implemented on a single chip, and in some embodiments, they can also be implemented on separate chips, respectively.
[0344] The memory 1320 can mainly include a program storage area and a data storage area, wherein the program storage area can store the operating system, various applications, etc., and the data storage area can store the data created according to the use of the electronic device 1300, etc. In addition, the memory 1320 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device, etc.
[0345] The electronic device 1300 further includes a power supply 1330 (such as a battery) for supplying power to each component. The power supply can be logically connected to the processor 1310 through a power management system, so as to realize the functions of managing charging, discharging, and power consumption, etc. through the power management system.
[0346] The display unit 1340 can be used to display the information input by the user or the information provided to the user, and various menus of the electronic device 1300, etc., and in the embodiments of the present application, it is mainly used to display the display interface of each application in the electronic device 1300 and the objects such as text, pictures, etc. displayed in the display interface. The display unit 1340 can include a display panel 1341. The display panel 1341 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.
[0347] The input unit 1350 can be used to receive the information such as numbers or characters input by the user. The input unit 1350 can include a touch panel 1351 and other input devices 1352. The touch panel 1351, also known as a touch screen, can collect the touch operation of the user on or near it (such as the operation of the user using a finger, a touch pen, etc. on or near the touch panel 1351).
[0348] Specifically, the touch panel 1351 can detect a user's touch operation, and detect signals caused by the touch operation, convert the signals into touch coordinates, send the touch coordinates to the processor 1310, and receive commands from the processor 1310 and execute the commands. In addition, the touch panel 1351 can be implemented in various types such as a resistive type, a capacitive type, an infrared type, and a surface acoustic wave type. The other input device 1352 can include one or more of a physical keyboard, a function key (such as a volume control key, a power on / off key, etc.), a trackball, a mouse, a joystick, etc.
[0349] Of course, the touch panel 1351 can cover the display panel 1341, and when the touch panel 1351 detects a touch operation thereon or nearby, the touch panel 1351 transmits the touch operation to the processor 1310 to determine a type of the touch event, and then the processor 1310 provides a corresponding visual output on the display panel 1341 according to the type of the touch event. Although in the above description, the touch panel 1351 and the display panel 1341 are implemented as two independent components to realize the input and output functions of the electronic device 1300, in some embodiments, the touch panel 1351 and the display panel 1341 can be integrated to realize the input and output functions of the electronic device 1300. Figure 13
[0350] The electronic device 1300 can further include one or more sensors, such as a pressure sensor, a gravity acceleration sensor, a proximity light sensor, etc. Of course, according to the needs in specific applications, the above electronic device 1300 can further include a camera and other components, since these components are not the components mainly used in the embodiments of the present application, they are not shown in the above description, and will not be described in detail. Figure 13
[0351] Those skilled in the art can understand that the above-mentioned electronic device is only an example of the electronic device, and does not constitute a limitation on the electronic device, and can include more or fewer components than the diagram, or combine certain components, or different components. Figure 13
[0352] In the embodiments of the present application, a readable storage medium has a computer program stored thereon, and the computer program is executed by a processor to enable a communication device to perform the steps in the above embodiments.
[0353] In the embodiments of the present application, a computer program product includes a computer program / instruction, and the computer program / instruction is executed by a processor to implement the steps in the above embodiments.
[0354] For the convenience of description, the above parts are divided into modules (or units) according to functions and are described respectively. Of course, in the implementation of the present application, the functions of the modules (or units) can be implemented in the same or multiple software or hardware.
[0355] Those skilled in the art will appreciate that embodiments of the present application can be readily used as software, hardware, or a combination of software and hardware. In one
[0356] The present application is described in reference to the flowchart illustrations and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart Figure 1 one or more functions specified in the flowchart block or blocks. Figure 1 means for performing each of the functions specified in the flowchart block or blocks.
[0357] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the Figure 1 one or more functions specified in the flowchart block or blocks. Figure 1 means for performing each of the functions specified in the flowchart block or blocks.
[0358] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more functions specified in the flowchart block or blocks. Figure 1 means for performing each of the functions specified in the flowchart block or blocks.
[0359] While preferred embodiments of the application have been described, modifications and alterations thereto will occur to those skilled in the art upon reading the preceding description. In particular, it will be apparent to those skilled in the art that parts can be added to, or substituted for, parts of the described embodiment. It is therefore desired to be secured to those alterations and modifications which come within the purview of this application.
[0360] Obviously, many modifications and variations of the present application are possible in light of the above teachings. It is, therefore, to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.
Claims
1. A method of retrieving, characterized by, The method comprises: obtaining target position information in a retrieval request message used for requesting retrieval of a target object; obtaining a target retrieval distance based on the target position information and a retrieval distance estimation model; retrieving the target object based on the target position information and the target retrieval distance, and obtaining a retrieval result; the step of retrieving the target object based on the target position information and the target retrieval distance, and obtaining a retrieval result, comprises: determining a target retrieval area based on the target position information and the target retrieval distance; obtaining object-related information and a target object quantity of the target object in the target retrieval area; the step of obtaining object-related information and a target object quantity of the target object in the target retrieval area, comprises: obtaining a sub-area size output by the retrieval distance estimation model; obtaining a correspondence between a sub-area of the sub-area size and the object-related information of the target object; determining a target sub-area in the target retrieval area; obtaining the object-related information and the target object quantity of the target object in the target sub-area according to the target sub-area and the correspondence.
2. The method of claim 1, wherein, the step of obtaining a target retrieval distance based on the target position information and a retrieval distance estimation model, comprises: obtaining a query distance threshold and a query quantity threshold of the target object; determining a maximum query area according to the target position information and the query distance threshold; obtaining a target object density in the maximum query area; inputting the query quantity threshold, the query distance threshold and the target object density into the retrieval distance estimation model, and outputting the target retrieval distance.
3. The method of claim 2, wherein, the step of retrieving the target object based on the target position information and the target retrieval distance, and obtaining a retrieval result, comprises: if the target object quantity is not lower than the query quantity threshold, or the target retrieval distance is not lower than the query distance threshold, it is determined that the retrieval condition is met, and the object-related information and the target object quantity are determined as the retrieval result; if it is determined that the target object quantity and the target retrieval distance do not meet the retrieval condition, the target retrieval distance is increased, and the target object is retrieved based on the target position information and the increased target retrieval distance until the new target object quantity or the increased target retrieval distance obtained by retrieval meets the retrieval condition, and the new target object quantity and the new object-related information obtained are determined as the retrieval result.
4. The method of claim 3, wherein, the step of adjusting the target retrieval distance and retrieving the target object based on the target position information and the increased target retrieval distance until the new target object quantity or the increased target retrieval distance obtained by retrieval meets the retrieval condition, comprises: recursively performing the following steps until the new target object quantity or the increased target retrieval distance obtained by retrieval meets the retrieval condition: increasing the target retrieval distance according to the sub-area size to obtain an increased target retrieval distance; updating a target sub-area covered by retrieval based on the target position information and the increased target retrieval distance; obtain new object-related information and a new target object quantity in the updated target sub-region based on the updated target sub-region and the correspondence; determine whether the newly obtained target object quantity is not lower than the query quantity threshold and whether the increased target search distance is not lower than the query distance threshold.
5. The method of any one of claims 3-4, wherein, After searching for the target object based on the target position information and the target search distance to obtain a search result, the method further includes: if the target object quantity in the search result is the query quantity threshold, presenting the target object obtained by searching to the user according to the object-related information of the target object in the search result; if the target object quantity in the search result is higher than the query quantity threshold, obtaining object position information in the object-related information of each target object; determining distances between each target object in the search result and the user based on the target position information and the object position information of each target object in the search result; selecting target objects with a quantity of the query quantity threshold from the target objects in the search result according to the distances between the target objects in the search result and the user, wherein the distances between the selected target objects and the user are lower than the distances between the unselected target objects and the user; presenting the selected target objects to the user according to the object-related information of the selected target objects.
6. The method according to any one of claims 1 to 4, wherein Before obtaining the target search distance based on the target position information and the search distance estimation model, the method further includes: constructing an initial prediction model based on a random forest algorithm or a deep learning algorithm; training the initial prediction model based on each search information sample, a sub-region size sample corresponding to each search information sample, and a search distance verification sample to obtain a trained search distance estimation model.
7. An apparatus for retrieving, characterized by The method includes: an obtaining unit configured to obtain target position information in a search request message used to request a search for a target object; an estimation unit configured to obtain a target search distance based on the target position information and a search distance estimation model; a searching unit configured to search for the target object based on the target position information and the target search distance to obtain a search result; the searching unit is configured to: determine a region to be searched based on the target position information and the target search distance; obtain object-related information and a target object quantity of a target object in the region to be searched; the searching unit is configured to obtain a sub-region size output by the search distance estimation model; obtain a correspondence between a sub-region with the sub-region size and the object-related information of the target object; determine a target sub-region in the region to be searched; obtain the object-related information and the target object quantity of the target object in the target sub-region based on the target sub-region and the correspondence.
8. The apparatus of claim 7, wherein, the estimation unit is configured to: obtain a query distance threshold and a query quantity threshold of the target object; determine a maximum query region based on the target position information and the query distance threshold. acquire a target object density in the maximum query area; input the query number threshold, the query distance threshold, and the target object density into the retrieval distance estimation model, and output the target retrieval distance.
9. The apparatus of claim 8, wherein, The retrieval unit is configured to: If the target object number is not lower than the query number threshold, or the target retrieval distance is not lower than the query distance threshold, it is determined that the retrieval condition is met, and the object-related information and the target object number are determined as the retrieval result. If it is determined that the target object number and the target retrieval distance do not meet the retrieval condition, the target retrieval distance is increased, and target objects are retrieved based on the target position information and the increased target retrieval distance until the new target object number or the increased target retrieval distance meets the retrieval condition, and the new target object number and the new object-related information are determined as the retrieval result.
10. The apparatus of claim 9, wherein, The retrieval unit is configured to: perform the following steps in a loop until the new target object number or the increased target retrieval distance meets the retrieval condition: increase the target retrieval distance based on the sub-area size to obtain an increased target retrieval distance; update the target sub-area covered by retrieval based on the target position information and the increased target retrieval distance; obtain new object-related information and a new target object number in the updated target sub-area based on the updated target sub-area and the correspondence relationship; determine whether the new target object number obtained by retrieval is not lower than the query number threshold, and whether the increased target retrieval distance is not lower than the query distance threshold.
11. The apparatus of any one of claims 9-10, wherein, The retrieval unit is further configured to: If the target object number in the retrieval result is the query number threshold, the target objects obtained by retrieval are displayed to the user according to the object-related information of the target objects in the retrieval result. If the target object number in the retrieval result is higher than the query number threshold, the object position information in the object-related information of each target object is acquired; determine the distance between each target object in the retrieval result and the user based on the target position information and the object position information of each target object in the retrieval result; select target objects with a number of the query number threshold from each target object in the retrieval result according to the distance between each target object in the retrieval result and the user, wherein the distance between the selected target objects and the user is lower than the distance between the unselected target objects and the user; display the selected target objects to the user according to the object-related information of the selected target objects.
12. The apparatus of any one of claims 7-10, wherein, The estimation unit is further configured to: construct an initial prediction model based on a random forest algorithm or a deep learning algorithm; train the initial prediction model based on each retrieval information sample, and the sub-area size sample and the retrieval distance verification sample corresponding to each retrieval information sample, to obtain a trained retrieval distance estimation model.
13. An electronic device, comprising: A computer program product comprising a computer readable medium having stored thereon computer readable instructions which, when executed by a processor, perform the method of any of claims 1-6.
14. A readable storage medium, having stored thereon a computer program, characterized in that, The computer program is executed by a processor to perform the method of any of claims 1-6.
15. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instructions, when executed by a processor, perform the steps of the method of any of claims 1-6.
Citation Information
Patent Citations
Facility retrieval method
JP1999053366A
Location based information search method and system
JP2019160320A