CN115470419A - Object recommendation method, device, equipment and medium - Google Patents

Object recommendation method, device, equipment and medium Download PDF

Info

Publication number
CN115470419A
CN115470419A CN202211126249.8A CN202211126249A CN115470419A CN 115470419 A CN115470419 A CN 115470419A CN 202211126249 A CN202211126249 A CN 202211126249A CN 115470419 A CN115470419 A CN 115470419A
Authority
CN
China
Prior art keywords
sub
target
area
user
objects
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211126249.8A
Other languages
Chinese (zh)
Inventor
钟元椋
吴帅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
CCB Finetech Co Ltd
Original Assignee
China Construction Bank Corp
CCB Finetech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202211126249.8A priority Critical patent/CN115470419A/en
Publication of CN115470419A publication Critical patent/CN115470419A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9537Spatial or temporal dependent retrieval, e.g. spatiotemporal queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9538Presentation of query results

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Remote Sensing (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application relates to the technical field of recommendation systems, in particular to an object recommendation method, device, equipment and medium, which are used for solving the problem that a large number of computing resources are consumed during distance sequencing between a large number of objects and a user. The method comprises the following steps: responding to a query request initiated by a user, and sorting the target points according to the distances between the coordinates of the target points and the coordinates of the user; each target point corresponds to one first sub-area in the target area, different target points correspond to different first sub-areas, and the target area is an area queried in a query request initiated by a user; and according to the sequence of the plurality of ordered target points, obtaining a first sequence of the objects which accord with the query request in a plurality of first sub-regions represented by the plurality of target points, and displaying the first sequence.

Description

Object recommendation method, device, equipment and medium
Technical Field
The present application relates to the technical field of recommendation systems, and in particular, to a method, an apparatus, a device, and a medium for object recommendation.
Background
In the current internet field, a user can find an offline object which the user wants to go by the position of the offline object recorded on the internet. For example, in an O2O (Online To Offline, O2O mode) application, a sorting function such as distance prioritization is provided, a user inputs an Offline shop type, such as a restaurant, which the user wants To query in the O2O application, and the O2O application calculates the distance from the position of each Offline shop To the position of the user and presents the distances To the user in the order from small To large. However, when the number of objects such as stores or businesses is very large, it takes a lot of computing resources to sequentially calculate the distance from the user to each object and then sort the objects.
Disclosure of Invention
The embodiment of the application provides an object recommendation method, device, equipment and medium, which are used for solving the problem that a large amount of computing resources are consumed when a large number of objects and users are subjected to distance sorting.
In a first aspect, the present application provides an object recommendation method, including:
responding to a query request initiated by a user, and sorting the target points according to the distance between the coordinates of the target points and the coordinates of the user; each target point corresponds to one first sub-area in a target area, different target points correspond to different first sub-areas, and the target area is an area queried in the query request initiated by the user;
and according to the sequence of the plurality of ordered target points, obtaining a first sequence of the objects which accord with the query request in the plurality of first sub-areas characterized by the plurality of target points, and displaying the first sequence.
According to the method, after a query request initiated by a user, the distance between the target points of a plurality of sub-areas in the area to be queried by the user and the coordinate of the user can be calculated, then the objects which are in accordance with the query request in the sub-areas represented by the target points are sorted according to the sequence of the target points, and the sequence is displayed to the user, so that the calculation resources are saved compared with a mode of comparing the distance calculation sequence between the objects and the user one by one according to the distance calculation sequence between the sub-areas and the user.
In a possible embodiment, before the displaying the first order, the method further comprises:
according to the coordinates of the user and the coordinates of the objects which accord with the query request in the screening area in the target area, sorting the objects which accord with the query request to obtain a sorted second sequence;
removing the target objects in the first sequence; wherein the target object is an object in the second order that is the same as an object in the first order;
and fusing the objects in the second sequence into the first sequence after the objects are removed according to the distances between the coordinates of the objects in the first sequence after the objects are removed and the coordinates of the user in the second sequence.
In one possible embodiment, the screening area in the target area is determined by:
determining a target second subregion from a plurality of second subregions in the target region; the target second sub-area is the second sub-area where the user is located; the area of the second sub-region is smaller than that of the first sub-region;
and taking the target second sub-area and a plurality of second sub-areas around the target second sub-area as the screening areas in the target area.
In a possible embodiment, before the sorting the plurality of target points according to the distances between the coordinates of the plurality of target points and the coordinates of the user, the method further comprises:
determining that the requirement of query in the query request initiated by the user meets a preset requirement;
wherein the preset requirements include:
the distance between the object queried in the query request initiated by the user and the user is greater than a preset kilometer; and/or
The total number of the objects queried in the query request initiated by the user is larger than a preset number.
In one possible embodiment, the coordinates of a plurality of target points are determined by:
searching coordinates of target points corresponding to a plurality of first sub-areas in the target area from a database; wherein each first sub-region of the target region in the database is represented by a geohash value.
In one possible embodiment, the geohash value for each of the first sub-regions in the target region is determined by:
determining the bit number of the geohash value corresponding to the target area according to the corresponding relation between the area size of the area and the bit number of the geohash value;
and determining the geohash value of each first sub-area in the target area according to the bit number of the geohash value corresponding to the target area.
In a possible embodiment, after obtaining, according to the order of the plurality of ranked target points, a first order of objects meeting the query request in the first sub-regions characterized by the plurality of target points, the method further includes:
storing the first order;
and within a preset time length after responding to the query request initiated by the user, receiving the request initiated by the user and identical to the query request again, and displaying the first sequence again.
In a second aspect, the present application provides an object recommendation apparatus, comprising:
the first sequencing module is used for responding to a query request initiated by a user and sequencing the target points according to the distance between the coordinates of the target points and the coordinates of the user; each target point corresponds to one first sub-area in a target area, different target points correspond to different first sub-areas, and the target area is an area queried in the query request initiated by the user;
and the display module is used for obtaining a first sequence of the objects which accord with the query request in the first sub-areas represented by the target points according to the sequence of the ordered target points and displaying the first sequence.
In a possible embodiment, the apparatus further comprises:
the second sequencing module is used for sequencing the objects which accord with the query request according to the coordinates of the user and the coordinates of the objects which accord with the query request in the screening area in the target area to obtain a sequenced second sequence;
the rejecting module is used for rejecting the target objects in the first sequence; wherein the target object is an object in the second order that is the same as an object in the first order;
and the fusion module is used for fusing the objects in the second sequence into the first sequence after the objects are removed according to the distances between the coordinates of the objects in the first sequence after the objects are removed and the coordinates of the user in the second sequence.
In a possible embodiment, the second sorting module is further configured to:
determining a target second subregion from a plurality of second subregions in the target region; the target second sub-area is the second sub-area where the user is located; the area of the second sub-region is smaller than that of the first sub-region;
and taking the target second sub-area and a plurality of second sub-areas around the target second sub-area as screening areas in the target area.
In a possible embodiment, the apparatus further comprises:
the preprocessing module is used for determining that the requirement of query in the query request initiated by the user meets a preset requirement;
wherein the preset requirements include:
the distance between the object queried in the query request initiated by the user and the user is greater than a preset kilometer; and/or
The total number of the objects queried in the query request initiated by the user is larger than a preset number.
In a possible embodiment, the first ordering module is further configured to:
searching coordinates of target points corresponding to a plurality of first sub-areas in the target area from a database; wherein each first sub-region of the target region in the database is represented by a geohash value.
In a possible embodiment, the first ordering module is further configured to:
determining the bit number of the geohash value corresponding to the target area according to the corresponding relation between the area size of the area and the bit number of the geohash value;
and determining the geohash value of each first sub-area in the target area according to the bit number of the geohash value corresponding to the target area.
In a possible embodiment, the apparatus further comprises:
a post-processing module for storing the first order;
and within a preset time length after responding to the query request initiated by the user, receiving the request initiated by the user and identical to the query request again, and displaying the first sequence again.
In a third aspect, the present application provides an electronic device, comprising:
a memory for storing program instructions;
a processor for calling the program instructions stored in the memory and executing the steps comprised in any one of the methods of the first aspect in accordance with the obtained program instructions.
In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a computer program comprising program instructions which, when executed by a computer, cause the computer to perform the method of any one of the first aspects.
In a fifth aspect, the present application provides a computer program product comprising: computer program code which, when run on a computer, causes the computer to perform the method of any of the first aspects.
Drawings
Fig. 1 is an application schematic diagram of an object recommendation method provided in an embodiment of the present application;
fig. 2 is a flowchart of an object recommendation method according to an embodiment of the present application;
fig. 3 is a schematic diagram of a plurality of first sub-areas of a target area partition provided in an embodiment of the present application;
FIG. 4 is a flowchart of another object recommendation method provided in an embodiment of the present application;
fig. 5 is a schematic diagram of a plurality of first sub-areas and a plurality of second sub-areas of a target area partition provided in an embodiment of the present application;
FIG. 6 is a flowchart of a store recommendation method according to an embodiment of the present disclosure;
fig. 7 is a structural diagram of an object recommendation device according to an embodiment of the present application;
fig. 8 is a structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions in the embodiments of the present application will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application. In the present application, the embodiments and features of the embodiments may be arbitrarily combined with each other without conflict. Also, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.
The terms "first" and "second" in the description and claims of the present application and the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the term "comprises" and any variations thereof, which are intended to cover non-exclusive protection. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus. The "plurality" in the present application may mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.
In the technical scheme, the data acquisition, transmission, use and the like meet the requirements of relevant national laws and regulations.
Before describing the object recommendation method provided in the embodiments of the present application, for ease of understanding, the following detailed description is first provided for the technical background of the embodiments of the present application.
Interpretation of terms:
O2O: the Online To Offline combines the opportunity of Offline commerce with the internet, and makes the internet become the foreground of Offline transaction.
GeoHash: the method is an address coding method, can code two-dimensional space longitude and latitude data into a character string, and is characterized in that more similar longitude and latitude data are more similar after being coded.
Fig. 1 is a diagram of an application scenario in which a user queries an object using a terminal. As shown in fig. 1, in the application scenario diagram, a user opens an O2O application using a terminal, inputs an object that the user wants to query, and the O2O application calculates a distance from a location of each offline store to the location of the user, and presents the distances to the user in order from small to large. For example, object 1, object 2, and object 3 are displayed in this order, and object 1, object 2, and object 3 are displayed in this order on the terminal. If the number of objects is large, then calculating the distances one by one to sort the objects consumes a large amount of computing resources.
In view of the above technical problems, the present application proposes the following technical concepts: the method comprises the steps of dividing a region inquired by a user into a plurality of sub-regions, finding a point from the sub-regions to represent the sub-regions, calculating the distance between the point of the sub-region and the position of the user, sequencing the points of the plurality of sub-regions, obtaining the sequence of objects in the sub-regions according with the user request according to the sequence of the points of the sub-regions, and displaying the sequence to the user.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Referring to fig. 2, an embodiment of the present application provides an object recommendation method, where the method includes:
s200: responding to a query request initiated by a user, and sorting the target points according to the distances between the coordinates of the target points and the coordinates of the user;
each target point corresponds to one first sub-area in the target area, different target points correspond to different first sub-areas, and the target area is an area queried in a query request initiated by a user;
the target area can be province and city where the user is located generally; after the user opens the application, the user generally selects an area, for example, the province and the city where the user is located, or an area that the user wants to query, and the area is a target area. After the user opens the application, the application can automatically identify the province or the city where the user is located, and the province or the city where the user is located is taken as a target area. The target point is a point, e.g. a center point, within the first sub-area.
The coordinates can be expressed by longitude and latitude, that is, the distance between each target point and the user is calculated according to the longitude and latitude of a plurality of target points and the longitude and latitude of the user, and then each target point is sequenced.
S201: and according to the sequence of the plurality of ordered target points, obtaining a first sequence of the objects which accord with the query request in a plurality of first sub-areas represented by the plurality of target points, and displaying the first sequence.
In detail, according to the sequence of the plurality of target points after the ranking, the first sequence of the objects meeting the query request in the plurality of first sub-regions characterized by the plurality of target points is taken as the first sequence, and the first sequence is the sequence from the small to the large of the plurality of target points from the user.
Referring to fig. 3, the target region includes a first sub-region a, a first sub-region B, a first sub-region C, and a first sub-region D, where the first sub-region a includes objects 1 to n meeting the query request, the first sub-region B includes objects 1 to m meeting the query request, the first sub-region C includes objects 1 to p meeting the query request, and the first sub-region D includes objects 1 to q meeting the query request.
Calculating the distance from the user to the center point of the first sub-area A, the distance from the user to the center point of the first sub-area B, the distance from the user to the center point of the first sub-area C and the distance from the user to the center point of the first sub-area D.
If the distance from the user to the center point of the first sub-area a is the smallest, the distance from the user to the center point of the first sub-area C is the second smallest, the distance from the user to the center point of the first sub-area B is the third smallest, and the distance from the user to the center point of the first sub-area D is the smallest, then the ranking result of the plurality of center points is: the center point of the first sub-area A, the center point of the first sub-area C, the center point of the first sub-area B and the center point of the first sub-area D;
then, according to the sequencing results of the plurality of central points, sequencing the objects in the sub-regions to obtain a first sequence, wherein the first sequence is as follows: objects 1 to n, objects 1 to p, objects 1 to m, and objects 1 to q.
It should be noted that, in the first order, the objects in the sub-regions that meet the user request are not sorted in order.
When the first sequence is displayed to the user, the distance from the central point of each sub-region to the user can be displayed, so that the user can conveniently inquire. For example, when the objects 1 to n are displayed, the distance from the central point of the first sub-area A to the user is displayed at the same time; when the objects 1-p are displayed, simultaneously displaying the distance from the central point of the first sub-area C to the user; when the objects 1-m are displayed, the distance from the central point of the first sub-area B to the user is displayed at the same time; and when the objects 1-q are displayed, simultaneously displaying the distance from the central point of the first sub-area D to the user.
Wherein, the first order is displayed, and the objects in the first order can be displayed according to the number of objects of each display page and the number of pages being visited in the user request.
For example, each display page in the user request may contain 5 objects, and then the first display page is 1-5 objects, the second display page is 6-10 objects, the third display page is 11-15 objects, and so on.
Illustratively, when n is 9, p is 5, m is 20, and q is 10, the first display page displays 5 of the objects 1 to n, the second display page displays 4 of the objects 1 to n (the four are different from the 5 displayed on the first display page) and 1 of the objects 1 to p, and the third display page displays 4 of the objects 1 to p (the four are different from the 1 displayed on the second display page) and 1 of the objects 1 to m, in the display order described above.
When the user is accessing the first display page, then 5 of objects 1-n are displayed to the user;
when the user is accessing the second display page, then 4 of objects 1-n and 1 of objects 1-p are displayed to the user;
when the user is accessing the third display page, then the display is given to the user as 4 of objects 1-p and 1 of objects 1-m.
In order to make the distance between the object and the user clearer, in the present application, the first order may be ranked in detail, and the second order may be ranked in detail. In detail, an embodiment of the present application provides another object recommendation method, which is shown in fig. 4 and includes:
s400: responding to a query request initiated by a user, and sorting the target points according to the distances between the coordinates of the target points and the coordinates of the user;
s401: according to the sequence of the plurality of ordered target points, obtaining a first sequence of objects which accord with the query request in a plurality of first sub-areas represented by the plurality of target points;
s402: according to the coordinates of the user and the coordinates of the objects which accord with the query request in the screening area in the target area, sorting the objects which accord with the query request to obtain a second sorted sequence;
determining a screening area in the target area by:
determining a target second sub-region from a plurality of second sub-regions in the target region; the target second sub-area is a second sub-area where the user is located; the area of the second sub-region is smaller than that of the first sub-region;
the target second sub-area, and a plurality of second sub-areas surrounding the target second sub-area, are used as the screening area in the target area.
Wherein the plurality of second sub-areas surrounding the target second sub-area may be second sub-areas surrounding the target second sub-area. If the second sub-area is rectangular, the 8 rectangular second sub-areas surrounding the target second sub-area are a plurality of second sub-areas surrounding the target second sub-area.
In detail, step 402 calculates the distances between the user and the objects within the screening area that meet the query requirements, and sorts these distances to obtain a second order.
S403: removing the target objects in the first sequence;
wherein the target objects are objects in a second order that are the same as the objects in the first order;
s404: fusing the objects in the second sequence into the first sequence after the objects are removed according to the distance between the coordinates of the objects in the first sequence and the second sequence after the objects are removed and the coordinates of the user;
illustratively, the distances between the object and the user in the second order and the distances between the multiple target points and the user in the first distance are compared, and the objects in the second order are merged into the first order after being eliminated according to the distances from small to large.
S405: the first order is displayed.
In combination with the object recommendation method, the application provides an application scenario, and as shown in fig. 5, the target second sub-region is a second sub-region e, the plurality of second sub-regions around the target second sub-region are a second sub-region a, a second sub-region b, a second sub-region c, a second sub-region d, a second sub-region f, a second sub-region g, a second sub-region h, and a second sub-region i, and the screening region is a second sub-region a to a second sub-region i. Calculating the distances between the user and objects which are in the second sub-areas a to i and meet the user request, obtaining a second sequence according to the distances from small to large, wherein the second sequence is an object aa, an object ab, an object ac, an object ad, an object ae and an object af, deleting the object aa, the object ab, the object ac, the object ad, the object ae and the object af from the first sequence, and finally calculating the distances from the object aa, the object ab, the object ac, the object ad, the object ae and the object af to the user, the central point of the first sub-area A, the central point of the first sub-area B, the central point of the first sub-area C and the central point of the first sub-area D, and fusing the second sequence into the deleted first sequence according to the sequence from small to large.
For example, the distances from the object aa, the object ab, the object ac, the object ad, the object ae, and the object af to the user are all smaller than the distances from the center point of the first sub-area a, the center point of the first sub-area B, the center point of the first sub-area C, and the center point of the first sub-area D to the user, the first order may be: the object aa, the object ab, the object ac, the object ad, the object ae, the object af, the object conforming to the user request excluding the object in the center point of the first sub-area a, the object conforming to the user request excluding the object in the center point of the first sub-area C, the object conforming to the user request excluding the object in the center point of the first sub-area B, and the object conforming to the user request excluding the object in the center point of the first sub-area D.
For example, the present application proposes that before the sorting of the plurality of target points according to the distances between the coordinates of the plurality of target points and the coordinates of the user, the method further includes:
determining that the requirement of query in the query request initiated by a user meets a preset requirement;
wherein the preset requirements include:
the distance between an object queried in a query request initiated by a user and the user is greater than a preset kilometer; and/or
The total number of the objects queried in the query request initiated by the user is greater than the preset number.
For example, when a user initiates a query request, the user typically defines the distance of the query and/or the number of objects of the query, e.g., the distance of the query is 5 kilometers and the number of objects of the query is 10.
In detail, in response to a query request initiated by a user, if it is determined that the distance queried by the user exceeds 5 kilometers, it is indicated that the objects that the user wants to query are many, and if the distances are calculated one by one, a large amount of computing resources may be consumed, so when it is determined that the distance queried by the user exceeds 5 kilometers, a plurality of target points may be sorted according to the distances between the plurality of target points and the user, and according to the sequence of the plurality of target points, a first sequence in which a plurality of first sub-regions represented by the plurality of target points meet the objects of the query request is obtained and displayed. If the query distance of the user does not exceed 5 kilometers, sorting can be performed according to the distance between the object meeting the user request and the user within 5 kilometers, and the sorted result is displayed.
The same is true for the object of the query. When a query request initiated by a user is responded, whether the number of objects queried by the user exceeds 10 is judged, if the number of the objects exceeds the object recommendation method according to the teaching of the application, the sequence is displayed to the user, if the number of the objects does not exceed 10, the distances between the objects meeting the user request and the user can be calculated one by one, the objects are sorted, and the sorted results are displayed.
In the actual calculation process, the method is realized by adopting a geohash technology. The present application determines coordinates of a plurality of target points by:
searching coordinates of target points corresponding to a plurality of first sub-areas in a target area from a database; and each first sub-area of the target area in the database is represented by a geohash value.
In detail, the target area is divided into a plurality of first sub-areas, the geographic coordinates of the target area are known, the geographic coordinates of the first sub-areas are also known, the geographic coordinates of the first sub-areas are represented by a geohash value, and the coordinates of the target point are recorded. The target point is a central point in the first sub-area. The geographic coordinates are latitude and longitude.
Determining a geohash value for each first sub-region in the target region by:
determining the bit number of the geohash value corresponding to the target region according to the corresponding relation between the area size of the region and the bit number of the geohash value;
and determining the geohash value of each first sub-region in the target region according to the bit number of the geohash value corresponding to the target region.
Illustratively, in conjunction with table 1, the correspondence between the area size of the region and the number of bits of the geohash value is shown:
TABLE 1
Area size of the region Number of bits of Geohash value
Less than 50 cubic meters 5
Greater than 50 cubic meters 3
That is, when the target area is less than 50 cubic meters, a 5-digit geohash value may be used to represent the first sub-area in the target area;
if the target area is greater than 50 cubic meters, then the first sub-area in the target area may be represented by a 3-bit geohash value. Wherein the smaller the number of bits of the geohash value, the larger the area he represents.
And after the digit of the geohash value corresponding to the target area is obtained, determining the geohash value of each first sub-area in the target area based on the longitude and latitude of the target area.
The second sub-region is represented by a geohash value, and the number of bits of the geohash value of the second sub-region is determined by the area size of the preset region. The preset region is a region smaller than the target region, and the preset region is generally determined according to the distance range that the user wants to query, for example, the distance range of most user queries is counted, the range is 5 kilometers away from the user, and then the square area of the range of 5 kilometers is set as the preset region. And then determining the geohash values of a plurality of second subregions of the target region based on the area size of the preset region. The geohash values of a plurality of second sub-regions of the target region are stored in a database.
And when the second sequence is determined, converting the longitude and latitude of the user into a geohash value with the same digit as the geohash value of the second sub-region, judging which second sub-region the geohash value of the user is the same as, taking the second sub-region with the same geohash value as the user's geohash value as a target second sub-region, finding the geohash value of the second sub-region around the target second sub-region, and taking the second sub-region and the target second sub-region as a screening region in the target region. And then, calculating the distance between the objects according to the longitude and latitude of the objects which accord with the user request in the screening area and the longitude and latitude of the user, and sequencing the objects which accord with the user request in the screening area according to the distance to obtain a second sequence.
After obtaining a first order of the objects meeting the query request in the first sub-areas characterized by the target points according to the ordered sequence of the target points, the method further includes:
storing the first order;
and within the preset time length after responding to the query request initiated by the user, receiving the request initiated by the user and identical to the query request again, and displaying the first sequence again.
In order to improve the response speed, the cache function is added, specifically, after the first sequence is determined, the first sequence is stored in the database, within a preset time length after a query request initiated by a user is responded, the request initiated by the user and the same as the query request are received again, and then the first sequence is called from the database and is directly displayed to the user. Of course, if the first sequence is deleted from the database after a preset duration after responding to the query request initiated by the user, the contents of the database are prevented from being occupied more.
Based on the technical characteristics of the application introduced above, the application provides an application. For example, an offline shop with an O2O platform as an object determines the number of bits of a geohash of the second sub-area according to the distance range queried by most users and the number of bits of a geohash value of the first sub-area according to the area of the target area, then converts the geographic positions of the second sub-areas of the target area into the geohash values, converts the geographic positions of the first sub-areas of the target area into the geohash values, stores the geohash values of the first sub-areas and the longitude and latitude of the center point of the first sub-areas into a database, and stores the geohash values of the second sub-areas into the database. And storing the longitude and latitude of the shop in the first sub-area and the geohash corresponding relation of the first sub-area into a database, and storing the longitude and latitude of the shop in the second sub-area and the geohash corresponding relation of the second sub-area into the database. The number of bits of the geohash value of the first sub-region is typically set to 3 bits and the number of bits of the geohash value of the second sub-region to 5 bits.
If the position of the store is changed or newly added, determining which first sub-area and which second sub-area the longitude and latitude of the changed or newly added store is in, and then updating the longitude and latitude of the first sub-area and the corresponding store. And if the change of the shop is carried out, judging whether the changed shop belongs to the original first sub-area or not, and if so, directly modifying the original longitude and latitude of the changed shop corresponding to the original first sub-area into the longitude and latitude of the changed shop. And if the changed shop does not belong to the original first sub-area, directly deleting the original longitude and latitude of the changed shop corresponding to the original first sub-area, and adding the longitude and latitude of the changed shop into the corresponding relation of the new first sub-area to which the changed shop belongs. The processing for the second sub-area is the same.
And if the new shop is newly added, judging which first sub-area the newly added shop belongs to, and adding the longitude and latitude of the newly added shop into the corresponding relation of the first sub-area the newly added shop belongs to. And judging which second sub-area the newly-added shop belongs to, and adding the longitude and latitude of the newly-added shop into the corresponding relation of the second sub-areas the newly-added shop belongs to.
With reference to fig. 6, based on the above, the present application provides a store recommendation method including:
s600: receiving a query request initiated by a user;
s601: judging whether a shop inquired by a user is in a close range or a long range according to a query request initiated by the user;
in detail, if the distance between the store queried in the query request initiated by the user and the user is greater than a preset kilometer, determining that the store queried by the user is in a long distance; and if the distance between the store inquired in the inquiry request initiated by the user and the user is less than or equal to a preset kilometer, determining that the store inquired by the user is in a close range.
Or if the total number of the stores queried in the query request initiated by the user is greater than the preset number, determining that the stores queried by the user are in a long distance; and if the total number of the stores queried in the query request initiated by the user is less than or equal to the preset number, determining that the stores queried by the user are in a close range.
Or if the distance between the stores queried in the query request initiated by the user and the user is greater than a preset kilometer and the total number of the stores queried in the query request initiated by the user is greater than a preset number, determining that the stores queried by the user are in a long distance; and if the distance between the stores queried in the query request initiated by the user and the user is less than or equal to a preset kilometer and the total number of the stores queried in the query request initiated by the user is less than or equal to a preset number, determining that the stores queried by the user are in a close range.
S602: if the store inquired by the user is in a close range, converting the longitude and latitude of the user into a user's geohash value with the same number of digits as the geohash value of the second sub-area;
s603: finding a target second sub-area with the same geohash value in the target area as the user's geohash value from the database, and taking the target second sub-area and 8 second sub-areas around the target second sub-area as a screening area;
s604: and obtaining a second sequence according to the distance between the shops which accord with the user request in the screening area and the user, and displaying the second sequence to the user.
S605: if the shop inquired by the user is in a long distance, finding the longitude and latitude of the central points of the plurality of first sub-areas in the target area from the database, calculating the distance between the longitude and latitude of the central points of the plurality of first sub-areas and the longitude and latitude of the user, and obtaining the sequence of the central points according to the distance of the plurality of first sub-areas;
s606: according to the sequence of the central points, obtaining a first sequence of shops which accord with the user request in a first sub-area corresponding to the central points;
s607: and displaying the shops in the first sequence to the user according to the number of objects of each display page in the user request and the number of pages being visited.
In the embodiment, the distance sorting is divided into a short-distance sorting scene and a long-distance sorting scene, the short-distance sorting and the short-distance sorting are combined with the short-distance sorting GeoHash values to screen out all shops, and then a precise sorting scheme is adopted, and the long-distance sorting and the long-distance GeoHash values are combined to perform rough sorting, so that the user experience is guaranteed, and the system performance and the resource consumption are also guaranteed.
The short-distance sorting and the long-distance sorting can select corresponding GeoHash value digits, and parameters can be dynamically adjusted to adapt to different requirements.
The GeoHash value digit used for remote sequencing is set based on the area size of a target area to be inquired, if the area size is large, a GeoHash value with smaller digit can be selected, otherwise, a GeoHash value with larger digit can be selected, so that the data volume needing to be calculated each time can not be large, and the resource consumed by the system can not be high.
Based on the same inventive concept, an embodiment of the present application provides an object recommendation apparatus, please refer to fig. 7, the apparatus includes:
a first sorting module 700, configured to respond to a query request initiated by a user, and sort a plurality of target points according to distances between coordinates of the target points and coordinates of the user; each target point corresponds to one first sub-area in a target area, different target points correspond to different first sub-areas, and the target area is an area queried in the query request initiated by the user;
a displaying module 701, configured to obtain, according to the order of the sorted multiple target points, a first order of objects, which meet the query request, in the multiple first sub-regions represented by the multiple target points, and display the first order.
Optionally, the apparatus further comprises:
the second sequencing module is used for sequencing the objects which accord with the query request according to the coordinates of the user and the coordinates of the objects which accord with the query request in the screening area in the target area to obtain a sequenced second sequence;
the rejecting module is used for rejecting the target objects in the first sequence; wherein the target object is an object in the second order that is the same as an object in the first order;
and the fusion module is used for fusing the objects in the second sequence into the first sequence after the objects are removed according to the distances between the coordinates of the objects in the first sequence after the objects are removed and the coordinates of the user in the second sequence.
Optionally, the second sorting module is further configured to:
determining a target second sub-region from a plurality of second sub-regions in the target region; the target second sub-area is the second sub-area where the user is located; the area of the second sub-region is smaller than that of the first sub-region;
and taking the target second sub-area and a plurality of second sub-areas around the target second sub-area as the screening areas in the target area.
Optionally, the apparatus further comprises:
the preprocessing module is used for determining that the requirement of query in the query request initiated by the user meets a preset requirement;
wherein the preset requirements include:
the distance between the object queried in the query request initiated by the user and the user is greater than a preset kilometer; and/or
The total number of the objects queried in the query request initiated by the user is greater than a preset number.
Optionally, the first ordering module 700 is further configured to:
searching coordinates of target points corresponding to a plurality of first sub-areas in the target area from a database; wherein each of the first sub-regions of the target region in the database is represented by a geohash value.
Optionally, the first ordering module 700 is further configured to:
determining the bit number of the geohash value corresponding to the target area according to the corresponding relation between the area size of the area and the bit number of the geohash value;
and determining the geohash value of each first sub-area in the target area according to the bit number of the geohash value corresponding to the target area.
Optionally, the apparatus further comprises:
a post-processing module for storing the first order;
and within a preset time length after responding to the query request initiated by the user, receiving the request initiated by the user and identical to the query request again, and displaying the first sequence again.
The object recommendation device provided in the embodiment of the present application may be used to implement the technical solution of the object recommendation method in the foregoing embodiment, and the implementation principle and the technical effect are similar, which are not described herein again.
It should be noted that the division of the modules of the above apparatus is only a logical division, and the actual implementation may be wholly or partially integrated into one physical entity, or may be physically separated. And these modules can be realized in the form of software called by processing element; or may be implemented entirely in hardware; and part of the modules can be realized in the form of calling software by the processing element, and part of the modules can be realized in the form of hardware. The processing element here may be an integrated circuit with signal processing capabilities. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in the form of software.
Based on the same inventive concept, the present application provides an electronic device, which can implement the functions of the object recommending apparatus discussed above, and referring to fig. 8, the electronic device includes a processor 801 and a memory 802.
The processor 801 executes computer executable instructions stored by the memory, causing the processor 801 to perform the scheme in the embodiments described above. The processor 801 may be a general-purpose processor including a central processing unit CPU, a Network Processor (NP), and the like; but also a digital signal processor DSP, an application specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic device, discrete gate or transistor logic, discrete hardware components.
The memory 802 is coupled to the processor 802 via a system bus and communicates with the processor 802 via the system bus, and the memory 802 is used for storing computer program instructions.
The system bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The system bus may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus. The transceiver is used to enable communication between the database access device and other computers (e.g., clients, read-write libraries, and read-only libraries). The memory may include Random Access Memory (RAM) and may also include non-volatile memory (non-volatile memory).
Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, and a computer program product includes: computer program code which, when run on a computer, causes the computer to perform any of the object recommendation methods as discussed in the preceding paragraphs. Because the principle of solving the problem of the computer-readable storage medium is similar to that of the object recommendation method, the implementation of the computer-readable storage medium can refer to the implementation of the method, and repeated details are not repeated.
Based on the same inventive concept, the embodiment of the present application further provides a computer program product, which includes: computer program code which, when run on a computer, causes the computer to perform any of the object recommendation methods as discussed in the preceding paragraphs. Because the principle of solving the problem of the computer program product is similar to that of the object recommendation method, the implementation of the computer program product can refer to the implementation of the method, and repeated details are not repeated.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of user-operated steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (17)

1. An object recommendation method, comprising:
responding to a query request initiated by a user, and sorting the target points according to the distance between the coordinates of the target points and the coordinates of the user; each target point corresponds to one first sub-area in a target area, different target points correspond to different first sub-areas, and the target area is an area queried in the query request initiated by the user;
and according to the sequence of the plurality of ordered target points, obtaining a first sequence of the objects which accord with the query request in the plurality of first sub-areas characterized by the plurality of target points, and displaying the first sequence.
2. The object recommendation method of claim 1, wherein prior to said displaying the first order, the method further comprises:
according to the coordinates of the user and the coordinates of the objects which accord with the query request in the screening area in the target area, sorting the objects which accord with the query request to obtain a second sorted sequence;
removing the target objects in the first sequence; wherein the target object is an object in the second order that is the same as an object in the first order;
and fusing the objects in the second sequence into the first sequence after the objects are removed according to the distances between the coordinates of the objects in the first sequence after the objects are removed and the coordinates of the user in the second sequence.
3. The object recommendation method of claim 2, wherein the screening area in the target area is determined by:
determining a target second subregion from a plurality of second subregions in the target region; the target second sub-area is the second sub-area where the user is located; the area of the second sub-region is smaller than that of the first sub-region;
and taking the target second sub-area and a plurality of second sub-areas around the target second sub-area as the screening areas in the target area.
4. The object recommendation method of claim 1, wherein before said ranking the plurality of target points according to the distances between the coordinates of the plurality of target points and the coordinates of the user, the method further comprises:
determining that the requirement of query in the query request initiated by the user meets a preset requirement;
wherein the preset requirements include:
the distance between the object queried in the query request initiated by the user and the user is greater than a preset kilometer; and/or
The total number of the objects queried in the query request initiated by the user is larger than a preset number.
5. The object recommendation method of claim 1, wherein the coordinates of the plurality of target points are determined by:
searching coordinates of target points corresponding to a plurality of first sub-areas in the target area from a database; wherein each of the first sub-regions of the target region in the database is represented by a geohash value.
6. The object recommendation method of claim 5, wherein the geohash value of each of the first sub-regions in the target region is determined by:
determining the bit number of the geohash value corresponding to the target area according to the corresponding relation between the area size of the area and the bit number of the geohash value;
and determining the geohash value of each first sub-area in the target area according to the bit number of the geohash value corresponding to the target area.
7. The object recommendation method according to any one of claims 1 to 6, wherein after obtaining a first order of objects meeting the query request in a plurality of first sub-regions characterized by a plurality of target points according to the ordered sequence of the plurality of target points, the method further comprises:
storing the first order;
and within a preset time length after responding to the query request initiated by the user, receiving the request initiated by the user and identical to the query request again, and displaying the first sequence again.
8. An object recommendation device, comprising:
the first sequencing module is used for responding to a query request initiated by a user and sequencing the target points according to the distance between the coordinates of the target points and the coordinates of the user; each target point corresponds to one first sub-area in a target area, different target points correspond to different first sub-areas, and the target area is an area queried in the query request initiated by the user;
and the display module is used for obtaining a first sequence of the objects which accord with the query request in the first sub-areas represented by the target points according to the sequence of the sorted target points and displaying the first sequence.
9. The object recommendation device of claim 8, wherein the device further comprises:
the second sequencing module is used for sequencing the objects which accord with the query request according to the coordinates of the user and the coordinates of the objects which accord with the query request in the screening area in the target area to obtain a sequenced second sequence;
the rejecting module is used for rejecting the target objects in the first sequence; wherein the target object is an object in the second order that is the same as an object in the first order;
and the fusion module is used for fusing the objects in the second sequence into the first sequence after the objects are removed according to the distances between the coordinates of the objects in the first sequence after the objects are removed and the coordinates of the user in the second sequence.
10. The object recommendation device of claim 9, wherein the second ranking module is further configured to:
determining a target second sub-region from a plurality of second sub-regions in the target region; the target second sub-area is the second sub-area where the user is located; the area of the second sub-region is smaller than that of the first sub-region;
and taking the target second sub-area and a plurality of second sub-areas around the target second sub-area as the screening areas in the target area.
11. The object recommendation device of claim 8, wherein the device further comprises:
the preprocessing module is used for determining that the requirement of query in the query request initiated by the user meets a preset requirement;
wherein the preset requirements include:
the distance between the object queried in the query request initiated by the user and the user is greater than a preset kilometer; and/or
The total number of the objects queried in the query request initiated by the user is larger than a preset number.
12. The object recommendation device of claim 8, wherein the first ordering module is further configured to:
searching coordinates of target points corresponding to a plurality of first sub-areas in the target area from a database; wherein each first sub-region of the target region in the database is represented by a geohash value.
13. The object recommendation device of claim 12, wherein the first ordering module is further configured to:
determining the bit number of the geohash value corresponding to the target area according to the corresponding relation between the area size of the area and the bit number of the geohash value;
and determining the geohash value of each first sub-area in the target area according to the bit number of the geohash value corresponding to the target area.
14. The object recommendation device of any one of claims 8-13, characterized in that the device further comprises:
a post-processing module for storing the first order;
and within a preset time length after responding to the query request initiated by the user, receiving the request initiated by the user and identical to the query request again, and displaying the first sequence again.
15. An electronic device, comprising:
a memory for storing program instructions;
a processor for calling program instructions stored in said memory and for executing the steps comprised by the method of any one of claims 1 to 7 in accordance with the obtained program instructions.
16. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions that, when executed by a computer, cause the computer to perform the method of any of claims 1-7.
17. A computer program product, the computer program product comprising: computer program code which, when run on a computer, causes the computer to perform the method of any of the preceding claims 1-7.
CN202211126249.8A 2022-09-16 2022-09-16 Object recommendation method, device, equipment and medium Pending CN115470419A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211126249.8A CN115470419A (en) 2022-09-16 2022-09-16 Object recommendation method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211126249.8A CN115470419A (en) 2022-09-16 2022-09-16 Object recommendation method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN115470419A true CN115470419A (en) 2022-12-13

Family

ID=84332800

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211126249.8A Pending CN115470419A (en) 2022-09-16 2022-09-16 Object recommendation method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115470419A (en)

Similar Documents

Publication Publication Date Title
CN109377329B (en) House resource recommendation method and device, storage medium and electronic equipment
CN110766269A (en) Task allocation method and device, readable storage medium and terminal equipment
CN108090208A (en) Fused data processing method and processing device
CN109657163B (en) Destination address determining method and device, electronic equipment and storage medium
CN111262953B (en) Method and device for pushing information in real time
CN107092623B (en) Interest point query method and device
CN111651685A (en) Interest point obtaining method and device, electronic equipment and storage medium
CN105956148A (en) Resource information recommendation method and apparatus
CN107092609B (en) Information pushing method and device
CN110888866B (en) Data expansion method and device, data processing equipment and storage medium
CN108415960A (en) A kind of implementation method and device of geo-location service, electronic equipment
CN110427574B (en) Route similarity determination method, device, equipment and medium
KR20180017085A (en) Location information providing method and device
WO2016188018A1 (en) Data processing method and apparatus
CN111797319A (en) Recommendation method, device, equipment and storage medium
CN103164436A (en) Image search method and device
CN111695047B (en) User clustering method and device, electronic equipment and storage medium
CN113077321A (en) Article recommendation method and device, electronic equipment and storage medium
CN109918401B (en) Building engineering list data processing method and device, storage medium and computer equipment
CN115470419A (en) Object recommendation method, device, equipment and medium
CN110930101A (en) Method, device, electronic equipment and readable medium for determining delivery time of order
CN116541616A (en) Object placement address determination method, device, computer equipment and storage medium
CN111581245B (en) Data searching method and device
CN109783052B (en) Data sorting method, device, server and computer readable storage medium
CN113761381A (en) Method, device and equipment for recommending interest points and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination