Mixed keyword query application based on road network space and attributes
By dividing the target objects of the road network in one-level and multi-level division, and using the R-tree index structure to optimize the query process, the problems of inefficiency and dissatisfaction with the mixed keyword query of the existing technology in the road network space and attributes are solved, and efficient and accurate query results are achieved.
Patent Information
- Application Number
- CN202510084244.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2025-06-03
AI Technical Summary
When the prior art handles mixed keyword query of road network space and attributes in a location service positioning system, there are problems such as low query efficiency, inability to meet personalized query requirements, inaccurate query results, and difficulty in dealing with multi-level attribute associations.
By dividing the target land objects of the road network according to the inherent labels and dividing them at second or multiple levels according to the attribute keywords, a more detailed classification is formed. Using query algorithm 1, establish an R-tree index structure, optimize the query process, and classify and classify the user's personalized attribute keywords.
It significantly improves query efficiency, reduces interference from useless information, improves the accuracy of query results, meets users' personalized query needs, and can quickly and accurately return results when dealing with complex multi-source query needs.
Smart Images

Figure CN120086456A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of spatial text indexing, and more specifically, to an application for querying based on a mixed keyword of road network space and attributes. Background Art
[0002] With the rapid development of information technology, location-based service (LBS) positioning systems have become key infrastructures in modern society and are widely used in fields such as intelligent transportation, urban planning, environmental monitoring, and logistics management. These services rely on the system's ability to accurately understand user queries and provide precise geographical location and related attribute information, including precise matching of geographical location and related attribute information. Users not only need to know where a certain location is but also hope to understand the specific attributes of that location, such as specific departments in a hospital, teaching ratings in a school, real-time congestion conditions on traffic routes, etc. Therefore, the development background of the technology for querying based on a mixed keyword of road network space and attributes is to meet the user's demand for precise and personalized geographical location information services and to handle the increasing complex query tasks.
[0003] Currently, the querying of mixed keywords of road network space and attributes in location-based service positioning systems mainly relies on three methods: nearest neighbor query, label value-based query, and POI application. The nearest neighbor query method finds the nearest location by calculating the shortest distance and is suitable for simple scenarios, but it is inefficient when dealing with multi-condition queries. The label value-based query method queries by specifying label values for network nodes or edges and is suitable for target points with fixed attributes, but it is difficult to reflect the implicit attributes of target entities. The POI application provides rich geographical information, but it requires users to have a certain degree of professionalism and is not very user-friendly to ordinary users. These methods can provide help in specific situations, but their limitations become particularly obvious when dealing with complex, multi-source, and personalized query requirements.
[0004] The existing technologies have the following main problems when dealing with the querying of mixed keywords of road network space and attributes in location-based service positioning systems: First, the existing technologies cannot effectively meet the personalized query needs of users, and the actual intentions of users may vary greatly due to different expressions of keywords. Second, the existing technologies fail to fully reflect the implicit attributes of target entities, especially in the case of mixed queries involving different categories of target entities, and the result set may deviate significantly from the user's wishes. In addition, the existing technologies have deficiencies in query efficiency and result set management, which may lead to low efficiency and an overly large result set. Finally, the requirement for user professionalism in the POI application limits its popularity. These defects limit the application scope of the query technology and affect the user experience. Summary of the Invention
[0005] The object of the present invention is to develop an application for mixed keyword query based on road network space and attributes, so as to solve the problems of low query efficiency, inability to meet personalized query needs, inaccurate query results, and difficulty in processing multi-level attribute associations in the prior art.
[0006] The above technical object of the present invention is achieved by the following technical solutions: A method for mixed keyword query based on road network space and attributes, comprising the following steps:
[0007] S1: Classify the target objects of the existing road network at the first level according to the target inherent tags;
[0008] S2: Determine whether there is a second-level classification. If so, on the basis of the first-level classification, associate the attribute keywords with the categories to form a second-level classification; if there is no second-level classification, directly proceed to step S4;
[0009] S3: For special target objects, continue to perform multi-level classification according to step S2 until the required query accuracy is achieved;
[0010] S4: Query the first-level list, and the system determines the query major category according to the first-level input;
[0011] S5: In the result set of the major category, perform custom classification according to the second- and third-level inputs for personalized query;
[0012] S6: According to the first-level query keyword, use query algorithm 1 to determine the query result set;
[0013] S7: On the basis of meeting the personalized query, sort and recommend according to the spatial attributes.
[0014] The specific implementation of the present invention is: common public service facilities such as parks, gas stations, hospitals, and schools.
[0015] The specific implementation of the present invention is: The second-level classification involves the association of attribute keywords with the first-level classification results, including but not limited to the following categories: the oil guns of gas stations are associated with oil numbers and oil products, and general hospitals are associated with departments and doctors.
[0016] The specific implementation of the present invention is: The query algorithm 1 includes the following steps:
[0017] a. Initialize the query point set and the result set;
[0018] b. Traverse each query source in the query set, and determine the first-level keyword result set according to the given spatial keyword;
[0019] c. For each query object in the result set composed of the first-level keywords, establish an R-tree index structure and put its corresponding Euclidean distance into the priority queue;
[0020] d. Traverse the nodes in the tree from the nearest to the farthest according to the Euclidean distance;
[0021] e. The element at the head of the queue dequeues. If the Euclidean distance is equal to the road network distance in the current candidate set, no calculation is performed and the result set is returned;
[0022] f. If the currently visited node is a leaf node, calculate the road network distance and update the candidate set;
[0023] g. If the current node is not a leaf node, traverse its child nodes. If the Euclidean distance of the child node is less than the current road network distance, then enqueue the child node and its Euclidean distance to the query point.
[0024] The specific implementation of the present invention is: in the step c, the node in the R-tree is the minimum bounding rectangle in space.
[0025] The specific implementation of the present invention is: in the step f, if the Euclidean distance is equal to the road network distance in the current candidate set, then return the result set.
[0026] Another object of the present invention is to provide an application of a method for querying a mixed keyword of road network space and attribute in a location-based service positioning system. The location-based service positioning system is configured with software for executing the above method to achieve efficient query based on the user's location and personalized attribute keywords.
[0027] Another object of the present invention is to provide a computer-readable storage medium, which stores a computer program for executing the above method, and is used to implement querying a mixed keyword of road network space and attribute in a location-based service positioning system.
[0028] Another object of the present invention is to provide an electronic device, including a processor and a memory. The memory stores a computer program, and the processor executes the computer program to implement the above method to provide a location-based service for querying a mixed keyword of road network space and attribute.
[0029] By adopting the above technical solutions, the present invention significantly improves the query efficiency through innovative first-level and multi-level partitioning methods. The present invention enables the system to quickly narrow the search range and directly focus on specific categories of interest to users, such as public service facilities like parks, gas stations, hospitals, and schools, thereby reducing the interference of useless information. Secondly, the present invention forms a more detailed second-level partitioning through the association of attribute keywords with categories, which not only improves the accuracy of query results but also better meets the personalized query needs of users. In addition, the query algorithm 1 of the present invention uses an R-tree to establish an index structure, optimizing the query process and ensuring that when dealing with complex multi-source query requirements, it can quickly and accurately return results.
[0030] The present invention is based on the systematic classification of target objects in the road network and the precise association of attribute keywords to achieve precise and efficient queries. Specifically, the present invention first makes a primary classification of the target objects according to their inherent tags, and then makes a secondary or deeper classification according to the attribute keywords to refine the query results. In terms of personalized queries, the present invention allows users to make a custom classification in the large-category result set according to the primary and secondary inputs for personalized queries. Query algorithm 1 is the core of the present invention. It initializes the query point set and the result set, traverses each query source in the query set, determines the primary keyword result set, uses an R-tree to establish an index structure, traverses the nodes in the tree from the nearest to the farthest according to the Euclidean distance, calculates the road network distance, and updates the candidate set, and finally determines the query result set.
[0031] The present invention makes primary, secondary, etc. classifications of real-world target entities and retrieves them according to the corresponding attribute tags, effectively improving the query efficiency, optimizing the query path, reducing unnecessary query nodes, significantly enhancing the query speed, enabling the system to quickly respond to users' query requests. In addition, by establishing a mapping relationship between keywords and attribute tags, under the initial multi-dimensional tag constraints, the present invention can further classify and grade the queries, and then guide users to make more explicit choices, meeting the characteristics of strong personalization of users' actual needs. According to the internal relationship between different constraint types, the present invention establishes a classification query condition model, and through the keyword mapping relationship, realizes the effective expression of implicit attributes, supports multiple constraint conditions, strengthens the expression ability of the system, and improves user satisfaction.
[0032] By configuring software to execute the above method, the present invention can achieve efficient queries based on the user's location and personalized attribute keywords, and realize applications in location-based service (LBS) positioning systems. Users can quickly obtain precise query results according to their own locations and specific needs, such as finding the nearest hospital or school. In addition, the present invention also provides a computer-readable storage medium storing a computer program for executing the above method, and an electronic device including a processor and a memory, and the processor executes the computer program stored in the memory to implement the above method. The implementation of the above method not only improves the query efficiency, but also greatly enhances the user experience, making the present invention have significant competitive advantages in providing location-based services with mixed keywords of road network space and attributes.
[0033] In summary, the present invention has the following beneficial effects:
[0034] 1. The present invention realizes in-depth personalized understanding and processing of user query requirements by innovatively introducing the mapping relationship of keywords and multi-dimensional label constraints. This allows the system, when receiving a user's query request, to not only consider the spatial distance but also comprehensively consider the user's personalized attribute keywords for classification and hierarchical processing. The present invention greatly improves the flexibility and accuracy of queries, enabling users to obtain query results that better meet their specific needs. In addition, the present invention can also guide users to make more explicit selections, optimizing the user experience and improving the accuracy and satisfaction of queries.
[0035] 2. The present invention effectively improves the query efficiency by dividing the target entities in the real world into first-level, second-level, and even multi-level categories and retrieving them according to the corresponding attribute labels. This not only reduces unnecessary query nodes but also speeds up the query speed, enabling the system to quickly respond to the user's query request. Compared with traditional flat queries, this hierarchical-based method can more effectively handle complex query conditions, especially in mixed queries where target entities belong to different categories. This method can significantly reduce the deviation between the result set and the user's intention, improving the accuracy and efficiency of queries. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 is a schematic flowchart of the method for querying based on a mixture of road network space and attribute keywords in Embodiment 1 of the present invention;
[0037] Figure 2 is a schematic diagram of Query Algorithm 1 in Embodiment 1 of the present invention;
[0038] Figure 3 is a schematic diagram of Query Algorithm 2 in Embodiment 2 of the present invention;
[0039] Figure 4 is a schematic diagram of the division of a hospital in Embodiment 2 of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0040] The following further elaborates on the present invention Figures 1-4 in conjunction with the accompanying drawings.
[0041] Precondition: The attribute data of existing target things is relatively complete. For example, a hospital should have department information and related introductions, including information such as doctors, facility conditions, evaluations, etc.; an administrative service center should have specific service departments and business information, etc.; in a social network, the overlap of hobbies among friends is conducive to initiating corresponding activities, etc. Therefore, graphic data information with relatively complete attribute data is required, such as electronic maps, social network graphs, etc.
[0042] Spatial keyword: Road network distance (or other metrics representing spatial cost, such as time cost, road cost, etc.).
[0043] Attribute keyword: Refers to the labeled keywords organized in a hierarchical structure, divided into levels such as primary level, secondary level, etc. The primary keyword is usually the main attribute of the space, and the secondary and tertiary keywords are the primary keys or other fields in the attribute table.
[0044] Embodiment 1: A method for querying based on a mixed keyword of road network space and attributes is as Figure 1 shown, including the following steps:
[0045] S1: Perform a primary division of the target features of the existing road network according to the target inherent labels;
[0046] Data collection: Collect detailed information of all target features in the road network, including but not limited to public service facilities such as parks, gas stations, hospitals, schools, etc.
[0047] Attribute definition: Define a set of inherent attribute labels for each target feature, and these labels should be able to accurately describe the main features of the feature. For example, for a gas station, the labels may include "number of fuel dispensers", "types of fuels provided", etc.
[0048] Classification storage: Classify the target features according to the defined inherent attribute labels, and store this classification information in the database. Each category has corresponding attribute fields for subsequent query and analysis.
[0049] S2: Determine whether there is a secondary division. If there is, on the basis of the primary division, associate the attribute keywords with the categories to form a secondary division; if there is no secondary division, directly proceed to step S4;
[0050] Attribute keyword identification: On the basis of the primary division, identify the attribute keywords that can be used for secondary division. For example, for a hospital, the secondary keywords may include "departments", "doctor specialties", etc.
[0051] Associate attributes: Associate the secondary keywords with the primary division results to form a more detailed classification. For example, associate "general hospital" with departments such as "cardiology department", "neurology department", etc.
[0052] Data update: Update the database to include the results of the secondary division, and add secondary attribute information to the features under each primary classification.
[0053] S3: For special target features, continue to perform multi-level division according to step S2 until the required query accuracy is achieved;
[0054] Special requirement identification: For users with special query requirements, identify whether further multi-level division is needed.
[0055] Multi-level attribute association: If necessary, continue to perform multi-level division according to the attribute keywords until the query accuracy required by the user is reached.
[0056] S4: Query the first-level list, and the system determines the query major category according to the first-level input.
[0057] User input: The user inputs the first-level query keyword through the interface, such as 'hospital'.
[0058] System response: The system retrieves all the feature lists belonging to this category from the database according to the first-level keyword input by the user and displays them to the user.
[0059] S5: In the result set of the major category, perform personalized query by custom division according to the second- and third-level inputs; Second-level input: On the basis of the first-level list, the user inputs the second-level keyword according to needs, such as 'cardiology'.
[0060] Result filtering: The system filters in the result set of the first-level list according to the second-level keyword to provide more accurate query results.
[0061] S6: According to the first-level query keyword, use query algorithm 1 to determine the query result set.
[0062] Determination of the query algorithm. According to the first-level query keyword, use query algorithm 1 to determine the query result set. Query algorithm 1 is as Figure 2 shown. Perform association queries on the second- and third-level attribute data in the first-level query result set, and filter and sort the first-level query results. The specific steps include:
[0063] a. Initialize the query point set and the result set.
[0064] b. Traverse each query source in the query set, and determine the first-level keyword result set according to the given spatial keyword.
[0065] c. For each query object in the result set composed of the first-level keywords, establish an R-tree index structure and put its corresponding Euclidean distance into the priority queue.
[0066] d. Traverse the nodes in the tree from the nearest to the farthest according to the Euclidean distance.
[0067] e. When the first element in the queue is processed, if its Euclidean distance is equal to the road network distance in the current candidate set, no further calculation is performed and the result set is directly returned.
[0068] f. If the currently visited node is a leaf node, that is, it has no child nodes, calculate its road network distance from the query point and update the candidate set according to this distance.
[0069] g. If the current node is not a leaf node, traverse its child nodes. For each child node, if its Euclidean distance is less than the current road network distance, add it and its Euclidean distance to the query point to the queue.
[0070] S7: On the basis of meeting the personalized query, sort and recommend the query results according to spatial attributes (such as time, distance, etc.). In the personalized query, sort according to the number of peer keywords satisfied.
[0071] Sorting of query results. On the basis of meeting the personalized query, sort and recommend according to spatial attributes (time, space, etc.). In the personalized query, sort according to the number of peer keywords satisfied.
[0072] Embodiment 2: In this example, taking road network data as the background, the hospital location selection and service area division are discussed, and the division results are as Figure 4 shown. The specific steps are as follows:
[0073] 1) Obtain the location information of existing residential areas.
[0074] 2) Obtain the location information of the locations where public service facilities can be built.
[0075] 3) According to Query Algorithm 2, as shown in Query Algorithm 2 Figure 3 shown, use the location of the hospital as the query source and the service targets (residential areas) of existing public service facilities as the targets to calculate the spatial distance and associate the attribute data. Calculate the total distance from all target objects to the query source (i.e., the aggregated value of their respective distances) through the algorithm; determine the service content that the public facilities should provide through the associated attribute data (for example: hospital floor area, number of departments, etc.).
[0076] 4) Sort in ascending order based on the total distance from the hospital to the residential areas, and further divide the levels according to the secondary and tertiary attribute keywords, that is, on the premise that the spatial distance is satisfied, the service level that satisfies more attribute keywords is higher. (For example: when the hospital area is large, it may provide more departments, where the department is the secondary keyword and the specific functional department is the tertiary keyword).
[0077] 5) Sort according to the service level to determine the specific location of the hospital
[0078] This embodiment is the reverse application of ordinary target query, where the secondary attributes of the location selection object are only used for sorting and do not involve query. In cases where attribute query is required, the content in lines 15 - 17 of Query Algorithm 1 should be combined for processing.
[0079] This specific embodiment is only an interpretation of the present invention and does not limit the present invention. After reading this specification, those skilled in the art may make modifications to this embodiment that do not contribute creatively, but as long as they are within the scope of the claims of the present invention, they are protected by the patent law.
Claims
1. A method for hybrid keyword query based on road network space and attributes, characterized by: The following steps are involved: S1: Divide the target objects in the existing road network into the first level according to the inherent labels of the targets; S2: Determine whether there is a secondary division. If so, associate the attribute keywords with the categories based on the primary division to form a secondary division. If there is no secondary division, proceed directly to step S4. S3: For special target objects, continue to perform multi-level division according to step S2 until the required query accuracy is achieved; S4: Query the first-level list, and the system determines the query category based on the first-level input; S5: In the large-category result set, customized division is performed based on the secondary and tertiary inputs for personalized query; S6: according to the primary query keyword, use query algorithm 1 to determine the query result set; S7: On the basis of satisfying personalized queries, recommendations are made based on spatial attributes.
2. The method according to claim 1, characterized in that: The first-level classification includes but is not limited to the following categories: common public service facilities such as parks, gas stations, hospitals, and schools.
3. The method according to claim 1 or 2, characterized in that: The secondary division involves the association between attribute keywords and the primary division results, including but not limited to the following categories: the oil guns at gas stations are associated with oil numbers and oil products, and comprehensive hospitals are associated with departments and doctors.
4. The method according to claim 1, characterized in that: The query algorithm 1 comprises the following steps: a. Initialize the query point set and result set; b. Traverse each query source in the query set and determine the primary keyword result set according to the given spatial keyword; c. For each query object in the result set consisting of the primary keywords, an R-tree index structure is established, and the corresponding Euclidean distance is put into the priority queue; d. Traverse the nodes in the tree from near to far according to the Euclidean distance; e. The first element of the team is removed from the queue. If the Euclidean distance is equal to the road network distance in the current candidate set, no calculation is performed and the result set is returned; f. If the currently visited node is a leaf node, calculate the road network distance and update the candidate set; g. If the current node is not a leaf node, traverse its child nodes. If the Euclidean distance of the child node is less than the current road network distance, put the child node and its Euclidean distance to the query point into the queue.
5. The method according to claim 4, characterized in that: In the step c, the nodes in the R-tree are the minimum spatial circumscribed rectangles.
6. The method according to claim 4, characterized in that: In the step f, if the Euclidean distance is equal to the road network distance in the current candidate set, the result set is returned.
7. An application of a hybrid keyword query method based on road network space and attributes in a location-based service positioning system, characterized in that: The location-based service positioning system is configured with software for executing any one of the methods in claims 1-6 above, so as to realize efficient query based on user location and personalized attribute keywords.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for executing any one of the methods in claims 1-6, and is used to implement mixed keyword queries based on road network space and attributes in a location-based service positioning system.
9. An electronic device comprising a processor and a memory, wherein the memory stores a computer program, wherein: The processor executes the computer program to implement any one of the methods in claims 1-6 above, so as to provide location-based services based on road network space and attribute hybrid keyword queries.