Method, device and electronic device for comparing differences in multi-layer image data

By using GeoMesa and PostGIS to optimize the difference comparison of multi-layer patch data, the problem of long patch difference analysis time is solved, and fast and efficient patch data comparison is achieved.

CN118332147BActive Publication Date: 2024-10-01富盛科技股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410775584.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-10-01
Estimated Expiration
2044-06-17

AI Technical Summary

Technical Problem

In the existing technology, the comparative analysis of pattern differences requires a large amount of calculation, resulting in a long time consumption and a lack of effective solutions.

Method used

The spatiotemporal data processing framework GeoMesa and spatial database PostGIS are used to optimize the difference comparison process of multi-layer patch data through data format conversion, coding unification, rectangular division and parallel processing.

Benefits of technology

It significantly reduces the time required for multi-layer patch difference comparison and improves the analysis speed, shortening it from several hours to half an hour, solving the problem of excessive calculation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118332147B_ABST
    Figure CN118332147B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method, device and electronic device for comparing differences in multi-layered spot data, and relates to the field of geographic information technology, wherein the method comprises: receiving a compressed file of multi-layered spot data uploaded by a user, and receiving a difference comparison type selected by the user, wherein the multi-layers are multiple vector layers; converting the data format of the compressed file of the multi-layered spot data into a unified format, and storing the converted multi-layered spot data into a spatial database, wherein the spatial database comprises PostGIS; obtaining the converted multi-layered spot data from the spatial database, and using a spatiotemporal data processing framework to compare the differences between the converted multi-layered spot data according to the difference comparison type, and obtaining a difference comparison result, wherein the spatiotemporal data processing framework comprises GeoMesa. The present disclosure reduces the amount of calculation for comparing differences in multi-layered spot data, improves the speed for comparing differences in multi-layered spot data, and reduces the time for comparing differences in multi-layered spot data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of geographic information technology, and in particular to a method, device and electronic device for comparing differences in multi-layered image data. Background Art

[0002] With the deepening of urbanization, the important role of national land space planning has gradually emerged. How to reasonably plan urban construction, basic farmland, water source areas and other spaces has become the basis of modernization. The spot difference comparison analysis compares two different national land planning layer spots. Through the conflict spots, the changes in various functional land spaces can be intuitively analyzed to provide guidance for the next step of planning.

[0003] When performing comparative analysis of patch differences, the related technology converts patch data in multiple vector layers into a map set, and uses each patch data in one layer to compare and mark all patch data in another layer in turn until all patch data in one layer are traversed; however, this comparison method generates a large amount of Cartesian product calculation, so that the comparison of patch differences in the entire layer will take a lot of time, ranging from a few hours to more than ten hours.

[0004] With regard to the problem that the comparative analysis of image differences in related technologies requires large amount of calculation and takes a long time, no effective technical solution has been proposed so far. Summary of the invention

[0005] The main purpose of the present invention is to provide a method, device and electronic device for comparing differences in multi-layer image data, so as to solve the problem that the image difference comparison analysis in the related art has large amount of calculation and takes a long time.

[0006] In order to achieve the above-mentioned object, the first aspect of the present disclosure provides a method for comparing differences in multi-layered pattern data, comprising:

[0007] Receive the multi-layered spot data compressed file uploaded by the user, and receive the difference comparison type selected by the user, where the multi-layers are multiple vector layers, the data formats of the multi-layered spot data compressed file include shapefile, gdb and mdb, and the difference comparison types include erase, intersection and union, intersection and inversion, topology and buffer;

[0008] Convert the data format of the multi-layered spot data compression file into a unified format, and store the converted multi-layered spot data into a spatial database, wherein the spatial database includes PostGIS;

[0009] Obtaining the converted multi-layered patch data from a spatial database, and using a spatiotemporal data processing framework to compare differences between the converted multi-layered patch data according to a difference comparison type to obtain a difference comparison result, wherein the spatiotemporal data processing framework includes GeoMesa; and

[0010] The difference comparison results are stored in the spatial database and displayed to the user.

[0011] Optionally, the number of the vector layer spot data compression files is 2, each of the vector layer spot data compression files contains a plurality of data files in different formats, and each of the data files contains a plurality of data with data numbers;

[0012] The data format of the multi-layer spot data compression file is converted into a unified format, and the converted multi-layer spot data is stored in the spatial database, including:

[0013] According to the corresponding relationship between the data numbers in each data file, each piece of data in each data file is extracted one by one, and the extracted multiple pieces of data are merged into one complete piece of data;

[0014] Using a conversion tool to convert the format of the complete data into a unified format, wherein the conversion tool includes a geospatial data abstraction library;

[0015] According to the spatial data table structure defined in the spatial database, the converted multi-layer patch data in a unified format is stored in the spatial database.

[0016] Furthermore, the format of the complete data is converted into a unified format using a conversion tool, including:

[0017] Use the Geospatial Data Abstraction Library to convert the complete data into GeoJson format; or

[0018] Use the geospatial data abstraction library to convert the complete data into XML format.

[0019] Optionally, using the spatiotemporal data processing framework, the differences between the converted multi-layered spot data are compared according to the difference comparison type to obtain difference comparison results, including:

[0020] Using the spatiotemporal data processing framework, the data source is configured as the corresponding data table in the spatial database, and the multi-layer patch data to be compared and differentiated is loaded from the spatial database;

[0021] Use the conversion tool to convert the map coordinate systems of different codes used by the multi-layered spot data into a unified coded map coordinate system, where the unified coded map coordinate system takes the endpoint at the lower left corner of the page as the origin, and the rightward direction within the page is the positive direction of the X axis, and the upward direction is the positive direction of the Y axis;

[0022] Determine the minimum value in the X-axis direction, the maximum value in the X-axis direction, the minimum value in the Y-axis direction, and the maximum value in the Y-axis direction of the multi-layer map data in the uniformly encoded map coordinate system through a big data processing engine, and construct a rectangular border, wherein the big data processing engine includes Spark;

[0023] According to the size of the rectangular border, the rectangular border is evenly divided into a plurality of grids of equal size in an equidistant manner;

[0024] The big data processing engine calls the application program interface to set the number of parallel operations. According to the difference comparison type, each piece of image spot data in the grid of the first layer is compared with all the image spot data in the corresponding position grid of the second layer in turn to obtain the difference comparison result.

[0025] Furthermore, let the minimum value of the X-axis direction of the multi-layer pattern data be X min , the maximum value in the X-axis direction is X max , the minimum value of the Y axis is Y min , the maximum value in the Y-axis direction is Y max , then: the length of the rectangular frame in the X-axis direction is X frame =X max -X min , the Y-axis length of the rectangular border frame =Y max -Y min ;

[0026] According to the size of the rectangular border, the rectangular border is evenly divided into a plurality of grids of equal size in an equidistant manner, including:

[0027] Determine the X-axis spacing of each grid according to the following formula and Y axis spacing :

[0028] ,

[0029] ,

[0030] Among them, GridNum is the number of divided grids, which can be 9 or 16. When the area of ​​the rectangular border is less than the preset threshold, the number of grids is 9, and when the area of ​​the rectangular border is greater than or equal to the preset threshold, the number of grids is 16.

[0031] Furthermore, according to the difference comparison type, each piece of image spot data in the grid in the first layer is compared with all the image spot data in the grid at the corresponding position in the second layer in turn, and the difference comparison results are obtained, including:

[0032] according to and Determine all the patch data in each grid in each layer, where: is the horizontal coordinate of the i-th spot data, is the ordinate of the i-th image spot data, i is a positive integer, and the value of j is determined by the number of divided grids. When the number of grids is 9, the value of j is {1,2,3}, and when the number of grids is 16, the value of j is {1,2,3,4};

[0033] Add all the spot data in each grid in the first layer to the first map set, and add all the spot data in each grid in the second layer to the second map set;

[0034] Determine whether the image spot data in the first map set and the image spot data in the second map set have a position intersection;

[0035] If so, the patch data with the position intersection is marked, and the corresponding application program interface is called according to the difference comparison type selected by the user to determine the difference comparison result;

[0036] If it does not exist, continue to traverse backwards and repeat the judgment.

[0037] Optionally, after receiving the difference comparison type selected by the user, the method further includes:

[0038] Create a difference comparison task corresponding to the difference comparison type, and add the difference comparison task to the task list;

[0039] Before displaying the difference comparison result to the user, the method further includes:

[0040] Respond to the user's query request for the results corresponding to the difference comparison tasks in the task list.

[0041] A second aspect of the present disclosure provides a device for comparing differences in multi-layer pattern data, comprising:

[0042] A receiving unit is used to receive a multi-layered spot data compression file uploaded by a user, and receive a difference comparison type selected by the user, wherein the multi-layers are multiple vector layers, the data formats of the multi-layered spot data compression file include shapefile, gdb and mdb, and the difference comparison types include erase, intersection and union, intersection and inversion, topology and buffer;

[0043] A conversion unit, used for converting the data format of the multi-layer spot data compression file into a unified format, and storing the converted multi-layer spot data in a spatial database, wherein the spatial database includes PostGIS;

[0044] A comparison unit is used to obtain the converted multi-layered patch data from the spatial database, and compare the differences between the converted multi-layered patch data according to the difference comparison type using a spatiotemporal data processing framework to obtain a difference comparison result, wherein the spatiotemporal data processing framework includes GeoMesa; and

[0045] The display unit is used to store the difference comparison result in the spatial database and display the difference comparison result to the user.

[0046] A third aspect of the present disclosure provides a computer-readable storage medium storing computer instructions for causing a computer to execute the method for comparing differences in multi-layer pattern data provided in any one of the first aspects.

[0047] The fourth aspect of the present disclosure provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor executes the difference comparison method of multi-layer pattern data provided in any one of the first aspects.

[0048] In the difference comparison method of multi-layer spot data provided by the embodiment of the present disclosure, a multi-layer spot data compressed file uploaded by a user is received, and a difference comparison type selected by the user is received, wherein the multi-layer is a plurality of vector layers, the data format of the multi-layer spot data compressed file includes shapefile, gdb and mdb, and the difference comparison types include erase, intersection union, intersection negation, topology and buffer; the data format of the multi-layer spot data compressed file is converted into a unified format, and the converted multi-layer spot data is stored in a spatial database, wherein the spatial database includes PostGIS; by converting the data format of the multi-layer spot data compressed file into a unified format, it is convenient to compare the differences between the multi-layer spot data in the subsequent step, so as to facilitate data processing;

[0049] The converted multi-layered patch data is obtained from the spatial database, and the differences between the converted multi-layered patch data are compared according to the difference comparison type using the spatiotemporal data processing framework, and the difference comparison results are obtained, wherein the spatiotemporal data processing framework includes GeoMesa; the difference comparison results are stored in the spatial database, and the difference comparison results are displayed to the user. The difference between the converted multi-layered patch data is compared using the spatiotemporal data processing framework GeoMesa, which reduces the amount of calculation for comparing the differences between multiple vector layer patch data and improves the speed of comparing the differences between multiple vector layer patch data. The comparison of the differences between multiple vector layer patch data only takes half an hour, which significantly reduces the time spent on comparing the differences between multiple vector layer patches, and solves the problem of large amount of calculation and long time spent on patch difference comparison analysis in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0051] Figure 1 A flow chart of a method for comparing differences in multi-layered pattern data provided by an embodiment of the present disclosure;

[0052] Figure 2 A schematic diagram of a method for comparing differences in multi-layered pattern data provided by an embodiment of the present disclosure;

[0053] Figure 3 A schematic diagram of a difference comparison result of a page display provided in an embodiment of the present disclosure;

[0054] Figure 4 A block diagram of a device for comparing differences in multi-layer pattern data provided by an embodiment of the present disclosure;

[0055] Figure 5 A block diagram of an electronic device provided for an embodiment of the present disclosure. DETAILED DESCRIPTION

[0056] In order to enable those skilled in the art to better understand the scheme of the present disclosure, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present disclosure.

[0057] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so as to describe the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0058] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0059] With the deepening of urbanization, the important role of national land space planning has gradually emerged. How to reasonably plan urban construction, basic farmland, water source areas and other spaces has become the basis of modernization. The spot difference comparison analysis compares two different national land planning layer spots. Through the conflict spots, the changes in various functional land spaces can be intuitively analyzed to provide guidance for the next step of planning.

[0060] When performing comparative analysis of patch differences, the related technology converts patch data in multiple vector layers into a map set, and uses each patch data in one layer to compare and mark all patch data in another layer in turn until all patch data in one layer are traversed; however, this comparison method generates a large amount of Cartesian product calculation, so that the comparison of patch differences in the entire layer will take a lot of time, ranging from a few hours to more than ten hours.

[0061] In order to solve the above problems, the present disclosure provides a method for comparing the difference of multi-layer image data. Figure 1 As shown, the method includes the following steps S11 to S14:

[0062] Step S11: receiving a multi-layered image spot data compression file uploaded by a user, and receiving a difference comparison type selected by the user, wherein the multi-layered image spot data compression file is a plurality of vector layers, the data formats of the multi-layered image spot data compression file include shapefile, gdb and mdb, and the difference comparison types include spatial modification, deletion, intersection and union, intersection and inversion, topology and buffer;

[0063] Step S12: converting the data format of the multi-layer spot data compression file into a unified format, and storing the converted multi-layer spot data in a spatial database, wherein the spatial database includes PostGIS; PostGIS is an object-relational database management system specially used for storing spot data, and stores the spot data in a key-value pair manner;

[0064] In an optional implementation of the present disclosure, the number of vector layer spot data compressed files is 2, each vector layer spot data compressed file contains multiple data files in different formats, and each data file contains multiple data with data numbers; the number of layers or vector layers is 2 by default, the number of vector layer spot data compressed files is 2 by default, and each compressed file contains multiple data files in different formats;

[0065] For example, a shapefile compressed file contains .shp files, .shx files, .dbf files, .prj files, etc. Among them, the .shp file is used to store vector map data and record the spatial location information of each feature; the .shx file is an index file used to store the location of the features in the .shp file to speed up data access; the .dbf file is used to store the attribute information of the vector data, such as the name and type of each point on the map; the .prj file is a map coordinate system file used to store map projection information.

[0066] Wherein, step S12 comprises:

[0067] According to the corresponding relationship between the data numbers in each data file, each piece of data in each data file is extracted one by one, and the extracted multiple pieces of data are merged into one complete piece of data;

[0068] The complete data format is converted into a unified format using conversion tools, including the Geospatial Data Abstraction Library (GDAL). The Geospatial Data Abstraction Library (GDAL) uses an abstract data model to express various supported file formats and uses a series of command lines to perform data conversion and processing to achieve efficient processing of raster and vector data.

[0069] According to the spatial data table structure defined in the spatial database, the converted multi-layer patch data in a unified format is stored in the spatial database.

[0070] In a preferred embodiment of the present disclosure, a conversion tool is used to convert the format of the complete data into a unified format, including:

[0071] Use the Geospatial Data Abstraction Library to convert the complete data into GeoJson format; or

[0072] Use the geospatial data abstraction library to convert the complete data into XML format.

[0073] The conversion tool is used to convert the format of the complete data into the required unified format, which can be GeoJson format or XML format; by converting the data format of the multi-layer map data compression file into a unified format and storing it in the spatial database, it is convenient to compare the differences between the multi-layer map data in the future, which is convenient for data processing.

[0074] Step S13: Obtain the converted multi-layer patch data from the spatial database, and use the spatiotemporal data processing framework to compare the differences between the converted multi-layer patch data according to the difference comparison type to obtain the difference comparison result, wherein the spatiotemporal data processing framework includes GeoMesa; GeoMesa is an open source, distributed computing system-based toolkit for massive spatiotemporal data query and analysis.

[0075] The disclosed embodiment utilizes the spatiotemporal data processing framework GeoMesa to compare the differences between the converted multi-layer patch data, thereby reducing the amount of computation required for comparing the differences between multiple vector layer patch data and improving the speed of comparing the differences between multiple vector layer patch data. It only takes half an hour to compare the differences between multiple vector layer patch data, significantly reducing the time spent on comparing the differences between multiple vector layer patch data, and solving the problem in related technologies that the patch difference comparison analysis requires large amount of computation and takes a long time.

[0076] In an optional embodiment of the present disclosure, the spatiotemporal data processing framework is used in step S13 to compare the differences between the converted multi-layer image data according to the difference comparison type to obtain a difference comparison result, including:

[0077] Using the spatiotemporal data processing framework, the data source is configured as the corresponding data table in the spatial database, and the multi-layer patch data to be compared and differentiated is loaded from the spatial database;

[0078] Use the conversion tool to convert the map coordinate systems with different codes used by multi-layered spot data into a map coordinate system with a unified code, where the map coordinate system with a unified code takes the endpoint at the lower left corner of the page as the origin, the rightward direction of the page is the positive direction of the X axis, and the upward direction is the positive direction of the Y axis; the map coordinate system with a unified code is used to describe the position coordinates of the spot data on a two-dimensional plane, and the page is an interface displayed to the user, the X axis indicates the east-west direction, and the Y axis indicates the north-south direction; the map coordinate system with a unified code can be the national standard for surveying and mapping geographic information. By converting the map coordinate systems with different codes used by multi-layered spot data into a map coordinate system with a unified code, confusion in the position and spot data of the multi-layered spot data can be avoided during processing.

[0079] The minimum value in the X-axis direction, the maximum value in the X-axis direction, the minimum value in the Y-axis direction and the maximum value in the Y-axis direction of the multi-layer map data in the uniformly encoded map coordinate system are determined through a big data processing engine, and a rectangular border is constructed, wherein the big data processing engine includes Spark; Spark provides a complete set of application programming interfaces (Application Programming Interface, referred to as API) to support batch processing and stream processing;

[0080] According to the size of the rectangular border, the rectangular border is evenly divided into a plurality of grids of equal size in an equidistant manner;

[0081] The big data processing engine calls the application program interface to set the number of parallel operations, and compares each piece of spot data in the grid of the first layer with all the spot data in the grid of the corresponding position in the second layer in turn according to the difference comparison type to obtain the difference comparison result. By comparing each piece of spot data in the grid of the first layer with all the spot data in the grid of the corresponding position in the second layer in turn, compared with directly comparing all the spot data in two layers in the related art, the amount of calculation for comparing the differences of spot data in multiple vector layers is significantly reduced, the speed of comparing the differences of spot data in multiple vector layers is improved, and the time spent on comparing the differences of spot data in multiple vector layers is reduced.

[0082] GeoMesa configuration integrates Spark to call API to build a spatial geographic data environment, divides multiple vector layers into multiple equal-sized grids in an equidistant manner according to the size of the layer or rectangular border, and uses each piece of map data in the grid of one layer to compare and mark all the map data in the corresponding position grid of another layer in turn until all the grids in the layer are traversed and the difference comparison results are obtained.

[0083] In a preferred embodiment of the present disclosure, the minimum value of the multi-layer pattern data in the X-axis direction is X min , the maximum value in the X-axis direction is X max , the minimum value of the Y axis is Y min , the maximum value in the Y-axis direction is Y max , then: the length of the rectangular frame in the X-axis direction is X frame =X max -X min , the Y-axis length of the rectangular border frame =Y max -Y min ;

[0084] According to the size of the rectangular border, the rectangular border is evenly divided into a plurality of grids of equal size in an equidistant manner, including:

[0085] Determine the X-axis spacing of each grid according to the following formula and Y axis spacing :

[0086] ,

[0087] ,

[0088] Among them, GridNum is the number of divided grids, which can be 9 or 16. When the area of ​​the rectangular border is less than the preset threshold, the number of grids is 9, and when the area of ​​the rectangular border is greater than or equal to the preset threshold, the number of grids is 16. When the area of ​​the rectangular border is less than the preset threshold, the rectangular border is divided into 9 grids, the length of the rectangular border in the X-axis direction is 3 times the spacing of the grids in the X-axis direction, and the length of the rectangular border in the Y-axis direction is 3 times the spacing of the grids in the Y-axis direction; when the area of ​​the rectangular border is greater than or equal to the preset threshold, the rectangular border is divided into 16 grids, the length of the rectangular border in the X-axis direction is 4 times the spacing of the grids in the X-axis direction, and the length of the rectangular border in the Y-axis direction is 4 times the spacing of the grids in the Y-axis direction.

[0089] The number of grids is divided according to the size of the rectangular border, and the amount of calculation and the amount of resources occupied by the calculation are comprehensively considered so that the number of pattern data in each divided grid is moderate. This can reduce the amount of calculation for comparing the differences in pattern data of multiple vector layers without occupying too many system resources.

[0090] In a preferred embodiment of the present disclosure, according to the difference comparison type, each piece of image spot data in the grid in the first layer is compared with all the image spot data in the grid at the corresponding position in the second layer in sequence to obtain a difference comparison result, including:

[0091] according to and Determine all the patch data in each grid in each layer, where: is the horizontal coordinate of the i-th spot data, is the ordinate of the i-th image spot data, i is a positive integer, and the value of j is determined by the number of divided grids. When the number of grids is 9, the value of j is {1,2,3}, and when the number of grids is 16, the value of j is {1,2,3,4};

[0092] Add all the spot data in each grid in the first layer to the first map set, and add all the spot data in each grid in the second layer to the second map set;

[0093] Determine whether the spot data in the first map set and the spot data in the second map set have a position intersection; by determining whether the spot data in the two map sets have a position intersection, compare whether there is a difference between the spot data of the two layers;

[0094] If so, the patch data with the position intersection is marked, and the corresponding application program interface is called according to the difference comparison type selected by the user to determine the difference comparison result;

[0095] If it does not exist, continue to traverse backwards and repeat the judgment.

[0096] Step S14: storing the difference comparison result in the spatial database and displaying the difference comparison result to the user.

[0097] In an optional implementation of the present disclosure, after receiving the difference comparison type selected by the user in step S11, the method further includes:

[0098] Create a difference comparison task corresponding to the difference comparison type, and add the difference comparison task to the task list;

[0099] Before presenting the difference comparison result to the user in step S14, the method further includes:

[0100] Respond to the user's query request for the results corresponding to the difference comparison tasks in the task list.

[0101] When creating a new difference comparison task, receive the user's operation on the front-end page, create the difference comparison task and add the difference comparison task to the task list; after storing the difference comparison result in the spatial database, respond to the user's query request for the result corresponding to the difference comparison task, and display the difference comparison result to the user through the front-end page.

[0102] A schematic diagram of a method for comparing differences in multi-layer image data provided by an embodiment of the present disclosure is shown in FIG. Figure 2 As shown, the user creates a new difference comparison task or difference analysis task on the front-end page, and the multi-layered patch data is converted into data in a unified format and stored in the spatial database PostGIS. The spatiotemporal data processing framework GeoMesa loads the multi-layered patch data to be compared from PostGIS, performs difference comparison analysis to obtain the difference comparison results, and writes the difference comparison results into PostGIS.

[0103] After the user initiates a request to query the task results on the front-end page, the front-end queries the stored difference comparison results from PostGIS and displays the difference comparison results to the user through the page;

[0104] The difference comparison results shown on the page are as follows Figure 3 As shown, Figure 3The differences between the A layer and the B layer are compared. The two layers are the data of the same administrative area at different times. By comparing the differences, the total number of difference spots is 2. The difference comparison types of the two difference spots are spatial modification and deletion. A spot with id 1012 is modified, and a spot with id 2301 is deleted.

[0105] From the above description, it can be seen that the present disclosure achieves the following technical effects:

[0106] The disclosed embodiment utilizes the spatiotemporal data processing framework GeoMesa to compare the differences between the converted multi-layer patch data, thereby reducing the amount of computation required for comparing the differences between multiple vector layer patch data and improving the speed of comparing the differences between multiple vector layer patch data. It only takes half an hour to compare the differences between multiple vector layer patch data, significantly reducing the time spent on comparing the differences between multiple vector layer patch data, and solving the problem in related technologies that the patch difference comparison analysis requires large amount of computation and takes a long time.

[0107] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0108] The present disclosure also provides a device for comparing differences in multi-layer image data for implementing the above method embodiment. Figure 4 As shown, the difference comparison device 40 includes:

[0109] The receiving unit 41 is used to receive a multi-layered image spot data compression file uploaded by a user, and receive a difference comparison type selected by the user, wherein the multi-layered image spot data compression file is a plurality of vector layers, the data format of the multi-layered image spot data compression file includes shapefile, gdb and mdb, and the difference comparison types include erase, intersection and union, intersection and inversion, topology and buffer;

[0110] A conversion unit 42 is used to convert the data format of the multi-layer spot data compression file into a unified format, and store the converted multi-layer spot data in a spatial database, wherein the spatial database includes PostGIS;

[0111] A comparison unit 43 is used to obtain the converted multi-layered spot data from the spatial database, and compare the differences between the converted multi-layered spot data according to the difference comparison type using a spatiotemporal data processing framework to obtain a difference comparison result, wherein the spatiotemporal data processing framework includes GeoMesa; and

[0112] The display unit 44 is used to store the difference comparison result in the spatial database and display the difference comparison result to the user.

[0113] The specific manner in which each unit in the above device embodiment performs operations has been described in detail in the embodiment of the method, and will not be elaborated on here.

[0114] The present disclosure also provides an electronic device, such as Figure 5 As shown, the electronic device includes one or more processors 51 and a memory 52. Figure 5 A processor 51 is taken as an example.

[0115] The controller may further include: an input device 53 and an output device 54 .

[0116] The processor 51, the memory 52, the input device 53 and the output device 54 may be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.

[0117] The processor 51 may be a central processing unit (CPU), or other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips. The general-purpose processor may be a microprocessor or any conventional processor.

[0118] The memory 52 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the control method in the embodiment of the present disclosure. The processor 51 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 52, that is, the difference comparison method of multi-layer pattern data in the above method embodiment is realized.

[0119] The memory 52 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of a processing device operated by the server, etc. In addition, the memory 52 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 52 may optionally include a memory remotely arranged relative to the processor 51, and these remote memories may be connected to a network connection device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0120] The input device 53 can receive input digital or character information and generate key signal input related to user settings and function control of the processing device of the server. The output device 54 can include display devices such as a display screen.

[0121] One or more modules are stored in the memory 52, and when executed by one or more processors 51, the execution is as follows: Figure 1 The method shown.

[0122] Those skilled in the art can understand that the implementation of all or part of the processes in the above method embodiments can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes in the above method embodiments. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (FM), a hard disk (HDD), or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above types of memory.

[0123] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for comparing differences in multi-layered pattern data, characterized in that: include: Receive a multi-layered spot data compression file uploaded by a user, and receive a difference comparison type selected by the user, wherein the multi-layered layers are multiple vector layers, the data formats of the multi-layered spot data compression file include shapefile, gdb and mdb, and the difference comparison types include space modification, erasure, intersection and union, intersection and inversion, topology and buffer; Convert the data format of the multi-layered spot data compression file into a unified format, and store the converted multi-layered spot data into a spatial database, wherein the spatial database includes PostGIS; Acquire the converted multi-layered patch data from the spatial database, and compare the differences between the converted multi-layered patch data according to the difference comparison type using a spatiotemporal data processing framework to obtain a difference comparison result, wherein the spatiotemporal data processing framework includes GeoMesa; and storing the difference comparison result in the spatial database, and displaying the difference comparison result to the user; The number of the vector layer spot data compression files is 2, each of which contains multiple data files in different formats, and each of which contains multiple data with data numbers. The step of converting the data format of the multi-layered spot data compression file into a unified format and storing the converted multi-layered spot data into a spatial database includes: According to the corresponding relationship between the data numbers in each data file, each piece of data in each data file is extracted one by one, and the extracted multiple pieces of data are merged into one complete piece of data; Using a conversion tool, converting the format of the complete data into a unified format, wherein the conversion tool includes a geospatial data abstraction library; According to the spatial data table structure defined in the spatial database, the converted multi-layer image data in a unified format is stored in the spatial database.

2. The method according to claim 1, characterized in that The use of a conversion tool to convert the format of the complete data into a unified format includes: Use a geospatial data abstraction library to convert the complete data into GeoJson format; or The format of the complete data is converted into XML format using a geospatial data abstraction library.

3. The method according to claim 1, characterized in that The spatial-temporal data processing framework is used to compare the differences between the converted multi-layered spot data according to the difference comparison type to obtain a difference comparison result, including: Using the spatiotemporal data processing framework, the data source is configured as a corresponding data table in a spatial database, and the multi-layered patch data to be compared and differentiated is loaded from the spatial database; Use the conversion tool to convert the map coordinate systems of different codes used by the multi-layered spot data into a unified coded map coordinate system, wherein the unified coded map coordinate system takes the endpoint at the lower left corner of the page as the origin, and the rightward direction within the page is the positive direction of the X axis, and the upward direction is the positive direction of the Y axis; Determine the minimum value in the X-axis direction, the maximum value in the X-axis direction, the minimum value in the Y-axis direction, and the maximum value in the Y-axis direction of the multi-layered spot data in the uniformly encoded map coordinate system through a big data processing engine, and construct a rectangular frame, wherein the big data processing engine includes Spark; According to the size of the rectangular frame, the rectangular frame is evenly divided into a plurality of grids of equal size in an equidistant manner; The big data processing engine calls the application program interface to set the number of parallelism, and according to the difference comparison type, each piece of image spot data in the grid in the first layer is compared with all the image spot data in the corresponding position grid in the second layer in turn to obtain the difference comparison result.

4. The method according to claim 3, characterized in that The minimum value of the X-axis direction of the multi-layered spot data is X min , the maximum value in the X-axis direction is X max , the minimum value of the Y axis is Y min , the maximum value in the Y-axis direction is Y max , then: the length of the rectangular frame in the X-axis direction X frame =X max -X min , the Y-axis length of the rectangular frame is frame =Y max -Y min ; The step of evenly dividing the rectangular frame into a plurality of grids of equal size in an equidistant manner according to the size of the rectangular frame includes: Determine the X-axis spacing and Y-axis spacing of each grid according to the following formulas: Among them, GridNum is the number of divided grids, and its value is 9 or 16. When the area of ​​the rectangular border is less than the preset threshold, the number of grids is 9, and when the area of ​​the rectangular border is greater than or equal to the preset threshold, the number of grids is 16.

5. The method according to claim 4, characterized in that According to the difference comparison type, each piece of image spot data in the grid in the first layer is compared with all the image spot data in the grid at the corresponding position in the second layer in sequence to obtain a difference comparison result, including: according to and Determine all the patch data in each grid in each layer, where: is the horizontal coordinate of the i-th spot data, is the ordinate of the i-th image spot data, i is a positive integer, and the value of j is determined by the number of divided grids. When the number of grids is 9, the value of j is {1,2,3}, and when the number of grids is 16, the value of j is {1,2,3,4}; Add all the spot data in each grid in the first layer to the first map set, and add all the spot data in each grid in the second layer to the second map set; Determine whether the image spot data in the first map set and the image spot data in the second map set have a position intersection; If so, the patch data with the position intersection is marked, and the corresponding application program interface is called according to the difference comparison type selected by the user to determine the difference comparison result; If it does not exist, continue to traverse backwards and repeat the judgment.

6. The method according to claim 1, characterized in that After receiving the difference comparison type selected by the user, the method further includes: Creating a difference comparison task corresponding to the difference comparison type, and adding the difference comparison task to a task list; Before presenting the difference comparison result to the user, the method further includes: Respond to the user's query request for the result corresponding to the difference comparison task in the task list.

7. A device for comparing differences in multi-layer pattern data, characterized in that: include: A receiving unit is used to receive a multi-layered spot data compression file uploaded by a user, and receive a difference comparison type selected by the user, wherein the multi-layered layers are multiple vector layers, the data formats of the multi-layered spot data compression file include shapefile, gdb and mdb, and the difference comparison types include space modification, erasure, intersection and union, intersection and inversion, topology and buffer; A conversion unit, used for converting the data format of the multi-layer spot data compression file into a unified format, and storing the converted multi-layer spot data into a spatial database, wherein the spatial database includes PostGIS; a comparison unit, configured to obtain the converted multi-layered patch data from the spatial database, and compare the differences between the converted multi-layered patch data according to the difference comparison type using a spatiotemporal data processing framework to obtain a difference comparison result, wherein the spatiotemporal data processing framework includes GeoMesa; and A display unit, used to store the difference comparison result in the spatial database and display the difference comparison result to the user; The number of the vector layer spot data compression files is 2, each of which contains multiple data files in different formats, and each of which contains multiple data with data numbers. The step of converting the data format of the multi-layered spot data compression file into a unified format and storing the converted multi-layered spot data into a spatial database includes: According to the corresponding relationship between the data numbers in each data file, each piece of data in each data file is extracted one by one, and the extracted multiple pieces of data are merged into one complete piece of data; Using a conversion tool, converting the format of the complete data into a unified format, wherein the conversion tool includes a geospatial data abstraction library; According to the spatial data table structure defined in the spatial database, the converted multi-layer image data in a unified format is stored in the spatial database.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for comparing differences in multi-layer pattern data as described in any one of claims 1 to 6.

9. An electronic device, characterized in that: The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor executes the method for comparing the difference of multi-layer pattern data as described in any one of claims 1 to 6.