Geographic JSON (JavaScript Object Notation) data generation method and device, equipment, medium and program product

By acquiring geographic semantic keywords and generating GeoJSON data using a large language model, combined with R-tree indexes and format templates, the problem of low automation in the GeoJSON generation process is solved, achieving efficient and low-cost data generation and processing.

CN120832393APending Publication Date: 2025-10-24CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510948091.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-09
Publication Date
2025-10-24

AI Technical Summary

Technical Problem

Existing technologies suffer from problems such as high level of specialization, low automation, and high labor costs in the GeoJSON generation process.

Method used

By acquiring geographic semantic keywords, converting them into target spatial ranges, filtering spatial objects, extracting location and attribute information, generating GeoJSON data using a large language model, and combining R-tree indexes and GeoJSON format templates, the level of automation is improved.

Benefits of technology

It improves the efficiency of GeoJSON data generation, reduces labor costs, ensures data accuracy and consistency, and is suitable for map display and spatial analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120832393A_ABST
    Figure CN120832393A_ABST
Patent Text Reader

Abstract

The invention provides a geographic JSON data generation method and device, equipment, a medium and a program product, and relates to the technical field of artificial intelligence. The method comprises the steps that geographic semantic keywords are obtained, and the geographic semantic keywords are used for representing the query intention of a user in a geographic space; converting the geographic semantic keywords to obtain a target space range; space objects in the target space range are screened, a candidate space data list related to the target space is obtained, and the candidate space data list comprises identifiers corresponding to one or more candidate space objects; extracting position information and attribute information corresponding to each candidate spatial object in the candidate spatial data list, and constructing a geographic information cue word; and inputting the geographic information cue word and a preset GeoJSON format template into a pre-constructed large language model, and outputting GeoJSON data. According to the method and the device, the GeoJSON data generation efficiency can be improved, and meanwhile, the labor cost involved in the process is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of artificial intelligence, and particularly relates to a geographic JSON data generation method and device, equipment, medium and program product. BACKGROUND

[0002] As a provider of mobile communication services, operators naturally accumulate a large amount of spatial geographic information data such as mobile phone signaling data and base station location data due to their business nature and technical requirements. These data have important value for improving service quality, developing new services, and marketing, etc.

[0003] However, the original data is often not in a format suitable for direct use for these purposes, so when such data is applied to map visualization, spatial query and analysis, it is usually necessary to convert it into a standardized spatial structure data format (such as geographic JSON).

[0004] Geographic JSON (GeoJSON) is a format for encoding geographic data structures, whose syntax is completely consistent with the json format and is specifically used to represent geographic information. GeoJSON supports multiple geometric types including points, lines, faces, multi-points, multi-lines, multi-faces and geometric collections, etc.

[0005] In related technologies, the generation of GeoJSON mainly depends on artificial geographic information system (GIS) professionals. Specifically, artificial GIS usually refers to a traditional GIS system based on human design and development, rather than a system with higher automation or intelligence. Although it has certain data analysis capabilities, the process is highly professional and has low automation.

[0006] It should be noted that the information disclosed in the above background section is only used to strengthen the understanding of the background of the present disclosure, and therefore can include information that does not constitute prior art known to those of ordinary skill in the art. SUMMARY

[0007] The present disclosure provides a geographic JSON data generation method, device, equipment, medium and program product, which at least partially overcomes the problem of high professional and low automation in the related art.

[0008] Other characteristics and advantages of the present disclosure will become apparent from the following detailed description, or will be learned by practice of the present disclosure.

[0009] According to one aspect of the present disclosure, a geographic JSON data generation method is provided, comprising: obtaining a geographic semantic keyword, wherein the geographic semantic keyword is used to represent a user's query intention in a geographic space; converting the geographic semantic keyword to obtain a target space range; screening spatial objects in the target space range to obtain a candidate spatial data list related to the target space, wherein the candidate spatial data list contains identifiers corresponding to one or more candidate spatial objects; extracting position information and attribute information corresponding to each candidate spatial object in the candidate spatial data list to construct a geographic information prompt word; inputting the geographic information prompt word and a pre-set GeoJSON format template into a pre-constructed large language model to output GeoJSON data.

[0010] In some embodiments, before obtaining the geographic semantic keyword, the method further comprises: obtaining a spatial data set, wherein the spatial data set includes original spatial data of one or more spatial objects; obtaining identifiers and spatial geometric coordinates of each spatial object according to the spatial data set; calculating the minimum circumscribed rectangle corresponding to each object based on the spatial geometric coordinates of each spatial object; and constructing a target space index based on the identifiers and the minimum circumscribed rectangle corresponding to each spatial object.

[0011] In some embodiments, the obtaining of the geographic semantic keyword comprises: obtaining natural language query request information input by a user; inputting the natural language query request information into a pre-constructed natural language intention analysis model to output a geographic semantic keyword, wherein the geographic semantic keyword includes a spatial keyword and a point of interest category.

[0012] In some embodiments, the screening of the spatial objects in the target space range to obtain a candidate spatial data list related to the target space comprises: obtaining all spatial objects intersecting with the target space range as candidate spatial objects through the target space index; and obtaining a candidate spatial data list related to the target space according to the candidate spatial objects.

[0013] In some embodiments, the target space index is an R-tree space index.

[0014] In some embodiments, after inputting the geographic information prompt word and the pre-set GeoJSON format template into the pre-constructed large language model to output the GeoJSON data, the method further comprises: structurally verifying the GeoJSON data; if the verification is successful, storing the GeoJSON data into a pre-existing spatial database; and if the verification fails, reconstructing the large language model or starting a repair program.

[0015] According to another aspect of the present disclosure, a geographic JSON data generation apparatus is also provided, comprising: a geographic semantic keyword acquisition module configured to acquire a geographic semantic keyword, wherein the geographic semantic keyword is used to represent a query intention of a user in a geographic space; a target space range determination module configured to convert the geographic semantic keyword to obtain a target space range; a candidate space data list determination module configured to filter space objects in the target space range to obtain a candidate space data list related to a target space, wherein the candidate space data list comprises one or more identifiers corresponding to candidate space objects; a geographic information prompt word construction module configured to extract position information and attribute information corresponding to each candidate space object in the candidate space data list to construct a geographic information prompt word; and a GeoJSON data output module configured to input the geographic information prompt word and a pre-set GeoJSON format template into a pre-constructed large language model to output GeoJSON data.

[0016] According to another aspect of the present disclosure, an electronic device is also provided, comprising: a processor; and a memory configured to store executable instructions of the processor; wherein the processor is configured to execute any of the above-mentioned geographic JSON data generation methods via execution of the executable instructions.

[0017] According to another aspect of the present disclosure, a computer-readable storage medium is also provided, having a computer program stored thereon, wherein the computer program is executed by a processor to implement any of the above-mentioned geographic JSON data generation methods.

[0018] According to another aspect of the present disclosure, a computer program product is also provided, comprising a computer program, wherein the computer program is executed by a processor to implement any of the above-mentioned geographic JSON data generation methods.

[0019] The geographic JSON data generation method, apparatus, device, medium and program product provided in the embodiments of the present disclosure can improve the efficiency of generating GeoJSON data, while reducing the labor cost involved in the process.

[0020] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0021] The accompanying drawings, which are incorporated in and form a part of the specification, illustrate one embodiment of the present disclosure and, together with the description, serve to explain the principles of the disclosure. It is appreciated that the drawings described below are only some embodiments of the present disclosure, and other drawings can be obtained by those of ordinary skill in the art without creative effort on the basis of these drawings.

[0022] Figure 1 A flow chart of a geographic JSON data generation method in an embodiment of the present disclosure is shown;

[0023] Figure 2 A prompt word structure schematic diagram in an embodiment of the present disclosure is shown;

[0024] Figure 3 Another flow chart of a geographic JSON data generation method in an embodiment of the present disclosure is shown;

[0025] Figure 4 A schematic diagram of a geographic JSON data generation device in an embodiment of the present disclosure is shown;

[0026] Figure 5 A structural block diagram of an electronic device in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0027] Example implementations will now be described with reference to the drawings. However, example implementations can be implemented in numerous ways, and should not be construed as being limited to the examples set forth herein; rather, these implementations are provided so that this disclosure will be thorough and complete, and will fully convey the inventive concept to those skilled in the art. The described features, structures, or characteristics can be combined in one or more implementations.

[0028] In addition, the accompanying drawings are only schematic and are not necessarily drawn to scale. Identical reference signs refer to identical or similar parts throughout the several views of the drawings and a repeated description is omitted. Some of the blocks in the drawings can be functional building blocks, and do not necessarily have to correspond to a physical or logical entity. These functional building blocks can be implemented in software, or in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0029] The specific implementations of the embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.

[0030] Figure 1 A flowchart of a method for generating geographic JSON data in an embodiment of the present disclosure is shown as follows. Figure 1 The method includes the following steps:

[0031] S102, obtaining geographic semantic keywords, wherein the geographic semantic keywords are used to represent the query intention of the user in the geographic space.

[0032] In an embodiment of the present disclosure, the geographic semantic keywords can refer to the spatial keywords and point of interest categories obtained according to the natural language query request input by the user.

[0033] S104, converting the geographic semantic keywords to obtain a target spatial range.

[0034] In an embodiment of the present disclosure, the geographic semantic keywords can be converted by calling a geocoder, and then the geometric shape (such as a polygon, a point coordinate, or a minimum bounding rectangle MBR) of the spatial range is obtained as the target spatial range, that is, a spatial query window.

[0035] S106, screening the spatial objects in the target spatial range to obtain a candidate spatial data list related to the target space, wherein the candidate spatial data list contains one or more identifiers corresponding to the candidate spatial objects.

[0036] In an embodiment of the present disclosure, the spatial objects in the target spatial range are screened to exclude irrelevant spatial objects, and the candidate spatial objects are obtained, and then the candidate spatial data list related to the target space is obtained.

[0037] S108, extracting the position information and attribute information corresponding to each candidate spatial object in the candidate spatial data list to construct a geographic information prompt word.

[0038] In an embodiment of the present disclosure, the position information and attribute information corresponding to each candidate spatial object are extracted through the identifier corresponding to each candidate spatial object in the candidate spatial data list. Specifically, the position information can include points, lines, polygons, etc., and the attribute information can include names, types, addresses, etc., and the prompt word is constructed based on the above information.

[0039] S110, inputting the geographic information prompt word and the pre-set GeoJSON format template into a pre-constructed large language model to output GeoJSON data.

[0040] In one embodiment of the present disclosure, the geographic information prompt word can include but is not limited to a user query, a retrieved candidate spatial object, wherein each spatial object at least contains a name, a type, location information, attribute information, etc. After inputting the geographic information prompt word and the pre-set GeoJSON format template into the large model, the large model can automatically generate structured spatial data conforming to the GeoJSON standard according to the provided prompt content and format template. The GeoJSON data includes spatial geometric coordinates and attribute fields.

[0041] As can be seen from the above, by converting the obtained geographic semantic keywords, obtaining a target spatial range, and screening spatial objects in the target spatial range to obtain a candidate spatial data list related to the target space, the location information and attribute information corresponding to each candidate spatial object in the candidate spatial data list are extracted to construct a geographic information prompt word, and finally the geographic information prompt word is combined with the pre-set GeoJSON format template and input into the pre-constructed large language model to output GeoJSON data. The embodiment of the present disclosure can improve the efficiency of generating GeoJSON data, while reducing the labor cost involved in the process.

[0042] In one embodiment of the present disclosure, before S102, the method further comprises: obtaining a spatial data set, wherein the spatial data set includes original spatial data of one or more spatial objects; obtaining identifiers and spatial geometric coordinates of each spatial object according to the spatial data set; calculating the minimum bounding rectangle corresponding to each object based on the spatial geometric coordinates of each spatial object; and constructing a target space index based on the identifiers of each spatial object and the corresponding minimum bounding rectangle.

[0043] In one embodiment of the present disclosure, the spatial data set can refer to a data set containing original spatial data (such as points, lines, and surfaces) of multiple spatial objects, and can specifically refer to base station locations, road networks, administrative divisions, etc. The identifiers (such as base station IDs, administrative area codes, etc.) and spatial geometric coordinates of each spatial object are extracted from the spatial data set, wherein the identifier is used to uniquely identify a spatial object, and the spatial geometric coordinates can be represented as points, lines or polygons according to the different types of spatial objects, i.e. latitude and longitude coordinates, paths or closed areas.

[0044] According to the spatial geometric coordinates of each object, the corresponding minimum bounding rectangle MBR is calculated. For a point, the MBR can be regarded as the point itself; for a line or a polygon, all vertices need to be traversed to find the maximum and minimum X coordinate values and the maximum and minimum Y coordinate values to determine the boundary of the MBR.

[0045] In an embodiment of the present disclosure, the R-tree is a tree data structure specially used for storing and querying multi-dimensional information (such as geographic spatial data), which can be used as a target spatial index. The identifiers of various spatial objects and the corresponding MBRs are stored in the R-tree spatial index, at this time, each node in the R-tree represents an MBR, and can contain multiple child nodes or actual geographic objects. The root node contains the MBR of the entire data set, and the leaf node directly points to the specific geographic object. When performing a spatial query, the R-tree can quickly locate which nodes intersect with the query range, thereby reducing the amount of data that needs to be checked.

[0046] For example, the boundary data of B district in A city is obtained, and the corresponding MBR is calculated, and the administrative code of the boundary is stored in the R-tree spatial index.

[0047] In an embodiment of the present disclosure, the S102 includes: obtaining a natural language query request information input by a user; inputting the natural language query request information into a pre-constructed natural language intent analysis model to output a geographic semantic keyword, wherein the geographic semantic keyword includes a spatial keyword and a point of interest category.

[0048] In an embodiment of the present disclosure, the user inputs the own demand as the natural language query request information into the natural language intent analysis model, and the model extracts the spatial keyword and the point of interest category from the natural language query request information input by the user.

[0049] For example, the user queries “all restaurants in B district in A city”, and “B district in A city” is extracted as the spatial keyword, and “restaurant” is extracted as the point of interest category.

[0050] In an embodiment of the present disclosure, the Geocoder can be used to convert a human-readable address or location description into a computer-understandable coordinate or geometric shape. According to the extracted spatial keyword and the point of interest category, the Geocoder is called to obtain the geometric shape (such as a polygon, a point coordinate or an MBR) of the spatial range as the target spatial range.

[0051] In an embodiment of the present disclosure, the S106 includes: obtaining all spatial objects intersecting with the target spatial range as candidate spatial objects through the target spatial index; and obtaining a candidate spatial data list related to the target space according to the candidate spatial objects.

[0052] In an embodiment of the present disclosure, the above-mentioned geometric shape is taken as a spatial query window, i.e., a target spatial range, to find all spatial objects intersecting therewith as candidate spatial objects through a target spatial index. Compared with traversing the entire database without using an index, this step greatly reduces the amount of data to be processed, ensuring that the subsequent steps focus on the relevant area.

[0053] If the target spatial index is an R-tree spatial index at this time, the R-tree traverses the tree structure, quickly excludes those completely non-intersecting nodes, and returns a list of candidate spatial data intersecting with the spatial query window, which includes the identifiers of the respective candidate spatial objects.

[0054] In an embodiment of the present disclosure, the target spatial index is an R-tree spatial index.

[0055] In an embodiment of the present disclosure, the operator location data structured generation method combining the R-tree spatial index and the large model can automatically convert the natural language location request proposed by the user into a standardized GeoJSON structure, which can be used for map display, spatial analysis and intelligent decision-making.

[0056] For example, the R-tree spatial index is used to retrieve a list of Point of Interest IDs (POI_IDs) of all restaurants within the boundary range of the B district.

[0057] In an embodiment of the present disclosure, according to the identifiers of the respective candidate spatial objects included in the above-mentioned list of candidate spatial data, the location information and attribute information of the respective candidate spatial objects are obtained, and a complete prompt is constructed in combination with the pre-set GeoJSON format requirements.

[0058] Specifically, Figure 2 A prompt structure diagram in an embodiment of the present disclosure is shown, as shown in Figure 2 The prompt includes a format requirement part, a user query part and a candidate spatial object part.

[0059] The format requirement part includes: the output format must be a legal GeoJSON, ensuring that the generated data complies with the GeoJSON specification; each "Feature" contains a "geometry" field, which specifically includes the type and coordinates, and the type is "Point", "Polygon", etc.; a "properties" field, which specifically includes the name, category, administrative region, etc.; all coordinates are in the format of [longitude, latitude], ensuring that the generated data complies with the GeoJSON specification; please do not output any non-JSON text or explanation, only output pure JSON data without additional explanations; filter the spatial objects, only keep the objects that meet the user's query semantics, filter the data according to the user's query conditions, and exclude objects that do not meet the conditions.

[0060] The user query part includes: user query {user_query}, and according to the query content, it is inferred which spatial objects need to be kept, and data with attribute values that do not meet the conditions is excluded.

[0061] The candidate spatial object part includes: spatial related objects {retrieved_spatial_objects} retrieved by R-tree, wherein each spatial object contains the following fields: object name, object type (such as restaurant, library, park, etc.), geometry (including `type` and `coordinates`), and other additional information (such as administrative area, opening time, number of facilities, etc.).

[0062] It should be noted that the above prompt word structure can be adjusted according to actual needs, and the embodiments of the present disclosure do not make specific limitations thereto.

[0063] In an embodiment of the present disclosure, after S110, the method further includes: structurally verifying the GeoJSON data; if the verification is successful, storing the GeoJSON data to a pre-existing spatial database; if the verification fails, reconstructing or starting a repair program for the large language model.

[0064] In an embodiment of the present disclosure, the structured verification can include but is not limited to JSON format verification, spatial geometry validity check (such as polygon closure check) and attribute integrity verification.

[0065] If the verification is successful, the verified GeoJSON structured spatial data is stored in the spatial database, and data services are provided to the user or downstream system through a standard interface.

[0066] For example, the B district restaurant GeoJSON data is stored in the PostGIS database and provided to the front-end map display.

[0067] If the verification fails, i.e., errors or incompleteness are found, the system will correct them through automatic refactoring prompts, secondary model generation or automatic repair programs. Specifically, for large language models, automatic refactoring prompts refer to the system intelligently adjusting or optimizing the user's input prompts based on the results of the initial interaction to more accurately obtain the required information or results, such as checking whether the GeoJSON file meets the standard, whether the coordinates are accurate, whether the attribute fields are complete, etc., and making necessary corrections; secondary model generation refers to calling the large language model again based on the initial results to further refine the output after preliminary processing, for example, in the process of creating GeoJSON data, the first call can be used to identify and parse the basic attributes of spatial objects (name, type, etc.), and the second call focuses on generating geometric coordinates or adding detailed attribute fields. For the entire system, the automatic repair program refers to the system's ability to detect errors and automatically correct them, such as checking whether the GeoJSON file meets the standard, whether the coordinates are accurate, whether the attribute fields are complete, etc., and making necessary corrections.

[0068] Figure 3 Another flowchart of a method for generating geographic JSON data in an embodiment of the present disclosure is shown, as shown in Figure 3 The method comprises:

[0069] S301, spatial data preprocessing and storage.

[0070] In an embodiment of the present disclosure, identifiers (such as base station ID, administrative district code, etc.) and spatial geometric coordinates of each spatial object are extracted from the original spatial data (such as points, lines, and surfaces), and the minimum bounding rectangle (MBR) of each object is calculated according to the spatial geometric coordinates, and then the identifier of the object and its corresponding MBR are stored in the R-tree spatial index, so as to facilitate subsequent efficient spatial queries.

[0071] S302, natural language spatial intent analysis on user questions.

[0072] In an embodiment of the present disclosure, the user raises a query request through natural language, and the system extracts key spatial information and point of interest categories from it using large model technology.

[0073] It should be noted that the large model here can be any model that can realize natural language analysis function, and the type of large model is not limited in the embodiments of the present disclosure.

[0074] S303, spatial retrieval and candidate data acquisition.

[0075] In one embodiment of the present disclosure, according to the extracted spatial keywords and point of interest categories, a geocoder is called to obtain the geometric shape (such as a polygon, point coordinates, or MBR) of the spatial range corresponding to the spatial keywords. This geometric shape or its MBR is used as a spatial query window to retrieve the target spatial range through an R-tree spatial index, and a list of identifiers of candidate spatial objects is obtained. Through the preliminary screening of the R-tree, a list of candidate data related to the target spatial range is obtained. Compared with traversing the entire database without using an index, this step greatly reduces the amount of data to be processed, ensuring that the subsequent steps focus on the relevant area.

[0076] S304, constructing a prompt word prompt.

[0077] In one embodiment of the present disclosure, according to the list of identifiers of candidate spatial objects, the spatial geometric coordinates and attributes corresponding to each spatial object are determined, and a complete prompt is constructed according to the pre-set GeoJSON format requirements, and provided to the large language model, so that the large language model generates GeoJSON corresponding to natural language. The prompt is used to guide the large model to generate a GeoJSON file that meets the requirements

[0078] S305, generating GeoJSON data based on the large language model.

[0079] In one embodiment of the present disclosure, the large language model automatically generates structured spatial data conforming to the GeoJSON standard according to the provided prompt content and format template, including spatial geometric coordinates and attribute fields.

[0080] S306, verifying and optimizing the generated results.

[0081] In one embodiment of the present disclosure, the generated GeoJSON results are structurally verified, including JSON format verification, spatial geometric validity check (such as polygon closure check), and attribute integrity verification. If errors or incompleteness are found, automatic reconfiguration prompts, secondary model generation, or automatic repair programs are used for correction.

[0082] S307, storing and publishing the generated results.

[0083] In one embodiment of the present disclosure, the verified GeoJSON structured spatial data is stored in a spatial database (such as PostGIS), and data services are provided to users or downstream systems through standard interfaces.

[0084] In one embodiment of the present disclosure, by introducing an R-tree spatial index, the real spatial data (such as actual base station locations) related to the query range is quickly located, providing accurate context support for large models, improving the efficiency and accuracy of spatial data generation, and greatly reducing the "illusion" phenomenon (fictitious coordinates or incorrect attributes) when a pure large language model (LLM) generates spatial data. At the same time, it can automatically convert the natural language location request proposed by the user into a standardized GeoJSON structure, which can be used for map display, spatial analysis and intelligent decision-making, with high spatial data generation efficiency and significantly reduced manual intervention. In addition, by inputting prompt words and pre-set format templates into the large language model, the spatial accuracy and format consistency of the generated data are significantly enhanced, making the output conform to the standard GeoJSON and directly usable in GIS systems, facilitating subsequent spatial data processing.

[0085] Based on the same inventive concept, the present disclosure also provides a geographic JSON data generation device, as described in the following embodiments. Since the principles of the device embodiments solve the problem are similar to the above-mentioned method embodiments, the implementation of the device embodiments can be referred to the implementation of the above-mentioned method embodiments, and the repeated parts will not be repeated.

[0086] Figure 4 A schematic diagram of a geographic JSON data generation device in an embodiment of the present disclosure is shown, as shown in Figure 4 The device includes a geographic semantic keyword acquisition module 401, a target spatial range determination module 402, a candidate spatial data list determination module 403, a geographic information prompt word construction module 404, and a GeoJSON data output module 405.

[0087] The geographic semantic keyword acquisition module 401 is configured to acquire geographic semantic keywords, wherein the geographic semantic keywords are used to represent the user's query intention in the geographic space. The target spatial range determination module 402 is configured to convert the geographic semantic keywords to obtain a target spatial range. The candidate spatial data list determination module 403 is configured to filter the spatial objects in the target spatial range to obtain a candidate spatial data list related to the target space, wherein the candidate spatial data list contains one or more identifiers corresponding to the candidate spatial objects. The geographic information prompt word construction module 404 is configured to extract the position information and attribute information of each candidate spatial object in the candidate spatial data list to construct geographic information prompt words. The GeoJSON data output module 405 is configured to input the geographic information prompt words and the pre-set GeoJSON format template into the pre-constructed large language model to output the GeoJSON data.

[0088] As can be known from the above, by converting the obtained geographic semantic keywords, the target space range is obtained, and the spatial objects in the target space range are screened to obtain a candidate spatial data list related to the target space. By extracting the position information and attribute information corresponding to each candidate spatial object in the candidate spatial data list, a geographic information prompt word is constructed, and finally the geographic information prompt word is combined with the pre-set GeoJSON format template and input into the pre-constructed large language model to output the GeoJSON data. The efficiency of generating the GeoJSON data can be improved, and the labor cost involved in the process can be reduced.

[0089] In an embodiment of the present disclosure, the device further comprises a target space index construction module 406 configured to obtain a spatial data set, wherein the spatial data set comprises original spatial data of one or more spatial objects; obtain identifiers and spatial geometric coordinates of the spatial objects according to the spatial data set; calculate the minimum bounding rectangle corresponding to each spatial object based on the spatial geometric coordinates of the spatial objects; and construct a target space index based on the identifiers of the spatial objects and the minimum bounding rectangles corresponding thereto.

[0090] In an embodiment of the present disclosure, the spatial data set can refer to a data set containing original spatial data (such as points, lines, and surfaces) of a plurality of spatial objects, and can specifically refer to base station locations, road networks, administrative divisions, and the like. The identifiers (such as base station IDs, administrative area codes, and the like) and spatial geometric coordinates of the spatial objects are extracted from the spatial data set, wherein the identifier is used to uniquely identify a spatial object, and the spatial geometric coordinates can be expressed as a point, a line, or a polygon according to the different types of spatial objects, i.e., longitude and latitude coordinates, a path, or a closed area.

[0091] According to the spatial geometric coordinates of each object, the corresponding minimum bounding rectangle MBR is calculated. For a point, the MBR can be regarded as the point itself; for a line or a polygon, all vertices need to be traversed to find the maximum and minimum X coordinate values and the maximum and minimum Y coordinate values, so as to determine the boundary of the MBR.

[0092] In an embodiment of the present disclosure, the R-tree is a tree-shaped data structure specially used for storing and querying multidimensional information (such as geographic spatial data), and can be used as a target space index. The identifiers of the spatial objects and the corresponding MBRs are stored in the R-tree space index, at this time, each node in the R-tree represents an MBR, and can contain multiple child nodes or actual geographic objects. The root node contains the MBR of the entire data set, and the leaf node directly points to a specific geographic object. When performing a spatial query, the R-tree can quickly locate which nodes intersect with the query range, thereby reducing the amount of data that needs to be checked.

[0093] In one embodiment of the present disclosure, the geographic semantic keyword obtaining module 401 described above is further configured to obtain natural language query request information input by a user, input the natural language query request information into a pre-constructed natural language intention analysis model, and output geographic semantic keywords, wherein the geographic semantic keywords include a spatial keyword and a point of interest category.

[0094] In one embodiment of the present disclosure, a user inputs his / her own demand as natural language query request information into a natural language intention analysis model, and the model extracts the natural language query request information input by the user to obtain a spatial keyword and a point of interest category.

[0095] In one embodiment of the present disclosure, a geographic encoder Geocoder can be used to convert a human-readable address or location description into a coordinate or geometric shape that can be understood by a computer. According to the extracted spatial keyword and point of interest category, the Geocoder is called to obtain a geometric shape (such as a polygon, a point coordinate, or an MBR) of a spatial range as a target spatial range.

[0096] In one embodiment of the present disclosure, the candidate spatial data list determining module 403 described above is further configured to obtain all spatial objects intersecting with the target spatial range as candidate spatial objects through a target spatial index, and obtain a candidate spatial data list related to the target spatial range according to the candidate spatial objects.

[0097] In one embodiment of the present disclosure, the geometric shape obtained above is taken as a spatial query window, i.e., a target spatial range, all spatial objects intersecting with the target spatial range are found as candidate spatial objects through a target spatial index. Compared with traversing the entire database without using an index, this step greatly reduces the amount of data to be processed, and ensures that the subsequent steps focus on the relevant area.

[0098] If the target spatial index is an R-tree spatial index at this time, the R-tree traverses the tree structure, quickly excludes nodes that do not intersect at all, and returns a candidate spatial data list intersecting with the spatial query window, which includes identifiers corresponding to various candidate spatial objects.

[0099] In one embodiment of the present disclosure, the target spatial index is an R-tree spatial index.

[0100] In one embodiment of the present disclosure, according to the identifiers corresponding to various candidate spatial objects in the candidate spatial data list described above, the position information and attribute information corresponding to various candidate spatial objects are obtained, and a complete prompt word prompt is constructed in combination with a pre-set GeoJSON format requirement.

[0101] In one embodiment of the present disclosure, the apparatus further comprises a data structured verification module 407 for structured verification of the GeoJSON data; if the verification is successful, the GeoJSON data is stored to the pre-existing spatial database; if the verification fails, the large language model is restructured or a repair program is started.

[0102] In one embodiment of the present disclosure, the structured verification can include, but is not limited to, JSON format verification, spatial geometry validity check (such as polygon closure check) and attribute integrity verification.

[0103] If the verification is successful, the verified GeoJSON structured spatial data is stored in the spatial database, and data services are provided to users or downstream systems through standard interfaces. For example, the B district restaurant GeoJSON data is stored in the PostGIS database and provided to the front-end map display.

[0104] If the verification fails, i.e., errors or incompleteness are found, the correction is made through automatic restructuring prompts, secondary model generation or automatic repair programs. Specifically, for the large language model, the automatic restructuring prompt means that the system intelligently adjusts or optimizes the user's input prompts based on the results of the initial interaction, so as to more accurately obtain the required information or results, such as checking whether the GeoJSON file meets the standard, whether the coordinates are accurate, whether the attribute fields are complete, etc., and making necessary corrections; the secondary model generation means that after the preliminary processing, the large language model is called again based on the initial results to further refine the output, for example, in the process of creating GeoJSON data, the first call can be used to identify and parse the basic attributes (name, type, etc.) of spatial objects, and the second call focuses on generating geometric coordinates or adding detailed attribute fields. For the entire system, the automatic repair program means that the system has the ability to detect errors and automatically correct them, such as checking whether the GeoJSON file meets the standard, whether the coordinates are accurate, whether the attribute fields are complete, etc., and making necessary corrections.

[0105] Those skilled in the art can understand that each aspect of the present disclosure can be implemented as a system, a method or a program product. Therefore, each aspect of the present disclosure can be embodied as a whole hardware embodiment, a whole software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects, which can be collectively referred to as "circuitry", "module" or "system" here.

[0106] The electronic device 500 according to this embodiment of the present disclosure will be described below with reference to Figure 5 Figure 5 ​The electronic device 500 shown is merely one example and should not be taken as limiting the scope of the present disclosure.

[0107] As shown in Figure 5 The electronic device 500 is in the form of a general computing device. Components of the electronic device 500 can include, but are not limited to, the at least one processing unit 510 described above, the at least one storage unit 520 described above, and a bus 530 that connects the different system components including the storage unit 520 and the processing unit 510.

[0108] The storage unit stores program codes that can be executed by the processing unit 510, so that the processing unit 510 performs the steps described in the above “Exemplary Method” section according to various exemplary embodiments of the present disclosure. For example, the processing unit 510 can perform the following steps of the above method embodiments: obtaining a geographic semantic keyword, wherein the geographic semantic keyword is used to represent the user's query intention in the geographic space; converting the geographic semantic keyword to obtain a target spatial range; filtering spatial objects in the target spatial range to obtain a candidate spatial data list related to the target space, wherein the candidate spatial data list contains one or more identifiers corresponding to candidate spatial objects; extracting position information and attribute information corresponding to each candidate spatial object in the candidate spatial data list to construct a geographic information prompt word; and inputting the geographic information prompt word and a pre-set GeoJSON format template into a pre-constructed large language model to output GeoJSON data.

[0109] The storage unit 520 can include a readable medium in the form of volatile storage such as a random access memory (RAM) 5201 and / or cache memory 5202, and can further include a read-only memory (ROM) 5203.

[0110] The storage unit 520 can further include a program / utility 5204 having a set of program modules 5205 such as an operating system, one or more application programs, other program modules, and program data, each of which can govern aspects of the operation of the device. Examples of program modules that might be included are applications program that implement word processing, spreadsheet, database, and / or other multimedia programs.

[0111] The bus 530 can be representative of one or more of several types of bus structures, including a storage bus or bus controller, a peripheral bus, a graphics bus, a processing bus, and a local bus using any of a variety of bus architectures.

[0112] The electronic device 500 can also communicate with one or more external devices 540 such as a keyboard or pointing device, a Bluetooth device, or a database, and / or one or more devices that enable a user to interact with the electronic device 500 and / or one or more devices (e.g., routers, modems, or the like) that enable the electronic device 500 to communicate with one or more other computing devices. Such communication can occur via Input / Output (I / O) interface 550. Still yet, the electronic device 500 can communicate with one or more networks, such as a local area network (LAN), a wide area network (WAN), and / or the Internet, through a network adapter 560. As depicted, the network adapter 560 communicates with the other components of the electronic device 500 via bus 530. It should be appreciated that although not shown, other hardware and / or software modules could be used in connection with the electronic device 500. Such modules can include, but are not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archival storage systems, etc.

[0113] Those skilled in the art will readily understand that the example embodiments described herein can be implemented by software and / or by hardware coupled with software, as described above. Thus, the technical solutions of the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash disk, a mobile hard disk, or the like) or a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to perform the methods according to the embodiments of the present disclosure.

[0114] Based on the same inventive concept, the present disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the geographic JSON data generation method of any one of the above. Since the problem-solving principle of the computer-readable storage medium embodiment is similar to that of the above method embodiment, the implementation of the computer-readable storage medium embodiment can be referred to the implementation of the above method embodiment, and the repeated parts will not be described here.

[0115] More specific examples of the computer-readable storage medium in the present disclosure can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0116] In this disclosure, a computer readable storage medium can include a data signal transporting or broadcasting computer readable program code embodied in the data signal. The data signal can also be transmitted over a network including the Internet. Additionally, the computer readable storage medium can also be any tangible storage medium which can be used to store and / or carry the program codes.

[0117] Optionally, program code embodied on a computer readable storage medium can also be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0118] In an implementation, the program code for carrying out operations of the present disclosure can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ and the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computing device, partly on the user's computing device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server. In the latter scenario, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computing device, such as through the Internet using an Internet Service Provider (ISP).

[0119] Based on the same inventive concept, the present disclosure also provides a computer program product, including a computer program product, including: a computer program or instructions, which, when executed by a processor, implements the geographic JSON data generation method of any one of the above method embodiments. Since the principle of solving problems of this computer program product embodiment is similar to the above method embodiments, the implementation of this computer program product embodiment can be referred to the implementation of the above method embodiments, and the repeated parts will not be described here.

[0120] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, such division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into a plurality of modules or units.

[0121] Moreover, although individual steps of the methods in the present disclosure are described in a particular order in the drawings, this is not required or implied, nor is it necessary to perform all of the steps shown to achieve the desired result. Additionally or alternatively, certain steps can be omitted, combined into a single step, performed in a different order, broken down into multiple steps, and / or the like.

[0122] Those skilled in the art will readily understand that the example embodiments described herein can be implemented by software and / or by hardware coupled with software, as described above. Thus, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash disk, a mobile hard disk, or the like) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to perform the methods according to the embodiments of the present disclosure.

[0123] Other embodiments of the present disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure following the general principles thereof and including such departures from the present disclosure that come within known use or custom in the art to which the present disclosure pertains. The specification and examples are to be regarded as illustrative only, and the true scope and spirit of the present disclosure are indicated by the appended claims.

Claims

1. A method for generating geographic JSON data, characterized by, The method comprises the following steps: acquiring a geographic semantic keyword, wherein the geographic semantic keyword is used to represent a query intention of a user in a geographic space; converting the geographic semantic keyword to obtain a target space range; screening spatial objects in the target space range to obtain a candidate spatial data list related to the target space, wherein the candidate spatial data list contains identifiers corresponding to one or more candidate spatial objects; extracting position information and attribute information corresponding to each candidate spatial object in the candidate spatial data list to construct a geographic information prompt word; inputting the geographic information prompt word and a pre-set GeoJSON format template into a pre-constructed large language model to output GeoJSON data.

2. The geographic JSON data generation method according to claim 1, characterized in that: Before acquiring the geographic semantic keyword, the method further comprises the following steps: acquiring a spatial data set, wherein the spatial data set contains original spatial data of one or more spatial objects; obtaining identifiers and spatial geometric coordinates of each spatial object according to the spatial data set; calculating the minimum circumscribed rectangle corresponding to each object based on the spatial geometric coordinates of each spatial object; constructing a target space index based on the identifiers and the minimum circumscribed rectangle corresponding to each spatial object. 3.The method of claim 1, wherein, The step of acquiring the geographic semantic keyword comprises the following steps: acquiring a natural language query request information input by a user; inputting the natural language query request information into a pre-constructed natural language intention analysis model to output a geographic semantic keyword, wherein the geographic semantic keyword comprises a spatial keyword and a point of interest category. 4.The method of claim 2, wherein, The step of screening spatial objects in the target space range to obtain a candidate spatial data list related to the target space comprises the following steps: obtaining all spatial objects intersecting with the target space range as candidate spatial objects through the target space index; obtaining a candidate spatial data list related to the target space according to the candidate spatial objects. 5.The method according to claim 2 or 4, wherein, The target space index is an R-tree space index. 6.The method of Claim 1, wherein, After inputting the geographic information prompt word and the pre-set GeoJSON format template into the pre-constructed large language model to output the GeoJSON data, the method further comprises the following steps: performing structural verification on the GeoJSON data; if the verification is successful, storing the GeoJSON data into a pre-existing spatial database; if the verification fails, reconstructing the large language model or starting a repair program.

7. A geographic JSON data generating apparatus characterized by comprising: The method comprises the following steps: a geographic semantic keyword acquisition module is configured to acquire a geographic semantic keyword, wherein the geographic semantic keyword is used to represent a query intention of a user in a geographic space; a target space range determination module is configured to convert the geographic semantic keyword to obtain a target space range; a candidate spatial data list determination module is configured to screen spatial objects in the target space range to obtain a candidate spatial data list related to the target space, wherein the candidate spatial data list contains identifiers corresponding to one or more candidate spatial objects; The geographic information prompt word construction module is configured to extract position information and attribute information corresponding to each candidate spatial object in the candidate spatial data list, and construct a geographic information prompt word. The GeoJSON data output module is configured to input the geographic information prompt word and a pre-set GeoJSON format template into a pre-constructed large language model, and output GeoJSON data.

8. An electronic device, comprising: Comprise: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the executable instructions to perform the geographic JSON data generation method of any one of claims 1-6.

9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to realize the geographic JSON data generation method of any one of claims 1-6.

10. A computer program product, comprising: Computer programs or instructions, characterized in that the computer programs or instructions are executed by the processor to realize the geographic JSON data generation method of any one of claims 1-6.

Citation Information

Cited By

  • Address and entity identification method and system based on large language model and retrieval enhancement

    CN122087088A