A location prediction method, an electronic device, and a readable storage medium
By obtaining the road name and door number requested by the user, screening adjacent numbers and filtering distance abnormal points, combining with quality inspection strategies, fitting straight lines based on road data, the problems of low recall and poor accuracy in the existing technology are solved, and more efficient location prediction is achieved.
Patent Information
- Application Number
- CN202211618859.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-15
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2042-12-15
AI Technical Summary
The prior art has low recall rates and poor accuracy in location search, and cannot effectively predict the target address points corresponding to the user query request, resulting in poor user experience.
By obtaining the road name and door number requested by the user, filtering adjacent numbers and filtering distance abnormal points, combining the quality inspection strategy, accurate recall data is selected, and linear processing is fitted based on the road data to predict the target address point.
Improves the accuracy and recall of location forecasts and improves user experience.
Smart Images

Figure CN115905339B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of computers and data processing, and particularly relates to a location prediction method, an electronic device, and a readable storage medium. Background Art
[0002] Nowadays, with the development of intelligent devices and mobile Internet technologies, new travel modes combined with the Internet have also flourished. To better meet the needs of users, accurately identifying the destinations that users want to go to is crucial for location retrieval. In business scenarios based on maps, data missing is the biggest problem in location retrieval failures. Due to factors such as the difficulty of data production and collection, high time costs, and high labor costs, map data is not updated in a timely manner and is not updated frequently. Therefore, in addition to supplementing missing data, it is also necessary to predict missing data to reduce costs and improve efficiency.
[0003] However, in the process of researching and practicing the prior art, the inventors of the present application found that the prior art mainly conducts retrieval or prediction based on the existing results in the database, but it needs to rely on huge and complete data. If the address searched by the user is not in the database, it cannot be predicted. Additionally, the results of retrieval or prediction are easily limited by the sorting algorithm effect, and there may be a situation where the text structure similarity is greater than the semantic similarity. Moreover, since less information is utilized, the retrieval or prediction strategy must be very strict to ensure data accuracy, resulting in the defects of low recall rate and poor accuracy in the prior art.
[0004] The foregoing description is for providing general background information and does not necessarily constitute prior art. Summary of the Invention
[0005] In view of the above technical problems, the present application provides a location prediction method, an electronic device, and a readable storage medium, which can accurately predict the target address point corresponding to the user's query request, improve the accuracy of location prediction and the recall rate of the prediction algorithm, solve the defects of low recall rate and poor accuracy in the prior art, and thereby improve the user experience.
[0006] To solve the above technical problems, the present application provides a location prediction method, including the following steps:
[0007] Respond to a user query request, and obtain the road name, house number, and first recall data corresponding to the user query request;
[0008] Based on a preset number screening strategy and the house number, perform adjacent number screening on the first recall data to obtain second recall data;
[0009] Based on a preset distance filtering strategy, perform distance outlier filtering on the second recall data to obtain third recall data;
[0010] Perform quality inspection on the third recall data based on the quality inspection strategy corresponding to the preset location prediction strategy;
[0011] After determining that the third recall data passes the quality inspection, determine the address coordinate prediction candidate points corresponding to the third recall data;
[0012] Based on the road data obtained by matching the road name, perform road screening, road section screening, and fitting straight line processing of the road data in sequence to obtain the road profile interval line segments corresponding to the road name;
[0013] Based on the address coordinate prediction candidate points and the road profile interval line segments, predict the target address points corresponding to the user query request.
[0014] Optionally, the obtaining the road name, house number, and first recall data corresponding to the user query request includes:
[0015] Obtain the address text corresponding to the user query request;
[0016] Perform entity segmentation on the address text to obtain the road name and house number corresponding to the address text;
[0017] Perform data recall based on the address text to obtain the corresponding first recall data.
[0018] Optionally, the performing proximity number screening on the first recall data based on the preset number screening strategy and the house number to obtain the second recall data includes:
[0019] Perform numerical processing on the house number data in the first recall data to obtain the corresponding first house number set;
[0020] Based on the preset number screening strategy, screen the house numbers within the preset offset interval range of the house number in the first house number set to obtain the second house number set;
[0021] Select the data corresponding to the second house number set as the second recall data.
[0022] Optionally, the performing distance outlier filtering on the second recall data based on the preset distance filtering strategy to obtain the third recall data includes:
[0023] Screen the recall points that meet the preset longitude inner distance and preset latitude inner distance in the second recall data to obtain the first recall point set;
[0024] Calculate the coordinates of the recall center point corresponding to the first recall point set;
[0025] Calculate the distances between each recall point in the first recall point set and the recall center point respectively;
[0026] Select the recall points in the first recall point set that meet the preset distance range to obtain a second recall point set;
[0027] Select the data corresponding to the second recall point set as the third recall data.
[0028] Optionally, the quality inspection of the third recall data based on the quality inspection strategy corresponding to the preset location prediction strategy includes:
[0029] Based on the house number corresponding to the user query request and the third recall data, determine the corresponding preset location prediction strategy;
[0030] Based on the preset location prediction strategy, determine the corresponding quality inspection strategy, where the quality inspection strategy includes double-point quality inspection and single-point quality inspection strategies;
[0031] Perform quality inspection on the recall points in the third recall data based on the quality inspection strategy.
[0032] Optionally, determining the address coordinate prediction candidate points corresponding to the third recall data includes:
[0033] If there are multiple coordinate prediction candidate points corresponding to any recall point in the third recall data, calculate the center point coordinates corresponding to the multiple coordinate prediction candidate points as the final coordinate prediction candidate point of the any recall point.
[0034] Optionally, the method of successively performing road screening, road section screening, and fitting a straight line to road data based on the road data matched according to the road name to obtain the road contour interval line segment corresponding to the road name includes:
[0035] Based on the road name, match the corresponding road data;
[0036] According to the preset road screening strategy, perform road screening on the road data to obtain the corresponding first road data;
[0037] According to the preset road section screening strategy, perform road section screening on the first road data to obtain the corresponding second road data;
[0038] According to the preset road straight line detection strategy, perform fitting a straight line to the second road data to obtain the corresponding road contour interval line segment.
[0039] Optionally, predicting the target address point corresponding to the user query request based on the address coordinate prediction candidate points and the road contour interval line segment includes:
[0040] According to the preset projection calculation formula, calculate the projection between the predicted candidate point of the address coordinate and the line segment in the road contour interval to obtain the corresponding projection point;
[0041] Based on the preset location prediction strategy and the projection point, predict the target address point corresponding to the user query request.
[0042] This application also provides an electronic device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of the location prediction method described above are implemented.
[0043] This application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the location prediction method described above are implemented.
[0044] Implementing the embodiments of the present invention has the following beneficial effects:
[0045] As described above, a location prediction method, an electronic device, and a readable storage medium provided by this application. The method includes: responding to a user query request, and obtaining the road name, house number, and first recall data corresponding to the user query request; based on a preset number screening strategy and the house number, perform proximity number screening on the first recall data to obtain second recall data; based on a preset distance filtering strategy, perform distance outlier filtering on the second recall data to obtain third recall data; perform quality inspection on the third recall data based on the quality inspection strategy corresponding to the preset location prediction strategy; after determining that the third recall data passes the quality inspection, determine the predicted candidate point of the address coordinate corresponding to the third recall data; based on the road data matched according to the road name, perform road screening, road interval segment screening, and road data fitting line processing in sequence to obtain the road contour interval line segment corresponding to the road name; based on the predicted candidate point of the address coordinate and the road contour interval line segment, predict the target address point corresponding to the user query request. The solution of this application first performs proximity number screening and distance outlier filtering on the recall data of the user query request, performs rough screening on the recall data, and screens the recall data that is relatively close to the user query request for subsequent prediction, effectively improving the accuracy of subsequent location prediction; after completing the rough screening, it also performs quality inspection on the recall data according to the quality inspection strategy corresponding to the location prediction strategy, further reducing prediction errors; after the recall data passes the quality inspection, road contour data is introduced to predict the target address point, further improving the accuracy and recall rate of location prediction and enhancing the user experience. Description of the Drawings
[0046] The accompanying drawings herein are incorporated into and constitute a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. To more clearly illustrate the technical solutions of the embodiments of the present application, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, for those of ordinary skill in the art, other accompanying drawings can be obtained based on these drawings without creative efforts.
[0047] Figure 1 is a schematic flowchart of the location prediction method provided by an embodiment of the present application;
[0048] Figure 2 is a schematic flowchart of step S1 provided by an embodiment of the present application;
[0049] Figure 3 is a schematic flowchart of step S2 provided by an embodiment of the present application;
[0050] Figure 4 is a schematic flowchart of step S3 provided by an embodiment of the present application;
[0051] Figure 5 is a schematic flowchart of step S4 provided by an embodiment of the present application;
[0052] Figure 6 is a schematic flowchart of step S6 provided by an embodiment of the present application;
[0053] Figure 7 is a schematic flowchart of step S7 provided by an embodiment of the present application;
[0054] Figure 8 is a schematic structural diagram of the location prediction device provided by an embodiment of the present application;
[0055] Figure 9 is a schematic structural diagram of the electronic device provided by an embodiment of the present application.
[0056] The realization of the objectives, functional features, and advantages of the present application will be further described in conjunction with the embodiments with reference to the accompanying drawings. Through the above accompanying drawings, the clear embodiments of the present application have been shown, and there will be more detailed descriptions hereinafter. These accompanying drawings and textual descriptions are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. Detailed Embodiments
[0057] Exemplary embodiments will be described in detail herein, and examples thereof are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0058] It should be noted that in this document, the terms "include", "comprise" or any other variation thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the phrase "comprising a..." does not exclude the presence of additional identical elements in the process, method, article or device comprising such element. In addition, components, features, and elements with the same name in different embodiments of the present application may have the same meaning or may have different meanings, and their specific meanings need to be determined based on their interpretations in the specific embodiments or further in combination with the context of the specific embodiments.
[0059] It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this document, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while" or "in response to determining". Furthermore, as used herein, the singular forms "a", "an" and "the" are also intended to include the plural forms unless the context indicates otherwise. It should be further understood that the terms "comprising", "including" indicate the presence of the stated features, steps, operations, elements, components, items, types, and / or groups, but do not exclude the presence, occurrence or addition of one or more other features, steps, operations, elements, components, items, types, and / or groups. The terms "or", "and / or", "including at least one of the following" used in the present application can be interpreted inclusively, or mean any one or any combination. For example, "including at least one of the following: A, B, C" means "any one of the following: A; B; C; A and B; A and C; B and C; A and B and C", and again, "A, B or C" or "A, B and / or C" means "any one of the following: A; B; C; A and B; A and C; B and C; A and B and C". An exception to this definition only occurs when the combination of elements, functions, steps or operations is inherently mutually exclusive in some way.
[0060] It should be understood that although the steps in the flowcharts in the embodiments of the present application are sequentially shown according to the indications of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and they can be executed in other orders. Moreover, at least a part of the steps in the figure may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same moment, but can be executed at different moments, and their execution order is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps.
[0061] Depending on the context, the words "if" or "when" as used herein can be interpreted as "when...", "when...", "in response to determining", or "in response to detecting". Similarly, depending on the context, the phrase "if determined" or "if detecting (stated condition or event)" can be interpreted as "when determined", "in response to determining", "when detecting (stated condition or event)", or "in response to detecting (stated condition or event)".
[0062] It should be noted that in this article, step codes such as S1, S2, etc. are used. The purpose is to more clearly and briefly express the corresponding content and do not constitute a substantial limitation in order. Those skilled in the art may execute S2 first and then S1, etc. during specific implementation, but these should all be within the protection scope of the present application.
[0063] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0064] In the subsequent description, the suffixes such as "module", "component", or "unit" used to represent elements are only for the convenience of the description of the present application, and they have no specific meaning in themselves. Therefore, "module", "component", or "unit" can be used interchangeably.
[0065] The embodiments of the present application can be applied to a server. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms.
[0066] First, the application scenarios that this application can provide will be introduced. For example, a location prediction method, an electronic device, and a readable storage medium are provided, which can perform location prediction on the query request initiated by the user, accurately predict the target address point corresponding to the user's query request, improve the accuracy of location prediction and the recall rate of the prediction algorithm, solve the defects of low recall rate and poor accuracy existing in the prior art, and thus improve the user experience.
[0067] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of the first implementation manner of the location prediction method provided by the embodiment of this application. The location prediction method may specifically include:
[0068] S1. Respond to the user's query request and obtain the road name, house number, and the first recall data corresponding to the user's query request.
[0069] Specifically, for step S1, it mainly responds to the user's query request, performs entity recognition on the user's query request, thereby obtaining the road name and house number corresponding to the user's query request, and obtaining the corresponding first recall data based on the user's query request.
[0070] Optionally, as Figure 2 shown, in some embodiments, step S1 may specifically include:
[0071] S11. Obtain the address text corresponding to the user's query request;
[0072] S12. Perform entity segmentation on the address text to obtain the road name and house number corresponding to the address text;
[0073] S13. Perform data recall based on the address text to obtain the corresponding first recall data.
[0074] Specifically, receive the user's query request, obtain the address text corresponding to the user's query request, perform entity segmentation on the address text, thereby obtaining the road name and house number corresponding to the address text, and query the recall data corresponding to the address text in the preset text library based on the address text, thereby obtaining the first recall data corresponding to the user's query request, where the first recall data includes multiple recall points and their address data.
[0075] In a specific embodiment, the address text may be the input text corresponding to the user's query request, may also be the text saved in the local database, or may be the text obtained by pulling through accessing the network interface, depending on the actual situation. For example, when the user enters a query request of "XX Road XX Number" in the taxi-hailing software, then this "XX Road XX Number" is the address text.
[0076] It should be noted that, in this embodiment, a preset Named Entity Recognition (NER) algorithm can be used to segment the address text into at least one entity corresponding to the address text (such as a road name and a house number). NER is a very basic task in natural language processing and an important basic tool for many NLP tasks such as information extraction, question answering systems, syntactic analysis, and machine translation. Named entities generally refer to entities with specific meanings or strong referentiality in the text. Academically, they usually include three major categories: entity category, time category, and number category, and seven minor categories: person name, place name, organization name, time, date, currency, and percentage. NER is to extract the above entities from unstructured input text and can identify more categories of entities according to business requirements. Named entity recognition algorithms can include methods based on dictionaries and rules, traditional machine learning methods, and methods based on deep learning.
[0077] Rule-based NER systems rely on manually formulated rules. The design of the rules is generally based on syntactic, grammatical, lexical patterns, and knowledge in specific domains, etc. The dictionary is composed of a dictionary of feature words and an external dictionary. The external dictionary refers to existing common sense dictionaries. After formulating the rules and the dictionary, the text is usually processed in a matching manner to achieve named entity recognition.
[0078] In the method based on machine learning, named entity recognition is regarded as a sequence labeling problem. Compared with classification problems, in sequence labeling problems, the current predicted label is not only related to the current input features but also related to the previous predicted labels, that is, there is a strong interdependence relationship between the predicted label sequences. The traditional machine learning methods adopted mainly include: Hidden Markov Model, Maximum Entropy, Maximum Entropy Markov Model, Support Vector Machine, and Conditional Random Field.
[0079] The main reasons for using deep learning in NER are: 1. NER is suitable for non-linear transformation. 2. Deep learning avoids the construction of a large number of artificial features, saving a lot of effort in designing the NER function. 3. Deep learning can be trained through gradient propagation, so that a more complex network can be constructed. 5. End-to-end training method.
[0080] In this application, the corresponding NER algorithm can be selected according to actual needs, which will not be elaborated here.
[0081] S2. Based on the preset number screening strategy and the house number, perform adjacent number screening on the first recalled data to obtain the second recalled data.
[0082] Specifically, for step S2, according to the preset number screening strategy and the house number corresponding to the user query request, the first recalled data is screened for adjacent numbers, and the recalled data within the preset offset range of the house number corresponding to the user query request in the first recalled data is selected as the second recalled data.
[0083] Optionally, as Figure 3 shown, in some embodiments, step S2 may specifically include:
[0084] S21. Numerically process the house number data in the first recalled data to obtain the corresponding first set of house numbers;
[0085] S22. Based on the preset number screening strategy, screen the house numbers within the preset offset range of the house number in the first set of house numbers to obtain the second set of house numbers;
[0086] S23. Select the data corresponding to the second set of house numbers as the second recalled data.
[0087] In a specific embodiment, step S2 is mainly based on the house number included in the address queried in the user query request, and the first recalled data with the numbers within the preset interval range is screened according to the house number. The preset interval is [queryNum - offset, queryNum + offset], where queryNum is the house number corresponding to the user query request and offset is the number offset. The first recalled data is roughly screened, and the data with relatively close numbers is selected for subsequent process handling. In the specific implementation process, the user query request and the house numbers in the first recalled data are numerically processed to obtain integer-type numbers, and then the first recalled data is filtered according to the preset interval range. For example, if the user query request is No. 28, XX Road and the offset is 10, after numerical processing, the integer number corresponding to the user query request is 28; the first recalled data includes No. 26, XX Road, No. 38, XX Road, and No. 108, XX Road, then the corresponding integer numbers after numerical conversion include 26, 38, and 108; after screening according to the offset of 10, the second recalled data is obtained, including No. 26, XX Road -> 26 and No. 38, XX Road -> 38.
[0088] S3. Based on the preset distance filtering strategy, filter the distance outliers from the second recalled data to obtain the third recalled data.
[0089] Specifically, for step S3, it is mainly based on the preset distance filtering strategy to filter the distance outliers from the recalled points in the second recalled data, and remove the points that deviate from the group to ensure the reliability of the prediction data. After filtering, the third recalled data is obtained.
[0090] Optionally, as Figure 4As shown, in some embodiments, step S3 may specifically include:
[0091] S31. Screen the recall points in the second recall data that meet the preset longitude inner distance and preset latitude inner distance to obtain the first recall point set;
[0092] S32. Calculate the coordinates of the recall center point corresponding to the first recall point set;
[0093] S33. Calculate the distances between each recall point in the first recall point set and the recall center point respectively;
[0094] S34. Select the recall points in the first recall point set that meet the preset distance range to obtain the second recall point set;
[0095] S35. Select the data corresponding to the second recall point set as the third recall data.
[0096] Specifically, step S3 in this embodiment is used to identify outliers based on the clustering of recall points, so as to eliminate the recall points that deviate from the group before prediction and ensure the reliability of the prediction data. Among them, the recall data can be retrieved by ES search, and this type of data is mainly sorted and returned according to the text similarity. However, in practice, some recall data may have a close house number but a large actual coordinate distance. Therefore, it is necessary to further screen the adjacent points according to the coordinate clustering. The specific steps are as follows: Filter the data according to the inner distance of longitude and latitude respectively, and retain the points that meet both the longitude and latitude within the inner distance range to obtain the first recall point set recall filtered ; Calculate the coordinates of the recall center point loc center of the first recall point set; Calculate the distances d between each recall point in the first recall point set recall filtered and the recall center point loc center respectively, so as to calculate the average distance d mean ; Select the recall points in the first recall point set that meet the preset distance range. If they do not meet the preset distance range, determine that the recall point is an outlier and then eliminate it to obtain the second recall point set; Select the recall data corresponding to the second recall point set as the third recall data. Among them, the preset distance range in this embodiment can be twice the average distance d mean , or it can be changed according to actual needs, and no specific limitation is made here.
[0097] S4. Perform quality inspection on the third recall data based on the quality inspection strategy corresponding to the preset location prediction strategy.
[0098] Specifically, for step S4, determine the corresponding quality inspection strategy according to the preset location prediction strategy, and then perform quality inspection on the third recalled data according to the corresponding quality inspection strategy, so as to determine whether the data filtered in steps S2 and S3 meet the strategy requirements for subsequent location prediction. If the quality inspection result fails, that is, the data does not meet the strategy requirements, no subsequent prediction is performed; otherwise, subsequent prediction is performed.
[0099] Optionally, as Figure 5 shown, in some embodiments, step S4 may specifically include:
[0100] S41. Based on the house number corresponding to the user query request and the recalled points in the third recalled data, determine the corresponding preset location prediction strategy;
[0101] S42. Based on the preset location prediction strategy, determine the corresponding quality inspection strategy, where the quality inspection strategy includes a double-point quality inspection strategy and a single-point quality inspection strategy;
[0102] S43. Perform quality inspection on the recalled points in the third recalled data based on the quality inspection strategy.
[0103] Specifically, in step S4 of this embodiment, first, based on the house number corresponding to the user query request and the recalled points in the third recalled data, determine the corresponding preset location prediction strategy. For example, when the house number is 28 and the recalled points are 26 and 38, determine the location prediction strategy as the bilateral double-number prediction strategy. Another example is when the house number is 28 and the recalled points are 24 and 26, determine the location prediction strategy as the unilateral double-number prediction strategy. Another example is when the house number is 28 and the recalled point is 26, determine the location prediction strategy as the unilateral single-number prediction strategy. Then, based on the preset location prediction strategy, determine the corresponding quality inspection strategy. For example, when the location prediction strategy is the bilateral double-number prediction strategy or the unilateral double-number prediction strategy, adopt the double-point quality inspection strategy. Another example is when the location prediction strategy is the unilateral single-number prediction strategy, adopt the single-point quality inspection strategy; thus, perform quality inspection on the recalled points in the third recalled data based on the quality inspection strategy.
[0104] Among them, the double-point quality inspection strategy specifically includes: calculating the number span Number_span of the recalled points, respectively calculating the longitude and latitude of the recalled points, and taking the maximum value among them as Loc_span; calculating the single-number span SingleNUmber_span = Loc_span / Number_span; determining whether Loc_span is less than the preset first threshold t1; determining whether SingleNUmber_span is less than the preset second threshold t2; if both of the above conditions are met, it is determined that the quality inspection passes and subsequent quality inspection is performed; otherwise, it is determined that the quality inspection fails and no subsequent prediction is performed.
[0105] The single-point strategy specifically includes: calculating the similarity between the address text corresponding to the user's query request and the address text of the recalled points, and determining whether the text similarity is greater than a preset third threshold t3. If so, it is determined that the quality inspection is passed and subsequent quality inspections are carried out; otherwise, it is determined that the quality inspection fails and subsequent predictions are not carried out.
[0106] S5. After determining that the third recalled data passes the quality inspection, determine the address coordinate prediction candidate points corresponding to the third recalled data.
[0107] Specifically, for step S5, after determining that the third recalled data passes the quality inspection, return the address coordinate prediction candidate points recall_c corresponding to the recalled point numbers that need to participate in the calculation of the location prediction strategy.
[0108] Optionally, in some embodiments, step S5 may specifically include:
[0109] If there are multiple coordinate prediction candidate points corresponding to any recalled point in the third recalled data, calculate the center point coordinates corresponding to the multiple coordinate prediction candidate points as the final coordinate prediction candidate point for any recalled point.
[0110] Specifically, when there are multiple coordinate prediction candidate points corresponding to any recalled point in the third recalled data, that is, when the adjacent point numbers correspond to multiple addresses, it is necessary to calculate the center point coordinates of the multiple coordinate prediction candidate points as the final position coordinates corresponding to this adjacent point number. The calculation method of the center point coordinates is to take the longitude and latitude of multiple points and calculate the average longitude and average latitude respectively as the coordinates of the center point; by calculating the center point coordinates of multiple points, the error caused by inaccurate single data points is reduced.
[0111] S6. Based on the road data obtained by matching the road name, successively perform road screening, road section screening, and road data fitting straight line processing to obtain the road contour interval line segment corresponding to the road name.
[0112] Specifically, for step S6, according to the road name corresponding to the user's query request, match the corresponding road data, and then successively perform road screening, road section screening, and road data fitting straight line processing on the road data to obtain the road contour interval line segment corresponding to the road name.
[0113] Optionally, as Figure 6 shown, in some embodiments, step S6 may specifically include:
[0114] S61. Based on the road name, match the corresponding road data;
[0115] Specifically, for step S61, based on the road name of the user's query request, match the corresponding road data.
[0116] S62. Screen the road data according to the preset road screening strategy to obtain the corresponding first road data;
[0117] Specifically, for step S62, when there are two or more pieces of road data matched by road name, the road data needs to be screened. The process of road screening is as follows: Filter according to the city attribute corresponding to the road. When there is road data with the same city as the user's query request, give priority to selecting the road data with the same city. At this time, there are two possible return results. One is one or more pieces of road data with the same city as the query request, and the other is one or more pieces of road data with a different city from the query request; then, in the return results, screen the road data with the shortest distance. Calculate the distance between the longitude and latitude of the center point of each piece of road data and the longitude and latitude of the address coordinate corresponding to the recall point number to predict the candidate point recall_c, and select the road data with the shortest distance as the road data after the final road screening to obtain the first road data.
[0118] S63. Screen the first road data according to the preset road section screening strategy to obtain the corresponding second road data;
[0119] Specifically, for step S63, since the difference between the recall point numbers actually participating in location prediction is relatively small, and the corresponding distance will also be relatively short, the contour data of the entire road is not used. In addition, after screening the road section, the road section can be approximately regarded as a straight line, providing a more efficient algorithm approximation for subsequent processing. Therefore, it is necessary to screen the first road data according to the preset road section screening strategy. The first road data includes road contour data. The specific method is as follows:
[0120] (1) Calculate the longitude span and latitude span span of the coordinate prediction candidate point recall_c respectively. The calculation method is, for example, lon_span = lon_max - lon_min;
[0121] (2) Compare the longitude span lon_span and latitude span lat_span of the coordinate prediction candidate point recall_c. If lon_span is large (i.e., the road is east-west), screen by longitude value and go to step (3); otherwise, screen by latitude value (i.e., the road is north-south) and go to step (4);
[0122] (3) According to the maximum value lon_max and minimum value lon_min of the longitude of the coordinate prediction candidate point recall_c, screen the road contour data points whose longitude is within the range of [lon_min - offset, lon_max + offset];
[0123] (4) According to the coordinates, predict the maximum value lat_max and the minimum value lat_min of the latitude of the candidate point recall_c, and filter the road contour data points whose latitude is within the range of [lat_min - offset, lat_max + offset], where offset is an offset parameter set according to the data;
[0124] (5) Sort the contour data points obtained in step (3) or step (4) according to longitude or latitude to obtain a list of contour interval segment points [point1, point2,..., pointk].
[0125] S64. According to the preset road straight line detection strategy, perform road data fitting straight line processing on the second road data to obtain the corresponding road contour interval segment;
[0126] Specifically, for step S64, after performing road interval segment screening on the first road data, perform road data fitting straight line processing on the second road data to check whether the second road data meets the characteristics of a straight line. The specific process is as follows: Take the two endpoints of the filtered contour data points [point1, point2,..., pointk], that is, point1 and pointk, and according to the two-point determination straight line formula, obtain the expression of the road contour interval segment L
[0127] (y - y1) / (y2 - y1) = (x - x1) / (x2 - x1);
[0128] It can be transformed into
[0129] Ax + By + C = 0 (A > 0);
[0130] Calculate the distance d from the contour data point (x0, y0) to the straight line L according to the point-to-straight-line distance formula;
[0131]
[0132] Judge whether the maximum value of d is less than the preset fourth threshold. If so, it means that the second road data is straight line data, and continue with subsequent predictions. Otherwise, do not perform subsequent predictions.
[0133] S7. Based on the address coordinates, predict the candidate points and the road contour interval segments, and predict the target address point corresponding to the user's query request.
[0134] Optionally, as Figure 7 shown, in some embodiments, step S7 may specifically include:
[0135] S71. Calculate the projection between the candidate point for predicting the address coordinates and the line segment in the range of the road contour according to the preset projection calculation formula, and obtain the corresponding projection point.
[0136] S72. Based on the preset location prediction strategy and the projection point, predict the target address point corresponding to the user query request.
[0137] Specifically, for step S71, it is mainly based on the candidate point for predicting the address coordinates and the line segment in the range of the road contour. According to the preset projection calculation formula, calculate the projection of the candidate point for coordinate prediction to the line segment L of the projection point to the contour range, and finally perform coordinate prediction based on the projection.
[0138] Assume two points p1(x1, y1) and p2(x2, y2) on the contour interval straight line L, and the candidate point p3(x3, y3) for coordinate prediction, and find the foot of the perpendicular p4(x4, y4). The specific calculation formula is as follows:
[0139] Formula 1:
[0140]
[0141] Formula 2:
[0142] x4 = x1 + u(x1 - x2)
[0143] y4 = y1 + u(y1 - y2);
[0144] Substitute the solution of Formula 1 into Formula 2 to obtain the coordinates of the foot of the perpendicular, and the coordinates of the foot of the perpendicular are the coordinates of the projection point.
[0145] Specifically, for step S72, it is mainly used to predict the target address point corresponding to the user query request, that is, the longitude and latitude of the address coordinates, according to different location prediction strategies. When the location prediction strategy is the bilateral double-number prediction strategy or the unilateral double-number prediction strategy, the intermediate recall point can be predicted by two points according to the interpolation algorithm, and the prediction formula is:
[0146]
[0147]
[0148] Among them, lon pred is the predicted longitude coordinate, lon right is the longitude coordinate on the right, lon left is the longitude coordinate on the left, num pred is the predicted recall point number, num left is the recall point number on the left, lat pred is the predicted latitude coordinate, lat right is the latitude coordinate on the right, lat 1eftIs the latitude coordinate on the left.
[0149] When the location prediction strategy is the one-sided single-number prediction strategy, that is, the coordinate position can only be inferred from one point, the coordinates of the recalled point are directly used as the coordinates of the address corresponding to the user's query request.
[0150] To better illustrate the solution of this application, the implementation process of the solution of this application will be exemplified below.
[0151] For example, a user requests as follows (key data has been desensitized):
[0152] UID: u19982;
[0153] Location where the user requests: 121.32955745026 (longitude), 31.25289537773 (latitude);
[0154] Request time: 2020-11-18 10:41:10;
[0155] Request point type: unloading point;
[0156] Request query: "No. 179, Middle Huaihai Road, Huangpu District, Shanghai";
[0157] Number: 179;
[0158] The recalled number dictionary corresponding after adjacent number screening is:
[0159] {
[0160] 160: [recall1, recall2],
[0161] 171: [recall3, recall4],
[0162] 175: [recall5],
[0163] 180: [recall6],
[0164] 181: [recall7, recall8],
[0165] 193: [recall9]
[0166] }
[0167] Among them, the key of the dictionary is the number, and the value is the address data class.
[0168] After filtering the distance anomaly points, the recalled number dictionary corresponding is:
[0169] {
[0170] 160: [recall1],
[0171] 171: [recall3],
[0172] 175: [recall5],
[0173] 181: [recall7, recall8],
[0174] 193: [recall9]
[0175] }
[0176] Perform pre - quality inspection on the previous data. After screening, it meets the strategy: the bilateral double - number prediction numbers are: [175, 181]
[0177] The data is:
[0178] {
[0179] 175: [recall5],
[0180] 181: [recall7, recall8],
[0181] }
[0182] Calculate the center point. After screening, it meets the strategy: bilateral double - number prediction
[0183] The numbers are: [175, 181]
[0184] The data is:
[0185] {
[0186] 175: recall5,
[0187] 181: recall7,
[0188] }
[0189] Perform road screening;
[0190] Road data:
[0191] {'id': 1, 'name': 'Huaihai Middle Road', 'ad_name': 'Huangpu District', 'center_point': (121.32955, 32.41255),
[0192] 'points': [(121.32955, 32.41255), (121.32955, 32.41255),...,(121.32955, 32.41255)]
[0193] {"id":2,"name":"Huaihai Middle Road","ad_name":"Xuhui District","center_point":(121.32966,32.41266),
[0194] "points":[(121.32955,32.41255),(121.32955,32.41255),(121.32955,32.41255)]
[0195] After screening:
[0196] {"id":1,"name":"Huaihai Middle Road","ad_name":"Huangpu District","center_point":(121.32955,32.41255),"points":[(121.32955,32.41255),(121.32955,32.41255),...,(121.32955,32.41255)]
[0197] Road section screening;
[0198] After screening:
[0199] {"id":1,"name":"Huaihai Middle Road","ad_name":"Huangpu District","center_point":(121.32955,32.41255),
[0200] "points":[(121.32955,32.41255),(121.32955,32.41255)]
[0201] Fitting a straight line to road data:
[0202] Two ends of the fitted straight line: [(121.32955,32.41255),(121.32985,32.41295)]
[0203] Projecting adjacent points to obtain the new coordinates loc_project after projection
[0204] { 175:
[0206] recall5:{"loc_raw":(121.32355,32.41355),"loc_project":(121.32355,32.41355)} 181:
[0208] recall7: {'loc_raw': (121.32455, 32.41455), 'loc_project': (121.32455, 32.41455)}
[0209] }
[0210] Point prediction, obtaining the data result after point prediction
[0211] {179: {'loc_pred': (121.32555, 32.41555)}}
[0212] As can be seen from the above, the location prediction method provided by the embodiments of the present application includes: responding to a user query request, and obtaining the road name, house number, and first recall data corresponding to the user query request; based on a preset number screening strategy and the house number, performing proximity number screening on the first recall data to obtain second recall data; based on a preset distance filtering strategy, performing distance outlier filtering on the second recall data to obtain third recall data; based on a quality inspection strategy corresponding to a preset location prediction strategy, performing quality inspection on the third recall data; after determining that the third recall data passes the quality inspection, determining the address coordinate prediction candidate points corresponding to the third recall data; based on the road data matched according to the road name, successively performing road screening, road section screening, and road data fitting line processing to obtain the road profile interval line segments corresponding to the road name; based on the address coordinate prediction candidate points and the road profile interval line segments, predicting the target address points corresponding to the user query request. The solution of the present application first performs proximity number screening and distance outlier filtering on the recall data of the user query request, coarsely screens the recall data, and screens the recall data closer to the user query request for subsequent prediction, effectively improving the accuracy of subsequent location prediction; after completing the coarse screening, it also performs quality inspection on the recall data according to the quality inspection strategy corresponding to the location prediction strategy, further reducing prediction errors; after the recall data passes the quality inspection, road profile data is introduced to predict the target address points, further improving the accuracy and recall rate of location prediction, and improving the user experience.
[0213] To better implement the location prediction method of the embodiments of the present application, the embodiments of the present application also provide a location prediction device based on the above location prediction method, where the meanings of the nouns are the same as those in the above location prediction method, and the specific implementation details can refer to the description in the method embodiments.
[0214] Please refer to Figure 8 , Figure 8 which is a schematic structural diagram of the location prediction device provided by the embodiments of the present application. The location prediction device may include a recall module 10, a proximity number screening module 20, a distance filtering module 30, a data quality inspection module 40, a center point module 50, a road profile module 60, and a prediction module 70.
[0215] A recall module 10, configured to respond to a user query request and obtain a road name, a house number, and first recall data corresponding to the user query request;
[0216] A proximity number screening module 20, configured to perform proximity number screening on the first recall data based on a preset number screening strategy and the house number to obtain second recall data;
[0217] A distance filtering module 30, configured to perform distance outlier filtering on the second recall data based on a preset distance filtering strategy to obtain third recall data;
[0218] A data quality inspection module 40, configured to perform quality inspection on the third recall data based on a quality inspection strategy corresponding to a preset location prediction strategy;
[0219] A center point module 50, configured to determine an address coordinate prediction candidate point corresponding to the third recall data after determining that the third recall data passes the quality inspection;
[0220] A road profile module 60, configured to successively perform road screening, road section screening, and road data fitting straight line processing on road data matched according to the road name to obtain a road profile interval line segment corresponding to the road name;
[0221] A prediction module 70, configured to predict a target address point corresponding to the user query request based on the address coordinate prediction candidate point and the road profile interval line segment.
[0222] Optionally, in some embodiments, the road profile module 60 may specifically include:
[0223] A road data unit, configured to match corresponding road data based on the road name;
[0224] A road screening unit, configured to perform road screening on the road data according to a preset road screening strategy to obtain corresponding first road data;
[0225] A road section screening unit, configured to perform road section screening on the first road data according to a preset road section screening strategy to obtain corresponding second road data;
[0226] A fitting straight line unit, configured to perform road data fitting straight line processing on the second road data according to a preset road straight line detection strategy to obtain a corresponding road profile interval line segment.
[0227] The location prediction device provided by the embodiments of the present application first performs proximity number screening and distance outlier filtering on the recall data of the user query request to roughly screen the recall data, and screens the recall data relatively close to the user query request for subsequent prediction, effectively improving the accuracy of subsequent location prediction; after the rough screening is completed, the recall data is also quality inspected according to the quality inspection strategy corresponding to the location prediction strategy to further reduce prediction errors; after the recall data passes the quality inspection, road contour data is introduced to predict the target address point, further improving the accuracy and recall rate of location prediction and enhancing the user experience.
[0228] In addition, the embodiments of the present application also provide an electronic device, as Figure 9 shown, which shows the structural schematic diagram of the electronic device involved in the embodiments of the present application. Specifically:
[0229] The electronic device may include components such as a processor 301 with one or more processing cores, a memory 302 with one or more computer-readable storage media, a power supply 303, and an input unit 304. Those skilled in the art can understand that Figure 9 the structure of the electronic device shown in does not constitute a limitation on the electronic device, and it may include more or fewer components than shown, or combine certain components, or have different component arrangements. Among them:
[0230] The processor 301 is the control center of the electronic device, connecting various parts of the entire electronic device through various interfaces and lines. By running or executing software programs and / or modules stored in the memory 302, and calling data stored in the memory 302, it executes various functions of the electronic device and processes data, thereby monitoring the entire electronic device. Optionally, the processor 301 may include one or more processing cores; preferably, the processor 301 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above modem processor may not be integrated into the processor 301.
[0231] The memory 302 can be used to store software programs and modules. The processor 301 executes various functional applications and location predictions by running the software programs and modules stored in the memory 302. The memory 302 mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of the electronic device. In addition, the memory 302 can include high-speed random access memory and can also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory 302 can also include a memory controller to provide the processor 301 with access to the memory 302.
[0232] The electronic device further includes a power supply 303 for supplying power to each component. Preferably, the power supply 303 can be logically connected to the processor 301 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 303 can also include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.
[0233] The electronic device may further include an input unit 304, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
[0234] Although not shown, the electronic device may further include a display unit, etc., which will not be elaborated here. Specifically, in this embodiment, the processor 301 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 302 according to the following instructions, and the processor 301 will run the application programs stored in the memory 302 to implement various functions as follows:
[0235] In response to a user query request, obtain the road name, house number, and first recall data corresponding to the user query request; based on a preset number screening strategy and the house number, perform proximity number screening on the first recall data to obtain second recall data; based on a preset distance filtering strategy, perform distance outlier filtering on the second recall data to obtain third recall data; based on a quality inspection strategy corresponding to a preset location prediction strategy, perform quality inspection on the third recall data; after determining that the third recall data passes the quality inspection, determine the candidate points for predicting the address coordinates corresponding to the third recall data; based on the road data matched according to the road name, perform road screening, road section screening, and fitting straight line processing on the road data in sequence to obtain the road contour interval line segment corresponding to the road name; based on the candidate points for predicting the address coordinates and the road contour interval line segment, predict the target address point corresponding to the user query request.
[0236] For the specific implementation of each of the above operations, reference may be made to the previous embodiments and will not be elaborated herein.
[0237] In the embodiment of the present application, first, proximity number screening and distance outlier filtering are performed on the recall data of the user query request to coarsely screen the recall data, and the recall data relatively close to the user query request is screened for subsequent prediction, effectively improving the accuracy of subsequent location prediction; after the coarse screening, quality inspection is also performed on the recall data according to the quality inspection strategy corresponding to the location prediction strategy to further reduce prediction errors; after the recall data passes the quality inspection, road contour data is introduced to predict the target address point, further improving the accuracy and recall rate of location prediction and enhancing the user experience.
[0238] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions or by controlling related hardware through instructions. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0239] Therefore, the embodiment of the present application provides a storage medium, which stores multiple instructions that can be loaded by a processor to execute the steps in any of the location prediction methods provided by the embodiment of the present application. For example, the instructions can execute the following steps:
[0240] Respond to the user's query request, and obtain the road name, house number, and first recall data corresponding to the user's query request; based on the preset number screening strategy and the house number, perform proximity number screening on the first recall data to obtain the second recall data; based on the preset distance filtering strategy, perform distance outlier filtering on the second recall data to obtain the third recall data; perform quality inspection on the third recall data based on the quality inspection strategy corresponding to the preset location prediction strategy; after determining that the third recall data passes the quality inspection, determine the address coordinate prediction candidate points corresponding to the third recall data; based on the road data matched according to the road name, perform road screening, road section screening, and road data fitting line processing in sequence to obtain the road contour interval line segments corresponding to the road name; based on the address coordinate prediction candidate points and the road contour interval line segments, predict the target address points corresponding to the user's query request.
[0241] For the specific implementation of each of the above operations, reference may be made to the previous embodiments, which will not be elaborated here.
[0242] Among them, the storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc.
[0243] Since the instructions stored in the storage medium can execute the steps in any of the location prediction methods provided in the embodiments of the present application, the beneficial effects achievable by any of the location prediction methods provided in the embodiments of the present application can be realized. For details, refer to the previous embodiments, which will not be elaborated here.
[0244] The above has introduced in detail a location prediction method, device, electronic device, and readable storage medium provided by the embodiments of the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A location prediction method, characterized in that, It includes the following steps: Respond to the user's query request and obtain the road name, house number, and first recall data corresponding to the user's query request; Based on the preset number screening strategy and the house number, perform proximity number screening on the first recall data to obtain second recall data; Based on the preset distance filtering strategy, perform distance outlier filtering on the second recall data to obtain third recall data; Based on the quality inspection strategy corresponding to the preset location prediction strategy, perform quality inspection on the third recall data; After determining that the third recall data passes the quality inspection, determine the address coordinate prediction candidate points corresponding to the third recall data; Based on the road data matched according to the road name, perform road screening, road section screening, and fitting straight line processing of the road data in sequence to obtain the road contour interval line segment corresponding to the road name; Based on the address coordinate prediction candidate points and the road contour interval line segment, predict the target address points corresponding to the user's query request.
2. The location prediction method according to claim 1, characterized in that The obtaining of the road name, house number, and first recall data corresponding to the user's query request includes: Obtain the address text corresponding to the user's query request; Perform entity segmentation on the address text to obtain the road name and house number corresponding to the address text; Based on the address text, perform data recall to obtain the corresponding first recall data.
3. The location prediction method according to claim 1, wherein The performing of proximity number screening on the first recall data based on the preset number screening strategy and the house number to obtain second recall data includes: Perform numerical processing on the house number data in the first recall data to obtain the corresponding first house number set; Based on the preset number screening strategy, screen the house numbers within the preset offset interval range of the house number in the first house number set to obtain a second house number set; Select the data corresponding to the second house number set as the second recall data.
4. The location prediction method according to claim 1, characterized in that The performing of distance outlier filtering on the second recall data based on the preset distance filtering strategy to obtain third recall data includes: Screen the recall points that meet the preset longitude inner distance and preset latitude inner distance in the second recall data to obtain a first recall point set; Calculate the coordinates of the recall center point corresponding to the first recall point set; Calculate the distances between each recall point in the first recall point set and the recall center point respectively; Select the recall points that meet the preset distance range in the first recall point set to obtain a second recall point set; Select the data corresponding to the second recall point set as the third recall data.
5. The location prediction method according to claim 1, wherein The performing of quality inspection on the third recall data based on the quality inspection strategy corresponding to the preset location prediction strategy includes: Based on the house number corresponding to the user's query request and the third recall data, determine the corresponding preset location prediction strategy; Based on the preset location prediction strategy, determine the corresponding quality inspection strategy, where the quality inspection strategy includes double-point quality inspection and single-point quality inspection strategies; Based on the quality inspection strategy, perform quality inspection on the recall points in the third recall data.
6. The location prediction method according to claim 1, wherein The determining of the address coordinate prediction candidate points corresponding to the third recall data includes: When there are multiple coordinate prediction candidate points corresponding to any recall point in the third recall data, calculate the center point coordinates corresponding to the multiple coordinate prediction candidate points as the final coordinate prediction candidate point for the any recall point.
7. The location prediction method according to claim 1, wherein The obtaining of the road contour interval line segment corresponding to the road name by successively performing road screening, road interval segment screening, and road data fitting straight line processing based on the road data obtained by matching according to the road name includes: Based on the road name, match to obtain the corresponding road data; According to a preset road screening strategy, perform road screening on the road data to obtain the corresponding first road data; According to a preset road interval segment screening strategy, perform road interval segment screening on the first road data to obtain the corresponding second road data; According to a preset road straight line detection strategy, perform road data fitting straight line processing on the second road data to obtain the corresponding road contour interval line segment.
8. The location prediction method according to claim 1, characterized in that, The predicting of the target address point corresponding to the user query request based on the address coordinate prediction candidate point and the road contour interval line segment includes: According to a preset projection calculation formula, calculate the projection between the address coordinate prediction candidate point and the road contour interval line segment to obtain the corresponding projection point; Based on the preset location prediction strategy and the projection point, predict the target address point corresponding to the user query request.
9. An electronic device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the location prediction method according to any one of claims 1 to 8 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the location prediction method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Address matching method, system and device and storage medium
CN114003812A
Location retrieval method, electronic equipment and storage medium
CN114692023A