CN109634962A - Merchant searching method and device, electronic equipment and storage medium - Google Patents
Merchant searching method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN109634962A CN109634962A CN201811498585.9A CN201811498585A CN109634962A CN 109634962 A CN109634962 A CN 109634962A CN 201811498585 A CN201811498585 A CN 201811498585A CN 109634962 A CN109634962 A CN 109634962A
- Authority
- CN
- China
- Prior art keywords
- boundary rectangle
- rectangle
- boundary
- trade company
- index tree
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 58
- 230000015654 memory Effects 0.000 claims description 28
- 238000003780 insertion Methods 0.000 claims description 26
- 230000037431 insertion Effects 0.000 claims description 26
- 230000008859 change Effects 0.000 claims description 7
- 238000004891 communication Methods 0.000 claims description 7
- 238000004364 calculation method Methods 0.000 abstract description 6
- 238000001914 filtration Methods 0.000 abstract description 5
- 238000010586 diagram Methods 0.000 description 6
- 230000000694 effects Effects 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000010276 construction Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 1
- 210000000481 breast Anatomy 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 229920006395 saturated elastomer Polymers 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9537—Spatial or temporal dependent retrieval, e.g. spatiotemporal queries
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)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Navigation (AREA)
Abstract
The embodiment of the invention relates to the technical field of e-commerce, and discloses a merchant searching method, which comprises the following steps: acquiring the geographic position of a user, and searching a first external rectangle covering the geographic position by using a pre-established index tree, wherein the first external rectangle is a minimum external rectangle covering a merchant distribution area; determining a target distribution area of which the geographic position is covered by a distribution area corresponding to the first external rectangle; the method comprises the steps that a merchant corresponding to a target distribution area is used as a distributable merchant corresponding to a geographic position; the index tree distribution area comprises at least two commercial tenant distribution areas, wherein leaf nodes of the index tree correspond to first external rectangles, non-leaf nodes of the index tree correspond to second external rectangles, and the second external rectangles are minimum external rectangles determined according to the at least two commercial tenant distribution areas. The invention adopts a space position searching scheme based on the index tree and the idea of external rectangle filtering to aggregate merchants with close distances, greatly reduces the calculation amount when a user searches for the merchants, and can quickly find the merchants meeting the searching conditions.
Description
Technical field
The present invention relates to electric business technical fields more particularly to a kind of trade company's lookup method, device, electronic equipment and storage to be situated between
Matter.
Background technique
With the development of internet, shopping online is more and more common, and in industries such as food and drink, hotels, user passes through network just
It can be achieved quickly to place an order.Such as industry is taken out, during user places an order, the position of oneself is first navigated to, then according to need of ordering
Selection trade company is asked to place an order.This process contains the process of the search of the spatial position based on location-based service (LBS), i.e. basis
The location finding of user's positioning can provide the businesses lists of delivery service to nearby for user.
The current implementation in relation to LBS space search, the relevant technologies are first is that utilize Relational DBMS
(PostgreSQL) space querying function, this scheme when searching for businessman, using to all trade companies dispatching region by
One mode compared, the situation for being suitble to trade company's dispatching region quantity less dispense region quantity situation up to ten thousand when facing trade company,
Obvious this scheme cannot receive;Second is that using search engine Lucene space querying, will dispense region division is the relevant technologies
It after several grids, is indexed and inquires using the relationship of grid and user location, there is certain promotion in performance, but
It is this scheme because increasing space data quantity, when spatial data reaches in the other situation of million, millions, indexes too big, meeting
Leading to query result, there are errors.
Summary of the invention
Embodiment of the present invention is designed to provide a kind of trade company's lookup method, device, electronic equipment and storage medium,
Using the thought of spatial position search plan and boundary rectangle filtering based on index tree, closely located trade company is gathered
It closes, when user searches trade company, the trade company for meeting search condition can be quickly found out.
In order to solve the above technical problems, embodiments of the present invention provide a kind of trade company's lookup method, comprising: obtain and use
The geographical location at family searches first boundary rectangle in covering geographical location using the index tree pre-established, wherein first is external
Rectangle is the minimum circumscribed rectangle for covering trade company's dispatching region;Determine geographical location by the corresponding dispatching region of the first boundary rectangle
The target of covering dispenses region;Trade company is dispensed using the target corresponding trade company in dispatching region as geographical location is corresponding;Wherein,
Corresponding first boundary rectangle of the leaf node of index tree, corresponding second boundary rectangle of the non-leaf nodes of index tree, second is external
Rectangle is to dispense the minimum circumscribed rectangle that region determines according at least two trade companies.
Embodiments of the present invention additionally provide a kind of trade company's lookup device, comprising: searching module, for obtaining user's
Geographical location searches first boundary rectangle in covering geographical location using the index tree pre-established, wherein the first boundary rectangle
The minimum circumscribed rectangle in region is dispensed for covering trade company;Target dispenses area determination module, for determining geographical location by first
The target of the corresponding dispatching region overlay of boundary rectangle dispenses region;Trade company's determining module can be dispensed, for target to be dispensed area
The corresponding trade company in domain dispenses trade company as geographical location is corresponding;Wherein, the corresponding first external square of the leaf node of index tree
Shape, corresponding second boundary rectangle of the non-leaf nodes of index tree, the second boundary rectangle is to be matched according at least two trade companies in commercial circle
The minimum circumscribed rectangle for sending region to determine.
Embodiments of the present invention additionally provide a kind of electronic equipment, comprising: at least one processor;And at least one
The memory of a processor communication connection;Wherein, memory is stored with the instruction that can be executed by least one processor, instructs quilt
At least one processor is executed to realize: obtaining the geographical location of user, it is geographical to search covering using the index tree pre-established
First boundary rectangle of position, wherein the first boundary rectangle is the minimum circumscribed rectangle for covering trade company's dispatching region;It determines geographical
Position dispenses region by the target of the corresponding dispatching region overlay of the first boundary rectangle;The corresponding trade company in target dispatching region is made
Trade company is dispensed for geographical location is corresponding;Wherein, corresponding first boundary rectangle of the leaf node of index tree, the n omicronn-leaf of index tree
Child node corresponds to the second boundary rectangle, and the second boundary rectangle is the external square of minimum for dispensing region according at least two trade companies and determining
Shape.
Embodiments of the present invention additionally provide a kind of non-volatile memory medium, for storing computer-readable program,
Computer-readable program is for executing trade company's lookup method as above for computer.
In terms of existing technologies, the main distinction and its effect are embodiment of the present invention: using based on index
The spatial position search plan of tree and dispatching region correspond to the thought of boundary rectangle filtering, and closely located trade company is gathered
It closes, when user searches trade company, greatly reduces operand, the trade company for meeting search condition can be quickly found out.
In addition, including the leaf node of the first quantity, the first quantity in the child node of each non-leaf nodes of index tree
Less than number of nodes threshold value.It avoids causing Clustering Effect bad because number of nodes is too many, increases the calculation amount of search procedure.
In addition, including the leaf node and third quantity of the second quantity in the child node of each non-leaf nodes of index tree
Non-leaf nodes;Second quantity and third quantity and be less than number of nodes threshold value.It avoids causing to cluster because number of nodes is too many
Effect is bad, increases the calculation amount of search procedure.
In addition, when creation index tree, the common rectangular including determining dynamic change by two third boundary rectangles;If two
Third boundary rectangle is that common rectangular is equal to the greater in two third boundary rectangles;If two thirds are external
Rectangle is to partly overlap or be separated from each other, and common rectangular is equal to the minimum circumscribed rectangle of two third boundary rectangles of covering;Wherein,
Two third boundary rectangles include first boundary rectangle and a common rectangular, or including two the first boundary rectangles;
Second boundary rectangle of each level of index tree is the public square of index tree corresponding level when creation is completed
Shape.According to positional relationship, the boundary rectangle of the most similar trade company of distance is polymerize, the scene of user's search is more in line with,
The multiple trade companies to match with user location can be quickly found out.
In addition, creating the index tree further include: selected from the first boundary rectangle that several are inserted into and building rope
Draw and sets the first nearest boundary rectangle of top common rectangular distance;According to the first nearest boundary rectangle of the distance and institute
The positional relationship for stating the unsaturated common rectangular in indexing tree determines the layer of nearest the first boundary rectangle insertion of the distance
Grade;Wherein, any state before indexing the corresponding index tree creation of tree and completing;The unsaturation common rectangular
It is less than the common rectangular of the number of nodes threshold value for son node number.According to the first boundary rectangle and each level being inserted into
Common rectangular positional relationship selection insertion level, keep Clustering Effect more preferable.
In addition, first boundary rectangle nearest according to the distance and the public square unsaturated in indexing tree
The positional relationship of shape determines the level of nearest the first boundary rectangle insertion of the distance, comprising: if it exists described in several not
Be saturated the first nearest boundary rectangle of common rectangular and the distance positional relationship be comprising the distance it is nearest first outside
Connect rectangle, it is determined that the insertion level is next layer of the minimum common rectangular in several described unsaturated common rectangulars;
If apart from the first nearest boundary rectangle with it is described indexing the positional relationship for setting top common rectangular be to partly overlap
Or it is separated from each other, it is determined that the insertion level is indexing the top of tree to be described.The first boundary rectangle that will be inserted into
It is inserted into the minimum common rectangular with inclusion relation, improves Clustering Effect, and then promote search efficiency.
In addition, the geographical location of user is obtained, outside first that covering geographical location is searched using the index tree pre-established
Connect rectangle, comprising: successively determine every grade of second boundary rectangle in covering geographical location since root node in index tree;From covering
In the leaf node that second boundary rectangle of most final stage in lid geographical location includes, determine that each of covering geographical location first is external
Rectangle.It searches from top to bottom, quickly judges, filter out the trade company for not meeting search condition.
In addition, in index tree since root node successively determine covering geographical location every grade of second boundary rectangle it
Before, further includes: according to geographical location determine user belonging to the corresponding index tree in commercial circle and commercial circle.It is established as unit of commercial circle every
The index tree of a commercial circle, and then index tree corresponding with commercial circle where user location is selected to carry out searching corresponding dispatching region,
Improve search speed.
In addition, searching first boundary rectangle in covering geographical location using the index tree pre-established, comprising: judgement is geographical
Whether position is located in the longitude and latitude extreme value section of the first boundary rectangle, if so, determining that the first boundary rectangle covers geographical position
It sets, otherwise, it determines the first boundary rectangle does not cover geographical location.Judged using longitude and latitude extreme value information, calculates data volume
Greatly reduce, can quickly obtain judging result.
In addition, determining that geographical location is external by first when the first boundary rectangle for covering geographical location is at least two
The target of the corresponding dispatching region overlay of rectangle dispenses region, comprising: uses parallel computation mode, while judging that geographical location is
The corresponding dispatching region overlay of the first boundary rectangle of each of no capped geographical location.Improve the speed that user obtains lookup result
Degree.
In addition, using the corresponding trade company in target dispatching region as geographical location it is corresponding dispense trade company after, also wrap
Include: transmission can dispense trade company to the terminal device of user, and the information that can dispense trade company is shown by terminal device.It is checked convenient for user
And selection, promote user experience.
In addition, geographical location and dispatching region are indicated with latitude and longitude information.Using latitude and longitude information, geographical location is obtained more
Accurately, it is more convenient.
In addition, the first boundary rectangle is determined according to following steps: determining the longitude and latitude extreme value in trade company's dispatching region, longitude and latitude
Spending extreme value includes maximum longitude, minimum longitude, maximum latitude and minimum latitude;The first external square is determined according to longitude and latitude extreme value
Shape.Minimum circumscribed rectangle including the available region comprising trade company's dispatching, reduces the calculation amount in search procedure.
Detailed description of the invention
Fig. 1 is trade company's lookup method flow chart that first embodiment provides according to the present invention;
Fig. 2 is the flow chart of the first boundary rectangle for determining dispatching region in first embodiment according to the present invention;
Fig. 3 is the schematic diagram of the second boundary rectangle of the determination non-leaf nodes in second embodiment according to the present invention;
Fig. 4 is the schematic diagram of the R-tree index tree in second embodiment according to the present invention;
Fig. 5 is that schematic device is searched by the trade company that third embodiment provides according to the present invention;
Fig. 6 is the electronic equipment schematic diagram that the 4th embodiment provides according to the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with attached drawing to the present invention
Each embodiment be explained in detail.However, it will be understood by those skilled in the art that in each embodiment party of the present invention
In formula, in order to make the reader understand this application better, many technical details are proposed.But even if without these technical details
And various changes and modifications based on the following respective embodiments, the application technical solution claimed also may be implemented.
The first embodiment of the present invention is related to a kind of trade company's lookup method, present embodiment can be applied in terminal side,
It such as applies in mobile phone, the terminal devices such as tablet computer, can also apply in the server of network side.
It include several trade companies in commercial circle in catering field, there are the dispatching region of fixed service, i.e. trade company in each trade company only
It provides and places an order and delivery service for the user in oneself dispatching regional scope.When user passes through network ordering, can first it search for
To the corresponding merchant list in dispatching region belonging to oneself position, then trade company is selected to place an order.
Fig. 1 is trade company's lookup method flow chart that first embodiment provides according to the present invention, this method comprises:
S101, the geographical location for obtaining user search the of covering user geographical location using the index tree that pre-establishes
One boundary rectangle.
In present embodiment, index tree is specially R-tree index tree, i.e. Rectangle-tree (rectangle index tree) is
For doing the tree data structure of GML data storage, core concept is to polymerize closely located node and in the upper of tree construction
As soon as layer being denoted as the minimum circumscribed rectangle of these nodes, this minimum circumscribed rectangle becomes upper one layer of a node.
R-tree index tree is indexed by establishing to spatial data, can guarantee that the search to a spatial data only needs to access very little
The node of a part.
Specifically, the first boundary rectangle is the minimum circumscribed rectangle for covering the dispatching region an of trade company, R-tree index
Corresponding first boundary rectangle of a leaf node for tree, a non-leaf nodes of R-tree index tree are one second corresponding
Boundary rectangle, the second boundary rectangle are the minimum circumscribed rectangle determined according to the dispatching region of at least two trade companies in commercial circle.
The dispatching region of trade company corresponds to certain geographic range, and the shape for dispensing region may be the rectangle of rule, can also
It can be irregular shape.Further, the geographical location information in the geographical location of user and the dispatching region of trade company is longitude and latitude.
The process of the first boundary rectangle for determining dispatching region in first embodiment is as shown in Fig. 2, according to dispatching according to the present invention
The longitude and latitude extreme value in region determines the first boundary rectangle, and longitude and latitude extreme value includes maximum longitude, minimum longitude, maximum latitude and most
Small latitude.It specifically includes:
S1011, the latitude and longitude information dispensed on zone boundary is extracted.Latitude and longitude information includes owning on dispatching zone boundary
The longitude and latitude value of point.
S1012, longitude and latitude extreme value is extracted from latitude and longitude information, i.e., maximum longitude, minimum longitude, maximum latitude and minimum
Latitude;
Specifically, in all longitudes on the dispatching zone boundary extracted, maximum longitude and minimum longitude are found;
In all latitude values on the dispatching zone boundary extracted, maximum latitude and minimum latitude are found.Maximum longitude and minimum
Longitude is for example respectively WmaxAnd Wmin, maximum latitude and minimum latitude are for example respectively NmaxAnd Nmin。
S1013, the first coordinate that the first boundary rectangle is determined according to maximum longitude and maximum latitude, according to minimum longitude and
Minimum latitude determines the second coordinate of the first boundary rectangle;
Specifically for example, according to maximum longitude WmaxWith maximum latitude NmaxFirst coordinate of the first determining boundary rectangle is
C1(Wmax, Nmax), according to minimum longitude WminSecond coordinate of the first boundary rectangle determined with minimum latitude is C2 (Wmin,
Nmin)。
S1014, the first boundary rectangle is determined according to the first coordinate and the second coordinate.
Specifically, with the first coordinate C1 (Wmax, Nmax) and the second coordinate C2 (Wmin, Nmin) between line as outside first
The diagonal line for connecing rectangle determines corresponding first boundary rectangle in dispatching region.
In present embodiment, R-tree index tree is established as unit of commercial circle, i.e., for the quotient for including in each commercial circle
The dispatching region of amount amount and each trade company, it is established that the R-tree index tree of the corresponding commercial circle.
Further, next level of child nodes of the non-leaf nodes of the R-tree index tree pre-established includes the first quantity
Leaf node, the first quantity be less than number of nodes threshold value.Alternatively, next level of child nodes of the non-leaf nodes of R-tree index tree
The non-leaf nodes of leaf node and third quantity including the second quantity, the second quantity and third quantity and be less than number of nodes
Threshold value.The size of number of nodes threshold value is determined with specific reference to the quantity of trade company with tree depth threshold.When trade company's quantity is more, section
The points settable biggish value of threshold value, so that the tree depth of R-tree index tree is no more than tree depth threshold.When trade company's quantity compared with
When few, in the case where the tree depth of R-tree index tree is no more than tree depth threshold, the settable lesser value of number of nodes threshold value,
So that tree depth is larger, accelerate the speed searched.Specifically, such as when trade company's quantity is 2000, first node threshold value can be set
It is set to 6.Wherein, geographic range represented by the second boundary rectangle on root node covers outside first of all trade companies in commercial circle
Connect rectangle.Geographic range represented by the second boundary rectangle in child node covers the first boundary rectangle of several trade companies.
More specifically, the R-tree index tree in present embodiment is established using sequence from bottom to top, final to establish
Each layer of R-tree index tree be up to a non-leaf nodes.During creating R-tree index tree, one is defined
The rectangle of a dynamic change is common rectangular, and position of the common rectangular in R-tree index tree is same as the position of the second boundary rectangle
It sets, that is, is located in non-leaf nodes.After the completion of the foundation of R-tree index tree, the non-leaf of the R-tree index tree of end-state
Common rectangular on node is then determined as the second boundary rectangle of R-tree index tree.
The common rectangular of above-mentioned dynamic change is determined that two third boundary rectangles include one by two third boundary rectangles
First boundary rectangle and a common rectangular, or including two the first boundary rectangles;Public affairs are determined by two third boundary rectangles
Altogether when rectangle, specifically,
If two third boundary rectangles are mutually to include, common rectangular is equal to the greater in two third boundary rectangles;
If two third boundary rectangles are to partly overlap or be separated from each other, common rectangular is equal to two external squares of third of covering
The minimum circumscribed rectangle of shape.
In one embodiment, such as finally the R-tree index tree established is N layers shared, numbers successively from the bottom
For 0,1,2 ..., N-1.During creating R-tree index tree, when being accomplished to n-th layer, such as currently built part
For n-R-tree index tree, several remaining first boundary rectangles are inserted into index tree.Under current state, n-R-tree rope
The n-th layer for drawing tree includes 1 non-leaf nodes, i.e. 1 common rectangular, the 0th layer of n-R-tree index tree includes several leaves
Other n-2 layers of child node, i.e. the first boundary rectangle, n-R-tree index tree includes 1 non-leaf nodes and several leaves
Node, i.e., comprising 1 common rectangular and several first boundary rectangles.Further, first be inserted into from several is external
First boundary rectangle nearest with the common rectangular distance of n-R-tree index tree n-th layer is selected in rectangle, is needed it
It is inserted into the n-R-tree index tree, then it needs to be determined that the level of nearest the first boundary rectangle insertion.Specifically, from n-R-
The common rectangular of the n-th layer of tree index tree starts, and traverses the common rectangular of each level from top to bottom, judge this nearest the
The positional relationship of the common rectangular of one boundary rectangle and each level, and the first nearest external square is determined according to positional relationship
The level of shape insertion, comprising:
Common rectangular if it exists comprising the first nearest boundary rectangle, and the son node number that the common rectangular includes is small
When number of nodes threshold value, it is determined that the insertion level of the first nearest boundary rectangle is comprising the first nearest boundary rectangle
Common rectangular next layer, i.e., the first nearest boundary rectangle is inserted into the public affairs comprising the first nearest boundary rectangle
Altogether in the child node of rectangle.At this point, the common rectangular comprising the first nearest boundary rectangle changes, that is, first covered
The quantity of boundary rectangle increases by one.
Further, multiple common rectangulars comprising the first nearest boundary rectangle, and multiple public square if it exists
When the son node number that shape includes is less than number of nodes threshold value, it is determined that the insertion level of the first nearest boundary rectangle is multiple
The first nearest boundary rectangle is inserted into multiple common rectangular by next layer of the minimum common rectangular in common rectangular
In minimum common rectangular child node in.At this point, the public common rectangular of the minimum changes, that is, the external square of first covered
The quantity of shape increases by one.
Common rectangular if it does not exist comprising the first nearest boundary rectangle, the i.e. first nearest boundary rectangle at this time
Positional relationship with the common rectangular of n-th layer is to partly overlap or be separated from each other, it is determined that the first nearest boundary rectangle
It is inserted into the n-th layer that level is n-R-tree index tree, i.e., the first nearest boundary rectangle is inserted into the n-R-tree index
In the leaf node for setting n-th layer, and by the common rectangular of the first nearest boundary rectangle and n-R-tree index tree n-th layer
Determine that n+1 layers of common rectangular, n+1 layers of common rectangular are to cover nearest first boundary rectangle and n-R-tree index
Set the minimum circumscribed rectangle of the common rectangular of n-th layer.N-R-tree index tree becomes n+1-R-tree index tree, i.e. R- at this time
Tree index tree is built to (n+1)th layer.
In a specific embodiment, the common rectangular of n-th layer is defined as the n-th common rectangular.It is created since the 0th layer
The step of R-tree index tree for example,
(1), select most similar two the first boundary rectangles of distance as the 0th layer of R-tree index tree of leaf node,
The first common rectangular for determining most similar two the first boundary rectangles of coverage distance, using the first common rectangular as R-tree rope
Draw the non-leaf nodes of the 1st layer of tree, and the father node as two the first boundary rectangles;
Wherein, if two the first boundary rectangles are mutually to include, the first common rectangular is equal in two the first boundary rectangles
The greater;
If two the first boundary rectangles are to partly overlap or be separated from each other, the first common rectangular is equal to outside covering two first
Connect the minimum circumscribed rectangle of rectangle.
(2), selection with the first common rectangular distance most similar first boundary rectangle, determine covering the first common rectangular and
The common rectangular of most similar first boundary rectangle of distance;
If the first common rectangular be mutually to include apart from the first nearest boundary rectangle, it is public that common rectangular is equal to first
The greater in rectangle and most similar first boundary rectangle of distance.
In one example, the greater is the first common rectangular, then the 0th of R-tree index tree layer increases a leaf section
Point, the coverage area for the first common rectangular that the 1st layer of R-tree index tree increases by first boundary rectangle, i.e., public with first
The first nearest boundary rectangle of rectangle.
In one example, the greater is the first nearest boundary rectangle, it is determined that the 2nd layer of R-tree index tree
Second common rectangular is equal to the first nearest boundary rectangle, becomes the first common rectangular and the first nearest boundary rectangle
Father node;One leaf node of the 1st layer of increase of R-tree index tree, the i.e. first external square nearest with the first common rectangular
Shape.
If the first common rectangular with apart from the first nearest boundary rectangle be partly overlap or be separated from each other, it is determined that R-
2nd layer of the second common rectangular of tree index tree is equal to the first common rectangular of covering and apart from the first nearest boundary rectangle
Minimum circumscribed rectangle, one leaf node of the 1st layer of increase of R-tree index tree, i.e., nearest first with the first common rectangular outside
Connect rectangle.
According to the method described above, until the first all boundary rectangles has all used, R-tree index tree, which is established, to be completed.It is worth
Illustrate, in R-tree index tree establishment process, when the number of child nodes of a certain layer has reached number of nodes threshold value, the layer is not
The first nearest boundary rectangle of distance is further added by as newly-increased leaf node.I.e. at this point, even if the common rectangular of this layer include away from
From the first nearest boundary rectangle, also first boundary rectangle is not increased into the leaf node for the common rectangular, but should
First boundary rectangle increases as the leaf node with the common rectangular same layer.Determining upper one layer of common rectangular simultaneously, and on
One layer of common rectangular is equal to next layer of common rectangular, but coverage area increases the first nearest boundary rectangle.
The most close central point distance for being specifically used for two the first boundary rectangles of description of the distance referred in present embodiment
Distance at a distance from the central point of the first boundary rectangle of distance or common rectangular, most similar first boundary rectangle of distance
Indicate that the distance of the central point of first boundary rectangle is nearest.
Further, the geographical location for obtaining user covers user geographical location using searching in R-tree index tree
First boundary rectangle, specific as follows:
By being positioned in real time to user, the geographical location of user, such as latitude and longitude information are obtained, in R-tree index
Every grade of second boundary rectangle in the geographical location of covering user is successively determined in tree since root node;From the geography of covering user
In the leaf node that the second boundary rectangle of most final stage of position includes, determine that each of geographical location of covering user first is external
Rectangle.
More specifically, if having the geographical location of the first boundary rectangle covering user of leaf node, by this outside first
Connecing rectangle addition can dispense in the first boundary rectangle list;If there is the geography of the second boundary rectangle covering user of non-leaf nodes
Whether position then continues to search next level of child nodes of the non-leaf nodes, judge the geographical location of user by child node
First boundary rectangle of leaf node is covered or is covered by the second boundary rectangle of the non-leaf nodes in child node.Until looking for
To first boundary rectangle in all covering user geographical locations, obtain that the first boundary rectangle list can be dispensed.
Specifically, whether the above-mentioned geographical location for judging user is covered by the first boundary rectangle of leaf node, Ke Yitong
The longitude and latitude extreme value for crossing the geographical location and the first boundary rectangle of comparing user, if the geographical location of user is located at the first external square
In the longitude and latitude extreme value section of shape, then illustrate that first boundary rectangle covers the user location.For example, comparing user geographical location
Longitude whether the first boundary rectangle minimum longitude between maximum longitude, and latitude whether the first boundary rectangle most
Small latitude is between maximum latitude.
S102, determine that the geographical location of user dispenses area by the target of the corresponding dispatching region overlay of the first boundary rectangle
Domain.
According to the first boundary rectangle comprising user location found in step S101, and then available corresponding quotient
Family.Because the geographic range that the first boundary rectangle of trade company covers is distinct from the geographic range of the dispatching region overlay of trade company,
Therefore the first boundary rectangle of the trade company includes user location, does not represent the geographic range of the dispatching region overlay of the trade company
Include user location.Therefore further, by the first boundary rectangle of the latitude and longitude information of user location and covering user location
Whether the coverage area in corresponding dispatching region is compared, judge user location in the corresponding dispatching area of first boundary rectangle
In the coverage area in domain, so that it is determined that the target of covering user location dispenses region.
If the latitude and longitude information of user location is in the coverage area in the corresponding dispatching region of first boundary rectangle, explanation
The corresponding trade company of first boundary rectangle can provide delivery service for the user, determine the corresponding dispatching area of first boundary rectangle
Domain is that target dispenses region.
If the latitude and longitude information of user location in the coverage area in the corresponding dispatching region of first boundary rectangle, is not said
The bright corresponding trade company of first boundary rectangle cannot provide delivery service for the user.
Further, when the first boundary rectangle quantity for covering user location has multiple, judge in this step multiple
When whether the dispatching region of trade company covers user location, serial computing mode can be used, multiple dispatching regions are successively sentenced
It is disconnected, or multiple dispatching regions are judged simultaneously using parallel computation mode.Wherein, serial computing mode refers to more to this
The dispatching region of a trade company successively calculates one by one and judges whether the dispatching region of each trade company covers user location;Parallel meter
Calculation mode refers to the dispatching region to multiple trade company, while calculating and judging whether the dispatching region of each trade company covers user
Position.
S103, trade company is dispensed using the target corresponding trade company in dispatching region as user geographical location is corresponding.
In present embodiment, target dispenses the geographical location of the corresponding dispatching region overlay user in region, that is to say, that mesh
Standard configuration send the corresponding trade company in region that can provide delivery service for the user, by the trade company be determined as the user can distributors
Family namely the user geographical location dispense trade company.
In present embodiment, when after dispensing trade company of user has been determined, the terminal that can dispense trade company to user is sent
Equipment is shown the information that can dispense trade company by terminal device.Such as transmission can dispense in trade company to the mobile phone of user, and in mobile phone
Display can dispense the information of trade company on screen, display content may include the ID, name of firm, trade company of trade company to the distance of user,
Dispatching expense rises and send valence etc..
In present embodiment, trade company, trade company dispatching region, dispense the first boundary rectangle feature for passing through trade company in region
Parameter establishes connection, and the characteristic parameter of trade company is, for example, the ID of trade company.
Embodiment of the present invention uses the spatial position search plan based on index tree and the thought of boundary rectangle filtering,
Closely located trade company is polymerize, the first external square of these trade companies is expressed as in the non-leaf nodes of index tree construction
The public external rectangle that shape collectively constitutes.When user searches trade company, operand is greatly reduced, can be quickly found out and meet search
The trade company of condition.The first boundary rectangle is determined with minimum longitude and latitude according further to the maximum longitude and latitude on dispatching zone boundary, it can
To obtain reducing the calculation amount in search procedure comprising the minimum circumscribed rectangle including trade company's dispatching region.
Second embodiment of the present invention is related to a kind of trade company's lookup method based on spatial position, and present embodiment can be with
It applies in terminal side, such as applies in mobile phone, the terminal devices such as tablet computer, can also apply in the server of network side.
Second embodiment of the invention provide trade company's lookup method include:
S201, the geographical location for obtaining user search the geographical location of covering user using the index tree pre-established
First boundary rectangle.
Next level of child nodes of the non-leaf nodes of the R-tree index tree pre-established includes the leaf section of the first quantity
Point, the first quantity are less than number of nodes threshold value.Alternatively, next level of child nodes of the non-leaf nodes of R-tree index tree includes second
The leaf node of quantity and the non-leaf nodes of third quantity, the second quantity and third quantity and be less than number of nodes threshold value.Section
The size for threshold value of counting is determined with specific reference to the quantity of trade company with tree depth threshold.When trade company's quantity is more, number of nodes threshold
It is worth settable biggish value, so that the tree depth of R-tree index tree is no more than tree depth threshold.When trade company's negligible amounts,
In the case that the tree depth of R-tree index tree is no more than tree depth threshold, the settable lesser value of number of nodes threshold value, so that tree
Depth is larger, accelerates the speed searched.Specifically, such as when trade company's quantity is 2000, first node threshold value may be configured as 6.
In a specific example, the number of nodes threshold value of setting R-tree index tree is 2,
Specifically, the schematic diagram of the second boundary rectangle of the determination non-leaf nodes in second embodiment according to the present invention
As shown in Figure 3.The schematic diagram of the R-tree index tree in second embodiment is as shown in Figure 4 according to the present invention.In conjunction with Fig. 3 and figure
4, when establishing R-tree index tree, can since any one first boundary rectangle, such as can from be located at commercial circle it is most marginal
First boundary rectangle of trade company starts, can also since be located at commercial circle bosom trade company the first boundary rectangle, by its with
The longitude and latitude range of another most similar the first boundary rectangle of distance is compared, and determines the public of one layer of father node thereon
Boundary rectangle, then the public external rectangle and the longitude and latitude range of most similar first boundary rectangle of next distance are compared
Compared with each the first boundary rectangle is inserted by the dummy node boundary rectangle of determining upper one layer of father node, same method
In R-tree index tree, the foundation of R-tree index tree is completed.
Further, it is assumed that trade company's total quantity is 5 in commercial circle, and the first boundary rectangle corresponding to all trade companies is numbered
It is D1, D2, D3, D4, D5 after sequence.The first adjacent boundary rectangle of serial number indicates that geographical location is also adjacent.Such as from D1
Start, compares the longitude and latitude range of D1 and the most similar first boundary rectangle D2 of distance first, obtaining D1 and D2 is to partly overlap,
Then determine that obtaining the first public external rectangle of one layer of father node thereon is D12, the coverage area of D12 contains two first
Boundary rectangle D1 and D2.Secondly, comparing the first public external rectangle D12 and the most similar first boundary rectangle D3 of next distance
Longitude and latitude range, obtain D12 and D3 be mutually indepedent, it is determined that obtain the second public external square of one layer of father node thereon
Shape is D123, and the coverage area of D123 contains three first boundary rectangles D1, D2, D3.Again, compare the second public external square
The longitude and latitude range of shape D123 and the most similar first boundary rectangle D4 of next distance, obtaining D123 includes D4, it is determined that
The third public external rectangle for arriving one layer of father node thereon is identical as the size and location of D123, is indicated with D1~4, D1~4
Coverage area contain four first boundary rectangles D1, D2, D3, D4.Same method continues through to be obtained more each time
Father node public external rectangle and most similar first boundary rectangle of next distance longitude and latitude range method successively
It is inserted into remaining first boundary rectangle D5, completes the foundation of R tree.
Further, the geographical location for obtaining user covers user geographical location using finding in R-tree index tree
The first boundary rectangle, obtain that the first boundary rectangle list can be dispensed.
Further, when searching the first boundary rectangle of covering user location in R-tree index tree, using from upper
Under looked-up sequence, i.e., begin looking for, specifically include from root node boundary rectangle:
(1), search whether corresponding second boundary rectangle of root node includes user location:
If corresponding second boundary rectangle of root node does not include user location, illustrate that trade company all in commercial circle is not to be somebody's turn to do
User location provides delivery service, terminates to search;Such as the party A-subscriber in Fig. 3, it is searched using R-tree index tree shown in fig. 5,
Not in the coverage area of the second boundary rectangle D1~5.
If corresponding second boundary rectangle of root node includes user location, all child nodes of the second layer are continued to search
Whether boundary rectangle includes user location.Such as party B-subscriber or E user in Fig. 3, it is looked into using R-tree index tree shown in Fig. 4
It looks for, in the coverage area of the second boundary rectangle D1~5.
(2), whether the corresponding boundary rectangle of all child nodes for successively searching the second layer includes user location, all sub- sections
Point boundary rectangle includes several second boundary rectangles or all child node boundary rectangles include several second boundary rectangles
With several the first boundary rectangles.Successively search whether the corresponding boundary rectangle of each child node includes user location:
If corresponding first boundary rectangle of leaf node does not include user location, illustrate the corresponding trade company of the leaf node not
Delivery service is provided for the user location;Such as the party B-subscriber in Fig. 3, through searching, not in the coverage area of the first boundary rectangle D5
It is interior.
If the corresponding boundary rectangle of leaf node includes user location, illustrate that the corresponding trade company of the leaf node can be to be somebody's turn to do
User location provides delivery service, records first boundary rectangle;Such as the E user in Fig. 3, through searching, in the first external square
In the coverage area of shape D5.
If the second boundary rectangle does not include user location, illustrate that the corresponding trade company of the second boundary rectangle is not user position
Offer delivery service is provided;
If the second boundary rectangle includes user location, illustrate that the corresponding trade company of the second boundary rectangle can be user position
Offer delivery service is set, then whether the corresponding boundary rectangle of all child nodes of third layer for continuing to search second boundary rectangle wraps
Containing user location;Such as the party B-subscriber in Fig. 3 in the coverage area of the second boundary rectangle D1~4, then continues downward through searching
One layer of lookup.
For in every level-one include user location the second boundary rectangle child node according to the method for step as above (2)
It is searched, until finding all the first boundary rectangles comprising user location.
Such as the party B-subscriber in Fig. 3 finally finds covering B and uses by lookup top-down in R-tree index tree
There are two first boundary rectangles of family position: D1 and D2.
S202, determine that the geographical location of user dispenses area by the target of the corresponding dispatching region overlay of the first boundary rectangle
Domain.Step S102 in specific such as the first specific embodiment.
S203, trade company is dispensed using the target corresponding trade company in dispatching region as user geographical location is corresponding.
In present embodiment, target dispenses the geographical location of the corresponding dispatching region overlay user in region, that is to say, that mesh
Standard configuration send the corresponding trade company in region that can provide delivery service for the user, by the trade company be determined as the user can distributors
Family namely the user geographical location dispense trade company.
Embodiment of the present invention uses the spatial position search plan based on index tree and the thought of boundary rectangle filtering,
Closely located trade company is polymerize, the first external square of these trade companies is expressed as in the non-leaf nodes of index tree construction
The public external rectangle that shape collectively constitutes.When user searches trade company, cluster are quickly found out by the public external rectangle more
A trade company for meeting condition, greatly reduces operand.According further to positional relationship, will gather apart from most similar trade company
It closes, is more in line with the scene of user's search.And by carrying out top-down lookup in index tree, user is made to search trade company
When, ineligible trade company is effectively filtered out, the multiple trade companies to match with user location can be quickly found out.
Third embodiment of the present invention is related to a kind of trade company and searches device, and Fig. 5 is third embodiment according to the present invention
Schematic device is searched by the trade company of offer, which searches device 500 and include:
Searching module 501 is searched using the index tree pre-established for obtaining the geographical location of user and covers geographical position
The first boundary rectangle set, wherein the first boundary rectangle is the minimum circumscribed rectangle for covering trade company's dispatching region;The geography of user
Position and dispatching region are indicated for latitude and longitude information.
Target dispenses area determination module 502, for determining geographical location by the corresponding dispatching region of the first boundary rectangle
The target of covering dispenses region;
Trade company's determining module 503 can be dispensed, for the corresponding trade company in target dispatching region is corresponding as geographical location
Trade company can be dispensed;Wherein, the non-leaf nodes of corresponding first boundary rectangle of the leaf node of index tree, index tree corresponds to outside second
Rectangle is connect, the second boundary rectangle is to dispense the minimum circumscribed rectangle that region determines according at least two trade companies in commercial circle.
It specifically, include the leaf node of the first quantity, the first number in the child node of each non-leaf nodes of index tree
Amount is less than number of nodes threshold value.Or in the child node of each non-leaf nodes of index tree including the second quantity leaf node and
The non-leaf nodes of third quantity;Second quantity and third quantity and be less than number of nodes threshold value.
More specifically, searching module 501 successively determines the every of covering geographical location in index tree since root node
The second boundary rectangle of grade;In the leaf node that the second boundary rectangle of most final stage from covering geographical location includes, covering ground is determined
Manage the first boundary rectangle of each of position, comprising: judge whether geographical location is located at the longitude and latitude extreme value area of the first boundary rectangle
In, if so, determining that the first boundary rectangle covers geographical location, otherwise, it determines the first boundary rectangle does not cover geographical location.
Further, when the first boundary rectangle for covering geographical location is at least two, determine geographical location by first
The target of the corresponding dispatching region overlay of boundary rectangle dispenses region, comprising: uses parallel computation mode, while judging geographical position
It sets and whether is capped each of the geographical location corresponding dispatching region overlay of the first boundary rectangle, if so, determining that first is external
The corresponding dispatching region of rectangle is that target dispenses region.
Further, searching module 501 successively determines the every of covering geographical location in index tree since root node
Grade the second boundary rectangle before, according to the geographical location of user determine user belonging to the corresponding index tree in commercial circle and commercial circle.
In embodiment of the present invention, it further includes index tree creation module 504 which, which searches device 500, for according to quotient
The dispatching region of Quan Nei trade company creates index tree.Specifically, index tree creation module 504 includes the first boundary rectangle determining module
5041, common rectangular determining module 5042 and insertion level determining module 5043.
Specifically, the first boundary rectangle determining module 5041 according to the dispatching region of trade company in commercial circle for determining outside first
Connect rectangle, specifically: determine the longitude and latitude extreme value in trade company's dispatching region, longitude and latitude extreme value include maximum longitude, minimum longitude,
Maximum latitude and minimum latitude;The first boundary rectangle is determined according to longitude and latitude extreme value.
More specifically, common rectangular determining module 5042 is used to determine dynamic change according to two third boundary rectangles
Common rectangular, specifically: if two third boundary rectangles are mutually to include, common rectangular is equal in two third boundary rectangles
The greater;If two third boundary rectangles are to partly overlap or be separated from each other, common rectangular is equal to two external squares of third of covering
The minimum circumscribed rectangle of shape.Wherein, two third boundary rectangles include first boundary rectangle and a common rectangular, or
Including two the first boundary rectangles;Second boundary rectangle of each level of index tree is each level of index tree when creation is completed
Common rectangular.
More specifically, insertion level determining module 5043 from the first boundary rectangle that several are inserted into for selecting
With set the first nearest boundary rectangle of top common rectangular distance indexing, according to the first nearest boundary rectangle of distance
The insertion level of the first nearest boundary rectangle of distance is determined with the positional relationship of common rectangular unsaturated in indexing tree.Tool
Body is that several unsaturated common rectangulars and the positional relationship apart from the first nearest boundary rectangle are comprising apart from most if it exists
The first close boundary rectangle, it is determined that insertion level is the next of the minimum common rectangular in several unsaturated common rectangulars
Layer;If apart from nearest the first boundary rectangle with index the positional relationship for setting top common rectangular be partly overlap or
It is separated from each other, it is determined that insertion level is to index the top of tree.Wherein, tree manipulative indexing tree creation completion is being indexed
Any state before;Unsaturated common rectangular is the common rectangular that son node number is less than number of nodes threshold value.
Four embodiment of the invention is related to a kind of electronic equipment, and Fig. 6 is that the 4th embodiment provides according to the present invention
Electronic equipment schematic diagram, the electronic equipment include: at least one processor 601;And it is communicated at least one processor 601
The memory 602 of connection;And respectively with processor 601 and memory 602 be communication connection communication component 603, communication
Component 603 sends and receivees data under the control of processor 601;Wherein, memory 602, which is stored with, to be handled by least one
The instruction that device 601 executes, instruction are executed by least one processor 601 to realize:
The first external square in covering geographical location is searched in the geographical location for obtaining user using the index tree pre-established
Shape, wherein the first boundary rectangle is the minimum circumscribed rectangle for covering trade company's dispatching region;Determine geographical location by the first external square
The target of the corresponding dispatching region overlay of shape dispenses region;The corresponding trade company in target dispatching region is corresponding as geographical location
Trade company can be dispensed;Wherein, the non-leaf nodes of corresponding first boundary rectangle of the leaf node of index tree, index tree corresponds to outside second
Rectangle is connect, the second boundary rectangle is to dispense the minimum circumscribed rectangle that region determines according at least two trade companies.
The electronic equipment includes: one or more processors 601 and memory 602, with a processor 601 in Fig. 6
For.Processor 601, memory 602 can be connected by bus or other modes, in Fig. 6 for being connected by bus.
Memory 602 is used as a kind of non-volatile computer readable storage medium storing program for executing, can be used for storing non-volatile software program, non-volatile
Property computer executable program and module.Non-volatile software journey of the processor 601 by operation storage in the memory 602
Sequence, instruction and module realize lookup side, above-mentioned trade company thereby executing the various function application and data processing of equipment
Method.
Memory 602 may include storing program area and storage data area, wherein storing program area can store operation system
Application program required for system, at least one function;Storage data area can store the longitude and latitude for dispensing region of the ID of trade company, trade company
Spend information etc..In addition, memory 602 may include high-speed random access memory, it can also include nonvolatile memory, example
Such as at least one disk memory, flush memory device or other non-volatile solid state memory parts.In some embodiments,
Optional memory 602 includes the memory remotely located relative to processor 601, these remote memories can be connected by network
It is connected to external equipment.The example of above-mentioned network include but is not limited to internet, intranet, local area network, mobile radio communication and
A combination thereof.
One or more module stores in the memory 602, when being executed by one or more processor 601, holds
Trade company's lookup method in the above-mentioned any means embodiment of row.
The said goods can be performed the application embodiment provided by method, have the corresponding functional module of execution method and
Beneficial effect, the not technical detail of detailed description in the present embodiment, reference can be made to method provided by the application embodiment.
5th embodiment of the invention is related to a kind of non-volatile memory medium, for storing computer-readable program,
Computer-readable program is used to execute above-mentioned all or part of embodiment of the method for computer.
That is, it will be understood by those skilled in the art that implement the method for the above embodiments be can be with
Relevant hardware is instructed to complete by program, which is stored in a storage medium, including some instructions are to make
It obtains an equipment (can be single-chip microcontroller, chip etc.) or processor (processor) executes each embodiment method of the application
All or part of the steps.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), magnetic or disk etc. are various can store journey
The medium of sequence code.
It will be understood by those skilled in the art that the respective embodiments described above are to realize specific embodiments of the present invention,
And in practical applications, can to it, various changes can be made in the form and details, without departing from the spirit and scope of the present invention.
The embodiment of the present application discloses a kind of trade company's lookup method of A1., comprising:
The geographical location for obtaining user, it is external using the first of the index tree lookup covering geographical location pre-established
Rectangle, wherein first boundary rectangle is the minimum circumscribed rectangle for covering trade company's dispatching region;
Determine that the geographical location dispenses region by the target of the corresponding dispatching region overlay of first boundary rectangle;
Trade company is dispensed using the target corresponding trade company in dispatching region as the geographical location is corresponding;
Wherein, the non-leaf nodes of corresponding first boundary rectangle of the leaf node of the index tree, the index tree is corresponding
Second boundary rectangle, second boundary rectangle are the external square of minimum for dispensing region according at least two trade companies and determining
Shape.
A2. trade company's lookup method as described in a1 includes the in the child node of each non-leaf nodes of the index tree
The leaf node of one quantity, first quantity are less than number of nodes threshold value.
A3. trade company's lookup method as described in a1 includes the in the child node of each non-leaf nodes of the index tree
The leaf node of two quantity and the non-leaf nodes of third quantity;Second quantity and third quantity and be less than number of nodes threshold
Value.
A4. such as the described in any item trade company's lookup methods of A1-A3, it includes: external by two thirds for creating the index tree
Rectangle determines the common rectangular of dynamic change;
If described two third boundary rectangles are, the common rectangular is equal to described two third boundary rectangles
In the greater;
If described two third boundary rectangles are to partly overlap or be separated from each other, the common rectangular is equal to covering described two
The minimum circumscribed rectangle of a third boundary rectangle;
Wherein, described two third boundary rectangles include first boundary rectangle and a common rectangular, or
Including two first boundary rectangles;
The institute of index tree corresponding level when second boundary rectangle of each level of index tree is completed for creation
State common rectangular.
A5. trade company's lookup method as described in A4, creates the index tree further include:
It is selected from the first boundary rectangle that several are inserted into and is indexing the top common rectangular distance of tree most
The first close boundary rectangle;
According to the position of the first nearest boundary rectangle of the distance and the common rectangular unsaturated in indexing tree
Relationship determines the level of nearest the first boundary rectangle insertion of the distance;
Wherein, any state before indexing the corresponding index tree creation of tree and completing;It is described unsaturated public
Rectangle is the common rectangular that son node number is less than the number of nodes threshold value altogether.
A6. trade company's lookup method as described in a5, first boundary rectangle nearest according to the distance and it is described
The positional relationship for indexing unsaturated common rectangular in tree determines the level of nearest the first boundary rectangle insertion of the distance, packet
It includes:
The positional relationship of the first boundary rectangle of several unsaturated common rectangulars and the distance recently if it exists
For first boundary rectangle nearest comprising the distance, it is determined that the insertion level is several described unsaturated common rectangulars
In minimum common rectangular next layer;
If the first nearest boundary rectangle of the distance is indexing the position pass for setting top common rectangular with described
System is to partly overlap or be separated from each other, it is determined that the insertion level is indexing the top of tree to be described.
A7. trade company's lookup method as described in a1, the geographical location for obtaining user, utilizes the index tree pre-established
Search the first boundary rectangle for covering the geographical location, comprising:
Every grade of second boundary rectangle for covering the geographical location is successively determined since root node in the index tree;
From the leaf node that the second boundary rectangle of most final stage for covering the geographical location includes, covering is determined describedly
Manage the first boundary rectangle of each of position.
A8. trade company's lookup method as described in A7, it is described successively to determine covering since root node in the index tree
Before every grade of second boundary rectangle in the geographical location, further includes:
According to the geographical location determine the user belonging to the corresponding index tree in commercial circle and the commercial circle.
A9. trade company's lookup method as described in a1, the index tree that the utilization pre-establishes search the covering geographical position
The first boundary rectangle set, comprising:
Judge whether the geographical location is located in the longitude and latitude extreme value section of first boundary rectangle, if so, really
Fixed first boundary rectangle covers the geographical location, otherwise, it determines first boundary rectangle does not cover the geographical position
It sets.
A10. trade company's lookup method as described in A9, when the first boundary rectangle for covering the geographical location is at least two
When, the determination geographical location dispenses region, packet by the target of the corresponding dispatching region overlay of first boundary rectangle
It includes:
Using parallel computation mode, while it is described to judge whether the geographical location is capped each of described geographical location
The corresponding dispatching region overlay of first boundary rectangle, if so, determining that the corresponding dispatching region of first boundary rectangle is mesh
Standard configuration send region.
The target is dispensed the corresponding trade company in region as described in described by A11. trade company's lookup method as described in a1
Geographical location is corresponding dispense trade company after, further includes:
Can be dispensed described in transmission trade company to the user terminal device, as the terminal device show described in can distributors
The information at family.
A12. trade company's lookup method as described in a1, the geographical location and the dispatching region latitude and longitude information table
Show.
A13. trade company's lookup method as described in A12, first boundary rectangle are determined according to following steps:
Determine that the longitude and latitude extreme value in trade company's dispatching region, the longitude and latitude extreme value include maximum longitude, minimum warp
Degree, maximum latitude and minimum latitude;
First boundary rectangle is determined according to the longitude and latitude extreme value.
The embodiment of the present application discloses a kind of trade company of B1. and searches device, comprising:
Searching module is searched using the index tree pre-established for obtaining the geographical location of user and covers the geography
First boundary rectangle of position, wherein first boundary rectangle is the minimum circumscribed rectangle for covering trade company's dispatching region;
Target dispenses area determination module, for determining the geographical location by the corresponding dispatching of first boundary rectangle
The target of region overlay dispenses region;
Trade company's determining module can be dispensed, for using the corresponding trade company in target dispatching region as the geographical location pair
That answers dispenses trade company;
Wherein, the non-leaf nodes of corresponding first boundary rectangle of the leaf node of the index tree, the index tree is corresponding
Second boundary rectangle, second boundary rectangle are to be dispensed outside the minimum that region determines according in commercial circle at least two trade companies
Connect rectangle.
The embodiment of the present application discloses C1. a kind of electronic equipment, comprising: at least one processor;And
The memory being connect at least one described processor communication;Wherein, the memory be stored with can by it is described extremely
The instruction that a few processor executes, described instruction are executed by least one described processor to realize: obtaining the geography of user
Position searches the first boundary rectangle for covering the geographical location using the index tree pre-established, wherein described first is external
Rectangle is the minimum circumscribed rectangle for covering trade company's dispatching region;Determine that the geographical location is corresponding by first boundary rectangle
The target for dispensing region overlay dispenses region;The corresponding trade company in target dispatching region is corresponding as the geographical location
Trade company can be dispensed;Wherein, corresponding first boundary rectangle of the leaf node of the index tree, the non-leaf nodes pair of the index tree
The second boundary rectangle is answered, second boundary rectangle is the external square of minimum for dispensing region according at least two trade companies and determining
Shape.
C2. the electronic equipment as described in C1 includes the first number in the child node of each non-leaf nodes of the index tree
The leaf node of amount, first quantity are less than number of nodes threshold value.
C3. the electronic equipment as described in C1 includes the second number in the child node of each non-leaf nodes of the index tree
The leaf node of amount and the non-leaf nodes of third quantity;Second quantity and third quantity and be less than number of nodes threshold value.
C4. such as the described in any item electronic equipments of C1-C3, creating the index tree includes: by two third boundary rectangles
Determine the common rectangular of dynamic change;If described two third boundary rectangles are, the common rectangular is equal to described
The greater in two third boundary rectangles;If described two third boundary rectangles are to partly overlap or be separated from each other, the public affairs
Rectangle is equal to the minimum circumscribed rectangle for covering described two third boundary rectangles altogether;Wherein, described two third boundary rectangle packets
First boundary rectangle and a common rectangular are included, or including two first boundary rectangles;The index tree
Second boundary rectangle of each level is the common rectangular of index tree corresponding level when creation is completed.
C5. the electronic equipment as described in C4 creates the index tree further include: the external square of first be inserted into from several
It is selected in shape and is indexing the first nearest boundary rectangle of the top common rectangular distance of tree;Nearest according to the distance
The positional relationship of first boundary rectangle and the common rectangular unsaturated in indexing tree determines nearest first of the distance
The level of boundary rectangle insertion;Wherein, any state before indexing the corresponding index tree creation of tree and completing;Institute
Stating unsaturated common rectangular is the common rectangular that son node number is less than the number of nodes threshold value.
C6. the electronic equipment as described in C5, first boundary rectangle nearest according to the distance are building rope with described
The positional relationship for drawing unsaturated common rectangular in tree determines the level of nearest the first boundary rectangle insertion of the distance, comprising:
Several unsaturated common rectangulars and the positional relationship of nearest the first boundary rectangles of the distance is include institute if it exists
State the first nearest boundary rectangle of distance, it is determined that the insertion level is the minimum in several described unsaturated common rectangulars
Next layer of common rectangular;If the first nearest boundary rectangle of the distance is indexing the top common rectangular of tree with described
Positional relationship be partly overlap or be separated from each other, it is determined that the insertion level be described in indexing the top of tree.
C7. the electronic equipment as described in C1, the geographical location for obtaining user, is searched using the index tree pre-established
Cover first boundary rectangle in the geographical location, comprising: successively determine covering institute since root node in the index tree
State every grade of second boundary rectangle in geographical location;The leaf for including from the second boundary rectangle of most final stage for covering the geographical location
In node, determines and cover the first boundary rectangle of each of the geographical location.
C8. the electronic equipment as described in C7, it is described successively to be determined described in covering since root node in the index tree
Before every grade of second boundary rectangle in geographical location, further includes: according to the geographical location determine the user belonging to commercial circle
And the corresponding index tree in the commercial circle.
C9. the electronic equipment as described in C1, the index tree that the utilization pre-establishes, which is searched, covers the geographical location
First boundary rectangle, comprising: judge whether the geographical location is located in the longitude and latitude extreme value section of first boundary rectangle,
If so, determining that first boundary rectangle covers the geographical location, otherwise, it determines first boundary rectangle does not cover institute
State geographical location.
C10. the electronic equipment as described in C9, when the first boundary rectangle for covering the geographical location is at least two,
The determination geographical location dispenses region by the target of the corresponding dispatching region overlay of first boundary rectangle, comprising:
Using parallel computation mode, while it is external to judge whether the geographical location is capped each of described geographical location described first
The corresponding dispatching region overlay of rectangle, if so, determining that the corresponding dispatching region of first boundary rectangle is that target dispenses area
Domain.
C11. the electronic equipment as described in C1, described using the corresponding trade company in target dispatching region as the geography
Position is corresponding dispense trade company after, further includes: can be dispensed described in transmission trade company to the user terminal device, by described
Terminal device can dispense the information of trade company described in showing.
C12. the electronic equipment as described in C1, the geographical location and the dispatching region are indicated with latitude and longitude information.
C13. the electronic equipment as described in C12, first boundary rectangle are determined according to following steps: determining the trade company
The longitude and latitude extreme value in region is dispensed, the longitude and latitude extreme value includes maximum longitude, minimum longitude, maximum latitude and minimum latitude
Degree;First boundary rectangle is determined according to the longitude and latitude extreme value.
The embodiment of the present application discloses a kind of non-volatile memory medium of D1., described for storing computer-readable program
Computer-readable program is used to execute trade company's lookup method as described in any one of A1 to A13 for computer.
Claims (10)
1. a kind of trade company's lookup method characterized by comprising
The the first external square for covering the geographical location is searched in the geographical location for obtaining user using the index tree pre-established
Shape, wherein first boundary rectangle is the minimum circumscribed rectangle for covering trade company's dispatching region;
Determine that the geographical location dispenses region by the target of the corresponding dispatching region overlay of first boundary rectangle;
Trade company is dispensed using the target corresponding trade company in dispatching region as the geographical location is corresponding;
Wherein, corresponding first boundary rectangle of the leaf node of the index tree, the non-leaf nodes corresponding second of the index tree
Boundary rectangle, second boundary rectangle are to dispense the minimum circumscribed rectangle that region determines according at least two trade companies.
2. the method according to claim 1, wherein in the child node of each non-leaf nodes of the index tree
Leaf node including the first quantity, first quantity are less than number of nodes threshold value.
3. the method according to claim 1, wherein in the child node of each non-leaf nodes of the index tree
The non-leaf nodes of leaf node and third quantity including the second quantity;Second quantity and third quantity and be less than section
Points threshold value.
4. according to the method in any one of claims 1 to 3, which is characterized in that creating the index tree includes: by two
Third boundary rectangle determines the common rectangular of dynamic change;
If described two third boundary rectangles are, the common rectangular is equal in described two third boundary rectangles
The greater;
If described two third boundary rectangles are to partly overlap or be separated from each other, the common rectangular, which is equal to, covers described two the
The minimum circumscribed rectangle of three boundary rectangles;
Wherein, described two third boundary rectangles include first boundary rectangle and a common rectangular, or including
Two first boundary rectangles;
Second boundary rectangle of each level of index tree is the public affairs of index tree corresponding level when creation is completed
Rectangle altogether.
5. according to the method described in claim 4, it is characterized in that, creating the index tree further include:
It is selected from the first boundary rectangle that several are inserted into and to set top common rectangular distance nearest indexing
First boundary rectangle;
According to the positional relationship of the first nearest boundary rectangle of the distance and the common rectangular unsaturated in indexing tree
Determine the level of nearest the first boundary rectangle insertion of the distance;
Wherein, any state before indexing the corresponding index tree creation of tree and completing;The public square of unsaturation
Shape is the common rectangular that son node number is less than the number of nodes threshold value.
6. according to the method described in claim 5, it is characterized in that, first boundary rectangle nearest according to the distance with
The positional relationship of the common rectangular unsaturated in indexing tree determines nearest the first boundary rectangle insertion of the distance
Level, comprising:
The positional relationship of the first boundary rectangle of several unsaturated common rectangulars and the distance recently is packet if it exists
Containing the first nearest boundary rectangle of the distance, it is determined that the insertion level is in several described unsaturated common rectangulars
Next layer of minimum common rectangular;
If the first nearest boundary rectangle of the distance is in the positional relationship for indexing the top common rectangular of tree with described
It partly overlaps or is separated from each other, it is determined that the insertion level is indexing the top of tree to be described.
7. the method according to claim 1, wherein the geographical location for obtaining user, using pre-establishing
Index tree search the first boundary rectangle for covering the geographical location, comprising:
Every grade of second boundary rectangle for covering the geographical location is successively determined since root node in the index tree;
From the leaf node that the second boundary rectangle of most final stage for covering the geographical location includes, the covering geographical position is determined
Each of set the first boundary rectangle.
8. device is searched by a kind of trade company characterized by comprising
Searching module is searched using the index tree pre-established for obtaining the geographical location of user and covers the geographical location
The first boundary rectangle, wherein first boundary rectangle be cover trade company dispatching region minimum circumscribed rectangle;
Target dispenses area determination module, for determining the geographical location by the corresponding dispatching region of first boundary rectangle
The target of covering dispenses region;
Trade company's determining module can be dispensed, for the corresponding trade company in target dispatching region is corresponding as the geographical location
Trade company can be dispensed;
Wherein, corresponding first boundary rectangle of the leaf node of the index tree, the non-leaf nodes corresponding second of the index tree
Boundary rectangle, second boundary rectangle are the external square of minimum for dispensing region according in commercial circle at least two trade companies and determining
Shape.
9. a kind of electronic equipment characterized by comprising at least one processor;And
The memory being connect at least one described processor communication;
Wherein, the memory be stored with can by least one described processor execute instruction, described instruction by it is described at least
One processor is executed to realize: being obtained the geographical location of user, is searched using the index tree pre-established and cover the geography
First boundary rectangle of position, wherein first boundary rectangle is the minimum circumscribed rectangle for covering trade company's dispatching region;It determines
The geographical location dispenses region by the target of the corresponding dispatching region overlay of first boundary rectangle;The target is dispensed
The corresponding trade company in region dispenses trade company as the geographical location is corresponding;Wherein, the leaf node of the index tree is corresponding
First boundary rectangle, corresponding second boundary rectangle of the non-leaf nodes of the index tree, according to second boundary rectangle extremely
The minimum circumscribed rectangle that few two trade company's dispatchings region determines.
10. a kind of non-volatile memory medium, for storing computer-readable program, which is characterized in that described computer-readable
Program is used to execute trade company's lookup method as described in any one of claims 1 to 7 for computer.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811498585.9A CN109634962A (en) | 2018-12-08 | 2018-12-08 | Merchant searching method and device, electronic equipment and storage medium |
PCT/CN2019/120839 WO2020114272A1 (en) | 2018-12-08 | 2019-11-26 | Merchant search method, apparatus, electronic device, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811498585.9A CN109634962A (en) | 2018-12-08 | 2018-12-08 | Merchant searching method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109634962A true CN109634962A (en) | 2019-04-16 |
Family
ID=66072135
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811498585.9A Pending CN109634962A (en) | 2018-12-08 | 2018-12-08 | Merchant searching method and device, electronic equipment and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109634962A (en) |
WO (1) | WO2020114272A1 (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111144904A (en) * | 2019-12-19 | 2020-05-12 | 北京三快在线科技有限公司 | Merchant recall method and device, electronic equipment and readable storage medium |
WO2020114272A1 (en) * | 2018-12-08 | 2020-06-11 | 拉扎斯网络科技(上海)有限公司 | Merchant search method, apparatus, electronic device, and storage medium |
CN112308600A (en) * | 2020-09-15 | 2021-02-02 | 天津五八到家货运服务有限公司 | Business circle dividing method and device and storage medium |
CN113254724A (en) * | 2021-06-02 | 2021-08-13 | 北京达佳互联信息技术有限公司 | Network space discovery method and device, electronic equipment and storage medium |
CN113360637A (en) * | 2020-03-05 | 2021-09-07 | 北京三快在线科技有限公司 | Method, device, storage medium and electronic equipment for acquiring merchant information |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107341625A (en) * | 2016-04-28 | 2017-11-10 | 阿里巴巴集团控股有限公司 | A kind of logistics service capability information query method, apparatus and system |
US20180063082A1 (en) * | 2016-08-31 | 2018-03-01 | Fortress Information Security | Systems and methods for geoprocessing-based computing network security |
CN108171357A (en) * | 2016-12-08 | 2018-06-15 | 北京京东尚科信息技术有限公司 | Information processing method and device in logistic information systems |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002259522A (en) * | 2000-12-26 | 2002-09-13 | Tohsho Logitech Kk | Efficiency improving system for load transportation service |
CN108665334A (en) * | 2017-03-31 | 2018-10-16 | 建汉科技股份有限公司 | order processing method and system |
CN109634962A (en) * | 2018-12-08 | 2019-04-16 | 拉扎斯网络科技(上海)有限公司 | Merchant searching method and device, electronic equipment and storage medium |
-
2018
- 2018-12-08 CN CN201811498585.9A patent/CN109634962A/en active Pending
-
2019
- 2019-11-26 WO PCT/CN2019/120839 patent/WO2020114272A1/en active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107341625A (en) * | 2016-04-28 | 2017-11-10 | 阿里巴巴集团控股有限公司 | A kind of logistics service capability information query method, apparatus and system |
US20180063082A1 (en) * | 2016-08-31 | 2018-03-01 | Fortress Information Security | Systems and methods for geoprocessing-based computing network security |
CN108171357A (en) * | 2016-12-08 | 2018-06-15 | 北京京东尚科信息技术有限公司 | Information processing method and device in logistic information systems |
Non-Patent Citations (1)
Title |
---|
贾婷: "《空间索引技术在电力GIS中的研究与应用》", 《中国优秀硕士学位论文全文数据库 基础科学辑(月刊 )2011 年 第 03 期,2011年2月16日—3月15日出版》 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020114272A1 (en) * | 2018-12-08 | 2020-06-11 | 拉扎斯网络科技(上海)有限公司 | Merchant search method, apparatus, electronic device, and storage medium |
CN111144904A (en) * | 2019-12-19 | 2020-05-12 | 北京三快在线科技有限公司 | Merchant recall method and device, electronic equipment and readable storage medium |
CN111144904B (en) * | 2019-12-19 | 2022-01-21 | 北京三快在线科技有限公司 | Merchant recall method and device, electronic equipment and readable storage medium |
CN113360637A (en) * | 2020-03-05 | 2021-09-07 | 北京三快在线科技有限公司 | Method, device, storage medium and electronic equipment for acquiring merchant information |
CN112308600A (en) * | 2020-09-15 | 2021-02-02 | 天津五八到家货运服务有限公司 | Business circle dividing method and device and storage medium |
CN112308600B (en) * | 2020-09-15 | 2023-04-07 | 天津五八到家货运服务有限公司 | Business circle dividing method and device and storage medium |
CN113254724A (en) * | 2021-06-02 | 2021-08-13 | 北京达佳互联信息技术有限公司 | Network space discovery method and device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
WO2020114272A1 (en) | 2020-06-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109634962A (en) | Merchant searching method and device, electronic equipment and storage medium | |
US9179253B2 (en) | Map service method and system of providing target contents based on location | |
US9377323B2 (en) | Systems and methods for using route matrices for identifying intersection POIs | |
CN107316167A (en) | A kind of allocator and device based on shops position of distributors | |
CN106455004A (en) | Method and apparatus for providing wireless access points | |
CN103473238B (en) | Dispense address location system and method | |
CN106557474A (en) | Obtain the method and device of POI, database, navigation terminal and automobile on the way | |
CN110263022A (en) | Hotel's data matching method and device | |
CN106779910A (en) | Dispatching order allocation method and device | |
CN109657163A (en) | Destination address determining method and device, electronic equipment and storage medium | |
CN109410064A (en) | Sales control method, apparatus, computer equipment and the storage medium of financial product | |
CN109992638A (en) | Generation method, device, electronic equipment and the storage medium of geographical location POI | |
CN107391137B (en) | Display method for electronic map, device and system | |
CN110288167A (en) | Kinds of goods Allocation plan method, apparatus, electronic equipment and readable storage medium storing program for executing | |
CN107742245A (en) | A kind of merchant information recommends method, apparatus and equipment | |
US11455552B2 (en) | Intelligent design platform using industrialized experience in product designs | |
CN109815419A (en) | Point of interest indexing means, device, medium and electronic equipment based on geographical location | |
CN107395680A (en) | Shop group's information push and output intent and device, equipment | |
CN109657022A (en) | Merchant searching method and device, electronic equipment and storage medium | |
CN109360042A (en) | Order allocation method and device, electronic equipment and storage medium | |
CN109635063A (en) | Information processing method and device for address library, electronic equipment and storage medium | |
CN109982257A (en) | Determine method, apparatus, the system of mobile user affiliation region | |
CN106296095A (en) | A kind of goods and materials concocting method based on wisdom storage and equipment | |
CN108257596A (en) | It is a kind of to be used to provide the method and apparatus that information is presented in target | |
CN109284951A (en) | Address information processing method and device |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190416 |
|
RJ01 | Rejection of invention patent application after publication |