CN109800360B - Cell query method, cell query device, electronic equipment and storage medium - Google Patents

Cell query method, cell query device, electronic equipment and storage medium Download PDF

Info

Publication number
CN109800360B
CN109800360B CN201811584345.0A CN201811584345A CN109800360B CN 109800360 B CN109800360 B CN 109800360B CN 201811584345 A CN201811584345 A CN 201811584345A CN 109800360 B CN109800360 B CN 109800360B
Authority
CN
China
Prior art keywords
information
cell
path distance
target
travel mode
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.)
Active
Application number
CN201811584345.0A
Other languages
Chinese (zh)
Other versions
CN109800360A (en
Inventor
李跃红
李超
白梦柯
宋慧俏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Urban Network Neighbor Information Technology Co Ltd
Original Assignee
Beijing Urban Network Neighbor Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Urban Network Neighbor Information Technology Co Ltd filed Critical Beijing Urban Network Neighbor Information Technology Co Ltd
Priority to CN201811584345.0A priority Critical patent/CN109800360B/en
Publication of CN109800360A publication Critical patent/CN109800360A/en
Application granted granted Critical
Publication of CN109800360B publication Critical patent/CN109800360B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a cell query method, a cell query device, electronic equipment and a storage medium, which are used for solving the problems that query results are inaccurate and the requirements of users cannot be met. The method comprises the following steps: receiving a query request sent by a client, and acquiring information of a specified position, a travel mode and a target path distance corresponding to the query request; determining the information of a designated area corresponding to the designated position according to the information of the designated position; inquiring information of a target cell of which the path distance from the specified position meets the requirement of the target path distance when the travel mode is adopted according to the information of the specified area, the travel mode and the target path distance; and returning the information of the target cell to the client. The query result is more accurate, and the user requirements can be better met; and the specified position is expanded to the specified area, and the query is not needed to be carried out aiming at each specific position, so that the query process can be simplified, and the equipment performance is improved.

Description

Cell query method, cell query device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a cell query method, an apparatus, an electronic device, and a storage medium.
Background
With the rapid development of network technology, users increasingly rely on obtaining various information through a network. In order to meet the needs of users, a large number of service-class APPs (applications) are emerging. Users may enjoy various services provided by these APPs, such as rental houses, job hunting, item trading, and so on.
In the house renting service, finding out a satisfactory residential cell meeting the requirement of a tenant is a difficult problem of the tenant, and the factors of position and distance are the basic requirements of the tenant on the residential cell. Based on this, in the related art, nearby cells are generally found by specifying a business circle, specifying a subway distance, a map dotting distance, and the like.
The method for searching the nearby cells by specifying the business district is adopted, and when the business district is large, the result inquired by the method is inaccurate, and the requirement of a tenant is difficult to meet. The method for searching for the nearby cell by specifying the subway distance or the map dotting distance generally searches according to the straight-line distance between two points without considering the actual situation of the road.
Therefore, the query result of the method for searching the nearby cell in the related art is inaccurate, and the requirements of the user cannot be met.
Disclosure of Invention
The embodiment of the application provides a cell query method, a cell query device, electronic equipment and a storage medium, and aims to solve the problems that in the related art, a query result is inaccurate in a mode of searching for a nearby cell, and the requirements of a user cannot be met.
According to an aspect of an embodiment of the present application, there is provided a cell query method, including:
receiving a query request sent by a client, and acquiring information of a specified position, a travel mode and a target path distance corresponding to the query request;
determining the information of a designated area corresponding to the designated position according to the information of the designated position;
inquiring information of a target cell of which the path distance from the specified position meets the requirement of the target path distance when the travel mode is adopted according to the information of the specified area, the travel mode and the target path distance;
and returning the information of the target cell to the client.
Optionally, the information of the designated location includes longitude and latitude, and the step of determining the information of the designated area corresponding to the designated location according to the information of the designated location includes: calculating GeoHash codes corresponding to the longitude and latitude of the specified position; and extracting a prefix code of the GeoHash code, and using the prefix code as the information of the designated area corresponding to the designated position.
Optionally, the step of querying, according to the information of the designated area, the travel mode, and the target path distance, information of a target cell whose path distance from the designated location meets the requirement of the target path distance when the travel mode is adopted includes: searching whether indexes matched with the information of the designated area, the travel mode and the target path distance exist in a preset database; and if so, acquiring the cell information corresponding to the searched index from the database, and taking the cell information as the information of the target cell.
Optionally, after the step of obtaining the cell information corresponding to the found index from the database and taking the cell information as the information of the target cell, the method further includes: calculating a path distance between the target cell and the designated position when the travel mode is adopted according to the information of the target cell; and selecting a target cell of which the difference value between the path distance and the target path distance exceeds a preset error range, and deleting the information of the selected target cell.
Optionally, after the step of searching whether an index matching the information of the designated area, the travel mode, and the target path distance exists in a preset database, the method further includes: if the candidate cell does not exist, inquiring the information of the candidate cell of which the straight line distance between the candidate cell and the specified position is less than or equal to the target path distance; calculating a path distance between the candidate cell and the designated position when the trip mode is adopted according to the information of the candidate cell; and selecting the candidate cells with the path distance smaller than the target path distance, and taking the information of the selected candidate cells as the information of the target cells.
Optionally, after the step of selecting the candidate cell with the path distance smaller than the target path distance and using the information of the selected candidate cell as the information of the target cell, the method further includes: and taking the information of the designated area, the travel mode and the target path distance as indexes, taking the information of the selected candidate cell as cell information corresponding to the indexes, and storing the cell information in the database.
According to another aspect of the present application, there is provided a cell query apparatus, the apparatus including:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for receiving a query request sent by a client and acquiring information of a designated position, a travel mode and a target path distance corresponding to the query request;
the determining unit is used for determining the information of the designated area corresponding to the designated position according to the information of the designated position;
the query unit is used for querying information of a target cell, of which the path distance from the specified position meets the requirement of the target path distance, when the travel mode is adopted according to the information of the specified area, the travel mode and the target path distance;
and the returning unit is used for returning the information of the target cell to the client.
Optionally, the information of the specified location includes longitude and latitude, and the determining unit includes: the code calculation module is used for calculating GeoHash codes corresponding to the longitude and latitude of the specified position; and the code extraction module is used for extracting the prefix code of the GeoHash code and taking the prefix code as the information of the designated area corresponding to the designated position.
Optionally, the query unit includes: the index searching module is used for searching whether an index matched with the information of the designated area, the travel mode and the target path distance exists in a preset database; and the information acquisition module is used for acquiring cell information corresponding to the searched index from the database when the index searching module searches the target cell, and taking the cell information as the information of the target cell.
Optionally, the apparatus further comprises: a calculating unit, configured to calculate, according to the information of the target cell, a path distance between the target cell and the specified location when the travel mode is adopted; and the deleting unit is used for selecting the target cell of which the difference value between the path distance and the target path distance exceeds a preset error range and deleting the information of the selected target cell.
Optionally, the query unit further includes: the information searching module is used for searching the information of the candidate cells of which the straight line distance between the candidate cells and the specified position is less than or equal to the target path distance when the index searching module does not search the candidate cells; a distance calculation module, configured to calculate, according to the information of the candidate cell, a path distance between the candidate cell and the designated location when the travel mode is adopted; and the cell selecting module is used for selecting the candidate cell with the path distance smaller than the target path distance and taking the information of the selected candidate cell as the information of the target cell.
Optionally, the apparatus further comprises: and the storage unit is used for storing the information of the designated area, the travel mode and the target path distance into the database as indexes, and the information of the selected candidate cell as cell information corresponding to the indexes.
According to still another aspect of the present application, there is provided an electronic apparatus including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to perform any of the above cell query methods.
According to yet another aspect of the present application, there is provided a non-transitory computer readable storage medium having instructions stored thereon which, when executed by a processor of an electronic device, enable the electronic device to perform any of the above-described cell query methods.
In the embodiment of the application, a query request sent by a client is received, and information of a designated position, a travel mode and a target path distance corresponding to the query request are obtained; determining the information of a designated area corresponding to the designated position according to the information of the designated position; inquiring information of a target cell of which the path distance from the specified position meets the requirement of the target path distance when the travel mode is adopted according to the information of the specified area, the travel mode and the target path distance; and returning the information of the target cell to the client. Therefore, when the cell is queried, the travel mode and the factors of the actual road conditions such as the actual path distance corresponding to the travel mode are considered, so that the query result is more accurate, and the user requirements can be better met; and the specified position is expanded to the specified area, and the query is not needed to be carried out aiming at each specific position, so that the query process can be simplified, and the equipment performance is improved.
Drawings
Fig. 1 is a flowchart illustrating steps of a cell query method according to an embodiment of the present application.
Fig. 2 is a flowchart illustrating another cell query procedure according to an embodiment of the present invention.
Fig. 3 is a block diagram of a cell query apparatus according to an embodiment of the present application.
Fig. 4 is a block diagram of another cell search apparatus according to an embodiment of the present application.
Fig. 5 is a block diagram of an apparatus for cell query according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, a flowchart illustrating steps of a cell query method according to an embodiment of the present application is shown.
The cell query method of the embodiment of the application comprises the following steps:
step 101, receiving a query request sent by a client, and acquiring information of a designated position, a travel mode and a target path distance corresponding to the query request.
The cell query method of the embodiment of the application can be applied to a server corresponding to a service type APP. The service APP can provide services such as house renting and the like for the user, and the cell query method can be applied to services such as house finding on commute. The client may be an APP installed on a mobile terminal, such as a mobile phone, a tablet computer, a wearable device, or the like.
When the user wants to rent a house, corresponding operation can be executed on the page of the client so as to trigger the query request. For example, a user may input information such as a designated position, a travel mode, a required time, a target path distance, and the like on a page of the client, click a query button, and the client may generate a query request according to the input information of the user and send the query request to the server. After receiving the query request, the server can obtain the information of the designated position, the travel mode and the target path distance corresponding to the query request as subsequent query conditions.
The route distance is different from a straight line distance between two positions on the map, and the route distance refers to the distance of an actual road passing from one position to the other position when different travel modes are adopted. Travel modes may include walking, riding, driving, subway, bus, etc.
And 102, determining the information of the designated area corresponding to the designated position according to the information of the designated position.
If the query is directly carried out according to the specified position, each position point needs to be calculated, and the calculation amount is large. Therefore, in the embodiment of the present application, the information of the designated area corresponding to the designated position is determined according to the information of the designated position. The specified position is expanded to a specified area, and each position in the area corresponds to the same result, so that the query process can be simplified.
Step 103, inquiring information of a target cell of which the path distance from the specified position meets the requirement of the target path distance when the travel mode is adopted according to the information of the specified area, the travel mode and the target path distance.
When the cell is inquired, factors of a travel mode and a target path distance are added. According to the information of the designated area, the travel mode and the target path distance, cells, the path distance between which and the designated position meets the requirement of the target path distance when the travel mode is adopted, can be inquired, and the cells are taken as target cells, and the information of the target cells is obtained.
And step 104, returning the information of the target cell to the client.
After inquiring the information of the target cells, the server returns the information of the target cells to the client as an inquiry result. The client may display information of the target cell to the user, such as may be located on a map, or may be displayed in a page in the form of a list, and so on. The information of the target cell may include the name, location, etc. of the cell.
When the cell is queried, the factors of road actual conditions such as a travel mode and an actual path distance corresponding to the travel mode are considered, so that a query result is more accurate, and the user requirements can be better met; and the specified position is expanded to the specified area, and the query is not needed to be carried out aiming at each specific position, so that the query process can be simplified, and the equipment performance is improved.
Referring to fig. 2, a flowchart illustrating steps of a cell query method according to an embodiment of the present application is shown.
The cell query method of the embodiment of the application comprises the following steps:
step 201, receiving a query request sent by a client, and acquiring information of a designated position, a travel mode and a target path distance corresponding to the query request.
The user can input the name of the designated position on the client, or position to obtain the name of the designated position and input the travel mode.
In an optional implementation manner, the user may further input the target path distance, and if the target path distance is not input, a default path distance corresponding to the travel mode may be adopted as the target path distance. For example, the default path distance corresponding to the walking mode may be 1.5km, the default path distance corresponding to the riding mode may be 5km, and the like, and the default path distance may be set according to an actual situation, which is not limited in the embodiment of the present application. In this case, the query request may include a name of the designated location, a travel mode, and a target route distance. The server can obtain the information of the designated position according to the name of the designated position in the query request, and extract the travel mode and the target path distance from the query request. The information of the designated location may include longitude and latitude, and the longitude and latitude of the designated location may be acquired according to the name of the designated location. For example, a correspondence between a name (the name may be an office building name, a cell name, or the like) and a longitude and latitude may be preset, and the longitude and latitude corresponding to the name of the specified location may be searched from the correspondence.
In another alternative embodiment, the user may also enter a desired time. In this case, the query request may include the name of the designated location, the travel mode, and the required time. The server can obtain the information of the designated position according to the name of the designated position in the query request, extract the travel mode and the required time from the query request, and calculate the target path distance according to the travel mode and the required time. The product of the default speed corresponding to the travel mode and the required time can be used as the target path distance. For example, the default speed for walking may be 5km/h, the default speed for riding a bicycle may be 20km/h, and the like, and the default speed may be set according to an actual situation, which is not limited in the embodiment of the present application.
Step 202, determining the information of the designated area corresponding to the designated position according to the information of the designated position.
The information of the designated position comprises longitude and latitude, and the information of the designated area corresponding to the designated position can be determined according to the longitude and latitude of the designated position.
In an alternative embodiment, step 202 may comprise: calculating GeoHash codes corresponding to the longitude and latitude of the specified position; and extracting a prefix code of the GeoHash code, and using the prefix code as the information of the designated area corresponding to the designated position.
GeoHash is an address coding method. The method can encode two-dimensional space longitude and latitude data into a character string. The GeoHash code has the following characteristics: the GeoHash code uses a character string to represent two coordinates of longitude and latitude; the GeoHash code represents not one point but one area; the prefix code of the GeoHash code may represent a larger area.
The calculation process of the GeoHash code comprises three steps:
1. converting the latitude and longitude into binary system: firstly, dividing a latitude range (-90,90) into two intervals (-90,0) and (0,90), if the target latitude is located in the previous interval, encoding to be 0, otherwise encoding to be 1; then dividing (0,90) into two intervals of (0,45) and (45,90), if the target latitude is located in the previous interval, coding to be 0, otherwise coding to be 1; and repeating the steps until the precision meets the requirement, and obtaining the binary representation of the latitude. The longitude is also used in the same algorithm to obtain a binary representation of the longitude.
2. Merging the binary system of latitude and longitude: the merging method is to merge the binary system of longitude and latitude according to the odd and even bit, the odd bit is latitude, and the even bit is longitude.
3. And coding the merged result according to the Base32 code to obtain a GeoHash code corresponding to the longitude and latitude of the result era.
In the embodiment of the application, the preset digit of the GeoHash code can be extracted as a prefix code, and the prefix code is used as the information of the designated area corresponding to the designated position. For the specific numerical value of the set digit, those skilled in the art may select any suitable value according to practical experience, and the embodiment of the present application does not limit this. For example, the predetermined number of bits may be 5, 6, 7, etc.
Step 203, searching whether an index matched with the information of the designated area, the travel mode and the target path distance exists in a preset database. If so, go to step 204; if not, step 206 is performed.
In the embodiment of the application, a local database can be preset, and relevant data of historical queries can be stored in the database in a key-value form. Since the factors involved in the query in the embodiment of the present application include the information of the designated area, the travel mode, and the target path distance, a combination of the information of the designated area, the travel mode, and the target path distance may be used as an index, that is, a key. And the cell information inquired according to the information of the specified area, the travel mode and the target path distance, namely the inquired cell information which meets the requirement of the target path distance on the path distance between the cell information and the specified position when the travel mode is adopted, is used as the cell information corresponding to the index, namely the value. The cell information may include the name, longitude and latitude, GeoHash code, etc. of the cell.
Therefore, after acquiring the information of the designated area, the travel mode and the marked path distance, the server can search whether an index matched with the information exists in the database according to the information. The matching means that the information included in the index is the same as the information of the designated area, the travel mode and the marked path distance acquired by the server.
And 204, if the cell information exists, acquiring the cell information corresponding to the searched index from the database, and taking the cell information as the information of the target cell.
If the matched index exists in the database found in step 203, the cell information corresponding to the found index may be obtained from the database, and the cell information is used as the information of the target cell.
The result corresponding to the designated area can be used for each position in the designated area, so that the positions are expanded to the area, calculation for each position is not needed, and the calculation cost is reduced. The information of the designated area refers to prefix codes of GeoHash codes corresponding to the latitude and longitude of the designated position, and the prefix codes represent larger areas, so that the storage capacity of data can be reduced within an error allowable range.
Step 205, calculating a path distance between the target cell and the designated location when the travel mode is adopted according to the information of the target cell; and selecting a target cell of which the difference value between the path distance and the target path distance exceeds a preset error range, and deleting the information of the selected target cell. Step 208 is then performed.
In consideration of the problem that errors may exist in the GeoHash code, the embodiment of the present application may also check the information of the target cell obtained in step 204.
According to the longitude and latitude of the target cell and the longitude and latitude of the specified position, the path distance between the target cell and the specified position can be calculated when the travel mode is adopted. In an alternative embodiment, a third party interface may be invoked, and the path distance between the target cell and the specified location is calculated by a third party server. The method comprises the following steps: calling a third party interface, and sending the travel mode, the longitude and latitude of the specified position and the longitude and latitude of the target cell to a third party server; and the third-party server calculates the path distance between the target cell and the specified position when the travel mode is adopted according to the information, and returns the calculation result. The third-party server may be a server corresponding to various maps APP (such as a Baidu map, a Gade map, etc.).
After the path distance between the designated location and each target cell is calculated, a difference between the corresponding path distance and the target path distance may be calculated for each target cell, and if the difference exceeds a preset error range, the information of the target cell may be considered as invalid data, and the invalid data may be deleted. For the specific numerical value of the error range, any suitable value may be selected by those skilled in the art according to practical experience, and the embodiment of the present application does not limit this. For example, the error range may be 500m, 800m, 1km, and so on.
And step 206, if the candidate cell does not exist, inquiring the information of the candidate cell of which the straight line distance between the candidate cell and the specified position is less than or equal to the target path distance.
If no matched index exists in the database found in step 203, the information of the target cell whose path distance from the designated location meets the requirement of the target path distance when the travel mode is adopted can be queried according to the information of the designated location, the travel mode and the target path distance.
In the embodiment of the invention, the calculation of the linear distance is more convenient, so that the cell with the linear distance between the cell and the specified position less than or equal to the target path distance can be inquired, and the inquired cell is taken as a candidate cell.
In the implementation, the longitude and latitude of which the straight-line distance with the longitude and latitude of the specified position is equal to the target path distance can be calculated, then the name of the cell corresponding to the longitude and latitude which is less than or equal to the calculated longitude and latitude is searched from the preset corresponding relation between the name and the longitude and latitude, and the cell corresponding to the searched name of the cell is the candidate cell. The information of the candidate cell may include a name, longitude and latitude, and the like, and of course, the corresponding GeoHash code may be calculated according to the longitude and latitude.
Step 207, calculating a path distance between the candidate cell and the designated position when the travel mode is adopted according to the information of the candidate cell; and selecting the candidate cells with the path distance smaller than the target path distance, and taking the information of the selected candidate cells as the information of the target cells.
According to the longitude and latitude of the candidate cell and the longitude and latitude of the specified position, the path distance between the candidate cell and the specified position can be calculated when the travel mode is adopted. For example, a third party interface may be invoked, and the path distance between the candidate cell and the specified location may be calculated by a third party server. The method comprises the following steps: calling a third party interface, and sending the travel mode, the longitude and latitude of the specified position and the longitude and latitude of the candidate cell to a third party server; and the third-party server calculates the path distance between the candidate cell and the specified position when the travel mode is adopted according to the information, and returns the calculation result.
After the path distance between the designated location and each candidate cell is calculated, the corresponding path distance and the target path distance may be compared for each target cell, a candidate cell having a path distance smaller than the target path distance is selected from the target cell, and information of the selected candidate cell is used as information of the target cell.
Because the corresponding record does not exist in the database during the query, the related data of the query can be stored in the database. It can be stored as follows: and taking the information of the designated area, the travel mode and the target path distance as indexes, taking the information of the selected candidate cell as cell information corresponding to the indexes, and storing the cell information in the database.
Step 208, returning the information of the target cell to the client.
If step 208 is performed after step 205, the returned information of the target cell is the information of the target cell remaining after deleting the information of the selected target cell.
If step 208 is performed after step 207, the information of the target cell is returned as the information of the selected candidate cell.
The embodiment of the application aims to optimize the commuting and house finding mode, add travel mode and path distance factors and optimize query precision, and avoid interface requests and path calculation with large data volume by introducing a simplified GeoHash algorithm and a scheme of local storage.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the embodiments are not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the embodiments. Further, those skilled in the art will also appreciate that the embodiments described in the specification are presently preferred and that no particular act is required of the embodiments of the application.
Referring to fig. 3, a block diagram of a cell query apparatus according to an embodiment of the present application is shown. The cell query device according to the embodiment of the present application includes an obtaining unit 301, a determining unit 302, a querying unit 303, and a returning unit 304.
An obtaining unit 301, configured to receive a query request sent by a client, and obtain information of a specified location, a travel mode, and a target path distance corresponding to the query request.
A determining unit 302, configured to determine, according to the information of the designated location, information of a designated area corresponding to the designated location.
A querying unit 303, configured to query, according to the information of the specified area, the travel mode, and the target path distance, information of a target cell whose path distance from the specified location meets the requirement of the target path distance when the travel mode is adopted.
A returning unit 304, configured to return the information of the target cell to the client.
When the cell is queried, the factors of road actual conditions such as a travel mode and an actual path distance corresponding to the travel mode are considered, so that a query result is more accurate, and the user requirements can be better met; and the specified position is expanded to the specified area, and the query is not needed to be carried out aiming at each specific position, so that the query process can be simplified, and the equipment performance is improved.
Referring to fig. 4, a block diagram of a cell query apparatus according to an embodiment of the present application is shown.
The cell query device of the embodiment of the application comprises: the obtaining unit 401 is configured to receive a query request sent by a client, and obtain information of a specified location, a travel mode, and a target path distance corresponding to the query request. A determining unit 402, configured to determine, according to the information of the designated location, information of a designated area corresponding to the designated location. An inquiring unit 403, configured to inquire, according to the information of the specified area, the travel mode, and the target path distance, information of a target cell whose path distance from the specified location meets the requirement of the target path distance when the travel mode is adopted. A returning unit 404, configured to return the information of the target cell to the client.
Optionally, the information on the specified location includes latitude and longitude, and the determining unit 402 includes: and the code calculation module 4021 is configured to calculate a GeoHash code corresponding to the latitude and longitude of the specified location. The code extraction module 4022 is configured to extract a prefix code of the GeoHash code, and use the prefix code as information of a designated area corresponding to the designated location.
Optionally, the querying unit 403 includes: an index searching module 4031, configured to search, from a preset database, whether an index matching the information of the designated area, the travel mode, and the target path distance exists. An information obtaining module 4032, configured to, when the index searching module searches for an existence of the cell, obtain cell information corresponding to the searched index from the database, and use the cell information as information of the target cell.
Optionally, the apparatus further comprises: a calculating unit 405, configured to calculate, according to the information of the target cell, a path distance between the target cell and the specified location when the travel mode is adopted. A deleting unit 406, configured to select a target cell for which a difference between the path distance and the target path distance exceeds a preset error range, and delete information of the selected target cell.
Optionally, the querying unit 403 further includes: an information searching module 4033, configured to query, when the index searching module searches for absence, information of a candidate cell whose linear distance from the specified location is less than or equal to the target path distance. A distance calculating module 4034, configured to calculate, according to the information of the candidate cell, a path distance between the candidate cell and the designated location when the travel mode is adopted. A cell selecting module 4035, configured to select a candidate cell whose path distance is smaller than the target path distance, and use information of the selected candidate cell as information of the target cell.
Optionally, the apparatus further comprises: a storage unit 407, configured to store the information of the designated area, the trip mode, and the target path distance as indexes, and the information of the selected candidate cell as cell information corresponding to the indexes in the database.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 5 is a block diagram illustrating an apparatus 500 for cell query in accordance with an example embodiment. For example, the apparatus 500 may be provided as an electronic device, such as a server.
Referring to fig. 5, the apparatus 500 includes a processing component 522 that further includes one or more processors and memory resources, represented by memory 532, for storing instructions, such as applications, that are executable by the processing component 522. The application programs stored in memory 532 may include one or more modules that each correspond to a set of instructions. Further, the processing component 522 is configured to execute instructions to perform the cell query method described above.
The apparatus 500 may also include a power component 526 configured to perform power management of the apparatus 500, a wired or wireless network interface 550 configured to connect the apparatus 500 to a network, and an input/output (I/O) interface 558. The apparatus 500 may operate based on an operating system stored in the memory 532, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as a memory comprising instructions, executable by a processor of an electronic device to perform the cell query method described above is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one of skill in the art, embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the true scope of the embodiments of the application.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The cell query method, the cell query device, the electronic device, and the storage medium provided by the present application are introduced in detail, and a specific example is applied to illustrate the principle and the implementation manner of the present application, and the description of the above embodiment is only used to help understand the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (12)

1. A method for cell query, the method comprising:
receiving a query request sent by a client, and acquiring information of a specified position, a travel mode and a target path distance corresponding to the query request;
determining the information of a designated area corresponding to the designated position according to the information of the designated position;
inquiring information of a target cell of which the path distance from the specified position meets the requirement of the target path distance when the travel mode is adopted according to the information of the specified area, the travel mode and the target path distance;
returning the information of the target cell to the client;
the step of querying information of a target cell, for which a path distance between the target cell and the designated location meets the requirement of the target path distance when the travel mode is adopted, includes:
searching whether indexes matched with the information of the designated area, the travel mode and the target path distance exist in a preset database;
if the cell information exists, cell information corresponding to the searched index is obtained from the database, and the cell information is used as the information of the target cell;
after the corresponding cell information is obtained through inquiring according to the designated area, the travel mode and the target path distance for the first time, the combination of the information of the designated area, the travel mode and the target path distance is stored into the database as an index, and then the cell information corresponding to the index is stored into the database so that when the subsequent inquiry is carried out according to the designated area, the travel mode and the target path distance again, the corresponding cell information is directly extracted from the database through the index for feedback.
2. The method according to claim 1, wherein the information of the designated location includes latitude and longitude, and the step of determining the information of the designated area corresponding to the designated location according to the information of the designated location includes:
calculating GeoHash codes corresponding to the longitude and latitude of the specified position;
and extracting a prefix code of the GeoHash code, and using the prefix code as the information of the designated area corresponding to the designated position.
3. The method according to claim 1, wherein after the step of obtaining the cell information corresponding to the searched index from the database and using the cell information as the information of the target cell, the method further comprises:
calculating a path distance between the target cell and the designated position when the travel mode is adopted according to the information of the target cell;
and selecting a target cell of which the difference value between the path distance and the target path distance exceeds a preset error range, and deleting the information of the selected target cell.
4. The cell query method according to claim 1, wherein after the step of searching for an index matching the information of the designated area, the travel mode, and the target path distance from a preset database, the method further comprises:
if the candidate cell does not exist, inquiring the information of the candidate cell of which the straight line distance between the candidate cell and the specified position is less than or equal to the target path distance;
calculating a path distance between the candidate cell and the designated position when the trip mode is adopted according to the information of the candidate cell;
and selecting the candidate cells with the path distance smaller than the target path distance, and taking the information of the selected candidate cells as the information of the target cells.
5. The method according to claim 4, wherein after the step of using the information of the selected candidate cell as the information of the target cell in the candidate cell with the selected path distance smaller than the target path distance, the method further comprises:
and taking the information of the designated area, the travel mode and the target path distance as indexes, taking the information of the selected candidate cell as cell information corresponding to the indexes, and storing the cell information in the database.
6. A cell query apparatus, the apparatus comprising:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for receiving a query request sent by a client and acquiring information of a designated position, a travel mode and a target path distance corresponding to the query request;
the determining unit is used for determining the information of the designated area corresponding to the designated position according to the information of the designated position;
the query unit is used for querying information of a target cell, of which the path distance from the specified position meets the requirement of the target path distance, when the travel mode is adopted according to the information of the specified area, the travel mode and the target path distance;
a returning unit, configured to return the information of the target cell to the client;
the query unit includes:
the index searching module is used for searching whether an index matched with the information of the designated area, the travel mode and the target path distance exists in a preset database;
an information obtaining module, configured to obtain cell information corresponding to the searched index from the database when the index searching module searches for the cell, and use the cell information as the information of the target cell;
after the corresponding cell information is obtained through inquiring according to the designated area, the travel mode and the target path distance for the first time, the combination of the information of the designated area, the travel mode and the target path distance is stored into the database as an index, and then the cell information corresponding to the index is stored into the database so that when the information is inquired again according to the designated area, the travel mode and the target path distance, the corresponding cell information can be directly extracted from the database through the index for feedback.
7. The cell query device according to claim 6, wherein the information on the specified location includes latitude and longitude, and the determination unit includes:
the code calculation module is used for calculating GeoHash codes corresponding to the longitude and latitude of the specified position;
and the code extraction module is used for extracting the prefix code of the GeoHash code and taking the prefix code as the information of the designated area corresponding to the designated position.
8. The cell query device of claim 6, wherein the device further comprises:
a calculating unit, configured to calculate, according to the information of the target cell, a path distance between the target cell and the specified location when the travel mode is adopted;
and the deleting unit is used for selecting the target cell of which the difference value between the path distance and the target path distance exceeds a preset error range and deleting the information of the selected target cell.
9. The cell query device of claim 6, wherein the query unit further comprises:
the information searching module is used for searching the information of the candidate cells of which the straight line distance between the candidate cells and the specified position is less than or equal to the target path distance when the index searching module does not search the candidate cells;
a distance calculation module, configured to calculate, according to the information of the candidate cell, a path distance between the candidate cell and the designated location when the travel mode is adopted;
and the cell selecting module is used for selecting the candidate cell with the path distance smaller than the target path distance and taking the information of the selected candidate cell as the information of the target cell.
10. The cell query device of claim 9, wherein the device further comprises:
and the storage unit is used for storing the information of the designated area, the travel mode and the target path distance into the database as indexes, and the information of the selected candidate cell as cell information corresponding to the indexes.
11. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the cell query method of any one of claims 1-5.
12. A non-transitory computer readable storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the cell query method of any one of claims 1-5.
CN201811584345.0A 2018-12-24 2018-12-24 Cell query method, cell query device, electronic equipment and storage medium Active CN109800360B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811584345.0A CN109800360B (en) 2018-12-24 2018-12-24 Cell query method, cell query device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811584345.0A CN109800360B (en) 2018-12-24 2018-12-24 Cell query method, cell query device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109800360A CN109800360A (en) 2019-05-24
CN109800360B true CN109800360B (en) 2020-12-08

Family

ID=66557442

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811584345.0A Active CN109800360B (en) 2018-12-24 2018-12-24 Cell query method, cell query device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109800360B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111275529A (en) * 2020-01-21 2020-06-12 青梧桐有限责任公司 Commuting time calculation method, system, electronic device and readable storage medium
CN111611501A (en) * 2020-05-15 2020-09-01 上海慧生健康科技有限公司 Pharmacist query method, system, device and computer storage medium
CN112052657A (en) * 2020-07-30 2020-12-08 北京城市网邻信息技术有限公司 Method and device for generating house source text information, electronic equipment and storage medium

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104380293B (en) * 2012-06-22 2017-03-22 谷歌公司 Method and computing device for providing information of relevant elements from maps history based on location
CN103944932B (en) * 2013-01-18 2017-07-14 阿里巴巴集团控股有限公司 Search for, determine the method and server of active regions
CN104240163B (en) * 2014-09-28 2017-09-05 百度在线网络技术(北京)有限公司 A kind of cell intelligent recommendation method and device
CN106649332B (en) * 2015-10-29 2021-02-19 创新先进技术有限公司 Method and device for searching interest points on map
CN105824975A (en) * 2016-04-19 2016-08-03 百度在线网络技术(北京)有限公司 Search recommendation method and device
CN107346316A (en) * 2016-05-06 2017-11-14 北京搜狗科技发展有限公司 A kind of searching method, device and electronic equipment
CN105976279A (en) * 2016-05-26 2016-09-28 成都正合地产顾问股份有限公司 House choosing method
CN107094165B (en) * 2016-08-31 2021-01-08 阿里巴巴集团控股有限公司 Distribution capacity determining method, distribution task obtaining method, distribution resource scheduling method and equipment
CN108121725B (en) * 2016-11-29 2021-10-19 阿里巴巴集团控股有限公司 Searching method and device
CN106777017B (en) * 2016-12-08 2020-08-18 国信优易数据有限公司 System and method for inquiring commuting range within time limit based on electronic map
CN108038143A (en) * 2017-11-28 2018-05-15 上海与德科技有限公司 A kind of houseclearing acquisition methods, device, equipment and storage medium
CN108446298A (en) * 2018-01-25 2018-08-24 链家网(北京)科技有限公司 Room method and device is looked in a kind of commuting

Also Published As

Publication number Publication date
CN109800360A (en) 2019-05-24

Similar Documents

Publication Publication Date Title
KR102022840B1 (en) Determining timing for determination of applicable geo-fences
CN109800360B (en) Cell query method, cell query device, electronic equipment and storage medium
CN110992681B (en) Traffic network attribute information generation method, device, storage medium and electronic equipment
CN102411615B (en) Identifying physical locations of entities
CN112398895B (en) Method and device for providing service information
US11151210B2 (en) Target location search method and apparatus
CN103686591B (en) Obtain the method and system of positional information
US11861516B2 (en) Methods and system for associating locations with annotations
CN103425655A (en) Method and device for searching venue information for location based service
CN107092623B (en) Interest point query method and device
CN110345964B (en) Path matching method, device, system and storage medium
CN104699764A (en) Information pushing method and equipment
CN104050205A (en) Address information input method, address information acquisition method, address information input device, address information acquisition device, equipment, and address information input system
CN105592120A (en) Method and apparatus for providing geographic position information
CN104269072A (en) Method, device and system for finding vehicles in underground parking lot
JP2018518664A (en) Method and system for determining a positioning interval of a mobile terminal
CN104244174A (en) Method for obtaining geographical location information of terminals and server
KR20140020332A (en) Method and system for acquiring user content
CN111274487B (en) House source information recommendation method and device
CN101207880A (en) Mobile phone indicating guidance system based on server client machine mode
EP3407568A1 (en) Service processing method and device
CN111641924A (en) Position data generation method and device and electronic equipment
CN104735237A (en) Path prediction method and interactive voice response (IVR) path prediction system
CN114814802A (en) Positioning method and device
CN105389395B (en) Information acquisition 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
GR01 Patent grant
GR01 Patent grant