Geographic region division method and device
By acquiring and marking the raster data and unit data of the geographical area, and using preset constraints and models to divide the geographical area, the problem of poor geographical area division in the existing technology is solved, and more efficient grid division and drawing is achieved .
Patent Information
- Application Number
- CN202310806972.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-03
- Publication Date
- 2025-01-03
AI Technical Summary
In the prior art, it is impossible to effectively divide and grid drawing based on regional unit data and unit feature information by manually dividing geographical areas, resulting in poor geographical area division effect.
By obtaining the geographic raster data and regional unit data of the geographical area, marking the geographic raster data based on the unit feature information, obtaining the raster feature information, and using preset constraints and a pre-trained geographical area division model for region division, Increase the proportion of the same type of geographic grid within the same grid.
The effect of geographical area division is improved, and the geographical area division and grid drawing are performed through grid feature information, which enhances the proportion of the same type of geographical rasters in the same grid.
Smart Images

Figure CN119251428A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data technology, and in particular to a method and device for dividing geographical areas. Background Art
[0002] In order to achieve refined business operations, it is necessary to divide geographical areas and draw grids. The current geographical area division scheme is to manually divide and grid the geographical raster data according to geographical areas.
[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0004] Manual geographic region division cannot be performed and grids drawn based on regional unit data and unit characteristic information, resulting in poor results in geographic region division. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a method and device for dividing geographic areas, which can mark geographic raster data according to regional unit data and unit feature information, obtain raster feature information of the geographic raster data, and then use the raster feature information to divide geographic areas and draw grids, and through constraint conditions and geographic area division models, can increase the proportion of geographic raster of the same type in the same grid, thereby improving the effect of geographic area division.
[0006] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for dividing geographical areas is provided.
[0007] A method for dividing a geographic area comprises: in response to a request for dividing a geographic area, obtaining geographic raster data and regional unit data of the geographic area, wherein the regional unit data has unit characteristic information; marking the geographic raster data according to the unit characteristic information of the regional unit data to obtain raster characteristic information of the geographic raster data; and performing regional division according to the geographic raster data and the corresponding raster characteristic information through a pre-trained geographic area division model based on preset constraints.
[0008] Optionally, the geographic raster data includes longitude and latitude information corresponding to each geographic raster, and the regional unit data includes the area of each regional unit. The geographic raster data is marked according to the unit characteristic information of the regional unit data to obtain the raster characteristic information of the geographic raster data, including: for each geographic raster in the geographic raster data, the area of the geographic raster is calculated according to the longitude and latitude information of the geographic raster, and the intersection area of the geographic raster and each of the regional units is calculated; the geographic raster is marked according to the unit characteristic information of the regional unit with the largest intersection area to obtain the raster characteristic information of the geographic raster; and the raster characteristic information of the geographic raster data is obtained according to the raster characteristic information of each geographic raster.
[0009] Optionally, based on preset constraints, regional division is performed through a pre-trained geographic region division model according to the geographic raster data and corresponding raster feature information, including: based on preset constraints, according to the raster feature information, aggregating the geographic raster data to generate first grid data; merging the first grid data according to edge data of the first grid data to generate second grid data; determining raster data to be optimized through the second grid data, optimizing the raster data to be optimized, so as to perform regional division according to the optimization processing result.
[0010] Optionally, the constraint condition includes: the overall Gini index value reaches a preset overall Gini index target, and the overall Gini index value is generated in the following manner: for each first grid in the first grid data, the grid Gini index value of the first grid is calculated according to the grid feature information corresponding to the first grid; and the overall Gini index value is generated through the grid Gini index values of all the first grids.
[0011] Optionally, the raster feature information includes a raster type, and the aggregation processing of the geographic raster data according to the raster feature information to generate first grid data includes: performing a first aggregation processing on geographic rasters with the same raster type according to the raster feature information to obtain first raster data, and obtaining the raster type of the first raster data according to the raster type corresponding to the geographic raster before the first aggregation processing; performing a second aggregation processing on the first raster in the first raster data that is within a set range and whose raster type similarity meets a set threshold to generate the first grid data.
[0012] Optionally, the grid feature information includes a grid type, and the merging of the first grid data based on the edge data of the first grid data to generate the second grid data includes: merging the first grid in the first grid data according to a preset merging condition to generate the second grid data, wherein the merging condition includes one or more of the same grid type, the same edge data, and being adjacent.
[0013] Optionally, determining the grid data to be optimized through the second grid data includes: identifying boundary grids located at the boundary in the second grid data; randomly constructing all boundary grids according to the number of grids to generate no less than one third grid, and generating the grid data to be optimized based on the third grid whose number of grids is greater than a preset number threshold.
[0014] Optionally, the optimization processing of the grid data to be optimized includes: for each grid to be optimized in the grid data to be optimized, selecting a target second grid from second grids adjacent to the grid to be optimized; based on the constraint condition, verifying the target second grid, and if the verification passes, moving the grid to be optimized from the second grid to which it currently belongs to the target second grid.
[0015] According to another aspect of an embodiment of the present invention, a device for dividing a geographical area is provided.
[0016] A device for dividing geographic areas, comprising: a request response module, used to respond to a request for dividing a geographic area, and obtain geographic raster data and regional unit data of the geographic area, wherein the regional unit data has unit feature information; a marking module, used to mark the geographic raster data according to the unit feature information of the regional unit data, and obtain the raster feature information of the geographic raster data; and a regional division module, used to perform regional division based on preset constraints, according to the geographic raster data and the corresponding raster feature information, through a pre-trained geographic area division model.
[0017] Optionally, the geographic grid data includes longitude and latitude information corresponding to each geographic grid, and the regional unit data includes the area of each regional unit. The marking module is also used to: for each geographic grid in the geographic grid data, calculate the area of the geographic grid according to the longitude and latitude information of the geographic grid, and calculate the intersection area between the geographic grid and each of the regional units; mark the geographic grid according to the unit feature information of the regional unit with the largest intersection area to obtain the grid feature information of the geographic grid; and obtain the grid feature information of the geographic grid data according to the grid feature information of each geographic grid.
[0018] Optionally, the region division module is also used to: based on preset constraints, aggregate the geographic raster data according to the raster feature information to generate first grid data; merge the first grid data according to the edge data of the first grid data to generate second grid data; determine the raster data to be optimized through the second grid data, optimize the raster data to be optimized, and perform region division according to the optimization processing results.
[0019] Optionally, the constraint conditions include: the overall Gini index value reaches a preset overall Gini index target, and the area division module is further used to: for each first grid in the first grid data, calculate the grid Gini index value of the first grid according to the grid feature information corresponding to the first grid; and generate the overall Gini index value through the grid Gini index values of all the first grids.
[0020] Optionally, the raster feature information includes a raster type, and the area division module is further used to: perform a first aggregation process on geographic rasters with the same raster type according to the raster feature information to obtain first raster data, and obtain the raster type of the first raster data according to the raster type corresponding to the geographic raster before the first aggregation process; perform a second aggregation process on the first raster in the first raster data that is within a set range and whose raster type similarity meets a set threshold, to generate the first grid data.
[0021] Optionally, the grid feature information includes a grid type, and the area division module is further used to: merge the first grid in the first grid data according to a preset merging condition to generate the second grid data, wherein the merging condition includes one or more of the same grid type, the same edge data, and being adjacent.
[0022] Optionally, the area division module is also used to: identify boundary grids located at the boundary in the second grid data; randomly construct all boundary grids according to the number of grids to generate no less than one third grid, and generate the grid data to be optimized based on the third grid whose number of grids is greater than a preset number threshold.
[0023] Optionally, the area division module is also used to: for each grid to be optimized in the grid data to be optimized, select a target second grid from the second grids adjacent to the grid to be optimized; based on the constraint condition, verify the target second grid, and if the verification passes, move the grid to be optimized from the second grid to which it currently belongs to the target second grid.
[0024] According to yet another aspect of the embodiments of the present invention, an electronic device is provided.
[0025] An electronic device includes: one or more processors; a memory for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method for dividing geographical areas provided by an embodiment of the present invention.
[0026] According to yet another aspect of an embodiment of the present invention, a computer readable medium is provided.
[0027] A computer readable medium stores a computer program, which, when executed by a processor, implements the method for dividing geographical areas provided in an embodiment of the present invention.
[0028] An embodiment of the above invention has the following advantages or beneficial effects: by responding to a request for division of a geographic area, geographic raster data and regional unit data of the geographic area are obtained, and the regional unit data has unit feature information; according to the unit feature information of the regional unit data, the geographic raster data is marked to obtain the raster feature information of the geographic raster data; based on preset constraints, according to the geographic raster data and the corresponding raster feature information, a technical solution for regional division is performed through a pre-trained geographic area division model, which can mark the geographic raster data according to the regional unit data and the unit feature information to obtain the raster feature information of the geographic raster data, and then use the raster feature information to perform geographic area division and grid drawing, and through the constraints and the geographic area division model, the proportion of geographic raster of the same type in the same grid can be increased, thereby improving the effect of geographic area division.
[0029] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0031] Figure 1 is a schematic diagram of main steps of a method for dividing geographical areas according to an embodiment of the present invention;
[0032] Figure 2 is a schematic flow chart of a method for dividing geographical areas according to an embodiment of the present invention;
[0033] Figure 3 is a schematic diagram of main modules of a device for dividing geographical areas according to an embodiment of the present invention;
[0034] Figure 4 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0035] Figure 5It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0036] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0037] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of the present invention are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.
[0038] Figure 1 4 is a schematic diagram of main steps of a method for dividing geographical areas according to an embodiment of the present invention.
[0039] like Figure 1 As shown, a method for dividing geographical areas according to an embodiment of the present invention mainly includes the following steps S101 to S103.
[0040] Step S101: in response to a request for dividing a geographic area, obtaining geographic grid data and regional unit data of the geographic area, where the regional unit data may have unit characteristic information.
[0041] The geographic grid data may include at least one geographic grid (obtained by dividing the geographic area into rectangular grids or polygonal grids), and the longitude and latitude information corresponding to each geographic grid (for example, the maximum and minimum longitude and latitude of the rectangular grid), the area unit data may include the area of each area unit, and the grid feature information may include the grid type and grid identification. The area unit data may be AOI data (Area of Interest, i.e., area of interest data), and the AOI is composed of polygonal fence boundaries and feature data.
[0042] Step S102: marking the geographic raster data according to the unit characteristic information of the regional unit data to obtain the raster characteristic information of the geographic raster data.
[0043] In one embodiment, geographic raster data is marked according to the unit characteristic information of the regional unit data to obtain the raster characteristic information of the geographic raster data, which may include: for each geographic raster in the geographic raster data, the area of the geographic raster is calculated according to the latitude and longitude information of the geographic raster, and the intersection area of the geographic raster and each regional unit is calculated; according to the unit characteristic information of the regional unit with the largest intersection area, the geographic raster is marked to obtain the raster characteristic information of the geographic raster; according to the raster characteristic information of each geographic raster, the raster characteristic information of the geographic raster data is obtained.
[0044] Specifically, the area of the geographic grid is calculated according to the latitude and longitude information of the geographic grid, the area of the regional unit is calculated according to the latitude and longitude information of the regional unit, and the intersection area between the geographic grid and each regional unit is calculated. The unit feature information of the regional unit with the largest intersection area is selected, for example, the unit feature information can be campus A, so as to mark the grid feature information of the geographic grid, and the grid feature information of the geographic grid is campus A. Among them, the method for calculating the intersection area can be calculated by Shapely, wherein Shapely is a Python library for geometric object operation and analysis based on Cartesian coordinates.
[0045] Step S103: Based on preset constraints, regional division is performed using a pre-trained geographic regional division model according to geographic raster data and corresponding raster feature information.
[0046] In one embodiment, based on preset constraints, regional division is performed through a pre-trained geographic region division model according to geographic raster data and corresponding raster feature information, which may include: based on preset constraints, according to raster feature information, aggregating the geographic raster data to generate first grid data; merging the first grid data according to edge data of the first grid data to generate second grid data; determining the raster data to be optimized through the second grid data, optimizing the raster data to be optimized, so as to perform regional division according to the optimization processing result.
[0047] In one embodiment, the geographic raster data is aggregated according to raster feature information to generate first grid data, which may include: according to the raster feature information, performing a first aggregation process on geographic rasters of the same raster type to obtain first raster data, and obtaining the raster type of the first raster data according to the raster type corresponding to the geographic raster before the first aggregation process; performing a second aggregation process on the first raster data that is within a set range and whose raster type similarity meets a set threshold to generate first grid data.
[0048] Specifically, according to the grid feature information, the geographic rasters with the same grid type are subjected to the first aggregation processing to obtain the first grid data, that is, the geographic rasters with the same grid tag or grid type are aggregated together to form the first grid. For example, if there are 10 geographic rasters whose grid types are all campus and whose grid identifiers are all campus A, then these 10 geographic rasters can be aggregated into "campus A first grid", and the grid type of "campus A first grid" is campus and the grid identifier is campus A, thereby ensuring that the geographic rasters with the same grid tag or grid type are in the same first grid.
[0049] Based on the preset constraints, the first grid data is subjected to a second aggregation process by a neighborhood search algorithm, which is within a set range and has the same grid type or a similarity that meets a set threshold, to generate the first grid data. The neighborhood search algorithm can be KMean s Algorithm (K-means clustering algorithm, an iterative clustering analysis algorithm).
[0050] For multiple first grids in the first grid data, the following definitions can be made:
[0051] G represents the first grid set (i.e., the first grid data);
[0052] P represents the first grid set (i.e., the first grid data) to be drawn;
[0053] C represents the first grid type set;
[0054] AG i represents the set of adjacent first grids of the first grid i∈G;
[0055] n represents the number of the first grid, i.e., size(P), which can be calculated based on the area;
[0056] a i represents the area covered by the first grid i∈G;
[0057] Indicates the upper limit of the first grid area, which can be 1 square kilometer;
[0058] t ic Indicates whether the grid type of the first grid i∈G is c∈C. If yes, it is 1; if not, it is 0. It is a known constant.
[0059] x ip It is a 0-1 decision variable. When it is 1, it means that the first grid i∈G is divided into the first grid p∈P.
[0060] Then the first grid of grid type c in the first grid p accounts for g pc The calculation formula can be:
[0061]
[0062] The calculation formula of the Gini index of the first grid p can be:
[0063] H(p)=-∑ c∈C g pc lng pc ≈∑ c∈C g pc (1-g pc )=1-∑ c∈C g pc 2 ;
[0064] The smaller the value of H(p), the higher the proportion of first grids with the same grid type in the first grid p.
[0065] Constraints can include:
[0066] (1) The overall Gini index value reaches the preset overall Gini index target, that is, the overall Gini index value is used as the objective function. The Gini index is a mathematical concept in machine learning, which represents the measure of the uncertainty of random variables. The fewer the number of categories, the lower the Gini index; when the number of categories is the same, the higher the category concentration, the lower the Gini index; when the number of categories is small and the category concentration is high, the Gini index is low; when the number of categories is large and the category concentration is low, the Gini index is high.
[0067] The overall Gini index value can be generated in the following manner: for each first grid in the first grid data, the grid Gini index value of the first grid is calculated according to the grid feature information corresponding to the first grid; and the overall Gini index value is generated through the grid Gini index values of all the first grids. The calculation formula of the overall Gini index value can be:
[0068]
[0069] (2) Full coverage constraint, that is, each first grid needs to be divided into a first grid:
[0070]
[0071] (3) The first grid upper limit area constraint:
[0072]
[0073] (4) Relationship constraints between decision variables:
[0074]
[0075] In one embodiment, merging the first grid data according to the edge data of the first grid data to generate the second grid data may include: merging the first grid in the first grid data according to a preset merging condition to generate the second grid data, wherein the merging condition may include one or more of the same grid type, the same edge data, and being adjacent.
[0076] Specifically, the edge data of the first grid data may be streets, rivers, etc. along the first grid. The first grids with the same grid type and edge data may be merged to generate a middle grid. For example, if the "first grid of campus AB" and the "first grid of campus CD" are on the same street and adjacent, the two are merged into the "middle grid of campus ABCD"; then the middle grids with the same grid type and adjacent are merged to generate a second grid. For example, if the "middle grid of campus ABCD" and the "middle grid of campus EFGH" are on different streets but adjacent, the two are aggregated and called the "second grid of campus ABCDEFGH". The embodiment of the present invention ensures that the grids are along the streets and rivers as much as possible during the merging, thereby ensuring that the formed second grid is along the streets, rivers and the junctions of streets as much as possible.
[0077] In one embodiment, determining the grid data to be optimized through the second grid data may include: identifying boundary grids located at the boundary in the second grid data; randomly constructing all boundary grids according to the number of grids to generate no less than one third grid, and generating the grid data to be optimized based on the third grid whose number of grids is greater than a preset number threshold.
[0078] Specifically, the first grid located at the boundary in the second grid data is identified as the boundary grid, and all boundary grids are randomly selected and constructed according to the number of grids being 10, 100 and 500, to obtain a third grid including 10 boundary grids, a third grid including 100 boundary grids and a third grid including 500 boundary grids, and the third grid including 500 boundary grids is used as the grid to be optimized.
[0079] In one embodiment, the optimization processing of the grid data to be optimized may include: for each grid to be optimized in the grid data to be optimized, selecting a target second grid from second grids adjacent to the grid to be optimized; based on the constraint condition, verifying the target second grid, and if the verification passes, moving the grid to be optimized from the second grid to which it currently belongs to the target second grid.
[0080] Specifically, for each grid to be optimized, a target second grid is selected from the second grids adjacent to the grid to be optimized, such as the nearest second grid can be selected as the target second grid; based on the constraint conditions, the target second grid is verified, that is, assuming that the grid to be optimized is moved from the current second grid to the target second grid, it is determined whether the data of the moved second grid is more in line with the constraint conditions, such as the overall Gini index value is lower, the grid area and the number of stores are more in line with the business requirements, etc. If the verification is passed, the grid to be optimized can be moved from the current second grid to the target second grid as a better solution, otherwise, the verification fails, and the grid to be optimized will not be moved from the current second grid to the target second grid. When the number of iterations does not reach the maximum number of iterations (such as 2000 times), the grid data to be optimized is repeatedly determined through the second grid data, and the grid data to be optimized is optimized until the number of iterations reaches the maximum number of iterations, thereby obtaining the final solution and performing the division of the geographical area and grid drawing.
[0081] Figure 2 It is a flowchart of a method for dividing geographical areas according to an embodiment of the present invention.
[0082] like Figure 2 As shown, in one embodiment, in response to a request for division of a geographic area, geographic raster data and regional unit data of the geographic area are obtained; the geographic raster data is marked according to the unit feature information of the regional unit data by the regional unit data mapping module to obtain the raster feature information of the geographic raster data; according to the constraint conditions, the geographic raster data is aggregated according to the raster feature information by the clustering module in the geographic area division model to generate first grid data; the first grid data is merged according to the edge data of the first grid data by the merging module to generate second grid data; the raster data to be optimized is determined by the variable neighborhood search module through the second grid data, and the raster data to be optimized is optimized; thereby, regional division is performed according to the optimization result.
[0083] The embodiment of the present invention associates the regional unit data with the geographic grid data by combining the regional unit data, and further marks the characteristic information of the regional unit data on the geographic grid, thereby simplifying the difficulty of solving the geographic area division problem. It also adopts a phased optimization idea, divide and conquer, gradually reduces the scale of problem solving, and designs heuristic algorithms for solving each stage close to business reality, which greatly reduces the difficulty of solving the problem.
[0084] Figure 3 4 is a schematic diagram of main modules of a device for dividing geographical areas according to an embodiment of the present invention.
[0085] like Figure 3As shown, a device 300 for dividing a geographical area according to an embodiment of the present invention mainly includes: a request response module 301 , a marking module 302 , and a region dividing module 303 .
[0086] The request response module 301 is used to respond to a request for division of a geographic area and obtain geographic grid data and regional unit data of the geographic area. The regional unit data may have unit characteristic information.
[0087] The marking module 302 is used to mark the geographic raster data according to the unit characteristic information of the regional unit data to obtain the raster characteristic information of the geographic raster data.
[0088] The region division module 303 is used to perform region division based on preset constraints, according to geographic grid data and corresponding grid feature information, using a pre-trained geographic region division model.
[0089] In one embodiment, the geographic grid data may include the longitude and latitude information corresponding to each geographic grid, and the regional unit data may include the area of each regional unit. The marking module 302 is specifically used to: for each geographic grid in the geographic grid data, calculate the area of the geographic grid according to the longitude and latitude information of the geographic grid, and calculate the intersection area between the geographic grid and each regional unit; mark the geographic grid according to the unit feature information of the regional unit with the largest intersection area to obtain the grid feature information of the geographic grid; and obtain the grid feature information of the geographic grid data according to the grid feature information of each geographic grid.
[0090] In one embodiment, the region division module 303 is specifically used to: based on preset constraints, aggregate the geographic raster data according to the raster feature information to generate first grid data; merge the first grid data according to the edge data of the first grid data to generate second grid data; determine the raster data to be optimized through the second grid data, optimize the raster data to be optimized, and divide the region according to the optimization result.
[0091] In one embodiment, the constraint conditions may include: the overall Gini index value reaches a preset overall Gini index target, and the area division module 303 is specifically used to: for each first grid in the first grid data, calculate the grid Gini index value of the first grid according to the grid feature information corresponding to the first grid; and generate the overall Gini index value through the grid Gini index values of all the first grids.
[0092] In one embodiment, the raster feature information may include the raster type, and the area division module 303 is specifically used to: perform a first aggregation process on geographic rasters with the same raster type to obtain first raster data based on the raster feature information, and obtain the raster type of the first raster data based on the raster type corresponding to the geographic raster before the first aggregation process; perform a second aggregation process on the first raster data that is within a set range and whose raster type similarity meets a set threshold, to generate first grid data.
[0093] In one embodiment, the grid feature information may include a grid type, and the area division module 303 is specifically used to merge the first grid in the first grid data according to a preset merging condition to generate second grid data, wherein the merging condition includes one or more of the same grid type, the same edge data, and being adjacent.
[0094] In one embodiment, the area division module 303 is specifically used to: identify boundary grids located at the boundary in the second grid data; randomly construct all boundary grids according to the number of grids to generate no less than one third grid, and generate grid data to be optimized based on the third grids whose number of grids is greater than a preset number threshold.
[0095] In one embodiment, the area division module 303 is specifically used to: for each grid to be optimized in the grid data to be optimized, select a target second grid from the second grids adjacent to the grid to be optimized; based on the constraint conditions, verify the target second grid, and if the verification passes, move the grid to be optimized from the current second grid to which it belongs to the target second grid.
[0096] In addition, the specific implementation content of the device for dividing geographical areas in the embodiment of the present invention has been described in detail in the above method for dividing geographical areas, so the repeated content will not be described again here.
[0097] Figure 4 An exemplary system architecture 400 is shown to which the method or device for dividing geographical areas according to the embodiments of the present invention can be applied.
[0098] like Figure 4 As shown, system architecture 400 may include terminal devices 401, 402, 403, network 404 and server 405. Network 404 is used to provide a medium for communication links between terminal devices 401, 402, 403 and server 405. Network 404 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0099] Users can use terminal devices 401, 402, 403 to interact with server 405 through network 404 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 401, 402, 403, such as geographic area division applications, grid drawing applications, map applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0100] The terminal devices 401 , 402 , and 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0101] The server 405 may be a server that provides various services, such as a background management server that provides support for geographic region division websites browsed by users using terminal devices 401, 402, and 403 (only as an example). The background management server may respond to the geographic region division request and other data received, obtain geographic raster data and regional unit data of the geographic region, and the regional unit data has unit feature information; mark the geographic raster data according to the unit feature information of the regional unit data to obtain the raster feature information of the geographic raster data; perform regional division and other processing based on the preset constraints, according to the geographic raster data and the corresponding raster feature information, through a pre-trained geographic region division model, and feed back the processing results (such as the geographic region division results - only as an example) to the terminal device.
[0102] It should be noted that the geographical area division method provided in the embodiment of the present invention is generally executed by the server 405 , and accordingly, the geographical area division device is generally disposed in the server 405 .
[0103] It should be understood that Figure 4 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0104] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of a terminal device or a server suitable for implementing an embodiment of the present invention. Figure 5 The terminal device or server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0105] like Figure 5As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0106] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.
[0107] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.
[0108] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0109] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0110] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes a request response module, a marking module, and an area division module. The names of these modules do not constitute a limitation on the modules themselves in some cases. For example, the request response module may also be described as "a module for obtaining geographic raster data and area unit data of a geographic area in response to a request for division of a geographic area".
[0111] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: in response to a request for division of a geographic area, obtaining geographic raster data and regional unit data of the geographic area, the regional unit data having unit feature information; marking the geographic raster data according to the unit feature information of the regional unit data to obtain the raster feature information of the geographic raster data; based on preset constraints, performing regional division according to the geographic raster data and the corresponding raster feature information through a pre-trained geographic area division model.
[0112] According to the technical solution of the embodiment of the present invention, in response to a request for division of a geographic region, geographic raster data and regional unit data of the geographic region are obtained, and the regional unit data has unit feature information; the geographic raster data is marked according to the unit feature information of the regional unit data to obtain the raster feature information of the geographic raster data; based on preset constraints, the region is divided according to the geographic raster data and the corresponding raster feature information through a pre-trained geographic region division model. The geographic raster data can be marked according to the regional unit data and the unit feature information to obtain the raster feature information of the geographic raster data, and then the raster feature information is used to divide the geographic region and draw the grid, and through the constraints and the geographic region division model, the proportion of geographic rasters of the same type in the same grid can be increased, thereby improving the effect of geographic region division.
[0113] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for dividing geographical areas, characterized in that: include: In response to a request for dividing a geographic area, obtaining geographic grid data and regional unit data of the geographic area, wherein the regional unit data has unit characteristic information; Marking the geographic raster data according to the unit characteristic information of the regional unit data to obtain the raster characteristic information of the geographic raster data; Based on preset constraints, regional division is performed according to the geographic raster data and corresponding raster feature information through a pre-trained geographic region division model.
2. The method according to claim 1, characterized in that The geographic grid data includes the latitude and longitude information corresponding to each geographic grid, and the regional unit data includes the area of each regional unit. The geographic grid data is marked according to the unit characteristic information of the regional unit data to obtain the grid characteristic information of the geographic grid data, including: For each geographic grid in the geographic grid data, the area of the geographic grid is calculated according to the latitude and longitude information of the geographic grid, and the intersection area between the geographic grid and each of the regional units is calculated; Marking the geographic grid according to the unit characteristic information of the regional unit with the largest intersection area to obtain grid characteristic information of the geographic grid; The grid feature information of the geographic grid data is obtained according to the grid feature information of each geographic grid.
3. The method according to claim 1, characterized in that The method of performing regional division based on the preset constraint conditions and the geographic grid data and the corresponding grid feature information by using a pre-trained geographic region division model includes: Based on the preset constraint conditions and according to the grid feature information, the geographic grid data is aggregated to generate first grid data; Merging the first grid data according to the edge data of the first grid data to generate second grid data; The grid data to be optimized is determined by using the second grid data, and the grid data to be optimized is optimized to perform region division according to the optimization result.
4. The method according to claim 3, characterized in that The constraint condition includes: the overall Gini index value reaches a preset overall Gini index target, and the overall Gini index value is generated in the following manner: For each first grid in the first grid data, calculating a grid Gini index value of the first grid according to grid feature information corresponding to the first grid; The overall Gini index value is generated by using the Gini index values of all the first grids.
5. The method according to claim 3, characterized in that: The grid feature information includes a grid type, and the aggregation processing is performed on the geographic grid data according to the grid feature information to generate the first grid data, including: According to the grid feature information, the geographic rasters with the same grid type are subjected to a first aggregation process to obtain first grid data, and the grid type of the first grid data is obtained according to the grid type corresponding to the geographic rasters before the first aggregation process; A second aggregation process is performed on first grid data that are within a set range and whose grid type similarity meets a set threshold, to generate the first grid data.
6. The method according to claim 3, characterized in that The grid feature information includes a grid type, and the merging process of the first grid data according to the edge data of the first grid data to generate the second grid data includes: According to a preset merging condition, the first grid in the first grid data is merged to generate the second grid data, wherein the merging condition includes one or more of the same grid type, the same edge data, and being adjacent.
7. The method according to claim 3, characterized in that The step of determining the grid data to be optimized by using the second grid data comprises: identifying a boundary grid located at a boundary in the second grid data; According to the number of grids, all boundary grids are randomly constructed to generate no less than one third grid, and the grid data to be optimized is generated according to the third grids whose number of grids is greater than a preset number threshold.
8. The method according to claim 7, characterized in that The step of optimizing the grid data to be optimized includes: For each grid to be optimized in the grid data to be optimized, selecting a target second grid from second grids adjacent to the grid to be optimized; Based on the constraint condition, the target second grid is verified, and if the verification passes, the grid to be optimized is moved from the current second grid to which it belongs to to the target second grid.
9. A device for dividing geographical areas, characterized in that: include: A request response module, configured to obtain geographic raster data and regional unit data of the geographic area in response to a request for division of the geographic area, wherein the regional unit data has unit characteristic information; A marking module, used for marking the geographic raster data according to the unit characteristic information of the regional unit data, to obtain the raster characteristic information of the geographic raster data; The region division module is used to perform region division based on preset constraints, according to the geographic raster data and corresponding raster feature information, through a pre-trained geographic region division model.
10. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.
11. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
