A recommendation method and device based on R-tree

By using an R-tree-based recommendation method, the distance between the matrix nodes of the R-tree and the user is used to select target objects. A pruning strategy is used to select objects that are closer to the user for recommendation. This solves the problems of high computational cost and low efficiency in existing technologies and achieves efficient personalized recommendation.

CN116263799BActive Publication Date: 2025-11-04CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211292671.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-21
Publication Date
2025-11-04
Estimated Expiration
2042-10-21

AI Technical Summary

Technical Problem

Existing location-based recommendation methods suffer from high computational cost and low recommendation efficiency due to the lack of spatial constraints.

Method used

An R-tree-based recommendation method is adopted. By obtaining user information and analyzing the R-tree, it is determined whether pruning is needed. Target objects are selected based on the distance between the matrix nodes of the R-tree and the user. The pruning strategy selects objects that are closer to the user for recommendation.

Benefits of technology

It effectively reduces computational load, improves recommendation efficiency, closely aligns with users' actual needs, and reduces unnecessary computation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116263799B_ABST
    Figure CN116263799B_ABST
Patent Text Reader

Abstract

The embodiment of the present application relates to the technical field of data processing, and discloses a recommendation method and device based on R-tree, which comprises the following steps: when there is a recommendation request, obtaining user information of the request, wherein the user information comprises a coordinate position where the user is located; based on the user information and the R-tree, analyzing whether pruning is needed, each matrix node of the R-tree corresponds to an object to be selected, the R-tree is a structure with tree-like hierarchy, and comprises a plurality of matrix nodes; when the analysis result is that pruning is needed, selecting the target object based on the distance between the matrix node of the R-tree and the user and a pruning strategy; and recommending the selected target object to the user. Through the above method, the embodiment of the present application can effectively reduce the operation amount and improve the recommendation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of data processing, in particular to a recommendation method and device based on R-tree. BACKGROUND

[0002] With the progress of technology and the maturation of the market, there are more and more intelligent devices with geographic positioning function. These intelligent devices can be GPS (Global Positioning System) trajectory recording devices or Beidou navigation devices. The geographic position trajectory data is usually collected by using intelligent devices with geographic positioning function to collect a series of position points of outdoor activities. Each position point includes time, longitude, latitude and other information.

[0003] Personalized recommendation is actually what we commonly call "thousand faces for a thousand people". The system recommends different targets to users according to the location and characteristics of the users. This is a common means at present.

[0004] In the prior art, the recommendation technology based on user location mainly recommends according to the data in the user's residence area or specific area. This way has a large amount of calculation and low efficiency due to the lack of spatial limitation. SUMMARY

[0005] In view of the above problems, embodiments of the present application provide a recommendation method and device based on R-tree, which overcomes the above problems or at least partially solves the above problems.

[0006] According to an aspect of an embodiment of the present application, a recommendation method based on R-tree is provided. The method comprises: when there is a recommendation request, obtaining user information of the request, the user information including a coordinate position where the user is located; analyzing whether pruning is needed based on the user information and the R-tree, each matrix node of the R-tree corresponding to a to-be-selected object, the R-tree being a structure with tree-like hierarchy and including a plurality of matrix nodes; when the analysis result is that pruning is needed, selecting a target object based on the distance between the matrix node of the R-tree and the user; and recommending the selected target object to the user.

[0007] In an optional manner, the analyzing whether pruning is needed based on the user information and the R-tree comprises: respectively obtaining a maximum distance between the user and a to-be-selected object in a corresponding matrix node of the R-tree and a minimum distance between the user and a sibling matrix node of the matrix node; analyzing whether pruning is needed based on the minimum distance and the maximum distance; if the minimum distance is greater than the maximum distance, it is determined that pruning is needed; and if the minimum distance is less than or equal to the maximum distance, it is determined that pruning is not needed.

[0008] In an alternative way, the user information comprises a coordinate position where the user is located, and the maximum distance between the user and the to-be-selected objects in the corresponding matrix node and the minimum distance between the user and the sibling matrix nodes of the matrix node are obtained respectively, comprising: determining the corresponding matrix node and the sibling matrix nodes of the user in the R-tree based on the coordinate position; calculating the maximum distance between the coordinate position and the to-be-selected objects in the matrix of the corresponding matrix node; and calculating the minimum distance between the coordinate position and the sibling matrix nodes.

[0009] The maximum distance between the user and the corresponding matrix node and the minimum distance between the sibling matrix nodes are obtained respectively, comprising: determining the corresponding matrix node and the sibling matrix nodes of the user in the R-tree based on the coordinate position; calculating the minimum distance between the coordinate position and the sibling matrix nodes; and calculating the maximum distance between the coordinate position and the to-be-selected objects in the matrix of the corresponding matrix node.

[0010] In an alternative way, the user information further comprises a recommended number, and the selection of the target objects based on the distance between the matrix nodes of the R-tree and the user comprises: counting the number of to-be-selected objects in the matrix node where the coordinate position is located; if the number of to-be-selected objects in the matrix node where the coordinate position is located is greater than or equal to the recommended number, selecting the recommended number of target objects from the to-be-selected objects in the matrix node where the coordinate position is located, and the distance between each selected target object and the coordinate position is less than or equal to the distance between the unselected to-be-selected objects in the matrix node where the coordinate position is located and the coordinate position; if the number of selected target objects is less than the recommended number, selecting a first number of target objects from the sibling matrix nodes of the matrix node, the first number being equal to the difference between the recommended number and the number of to-be-selected objects in the matrix node where the coordinate position is located, and the distance between any selected target object and the coordinate position is less than the distance between other to-be-selected objects in the sibling matrix nodes and the coordinate position.

[0011] In an alternative way, the selection of the first number of target objects from the sibling matrix nodes of the matrix node comprises: calculating the distance between the coordinate position and each of the sibling matrix nodes based on a preset formula, the preset formula being: Wherein, the (x, y) represents the coordinate position, the (x0, y0) represents the coordinate of the lower left corner of the matrix of the brother matrix node, and (x1, y1) represents the coordinate of the upper right corner of the corresponding matrix of the brother matrix node, to obtain the distance corresponding to each brother matrix node; the calculated distance is sorted in ascending order to form a queue; the number of the to-be-selected objects in the brother matrix node arranged in the first position is obtained; if the obtained number is equal to the first number, the to-be-selected objects in the brother matrix node arranged in the first position and the to-be-selected objects in the matrix node where the coordinate position is located are taken as the final recommended target objects; if the obtained number is less than the first number, a second number of target objects are selected from the brother matrix nodes arranged after the first position, and the second number is equal to the difference between the first number and the to-be-selected objects in the brother matrix node arranged in the first position, wherein the distance between the target objects corresponding to the second number and the coordinate position is less than or equal to the distance between any to-be-selected object in the brother matrix node that is not selected and the coordinate position; if the obtained number is greater than the first number, a first number of target objects are selected from the to-be-selected objects in the brother matrix node arranged in the first position, wherein the distance between the selected target objects and the coordinate position is less than or equal to the distance between the to-be-selected objects in the brother matrix node arranged in the first position that are not selected and the coordinate position.

[0012] In an optional manner, the user information further includes a plurality of coordinate positions, and the separately obtaining the maximum distance between the user and the to-be-selected object in the corresponding matrix node and the minimum distance between the user and the brother matrix node of the matrix node includes: forming a search matrix based on the plurality of coordinate data; determining the matrix node and the brother matrix node corresponding to the search matrix in the R-tree; calculating the maximum distance between the search matrix and the to-be-selected object in the corresponding matrix node and calculating the minimum distance between the search matrix and the matrix of the brother matrix node; or: the user information further includes a pre-activity time length, and the separately obtaining the maximum distance between the user and the to-be-selected object in the corresponding matrix node and the minimum distance between the user and the brother matrix node of the matrix node includes: obtaining the activity track of the user within the pre-activity time length based on the coordinate position and the pre-activity time length; forming a search matrix based on the activity track; determining the corresponding matrix node and the brother matrix node in the R-tree; calculating the maximum distance between the search matrix and the to-be-selected object in the corresponding matrix node and calculating the minimum distance between the search matrix and the matrix of the brother matrix node.

[0013] In an optional manner, the calculating the maximum distance between the search matrix and the to-be-selected object in the corresponding matrix node includes:

[0014] calculate distances between the search matrix and any to-be-selected object of the corresponding matrix node based on a distance formula, to obtain a distance corresponding to each to-be-selected object, the distance formula being: wherein, the (x di ,y di ) represents a coordinate position of a target object i, the (x j1 ,y j1 ) represents a coordinate of a lower left corner of the search matrix, and (x j2 ,y j2 ) represents a coordinate of a right upper corner of the search matrix; the maximum distance in the calculated distances is taken as the search matrix and the maximum distance; or

[0015] The calculating the minimum distance between the search matrix and the matrix of the brother matrix node comprises: if the search matrix intersects with the matrix of the brother matrix node, the minimum distance is 0; if the search matrix does not intersect with the matrix of the brother matrix node and the matrix coordinates of the two coincide, a minimum horizontal distance or a minimum vertical distance between the search matrix and the matrix of the brother matrix node is obtained, and the minimum distance is the minimum of the obtained distances; if the search matrix does not intersect with the matrix of the brother matrix node and the matrix coordinates of the two do not coincide, distances between vertices of the search matrix and vertices of the matrix of the brother matrix node are calculated, to obtain distances between each brother matrix node and the search matrix, and the minimum distance is the minimum of the calculated distances.

[0016] According to another aspect of the embodiment of the present application, a recommendation device based on R-tree is provided, which comprises: an acquisition module, configured to acquire user information when there is a recommendation request, the user information comprising a coordinate position where the user is located; an analysis module, configured to analyze whether pruning is needed based on the user information and the R-tree, each matrix node of the R-tree corresponding to a to-be-selected object, the R-tree being a structure having a tree-like hierarchy and comprising a plurality of matrix nodes; a selection module, configured to select a target object based on distances between the matrix nodes of the R-tree and the user when it is analyzed that pruning is needed; and a recommendation module, configured to recommend the selected target object to the user.

[0017] According to another aspect of the embodiment of the present application, a computing device is provided, which comprises a processor, a memory, a communication interface and a communication bus, the processor, the memory and the communication interface completing communication with each other through the communication bus; the memory is configured to store at least one executable instruction, the executable instruction causing the processor to execute steps of the above-mentioned recommendation method based on R-tree.

[0018] According to another aspect of the embodiments of the present application, a computer storage medium is provided, in which at least one executable instruction is stored, and the executable instruction causes the processor to execute the steps of the above-mentioned R-tree-based recommendation method.

[0019] The embodiments of the present application can effectively reduce the amount of calculation and improve the recommendation efficiency by determining the target recommendation object according to the distance between the matrix node of the R-tree and the position of the user when the pruning operation is needed based on the R-tree and the real-time position analysis, and by determining the candidate object purposefully according to the matrix node structure of the R-tree and in combination with the position of the user without calculating the distance between each candidate object and the user according to the map.

[0020] The above description is only a summary of the technical solutions of the embodiments of the present application, in order to make the technical means of the embodiments of the present application more clearly understood and implemented according to the content of the description, and in order to make the above-mentioned and other purposes, characteristics and advantages of the embodiments of the present application more obvious and easy to understand, the specific embodiments of the present application are described below. BRIEF DESCRIPTION OF DRAWINGS

[0021] Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The accompanying drawings are included to provide a description of the preferred embodiments and are not intended to limit the scope of the application. Moreover, the same reference numerals are used throughout the drawings to represent similar components. In the drawings:

[0022] Figure 1 A flowchart of the R-tree-based recommendation method provided by the embodiments of the present application is shown;

[0023] Figure 2 A structure diagram of the R-tree of a preferred scheme of the R-tree-based recommendation method provided by the embodiments of the present application is shown;

[0024] Figure 3 A structure diagram of the R-tree of another preferred scheme of the R-tree-based recommendation method provided by the embodiments of the present application is shown;

[0025] Figure 4 A structure diagram of the R-tree of a preferred scheme of the R-tree-based recommendation method provided by the embodiments of the present application is shown;

[0026] Figure 5 A specific flowchart of the step S13 of the R-tree-based recommendation method provided by the embodiments of the present application is shown;

[0027] Figure 6 A structure diagram of the R-tree-based recommendation device of the embodiments of the present application is shown;

[0028] Figure 7A structural schematic diagram of a computing device provided by an embodiment of the present application is shown. DETAILED DESCRIPTION

[0029] Exemplary embodiments of the present application will be described in detail with reference to the drawings. Although exemplary embodiments of the present application are shown in the drawings, it is understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thoroughly and completely understood, and will fully convey the scope of the application to those skilled in the art.

[0030] Figure 1 A flowchart of an R-tree-based recommendation method provided by an embodiment of the present application is shown. The R-tree-based recommendation method is applied to a server, such as Figure 1 As shown, the R-tree-based recommendation method includes:

[0031] Step S11: When there is a recommendation request, obtain the user information of the request, the user information including the coordinate position where the user is located.

[0032] Specifically, when the user needs to make a recommendation, first input the recommendation demand or request in the system, the request or demand including user information, which can include the coordinate position where the user is currently located, and can also include other information, such as the number of recommendations needed, or pre-activity time, or a number of coordinate positions, which are not limited herein. When the recommendation request is received, obtain the user information for subsequent use.

[0033] In this embodiment, the R-tree is a balanced tree hierarchy, all leaf nodes having the same depth, a leaf node directly containing a target, a parent node of the leaf node containing a plurality of leaf nodes, and sequentially nesting level by level upwards, a root node at the uppermost layer indirectly containing all targets, the root node range being the smallest bounding box containing all targets, the whole tree having only one root node, which is usually the entry of various operations, such as spatial query and update operations, etc.

[0034] In a preferred mode of the present application, before step S11, it further includes: pre-establishing an R-tree, the R-tree being a spatial search tree, the target object preferably being a new enterprise, the R-tree including a plurality of matrix nodes, each matrix node including a target object and corresponding attribute information, such as the name of the target object, the location thereof, and other information (such as the opening time of the enterprise, etc.).

[0035] Step S12: Based on the user information and the R-tree, analyze whether pruning is needed.

[0036] Specifically, the R-tree is analyzed based on the user information, and whether pruning is needed is analyzed according to an analysis result, for example, whether pruning is needed is analyzed according to the coordinate position of the user and the new enterprise distribution of the R-tree. When it is judged that pruning is needed, step S13 is performed, and when it is judged that pruning is not needed, the recommendation is directly performed according to the R-tree and the user information. The specific target object acquisition process can refer to an existing manner, and details are not described herein again.

[0037] Step S13: When it is analyzed that pruning is needed, a target object is selected based on the distance between the matrix node of the R-tree and the user.

[0038] Specifically, when it is analyzed that pruning is needed, it is indicated that many nodes are far away from the position of the user, and pruning is needed to improve the recommendation efficiency. A pruning strategy can be designed, the pruning strategy can be considered as selecting a new enterprise of a matrix node with a relatively short distance to recommend, and the target object is selected according to the distance between the matrix node of the R-tree and the user. Generally, the new enterprise with a relatively short distance is the demand of the user. The target object is selected through the pruning strategy, the actual demand of the user can be met, and the invalid calculation amount is also reduced to some extent. For example, the new enterprise with a too long distance is not satisfied with the actual demand of the user.

[0039] Step S14: The selected target object is recommended to the user.

[0040] Specifically, the selected target object is recommended to the user, and the recommendation can be performed to the user through a list or other manners. The recommendation content can include the coordinate position, the opening time, the business content and the like of the new enterprise, and can also include other information such as scale, and details are not limited herein.

[0041] In the embodiment, whether pruning is needed is determined based on the R-tree and the coordinate position, the target object is selected according to the distance between the matrix node of the R-tree and the user when pruning is needed, the recommendation efficiency can be improved, the calculation amount is reduced, and the actual demand of the user is met to some extent.

[0042] In a preferred mode of the present application, the step S12 specifically includes:

[0043] The maximum distance between the user and the to-be-selected object in the corresponding matrix node of the R-tree and the minimum distance between the user and the sibling matrix node of the matrix node are respectively acquired.

[0044] Specifically, the R-tree includes a plurality of matrix nodes. The corresponding matrix node is first determined according to the coordinate position of the user, and then the sibling matrix node of the matrix node is determined, for example, Figure 2The diagram shown illustrates the structure of the R-tree in the recommendation method based on the R-tree according to an embodiment of the present invention. The R-tree includes matrix nodes R1, R2, and R3. Matrix node R2 includes child matrix nodes R6, R7, and R5. Matrix node R3 includes child nodes R8, R9, and R10. Matrix node R6 includes child nodes R15, R16, and R17. Matrix node R5 includes child nodes R13 and R14, and so on. Figure 2 As shown, the gray matrix represents the coordinates of the corresponding user. The matrix nodes that overlap with it are R4 and R5. We need to calculate the distances from the gray matrix to the new nodes R11 and R12 within matrix node R4, and to the new nodes R13 and R14 within matrix node R5. The largest of these distances is the maximum distance. In addition, we calculate the distances from the gray matrix to its sibling matrix nodes R3, R6, and R7, and the smallest of these distances is the minimum distance. The specific calculation process will be explained later.

[0045] Based on the minimum distance and the maximum distance, it is determined whether pruning is necessary.

[0046] If the minimum distance is greater than the maximum distance, it is determined that pruning is necessary;

[0047] If the minimum distance is less than or equal to the maximum distance, it is determined that pruning is not required.

[0048] Specifically, the minimum distance is compared with the maximum distance. If the minimum distance is greater than the maximum distance, it means that most of the nodes in the sibling matrix are farther apart, and pruning is required. If the minimum distance is less than or equal to the maximum distance, pruning is not required.

[0049] In this invention, pruning is determined based on R-tree and real-time location analysis. When pruning is required, the target recommendation object is selected based on the distance between the matrix nodes of the R-tree and the user's location. The candidate objects are determined purposefully based on the matrix node structure of the R-tree and the user's location, without the need to calculate the distance between each candidate object and the user based on a map, which can effectively reduce the amount of computation and improve the recommendation efficiency.

[0050] In one embodiment of the present invention, the user information includes the coordinates of the user's location. The step of obtaining the maximum distance between the user and the selected object within the corresponding matrix node in the R-tree, and the minimum distance between the user and the sibling matrix node of the matrix node, includes:

[0051] Determine the user's corresponding matrix node and sibling matrix nodes in the R-tree based on their coordinate positions;

[0052] Specifically, such as Figure 3As shown, the coordinate position can be a current GPS positioning point of the user, for example, point A, point B, point C, and in the R-tree, taking A as an example, the matrix node where A is located is R7, and the sibling matrix nodes of the matrix node R7 are R6, R5, R1 and R3;

[0053] calculating a maximum distance between the coordinate position and the to-be-selected object in the matrix of the corresponding matrix node;

[0054] Specifically, the distances of the point A to new enterprises R19, R18 and R20 in the matrix node R7 are calculated respectively, and the maximum distance is the maximum distance obtained by calculation, preferably, since the new enterprises all carry their own coordinate data, the corresponding distances can be calculated according to the coordinate data of the point A, the new enterprises R19, R18 and R20, and the maximum distance is the maximum distance.

[0055] calculating a minimum distance between the coordinate position and the sibling matrix node;

[0056] Specifically, the distance between the coordinate position and each of the sibling matrix nodes is calculated based on a preset formula, and the preset formula is: wherein, the (x, y) represents the coordinate position, the (x0, y0) represents the coordinates of the left lower corner of the matrix of the sibling matrix node, and the (x1, y1) represents the coordinates of the right upper corner of the matrix corresponding to the sibling matrix node, so as to obtain the distance corresponding to each of the sibling matrix nodes, preferably, see Figure 4 As shown, in the present application, the coordinates of the left lower corner and the right upper corner of the rectangular frame where the matrix node is located are taken as the calculation data.

[0057] For example Figure 3 As shown, still taking the coordinate A as an example, the corresponding sibling matrix nodes of the coordinate A are the matrix nodes R5, R6, R3 and R1, and the distances corresponding to the sibling matrix nodes are calculated according to the above preset formula respectively, and the minimum distance is the minimum distance.

[0058] It should be noted that the maximum distance can be calculated first, and then the minimum distance can be calculated, or the maximum distance and the minimum distance can be calculated at the same time, which is not limited herein.

[0059] In an optional mode of the embodiment of the present application, the user information can further include a recommended number, for example, when the user initiates a recommendation request, the user inputs the coordinate position currently located and the number of new enterprises to be recommended, and when it is analyzed that pruning is needed, for example, as shown in the following table, the number of new enterprises to be recommended is 2, and the coordinate position is (x, y). Figure 5 As shown, the step S13 specifically includes:

[0060] Step S131: counting the number of to-be-selected objects in the matrix node where the coordinate position is located in the R-tree;

[0061] Specifically, the information of the user includes the coordinate position where the user is currently located and the recommended number, the matrix node where the coordinate position is located in the R-tree is determined according to the coordinate position, and the number of the to-be-selected objects (such as new enterprises) in the matrix node is determined, for example Figure 3 The matrix node R7 where the point A is located has three new enterprises, R18, R19 and R20.

[0062] Step S132: If the number of the to-be-selected objects in the matrix node where the coordinate position is located is greater than or equal to the recommended number, the target objects consistent with the recommended number are selected from the to-be-selected objects in the matrix node where the coordinate position is located, and the distance between each selected target object and the coordinate position is less than or equal to the distance between the unselected to-be-selected object in the matrix node where the coordinate position is located and the coordinate position.

[0063] Specifically, the number of the new enterprises in the matrix node is compared with the recommended number, if the number of the new enterprises in the matrix node is greater than or equal to the recommended number, the new enterprises equal to the recommended number are selected from the new enterprises in the matrix node, that is, the distance between each selected target object and the coordinate position is less than or equal to the distance between the unselected to-be-selected object in the matrix node where the coordinate position is located and the coordinate position. Preferably, the new enterprises are selected according to the distance between the new enterprises and the coordinate position, and the new enterprises closer to the coordinate position are selected as the recommended objects, for example Figure 3 In the figure, the recommended number is two, and there are three new enterprises that can be recommended. Since the distance between the new enterprise 18 and the new enterprise 20 and the point A is closer, the new enterprise 18 and the new enterprise 20 are selected as the recommended objects.

[0064] Step S133: If the number of the selected target objects is less than the recommended number, the first number of target objects are selected from the sibling matrix nodes of the matrix node, the first number is equal to the difference between the recommended number and the number of the to-be-selected objects in the matrix node where the coordinate position is located, and the distance between any selected target object and the coordinate position is less than the distance between the other to-be-selected object in the sibling matrix node and the coordinate position.

[0065] Specifically, if the number of new enterprises in the matrix node where the coordinate position is located is less than the recommended number, the recommended new enterprises need to be obtained from the sibling matrix nodes, at this time, the sibling matrix node closest to the coordinate position is selected, and the new enterprise with smaller distance to the coordinate position is selected from the sibling matrix node, if the number of new enterprises in the currently closest sibling matrix node is not enough, the new enterprise needs to be selected from the second closest sibling matrix node, the selected basis is still the new enterprise closest to the coordinate position, until the recommended number of new enterprises is reached, it needs to be noted that the selected new enterprise is the new enterprise closest to the coordinate position, that is, the distance between the selected new enterprise and the coordinate position is less than or equal to the distance between the other unselected new enterprises and the coordinate position.

[0066] In an optional mode of the embodiment of the present application, if the matrix node where the coordinate position is located does not contain new enterprises, such as point B in Figure 3 at this time, the sibling matrix node closest to point B needs to be selected, and the new enterprise is selected from the sibling matrix node, the selection principle is consistent with the foregoing, until the recommended number of new enterprises is reached.

[0067] In another preferred embodiment of the present application, the user information includes a plurality of coordinate positions input by the user or selected from the interface, one of which is the current position of the user, the maximum distance between the user and the target object in the corresponding matrix node and the minimum distance between the user and the sibling matrix node of the matrix node are obtained respectively, including:

[0068] Forming a search matrix based on a plurality of coordinate data;

[0069] Specifically, the system forms a search matrix according to the plurality of coordinate positions, such as the gray block in Figure 2 .

[0070] Determine the matrix node and its sibling matrix node corresponding to the search matrix in the R-tree;

[0071] Specifically, the corresponding matrix node and sibling matrix node of the search matrix are determined according to the position of the search matrix in the R-tree, as shown in Figure 2 , the matrix node corresponding to the search matrix includes R4 and R5, and the sibling nodes are R3, R6 and R7.

[0072] Calculate the maximum distance between the search matrix and the to-be-selected object in the corresponding matrix node and the minimum distance between the search matrix and the matrix of the sibling matrix node;

[0073] Specifically, the distances between the search matrix and the matrix nodes R4 and R5 are calculated respectively, and the larger distance is taken as the maximum distance, the distances between the search matrix and the sibling matrix nodes R3, R6 and R7 are calculated respectively, and the minimum distance is taken as the minimum distance.

[0074] It should be noted that the minimum distance can be calculated first and then the maximum distance, or the maximum distance and the minimum distance can be calculated simultaneously, and the sequence is not limited here.

[0075] In another preferred mode of the embodiment of the application, the user information includes a coordinate position where the user is currently located and a pre-activity duration, and the obtaining of the maximum distance between the user and the target object in the corresponding matrix node and the minimum distance between the user and the sibling matrix node of the matrix node includes:

[0076] The activity track of the user within the pre-activity duration is obtained based on the coordinate position and the pre-activity duration.

[0077] Specifically, the activity track of the user within the pre-activity duration is tracked according to the coordinate position where the user is currently located and the pre-activity duration, and the tracking means can use existing technology.

[0078] The search matrix is formed based on the activity track.

[0079] Specifically, the search matrix can be corrected according to the activity track, and the search matrix is preferably a rectangular frame.

[0080] The corresponding matrix node and the sibling matrix node are determined in the R-tree.

[0081] Specifically, the corresponding matrix node and the sibling matrix node are determined according to the position of the search matrix in the R-tree, as shown in FIG. 4, the search matrix corresponds to the matrix nodes R4 and R5, and the sibling nodes are R3, R6 and R7. Figure 2

[0082] The maximum distance between the search matrix and the target object of the corresponding matrix node is calculated, and the minimum distance between the search matrix and the matrix of the sibling matrix node is calculated.

[0083] Specifically, the distances between the search matrix and the matrix nodes R4 and R5 are calculated respectively, and the larger distance is taken as the maximum distance, and the distances between the search matrix and the sibling matrix nodes R3, R6 and R7 are calculated respectively, and the smallest distance is taken as the minimum distance.

[0084] It should be noted that the minimum distance can be calculated first and then the maximum distance, or the maximum distance and the minimum distance can be calculated simultaneously, and the sequence is not limited here.

[0085] In an optional mode of the embodiment of the application, the process of calculating the maximum distance is as follows:

[0086] As shown in FIG. 4, the maximum distance is calculated by taking the maximum distance between the search matrix and the target object of the corresponding matrix node as the maximum distance. Figure 2 ​As shown, when calculating the maximum distance between the search matrix and the corresponding matrix node and any target object, the distance between the search matrix and the target object of the corresponding matrix node is calculated according to the distance formula, thus obtaining the distance corresponding to each of the selected objects. The distance formula is: Wherein, the (x) di ,y di (x) represents the coordinate position of the target object i, where (x) j1 ,y j1 (x) represents the coordinates of the lower left corner of the search matrix. j2 ,y j2 () represents the coordinates of the upper right corner of the search matrix, for example... Figure 2 To find the distance between the new enterprise R14 in the search matrix, simply input the coordinates of R14 and the distance formula based on the coordinates of the lower left and upper right corners of the search matrix. This will give you the distance between the new enterprises in matrix nodes R4 and R5 and the search matrix. The largest distance will be taken as the maximum distance.

[0087] In another optional embodiment of the present invention, the process of calculating the minimum distance is as follows:

[0088] If the search matrix intersects with the matrix of a node in a sibling matrix, the minimum distance is 0;

[0089] If the search matrix and the matrix of the sibling matrix node do not intersect and their matrix coordinates overlap, obtain the minimum horizontal distance or the minimum vertical distance between the search matrix and the matrix of the sibling matrix node, and take the minimum of the obtained distances as the minimum distance.

[0090] If the search matrix does not intersect with the matrix of the sibling matrix node and their matrix coordinates do not coincide, calculate the distance between the vertex of the search matrix and the vertex of the matrix of the sibling matrix node to obtain the distance between each sibling matrix node and the search matrix, and take the smallest calculated distance as the minimum distance.

[0091] Specifically, such as Figure 4 As shown, matrix node R5 and matrix R7 do not intersect but coincide on the coordinate plane. The minimum distance between them is the horizontal spacing d1 (the distance between two parallel sides, see...). Figure 4 For example, if matrix node R16 and matrix node R15 do not intersect but their coordinates coincide, then the minimum distance is the vertical distance d3 between them (the distance between two parallel sides, see...). Figure 4 In the equation d3 = y8 - y7, the lowest distance between matrix nodes R6 and R7 is the distance d2 between their closest vertices. According to the linear formula... Calculate the minimum distance, where the coordinates of matrix node R6 are (x4, y4)(x5, y5) and the coordinates of matrix node R7 are (x2, y2)(x3, y3).

[0092] The distance from the search matrix to each new node of the corresponding matrix is ​​calculated using the above method, and the largest distance is taken as the maximum distance. The distance between the sibling matrix and the search matrix is ​​calculated using the above method, and the smallest distance is taken as the minimum distance.

[0093] In an optional embodiment, the user information may further include: the number of recommendations. For example, when a user initiates a recommendation request, they input their current coordinates and the number of new businesses to be recommended. When the analysis indicates that pruning is needed, step S13 specifically includes:

[0094] Count the number of objects to be selected in the matrix nodes corresponding to the search matrix in the R-tree;

[0095] Specifically, such as Figure 2 As shown, the matrix nodes corresponding to the search matrix are R4 and R5. The number of new enterprises in matrix nodes R4 and R5 is counted. If the search matrix overlaps with matrix nodes R4 and R5 respectively, then it is considered to be the corresponding matrix node.

[0096] If the number of candidate objects in the matrix node corresponding to the search matrix is ​​greater than or equal to the number of recommendations, select a target object with the same number of recommendations from the candidate objects in the corresponding matrix node. The distance between each selected target object and the search matrix is ​​less than or equal to the distance between the unselected candidate object in the corresponding matrix node and the search matrix.

[0097] Specifically, the number of new enterprises in the corresponding matrix node is compared with the number of recommended enterprises. If the number of new enterprises in the matrix node is greater than or equal to the number of recommended enterprises, then new enterprises equal to the number of recommended enterprises are selected from the new enterprises in the matrix node. That is, the distance between each selected target object and the search matrix is ​​less than or equal to the distance between the unselected candidate object in the corresponding matrix node and the search matrix. Preferably, the selection is based on the distance between the new enterprise and the search matrix, selecting new enterprises closer to the search matrix as recommended objects. Figure 2 In the case of two recommendations, there are three new companies that can be recommended. Since new companies 12 and 11 are relatively close to the search matrix, they are selected as the recommended companies.

[0098] If the number of the selected target objects is less than the recommended number, a second number of target objects are selected from sibling matrix nodes of the corresponding matrix node, the second number being equal to the difference between the recommended number and the number of the objects to be selected in the corresponding matrix node, and the distance between any selected target object and the search matrix being less than the distance between other objects to be selected in the sibling matrix nodes and the search matrix.

[0099] Specifically, if the number of new enterprises in the corresponding matrix node is less than the recommended number, sufficient new enterprises need to be obtained from sibling matrix nodes, at this time, the sibling matrix node closest to the search matrix is selected, and the new enterprises with smaller distances from the search matrix are selected from the sibling matrix node according to the distances from the search matrix, if the number of new enterprises in the currently closest sibling matrix node is not enough, new enterprises need to be selected from the second closest sibling matrix node, and the selected new enterprises are still the new enterprises closest to the coordinate position, that is, the distance between the selected new enterprises and the coordinate position is less than or equal to the distance between other new enterprises not selected and the coordinate position. For example, if the current recommended number is 8 and the number of new enterprises in the corresponding matrix node is 4, new enterprises need to be selected from the closest sibling matrix, for example, the closest sibling matrix R6 has 3 new enterprises, at this time, 1 new enterprise needs to be selected from the second closest sibling matrix node R3, at this time, R3 has new enterprises R8, R9 and R10, the closest new enterprise R8 is selected, and the selected new enterprise is taken as the recommended object, wherein the distance between the new enterprise and the search matrix can be calculated according to the distance formula, the distance between the sibling matrix and the search matrix can be calculated according to the relative position between the two matrices, and the minimum distance calculation method can be referred to for calculation, which will not be described here.

[0100] In a preferred mode of the present application, the user information can further include the opening time of the new enterprise, and the system updates the R-tree according to the opening time of the new enterprise (it can be considered that different opening times of new enterprises are set, and the R-tree is updated according to the user information, which needs to be recommended according to the structure of the corresponding R-tree) to meet the actual needs of the user and improve the recommendation accuracy.

[0101] It should be noted that the new enterprise recommendation is only one recommended object of the present application, and other institutions such as restaurants, banks and schools can also be recommended, which are not limited here.

[0102] The embodiment of the application is based on whether pruning operation is needed in real-time position analysis based on R-tree, when pruning is needed, a target recommended object is selected according to the distance between the matrix node of the R-tree and the position of the user, the to-be-selected object is determined purposefully according to the matrix node structure of the R-tree and in combination with the position of the user, and the distance between each to-be-selected object and the user does not need to be calculated according to a map, so that the operation amount can be effectively reduced and the recommendation efficiency can be improved.

[0103] Secondly, adaptive recommendation can also be made according to the position change of the user, and the accuracy of the recommendation is improved.

[0104] Based on the above method embodiment, Figure 6 The structure schematic diagram of the R-tree-based recommendation device of the embodiment of the application is shown. As shown in the figure, Figure 6 The R-tree-based recommendation device includes an acquisition module 601, an analysis module 602, a selection module 603 and a recommendation module 604. Wherein:

[0105] The acquisition module 601 is used for acquiring the user information of the request when there is a recommendation request, and the user information includes the coordinate position where the user is located;

[0106] The analysis module 602 is used for analyzing whether pruning is needed based on the user information and the R-tree, each matrix node of the R-tree corresponds to a to-be-selected object, the R-tree is a structure with tree-like hierarchy, and includes a plurality of matrix nodes;

[0107] The selection module 603 is used for selecting a target object based on the distance between the matrix node of the R-tree and the user when it is analyzed that pruning is needed;

[0108] The recommendation module 604 is used for recommending the selected target object to the user.

[0109] In an optional mode, the analysis module 602 is used for:

[0110] The maximum distance between the user and the to-be-selected object in the corresponding matrix node in the R-tree and the minimum distance between the user and the brother matrix node of the matrix node are respectively acquired;

[0111] Whether pruning is needed is analyzed based on the minimum distance and the maximum distance;

[0112] If the minimum distance is greater than the maximum distance, it is determined that pruning is needed;

[0113] If the minimum distance is less than or equal to the maximum distance, it is determined that pruning is not needed.

[0114] In an optional mode, the user information includes the coordinate position where the user is located, and the analysis module 602 is specifically used for:

[0115] determine a corresponding matrix node and a sibling matrix node of the user in the R-tree based on the coordinate position;

[0116] calculate a maximum distance between the coordinate position and a to-be-selected object in a matrix of the corresponding matrix node;

[0117] calculate a minimum distance between the coordinate position and the sibling matrix node; or

[0118] The separately obtaining the maximum distance between the user and the corresponding matrix node and the minimum distance between the sibling matrix nodes comprises:

[0119] determine a corresponding matrix node and a sibling matrix node of the user in the R-tree based on the coordinate position;

[0120] calculate a minimum distance between the coordinate position and a matrix of the sibling matrix node;

[0121] calculate a maximum distance between the coordinate position and a to-be-selected object in a matrix of the corresponding matrix node.

[0122] In an optional manner, the user information further comprises a recommended number, and the selection module 603 is configured to:

[0123] count a number of to-be-selected objects in a matrix node where the coordinate position is located in the R-tree;

[0124] if the number of to-be-selected objects in the matrix node where the coordinate position is located is greater than or equal to the recommended number, select target objects from the to-be-selected objects in the matrix node where the coordinate position is located, a number of the selected target objects being equal to the recommended number, and a distance between each selected target object and the coordinate position being less than or equal to a distance between an unselected to-be-selected object in the matrix node where the coordinate position is located and the coordinate position;

[0125] if the number of the selected target objects is less than the recommended number, select a first number of target objects from sibling matrix nodes of the matrix node, the first number being equal to a difference between the recommended number and the number of to-be-selected objects in the matrix node where the coordinate position is located, and a distance between any selected target object and the coordinate position being less than a distance between other to-be-selected objects in the sibling matrix nodes and the coordinate position.

[0126] In an optional manner, the selection module 603 is further configured to calculate the distance between the coordinate position and each sibling matrix node based on a preset formula, the preset formula being: wherein the (x, y) represents the coordinate position, the (x0, y0) represents the coordinate of the left bottom corner of the matrix of the sibling matrix node, and the (x1, y1) represents the coordinate of the right top corner of the matrix corresponding to the sibling matrix node, to obtain the distance corresponding to each sibling matrix node;

[0127] The calculated distances are sorted in ascending order to form a queue;

[0128] The number of the to-be-selected objects in the sibling matrix node arranged in the first position is obtained;

[0129] If the obtained number is equal to the first number, the to-be-selected objects in the sibling matrix node arranged in the first position and the to-be-selected objects in the matrix node where the coordinate position is located are taken as the final recommended target objects;

[0130] If the obtained number is less than the first number, a second number of target objects are selected from the sibling matrix nodes arranged after the first position, the second number being equal to the difference between the first number and the to-be-selected objects in the sibling matrix node arranged in the first position, wherein the distance between the target objects corresponding to the second number and the coordinate position is less than or equal to the distance between any to-be-selected object in the sibling matrix node that is not selected and the coordinate position;

[0131] If the obtained number is greater than the first number, a first number of target objects are selected from the to-be-selected objects in the sibling matrix node arranged in the first position, wherein the distance between the selected target objects and the coordinate position is less than or equal to the distance between the to-be-selected objects in the sibling matrix node arranged in the first position and the coordinate position.

[0132] In an optional manner, the user information further includes a plurality of coordinate positions, and the analysis module 602 is configured to form a search matrix based on the plurality of coordinate data;

[0133] Determine the matrix node corresponding to the search matrix and the sibling matrix nodes thereof in the R-tree;

[0134] Calculate the maximum distance between the search matrix and the to-be-selected objects in the corresponding matrix node and calculate the minimum distance between the search matrix and the matrices of the sibling matrix nodes; or

[0135] The user information further includes a pre-activity time length, and the separately obtaining the maximum distance between the user and the to-be-selected objects in the corresponding matrix node and the minimum distance between the user and the sibling matrix nodes of the matrix node includes:

[0136] obtaining an activity track of the user within the pre-activity time length based on the coordinate position and the pre-activity time length;

[0137] forming a search matrix based on the activity track;

[0138] determining a corresponding matrix node and its sibling matrix nodes in the R-tree;

[0139] calculating a maximum distance between the search matrix and a to-be-selected object of the corresponding matrix node and calculating a minimum distance between the search matrix and the matrix of the sibling matrix node.

[0140] In an optional manner, the analysis module 602 is configured to: calculate a distance between the search matrix and any to-be-selected object of the corresponding matrix node based on a distance formula, to obtain a distance corresponding to each to-be-selected object, the distance formula being: wherein (x di ,y di ) represents a coordinate position of a target object i, (x j1 ,y j1 ) represents a coordinate of a lower left corner of the search matrix, and (x j2 ,y j2 ) represents a coordinate of a right upper corner of the search matrix.

[0141] taking a maximum distance in the calculated distances as the search matrix and the maximum distance; or

[0142] The analysis module 602 is configured to:

[0143] if the search matrix intersects with the matrix of the sibling matrix node, the minimum distance is 0;

[0144] if the search matrix does not intersect with the matrix of the sibling matrix node and the matrix coordinates of the two coincide, obtaining a minimum horizontal distance or a minimum vertical distance between the search matrix and the matrix of the sibling matrix node, and taking a minimum distance of the obtained distances as the minimum distance;

[0145] if the search matrix does not intersect with the matrix of the sibling matrix node and the matrix coordinates of the two do not coincide, calculating a distance between a vertex of the search matrix and a vertex of the matrix of the sibling matrix node, obtaining a distance between each sibling matrix node and the search matrix, and taking a minimum distance of the calculated distances as the minimum distance.

[0146] The embodiment of the application is based on whether pruning operation is needed in real-time position analysis based on the R-tree, when pruning is needed, a target recommended object is selected according to the distance between the matrix node of the R-tree and the position of the user, the to-be-selected object is determined purposefully according to the matrix node structure of the R-tree and in combination with the position of the user, and the distance between each to-be-selected object and the user does not need to be calculated according to a map, so that the operation amount can be effectively reduced and the recommendation efficiency can be improved.

[0147] Secondly, adaptive recommendation can also be made according to the position change of the user, and the accuracy of the recommendation is improved.

[0148] The embodiment of the application provides a nonvolatile computer storage medium, the computer storage medium stores at least one executable instruction, and the computer executable instruction can execute the R-tree-based recommendation method in any method embodiment.

[0149] The executable instruction can be specifically used for causing the processor to execute the following operations:

[0150] When there is a recommendation request, user information of the request is acquired, and the user information includes a coordinate position where the user is located;

[0151] Whether pruning is needed is analyzed based on the user information and the R-tree, each matrix node of the R-tree corresponds to a to-be-selected object, the R-tree is a structure with tree-like levels, and the R-tree includes a plurality of matrix nodes;

[0152] When the analysis result is that pruning is needed, the target object is selected based on the distance between the matrix node of the R-tree and the user;

[0153] The selected target object is recommended to the user.

[0154] In an optional mode, the executable instruction causes the processor to execute the following operations:

[0155] The maximum distance between the user and the to-be-selected object in the corresponding matrix node in the R-tree and the minimum distance between the user and the sibling matrix node of the matrix node are respectively acquired;

[0156] Whether pruning is needed is analyzed based on the minimum distance and the maximum distance;

[0157] If the minimum distance is greater than the maximum distance, it is determined that pruning is needed;

[0158] If the minimum distance is less than or equal to the maximum distance, it is determined that pruning is not needed.

[0159] In an optional mode, the user information includes a coordinate position where the user is located, and the executable instruction causes the processor to execute the following operations:

[0160] determine a corresponding matrix node and a sibling matrix node of the user in the R-tree based on the coordinate position;

[0161] calculate a maximum distance between the coordinate position and a to-be-selected object in a matrix of the corresponding matrix node;

[0162] calculate a minimum distance between the coordinate position and the sibling matrix node; or

[0163] the separately obtaining the maximum distance between the user and the corresponding matrix node and the minimum distance between the sibling matrix nodes comprises:

[0164] determine a corresponding matrix node and a sibling matrix node of the user in the R-tree based on the coordinate position;

[0165] calculate a minimum distance between the coordinate position and a matrix of the sibling matrix node;

[0166] calculate a maximum distance between the coordinate position and a to-be-selected object in a matrix of the corresponding matrix node.

[0167] In an optional manner, the user information further comprises a recommended number, and the executable instructions cause the processor to perform the following operations:

[0168] count a number of to-be-selected objects in a matrix node where the coordinate position is located in the R-tree;

[0169] if the number of to-be-selected objects in the matrix node where the coordinate position is located is greater than or equal to the recommended number, select the recommended number of target objects from the to-be-selected objects in the matrix node where the coordinate position is located, and a distance between each selected target object and the coordinate position is less than or equal to a distance between an unselected to-be-selected object in the matrix node where the coordinate position is located and the coordinate position;

[0170] if the number of selected target objects is less than the recommended number, select a first number of target objects from sibling matrix nodes of the matrix node, the first number is equal to a difference between the recommended number and the number of to-be-selected objects in the matrix node where the coordinate position is located, and a distance between any selected target object and the coordinate position is less than a distance between other to-be-selected objects in the sibling matrix nodes and the coordinate position.

[0171] In an optional manner, the executable instructions cause the processor to perform the following operations:

[0172] calculate distances between the coordinate position and each of the sibling matrix nodes based on a preset formula, the preset formula being: wherein the (x, y) represents the coordinate position, the (x0, y0) represents coordinates of a left bottom corner of a matrix of the sibling matrix node, and the (x1, y1) represents coordinates of a right top corner of a matrix corresponding to the sibling matrix node, to obtain a distance corresponding to each sibling matrix node;

[0173] sort the calculated distances in ascending order to form a queue;

[0174] obtain a number of to-be-selected objects in the sibling matrix node arranged at a head position;

[0175] if the obtained number is equal to the first number, take the to-be-selected objects in the sibling matrix node arranged at the head position and the to-be-selected objects in the matrix node where the coordinate position is located as the final recommended target objects;

[0176] if the obtained number is less than the first number, select a second number of target objects from the sibling matrix nodes arranged after the head position, the second number being equal to a difference between the first number and the to-be-selected objects in the sibling matrix node arranged at the head position, wherein distances between the target objects corresponding to the second number and the coordinate position are less than or equal to distances between any to-be-selected object in the sibling matrix nodes that is not selected and the coordinate position;

[0177] if the obtained number is greater than the first number, select a first number of target objects from the to-be-selected objects in the sibling matrix node arranged at the head position, wherein distances between the selected target objects and the coordinate position are less than or equal to distances between the to-be-selected objects in the sibling matrix node arranged at the head position that are not selected and the coordinate position.

[0178] In an optional manner, the user information further includes a plurality of coordinate positions, and the executable instructions cause the processor to perform the following operations:

[0179] form a search matrix based on the plurality of coordinate data;

[0180] determine a matrix node corresponding to the search matrix and sibling matrix nodes thereof in the R-tree;

[0181] calculate a maximum distance between the search matrix and to-be-selected objects in the corresponding matrix node and calculate a minimum distance between the search matrix and matrices of the sibling matrix nodes; or

[0182] the user information further includes a pre-activity time length, and the executable instructions cause the processor to perform the following operations:

[0183] obtaining an activity track of the user within the pre-activity time length based on the coordinate position and the pre-activity time length;

[0184] forming a search matrix based on the activity track;

[0185] determining a corresponding matrix node and its sibling matrix nodes in the R-tree;

[0186] calculating a maximum distance between the search matrix and a to-be-selected object of the corresponding matrix node and calculating a minimum distance between the search matrix and the matrix of the sibling matrix nodes.

[0187] In an optional manner, the executable instructions cause the processor to perform the following operations:

[0188] calculating a distance between the search matrix and any to-be-selected object of the corresponding matrix node based on a distance formula, to obtain a distance corresponding to each to-be-selected object, the distance formula being: wherein (x di ,y di ) represents a coordinate position of a target object i, (x j1 ,y j1 ) represents a coordinate of a lower left corner of the search matrix, and (x j2 ,y j2 ) represents a coordinate of a right upper corner of the search matrix;

[0189] taking a maximum distance in the calculated distances as the search matrix and the maximum distance; or

[0190] The executable instructions cause the processor to perform the following operations:

[0191] if the search matrix intersects with the matrix of the sibling matrix nodes, the minimum distance is 0;

[0192] if the search matrix does not intersect with the matrix of the sibling matrix nodes and the matrix coordinates of the two coincide, obtaining a minimum horizontal distance or a minimum vertical distance between the search matrix and the matrix of the sibling matrix nodes, and taking a minimum distance of the obtained distances as the minimum distance;

[0193] if the search matrix does not intersect with the matrix of the sibling matrix nodes and the matrix coordinates of the two do not coincide, calculating a distance between a vertex of the search matrix and a vertex of the matrix of the sibling matrix nodes, obtaining a distance between each of the sibling matrix nodes and the search matrix, and taking a minimum distance of the calculated distances as the minimum distance.

[0194] The embodiment of the present application can effectively reduce the operation amount and improve the recommendation efficiency by determining whether the pruning operation is needed based on the R-tree and real-time position analysis, and acquiring the target recommended object according to the pruning strategy when the pruning is needed.

[0195] The embodiment of the present application provides a computer program product, which comprises a computer program stored on a computer storage medium, and the computer program comprises program instructions, which, when executed by a computer, cause the computer to perform the R-tree-based recommendation method in any method embodiment.

[0196] The executable instructions can be specifically used for causing the processor to perform the following operations:

[0197] When there is a recommendation request, user information of the request is acquired, and the user information comprises a coordinate position where the user is located;

[0198] Whether the pruning is needed is analyzed based on the user information and the R-tree, each matrix node of the R-tree corresponds to a to-be-selected object, the R-tree is a structure with tree-like hierarchy, and the R-tree comprises a plurality of matrix nodes;

[0199] When the analysis result is that the pruning is needed, the target object is selected based on the distance between the matrix node of the R-tree and the user;

[0200] The selected target object is recommended to the user.

[0201] In an optional mode, the executable instructions cause the processor to perform the following operations:

[0202] The maximum distance between the user and the to-be-selected object in the corresponding matrix node of the R-tree and the minimum distance between the user and a brother matrix node of the matrix node are respectively acquired;

[0203] Whether the pruning is needed is analyzed based on the minimum distance and the maximum distance;

[0204] If the minimum distance is greater than the maximum distance, it is determined that the pruning is needed;

[0205] If the minimum distance is less than or equal to the maximum distance, it is determined that the pruning is not needed.

[0206] In an optional mode, the user information comprises a coordinate position where the user is located, and the executable instructions cause the processor to perform the following operations:

[0207] The corresponding matrix node of the user in the R-tree and the brother matrix node are determined based on the coordinate position;

[0208] calculating a maximum distance between the coordinate position and a to-be-selected object in a matrix of the corresponding matrix node;

[0209] calculating a minimum distance between the coordinate position and the sibling matrix nodes; or

[0210] The separately obtaining the maximum distance between the user and the corresponding matrix matrix node and the minimum distance between the sibling matrix nodes comprises:

[0211] determining the corresponding matrix node and the sibling matrix nodes of the user in the R-tree based on the coordinate position;

[0212] calculating a minimum distance between the coordinate position and a matrix of the sibling matrix nodes;

[0213] calculating a maximum distance between the coordinate position and a to-be-selected object in a matrix of the corresponding matrix node.

[0214] In an optional manner, the user information comprises a coordinate position where the user is located, and the executable instructions cause the processor to perform the following operations:

[0215] determining the corresponding matrix node and the sibling matrix nodes of the user in the R-tree based on the coordinate position;

[0216] calculating a maximum distance between the coordinate position and a to-be-selected object in a matrix of the corresponding matrix node.

[0217] calculating a minimum distance between the coordinate position and the sibling matrix nodes; or

[0218] The separately obtaining the maximum distance between the user and the corresponding matrix matrix node and the minimum distance between the sibling matrix nodes comprises:

[0219] determining the corresponding matrix node and the sibling matrix nodes of the user in the R-tree based on the coordinate position;

[0220] calculating a minimum distance between the coordinate position and a matrix of the sibling matrix nodes;

[0221] calculating a maximum distance between the coordinate position and a to-be-selected object in a matrix of the corresponding matrix node.

[0222] In an optional manner, the user information further comprises a recommended number, and the executable instructions cause the processor to perform the following operations:

[0223] counting a number of to-be-selected objects in a matrix node where the coordinate position is located in the R-tree;

[0224] If the number of the to-be-selected objects in the matrix node where the coordinate position is located is greater than or equal to the recommended number, the recommended number of target objects are selected from the to-be-selected objects in the matrix node where the coordinate position is located, and the distance between each selected target object and the coordinate position is less than or equal to the distance between the to-be-selected object that is not selected in the matrix node where the coordinate position is located and the coordinate position;

[0225] If the number of the selected target objects is less than the recommended number, a first number of target objects are selected from the sibling matrix nodes of the matrix node, the first number is equal to the difference between the recommended number and the number of the to-be-selected objects in the matrix node where the coordinate position is located, and the distance between any selected target object and the coordinate position is less than the distance between the other to-be-selected object in the sibling matrix node and the coordinate position.

[0226] In an optional manner, the executable instructions cause the processor to perform the following operations:

[0227] The distance between the coordinate position and each sibling matrix node is calculated based on a preset formula, and the preset formula is: wherein the (x, y) represents the coordinate position, the (x0, y0) represents the coordinate of the lower left corner of the matrix of the sibling matrix node, and the (x1, y1) represents the coordinate of the upper right corner of the matrix corresponding to the sibling matrix node, to obtain the distance corresponding to each sibling matrix node;

[0228] The calculated distances are sorted in ascending order to form a queue;

[0229] The number of target objects in the sibling matrix node arranged in the first position is obtained;

[0230] If the obtained number is equal to the first number, the to-be-selected object in the sibling matrix node arranged in the first position and the to-be-selected object in the matrix node where the coordinate position is located are taken as the final recommended target objects;

[0231] If the obtained number is less than the first number, a second number of target objects are selected from the sibling matrix nodes arranged after the first position, the second number is equal to the difference between the first number and the to-be-selected object in the sibling matrix node arranged in the first position, and the distance between the target object corresponding to the second number and the coordinate position is less than or equal to the distance between any to-be-selected object that is not selected in the sibling matrix node and the coordinate position;

[0232] If the obtained number is greater than the first number, selecting a first number of target objects from the target objects arranged in the first sibling matrix node, wherein the distance between the selected target objects and the coordinate position is less than or equal to the distance between the unselected target objects to be selected and the coordinate position in the first sibling matrix node.

[0233] In an optional manner, the user information further comprises a plurality of coordinate positions, and the executable instructions cause the processor to perform the following operations:

[0234] forming a search matrix based on the plurality of coordinate data;

[0235] determining a matrix node corresponding to the search matrix and a sibling matrix node thereof in the R-tree;

[0236] calculating the maximum distance between the search matrix and the target objects in the corresponding matrix node and calculating the minimum distance between the search matrix and the matrix of the sibling matrix node; or

[0237] The user information further comprises a pre-activity time length, and the separately obtaining the maximum distance between the user and the target objects to be selected in the corresponding matrix node and the minimum distance between the user and the sibling matrix node of the matrix node comprises:

[0238] obtaining an activity track of the user within the pre-activity time length based on the coordinate position and the pre-activity time length;

[0239] forming a search matrix based on the activity track;

[0240] determining a corresponding matrix node and a sibling matrix node thereof in the R-tree;

[0241] calculating the maximum distance between the search matrix and the target objects to be selected in the corresponding matrix node and calculating the minimum distance between the search matrix and the matrix of the sibling matrix node.

[0242] In an optional manner, the executable instructions cause the processor to perform the following operations:

[0243] calculating the distance between the search matrix and any target object to be selected in the corresponding matrix node based on a distance formula, to obtain a distance corresponding to each target object, the distance formula being: wherein the (x di ,y di ) represents the coordinate position of the target object i, the (x j1 ,y j1 ) represents the coordinate of the lower left corner of the search matrix, and (x j2 ,y j2() represents the coordinates of the upper right corner of the search matrix;

[0244] The maximum of the calculated distances is used as the search matrix and the maximum distance; or

[0245] The executable instructions cause the processor to perform the following operations:

[0246] If the search matrix intersects with the matrix of the sibling matrix node, the minimum distance is 0;

[0247] If the search matrix does not intersect with the matrix of the sibling matrix node and their matrix coordinates overlap, obtain the minimum horizontal distance or minimum vertical distance between the search matrix and the matrix of the sibling matrix node, and take the minimum of the obtained distances as the minimum distance.

[0248] If the search matrix does not intersect with the matrix of the sibling matrix node and their matrix coordinates do not coincide, calculate the distance between the vertex of the search matrix and the vertex of the matrix of the sibling matrix node to obtain the distance between each sibling matrix node and the search matrix, and take the smallest calculated distance as the minimum distance.

[0249] This invention analyzes whether pruning is needed based on R-tree and real-time location. When pruning is required, the target recommendation object is obtained according to the pruning strategy, which can effectively reduce the amount of computation and improve the recommendation efficiency.

[0250] Figure 7 The diagram shows a schematic of the structure of a computing device provided in an embodiment of the present invention. The specific implementation of the device is not limited by the specific embodiments of the present invention.

[0251] like Figure 7 As shown, the computing device may include: a processor 702, a communications interface 704, a memory 706, and a communications bus 708.

[0252] The processor 702, communication interface 704, and memory 706 communicate with each other via communication bus 708. Communication interface 704 is used to communicate with other network elements such as clients or other servers. The processor 702 executes program 710, specifically performing the relevant steps in the recommended R-tree-based method embodiment described above.

[0253] Specifically, program 710 may include program code that includes computer operation instructions.

[0254] The processor 702 can be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to perform the functions of an embodiment of the present application. The device can include one or more processors of the same type, such as one or more CPUs, or processors of different types, such as one or more CPUs and one or more ASICs.

[0255] The memory 706 stores the program 710. The memory 706 can include a high-speed RAM memory, and can also include a non-volatile memory, such as at least one disk memory.

[0256] The program 710 can specifically cause the processor 702 to perform the following operations:

[0257] When there is a recommendation request, obtaining user information requested, the user information including a coordinate position where the user is located;

[0258] Based on the user information and the R-tree, analyzing whether pruning is needed, each matrix node of the R-tree corresponding to an object to be selected, the R-tree being a structure having a tree hierarchy, including a plurality of matrix nodes;

[0259] When the analysis is that pruning is needed, selecting a target object based on the distance between the matrix node of the R-tree and the user;

[0260] Recommending the selected target object to the user.

[0261] In an optional manner, the program 710 causes the processor to perform the following operations:

[0262] Respectively obtaining a maximum distance between the user and an object to be selected in a corresponding matrix node in the R-tree, and a minimum distance between the user and a sibling matrix node of the matrix node;

[0263] Based on the minimum distance and the maximum distance, analyzing whether pruning is needed;

[0264] If the minimum distance is greater than the maximum distance, it is determined that pruning is needed;

[0265] If the minimum distance is less than or equal to the maximum distance, it is determined that pruning is not needed.

[0266] In an optional manner, the user information includes a coordinate position where the user is located, and the program 710 causes the processor to perform the following operations:

[0267] determine a corresponding matrix node and a sibling matrix node of the user in the R-tree based on the coordinate position;

[0268] calculate a maximum distance between the coordinate position and a to-be-selected object in the corresponding matrix node;

[0269] calculate a minimum distance between the coordinate position and the sibling matrix node; or

[0270] the separately obtaining the maximum distance between the user and the corresponding matrix node and the minimum distance between the sibling matrix nodes comprises:

[0271] determine a corresponding matrix node and a sibling matrix node of the user in the R-tree based on the coordinate position;

[0272] calculate a minimum distance between the coordinate position and the sibling matrix node;

[0273] calculate a maximum distance between the coordinate position and a to-be-selected object in the corresponding matrix node.

[0274] In an optional manner, the user information further comprises a recommended number, and the program 710 causes the processor to perform the following operation:

[0275] count a number of to-be-selected objects in the matrix node where the coordinate position is located in the R-tree;

[0276] if the number of to-be-selected objects in the matrix node where the coordinate position is located is greater than or equal to the recommended number, select the recommended number of target objects from the target objects in the matrix node where the coordinate position is located, and the distance between each selected target object and the coordinate position is less than or equal to the distance between the unselected target object in the to-be-selected objects in the matrix node where the coordinate position is located and the coordinate position;

[0277] if the obtained number of target objects is less than the recommended number, select a first number of target objects from the sibling matrix node of the matrix node, the first number is equal to the difference between the recommended number and the number of to-be-selected objects in the matrix node where the coordinate position is located, and the distance between any selected target object and the coordinate position is less than the distance between the other to-be-selected objects in the sibling matrix node and the coordinate position.

[0278] In an optional manner, the program 710 causes the processor to perform the following operation:

[0279] calculate the distance between the coordinate position and each sibling matrix node based on a preset formula, the preset formula being: wherein the (x, y) represents the coordinate position, the (x0, y0) represents the coordinate of the left bottom corner of the matrix of the sibling matrix node, and the (x1, y1) represents the coordinate of the right top corner of the matrix corresponding to the sibling matrix node, to obtain the distance corresponding to each sibling matrix node;

[0280] sorting the calculated distances in ascending order to form a queue;

[0281] obtaining the number of target objects in the sibling matrix node arranged at the first position;

[0282] if the obtained number is equal to the first number, taking the target objects in the sibling matrix node arranged at the first position and the target objects in the matrix node where the coordinate position is located as the final recommended target objects;

[0283] if the obtained number is less than the first number, selecting a second number of target objects from the sibling matrix nodes arranged after the first position, the second number being equal to the difference between the first number and the target objects in the sibling matrix node arranged at the first position, wherein the distance between the target objects corresponding to the second number and the coordinate position is less than or equal to the distance between any unselected target object in the sibling matrix node and the coordinate position;

[0284] if the obtained number is greater than the first number, selecting a first number of target objects from the target objects in the sibling matrix node arranged at the first position, wherein the distance between the selected target objects and the coordinate position is less than or equal to the distance between the unselected target objects in the sibling matrix node arranged at the first position and the coordinate position.

[0285] In an optional mode, the program 710 further causes the processor to perform the following operations:

[0286] forming a search matrix based on the plurality of coordinate data;

[0287] determining the matrix node corresponding to the search matrix and the sibling matrix nodes thereof in the R-tree;

[0288] calculating the maximum distance between the search matrix and the target objects in the corresponding matrix node and calculating the minimum distance between the search matrix and the matrix of the sibling matrix node; or

[0289] The user information further includes a pre-activity duration, and the program 710 further causes the processor to perform the following operations:

[0290] obtaining an activity track of the user within the pre-activity time length based on the coordinate position and the pre-activity time length;

[0291] forming a search matrix based on the activity track;

[0292] determining a corresponding matrix node and its sibling matrix node in the R-tree;

[0293] calculating a maximum distance between the search matrix and a to-be-selected object of the corresponding matrix node and calculating a minimum distance between the search matrix and the matrix of the sibling matrix node.

[0294] In an optional manner, the program 710 causes the processor to perform the following operations:

[0295] calculating a distance between the search matrix and any target object of the corresponding matrix node based on a distance formula, to obtain a distance corresponding to each target object, the distance formula being: wherein (x di ,y di ) represents a coordinate position of a target object i, (x j1 ,y j1 ) represents a coordinate of a lower left corner of the search matrix, and (x j2 ,y j2 ) represents a coordinate of a right upper corner of the search matrix;

[0296] taking a maximum distance in the calculated distances as the search matrix and the maximum distance; or

[0297] The program 710 causes the processor to perform the following operations:

[0298] if the search matrix intersects with the matrix of the sibling matrix node, the minimum distance is 0;

[0299] if the search matrix does not intersect with the matrix of the sibling matrix node and the matrix coordinates of the two coincide, obtaining a minimum horizontal distance or a minimum vertical distance between the search matrix and the matrix of the sibling matrix node, and taking a minimum distance of the obtained distances as the minimum distance;

[0300] if the search matrix does not intersect with the matrix of the sibling matrix node and the matrix coordinates of the two do not coincide, calculating a distance between a vertex of the search matrix and a vertex of the matrix of the sibling matrix node, obtaining a distance between each sibling matrix node and the search matrix, and taking a minimum distance of the calculated distances as the minimum distance.

[0301] The embodiment of the present application can effectively reduce the operation amount and improve the recommendation efficiency by determining the target recommendation object according to the distance between the matrix node of the R-tree and the position of the user when the pruning operation is needed based on the R-tree and the real-time position analysis, and determining the candidate object purposefully according to the matrix node structure of the R-tree and in combination with the position of the user without calculating the distance between each candidate object and the user according to the map.

[0302] The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems can be used with programs in accordance with the teachings herein, or it can prove convenient to construct more specialized apparatus to perform the required method steps. The required structure for a variety of these systems will be apparent from the description above. In addition, the present embodiments are not described with reference to any particular programming language. It will be appreciated that a variety of programming languages can be used to implement the teachings of the present disclosure as described herein, and any references below to specific languages are provided for disclosure of enablement of the best mode of the invention.

[0303] In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the application can be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been described in detail in order to avoid obscuring the understanding of this description.

[0304] Similarly, it is to be understood that the mechanical details of the application sometimes are presented in terms of sequences of actions to be taken by persons or mechanical devices. It is to be understood that such presentation is by way of example and illustration only. There can be numerous specific configurations of actions by mechanical devices that would achieve the same results as described in this specification, and there can be numerous specific configurations of actions by persons that would achieve the same results as described in this specification. Similarly, the description sometimes presents mechanical details in terms of interactions between elements. It is to be understood that such presentation is by way of example and illustration only.

[0305] Those skilled in the art can understand that the modules in the device in the embodiments can be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and furthermore can be divided into multiple sub-modules or sub-units or sub-components. All the features disclosed in the specification (including the claims, abstract and drawings) and all the processes or units of any method or apparatus disclosed in the specification can be combined in any combination, except that at least some of such features and / or processes or units are mutually exclusive. Unless explicitly stated otherwise, each feature disclosed in the specification (including the claims, abstract and drawings) can be replaced by alternative features providing the same, equivalent or similar functionality.

[0306] It should be noted that the above-mentioned embodiments illustrate rather than limit the application, and that those skilled in the art will be able to design many alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word 'comprising' does not exclude the presence of elements or steps other than those listed in a claim. The word 'a' or 'an' preceding an element does not exclude the presence of a plurality of such elements. The application can be implemented by means of both hardware and software, and any combination thereof. In a unitary claim, several devices, apparatuses or means can be listed, comprising means for carrying out a certain task. The use of the term'means' in a claim is intended to refer to a combination of devices, apparatuses or means for carrying out a task. The word 'first','second', 'third', etc. do not imply any order. The use of these terms is to be construed as an indication of particular embodiments. Steps in the above-described embodiments, unless otherwise specified, are not to be construed as necessarily limiting the order in which the steps are performed.

Claims

1. A method of recommending based on R-tree, characterized by, The method comprises: when there is a recommendation request, obtaining user information requested, the user information comprising a coordinate position where the user is located; based on the user information and the R-tree, analyzing whether pruning is needed, each matrix node of the R-tree corresponding to an object to be selected, the R-tree being a structure having a tree hierarchy, comprising a plurality of matrix nodes; wherein, respectively obtaining a maximum distance between the user and the object to be selected in the corresponding matrix node in the R-tree and a minimum distance between the user and a sibling matrix node of the matrix node; based on the minimum distance and the maximum distance, analyzing whether pruning is needed; if the minimum distance is greater than the maximum distance, it is determined that pruning is needed; if the minimum distance is less than or equal to the maximum distance, it is determined that pruning is not needed; when it is analyzed that pruning is needed, selecting target objects based on the distance between the matrix node of the R-tree and the user; wherein, the user information further comprises a recommendation quantity; counting the number of objects to be selected in the matrix node where the coordinate position is located in the R-tree; if the number of objects to be selected in the matrix node where the coordinate position is located is greater than or equal to the recommendation quantity, selecting the target objects consistent with the recommendation quantity from the objects to be selected in the matrix node where the coordinate position is located, the distance between each selected target object and the coordinate position being less than or equal to the distance between the unselected object to be selected in the matrix node where the coordinate position is located and the coordinate position; if the number of selected target objects is less than the recommendation quantity, selecting a first number of target objects from the sibling matrix node of the matrix node, the first number being equal to the difference between the recommendation quantity and the number of objects to be selected in the matrix node where the coordinate position is located, the distance between any selected target object and the coordinate position being less than the distance between other objects to be selected in the sibling matrix node and the coordinate position; recommending the selected target objects to the user.

2. The method of claim 1, wherein, The user information comprises a coordinate position where the user is located, and the respective obtaining of the maximum distance between the user and the object to be selected in the corresponding matrix node in the R-tree and the minimum distance between the user and the sibling matrix node of the matrix node comprises: based on the coordinate position, determining the corresponding matrix node and the sibling matrix node of the user in the R-tree; calculating the maximum distance between the coordinate position and the object to be selected in the corresponding matrix node; calculating the minimum distance between the coordinate position and the sibling matrix node; or The respective obtaining of the maximum distance between the user and the object to be selected in the corresponding matrix node in the R-tree and the minimum distance between the user and the sibling matrix node of the matrix node comprises: based on the coordinate position, determining the corresponding matrix node and the sibling matrix node of the user in the R-tree; calculating the minimum distance between the coordinate position and the sibling matrix node; calculating a maximum distance between the coordinate position and an object to be selected in a matrix of the corresponding matrix node.

3. The method of claim 1, wherein, The selecting a first number of target objects from the sibling matrix nodes of the matrix node comprises: calculating distances between the coordinate position and each of the sibling matrix nodes based on a preset formula, the preset formula being: wherein the (x, y) represents the coordinate position, the (x0, y0) represents coordinates of a left lower corner of a matrix of the sibling matrix node, and (x1, y1) represents coordinates of a right upper corner of a matrix corresponding to the sibling matrix node, to obtain a distance corresponding to each sibling matrix node. sorting the calculated distances in ascending order to form a queue; obtaining a number of objects to be selected in the sibling matrix node arranged at the first position; if the obtained number is equal to the first number, taking the objects to be selected in the sibling matrix node arranged at the first position and the object to be selected in the matrix node where the coordinate position is located as the final recommended target objects; if the obtained number is less than the first number, selecting a second number of target objects from the sibling matrix nodes arranged after the first position, the second number being equal to a difference between the first number and the objects to be selected in the sibling matrix node arranged at the first position, wherein a distance between the target objects corresponding to the second number and the coordinate position is less than or equal to a distance between any object to be selected in the sibling matrix node and the coordinate position; if the obtained number is greater than the first number, selecting a first number of target objects from the objects to be selected in the sibling matrix node arranged at the first position, wherein a distance between the selected target objects and the coordinate position is less than or equal to a distance between the objects to be selected in the sibling matrix node arranged at the first position and the coordinate position.

4. The method of claim 1, wherein, The user information further comprises a plurality of coordinate positions, and the separately obtaining a maximum distance between the user and an object to be selected in a corresponding matrix node in the R-tree and a minimum distance between the user and a sibling matrix node of the matrix node comprises: forming a search matrix based on a plurality of coordinate data; determining a matrix node corresponding to the search matrix and a sibling matrix node thereof in the R-tree; calculating a maximum distance between the search matrix and an object to be selected in the corresponding matrix node and calculating a minimum distance between the search matrix and a matrix of the sibling matrix node; or The user information further comprises a pre-activity time length, and the separately obtaining a maximum distance between the user and an object to be selected in a corresponding matrix node and a minimum distance between the user and a sibling matrix node of the matrix node comprises: obtaining an activity track of the user within the pre-activity time length based on the coordinate position and the pre-activity time length; forming a search matrix based on the activity track; determining a corresponding matrix node and a sibling matrix node thereof in the R-tree; calculating a maximum distance between the search matrix and an object to be selected in the corresponding matrix node and calculating a minimum distance between the search matrix and a matrix of the sibling matrix node.

5. The method of claim 4, wherein, The calculating a maximum distance between the search matrix and an object to be selected in the corresponding matrix node comprises: Calculate distances between the search matrix and any to-be-selected object of the corresponding matrix node based on a distance formula, to obtain a distance corresponding to each to-be-selected object, the distance formula being: min[(x di -x j1 ) 2 ,(x di -x j2 ) 2 +min(y di -y j1 ) 2 ,(y di -y j2 ) 2 ],wherein (x di ,y di ) represents a coordinate position of a target object i, (x j1 ,y j1 ) represents a coordinate of a lower left corner of the search matrix, and (x j2 ,y j2 ) represents a coordinate of a right upper corner of the search matrix. taking a maximum distance in the calculated distances as the maximum distance between the search matrix and the corresponding matrix node; or The calculating a minimum distance between the search matrix and a matrix of the sibling matrix node comprises: if the search matrix intersects with the matrix of the sibling matrix node, the minimum distance is 0; If the search matrix and the matrix of the sibling matrix node are not intersected and have coinciding matrix coordinates, obtaining the minimum horizontal distance or the minimum vertical distance between the search matrix and the matrix of the sibling matrix node, and taking the minimum of the obtained distances as the minimum distance; If the search matrix and the matrix of the sibling matrix node are not intersected and have non-coinciding matrix coordinates, calculating the distance between the vertex of the search matrix and the vertex of the matrix of the sibling matrix node, obtaining the distance between each sibling matrix node and the search matrix, and taking the minimum of the calculated distances as the minimum distance.

6. A recommendation apparatus based on R-tree, characterized by, The device comprises: The acquisition module is configured to acquire user information when a recommendation request is received, the user information including a coordinate position of the user; The analysis module is configured to analyze whether pruning is needed based on the user information and the R-tree, each matrix node of the R-tree corresponding to an object to be selected, the R-tree being a structure having a tree hierarchy and including a plurality of matrix nodes; wherein the maximum distance between the user and the object to be selected in the corresponding matrix node and the minimum distance between the user and the sibling matrix node of the matrix node are obtained respectively; whether pruning is needed is analyzed based on the minimum distance and the maximum distance; if the minimum distance is greater than the maximum distance, it is determined that pruning is needed; if the minimum distance is less than or equal to the maximum distance, it is determined that pruning is not needed; The selection module is configured to select the target objects based on the distance between the matrix node of the R-tree and the user when it is analyzed that pruning is needed; wherein the user information further includes a recommendation quantity; the quantity of the objects to be selected in the matrix node in which the coordinate position is located is counted; if the quantity of the objects to be selected in the matrix node in which the coordinate position is located is greater than or equal to the recommendation quantity, the target objects consistent with the recommendation quantity are selected from the objects to be selected in the matrix node in which the coordinate position is located, the distance between each selected target object and the coordinate position being less than or equal to the distance between the unselected object to be selected in the matrix node in which the coordinate position is located and the coordinate position; if the quantity of the selected target objects is less than the recommendation quantity, a first quantity of target objects are selected from the sibling matrix node of the matrix node, the first quantity being equal to the difference between the recommendation quantity and the quantity of the objects to be selected in the matrix node in which the coordinate position is located, and the distance between any selected target object and the coordinate position being less than the distance between the other object to be selected in the sibling matrix node and the coordinate position; The recommendation module is configured to recommend the selected target objects to the user.

7. A computing device, comprising: The device comprises: The processor, the memory, the communication interface and the communication bus complete communication with each other through the communication bus; The memory is used to store at least one executable instruction, and the executable instruction causes the processor to execute the steps of the recommendation method based on the R-tree according to any one of claims 1-5.

8. A computer storage medium, characterized in that, The storage medium has at least one executable instruction stored therein, and the executable instruction causes the processor to execute the steps of the R-tree-based recommendation method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Method for recommending path from user position to target area based on R tree

    CN110553661A

  • Method and apparatus for determining answer sequence

    WO2022134578A1