Ecological land evolution mode quantitative identification method and device based on two-dimensional array

Through the quantitative identification method of ecological land evolution mode based on two-dimensional arrays, the problem of failure to capture the uniqueness and connectivity of ecological land evolution mode in the existing technology is solved, and the efficiency and accuracy of ecological land analysis is achieved, and the accuracy of ecological management is improved. and timeliness.

CN119152362APending Publication Date: 2024-12-17WUHAN UNIV

Patent Information

Application Number
CN202411132387.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

The existing technology fails to properly capture the uniqueness of the evolution model of ecological land and fails to fully consider the connectivity and temporal dynamics of ecological land, which affects the accuracy and timeliness of ecological management.

Method used

Using a quantitative identification method of ecological land evolution mode based on two-dimensional arrays, the land use raster data is collected, and the ecological land evolution index ELEI calculation function is constructed, multiple small areas are divided for parallel calculation, and generated Two-dimensional ELEI array realizes efficient quantitative analysis of ecological land evolution mode.

Benefits of technology

It improves the accuracy and efficiency of ecological land evolution analysis, comprehensively reveals the complexity of ecological processes, and enhances the accuracy and timeliness of ecological management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119152362A_ABST
    Figure CN119152362A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of geographic information science, in particular to an ecological land evolution mode quantitative recognition method and device based on a two-dimensional array, and the method comprises the steps: collecting land utilization raster data, obtaining ecological land data through preprocessing, converting the ecological land data into a two-dimensional array, and carrying out the tagging processing to obtain tagged ecological patches; carrying out quantitative analysis in combination with the changed ecological plaques to obtain a spatial quantitative relationship of the evolved ecological plaques, and constructing an ecological land evolution index calculation function; and dividing the ecological plaques in the ecological land for parallel calculation, and generating a two-dimensional ELI array through a result mapping function to obtain a quantitative analysis result of the evolution mode of the ecological land. Therefore, the problems that the complexity of the ecological process cannot be comprehensively revealed, the accuracy and timeliness of ecological management are affected and the like due to the fact that the uniqueness of the evolvement mode of the ecological land is not properly captured and the connectivity and the time dynamics of the ecological land are not fully considered in the related technology are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of geographic information science and technology, and in particular to a method and device for quantitatively identifying ecological land evolution patterns based on a two-dimensional array. Background Art

[0002] At present, China's ecological civilization construction has entered a critical period of achieving a qualitative change in ecological environment improvement from quantitative change. Given the indispensable role of ecological land in terrestrial ecosystems, quantifying the spatiotemporal characteristics of its evolution is crucial to understanding the ecological consequences of human land use and potential ecological processes.

[0003] Among the related technologies, the use of advanced remote sensing technology and geographic information system (GIS) can quantitatively characterize the evolution characteristics of regional landscape patterns based on landscape ecology theory. From the initial emphasis on quantifying landscape space and the widespread application of the landscape index software Fragstats, which focuses on geometric attributes, to the series of indexes in the field of urban research that quantify the evolution characteristics of urban expansion based on boundary contribution rates, the dynamics of urban land evolution can be effectively characterized.

[0004] However, in related technologies, because they fail to capture the uniqueness of the evolution pattern of ecological land oriented towards conservation, the simple and blind application of index methods to characterize ecological land cannot reveal the complexity of ecological processes and cannot accurately reflect the actual situation. Because they fail to capture the temporal dynamics of landscape connectivity at the patch level and do not consider changes in connectivity caused by natural disturbances, habitat loss or land use changes, the scientific nature and pertinence of quantitative assessments may be affected, and improvements are urgently needed. Summary of the invention

[0005] The present application provides a method and device for quantitatively identifying the evolution pattern of ecological land based on a two-dimensional array, in order to solve the problems in the related technology that the effectiveness of ecological management may be reduced due to the failure to properly capture the uniqueness of the evolution pattern of ecological land, and the complexity of ecological processes may not be fully revealed due to the failure to fully consider the connectivity and temporal dynamics of ecological land, thus affecting the accuracy and timeliness of ecological management.

[0006] The first aspect of the present application provides a method for quantitatively identifying an ecological land evolution pattern based on a two-dimensional array, comprising the following steps: collecting land use raster data of an ecological land, preprocessing the land use raster data to obtain ecological land data, converting the ecological land data into a two-dimensional array, and labeling the two-dimensional array to obtain labeled ecological patches; quantitatively analyzing the labeled ecological patches and the changing ecological patches to obtain a spatial quantitative relationship between the evolving ecological patches, and constructing an ecological land evolution index ELEI calculation function based on the quantitative relationship; dividing the ecological patches in the ecological land into a plurality of small areas, performing parallel calculations on the plurality of small areas using the ELEI calculation function to obtain a calculation result for each small area, and saving the calculation result for each small area in a dictionary form to obtain a global dictionary; generating a two-dimensional ELEI array in combination with the key values ​​and the result mapping function in the global dictionary, and obtaining a quantitative analysis result of the ecological land evolution pattern based on the two-dimensional ELEI array.

[0007] Optionally, in one embodiment of the present application, the labeling processing of the two-dimensional array to obtain labeled ecological patches includes: converting the ecological land data into the two-dimensional array, and labeling the two-dimensional array to obtain a label array for each ecological patch in the two-dimensional array: obtaining the area of ​​each ecological patch based on the number of times each label appears in the label array, and when the area is less than a preset threshold, removing the ecological patch corresponding to the area in the two-dimensional array to obtain an updated two-dimensional array; labeling the updated two-dimensional array to obtain a final labeled two-dimensional array and the corresponding labeled ecological patches.

[0008] Optionally, in one embodiment of the present application, the two-dimensional array is:

[0009] grid_dataset=gdal.Open(path)

[0010] array=dataset.GetRasterBand(1).ReadAsArray()

[0011] array=(array==1).astype(int)

[0012] Among them, grid_dataset is the input raster data, array is a binary array, GetRasterBand(1).ReadAsArray() reads the first band of the raster data and converts it into an array, and (array==1).astype(int) performs a Boolean operation on the array and converts it into a binary array containing only 0 and 1.

[0013] Optionally, in one embodiment of the present application, the labeled ecological patches and the changing ecological patches are quantitatively analyzed to obtain the spatial quantitative relationship of the evolving ecological patches, so as to construct the ecological land evolution index ELEI calculation function based on the quantitative relationship, including: constructing a first molar neighborhood array of the labeled ecological patches based on the labeled ecological patches and the label values ​​corresponding to the labeled ecological patches; constructing a second molar neighborhood array of the changing ecological patches based on the changing ecological patches and the label values ​​corresponding to the changing ecological patches; quantitatively analyzing the first molar neighborhood array and the second molar neighborhood array to obtain the spatial quantitative relationship of the evolving ecological patches, so as to construct the ecological land evolution index ELEI calculation function based on the spatial quantitative relationship of the evolving ecological patches.

[0014] Optionally, in one embodiment of the present application, the calculation function of the ELEI is:

[0015]

[0016] Among them, C is the number of non-zero label values ​​in the intersecting_labels array, λ is a binary variable indicating the increase or decrease of the changed ecological land patches, and N * is the number of pixels that intersect the mole area with the patch and the newly added patch, N is the number of pixels in the mole neighborhood of the newly added patch i, C max It is the maximum value of the number of intersections C between all new patches and the original patches.

[0017] The second aspect of the present application provides an apparatus for quantitatively identifying an ecological land evolution pattern based on a two-dimensional array, comprising: a collection module for collecting land use raster data of ecological land, preprocessing the land use raster data to obtain ecological land data, converting the ecological land data into a two-dimensional array, and labeling the two-dimensional array to obtain labeled ecological patches; a construction module for quantitatively analyzing the labeled ecological patches and the changing ecological patches to obtain a spatial quantitative relationship between the evolving ecological patches, so as to construct an ecological land evolution index ELEI calculation function based on the quantitative relationship; a calculation module for dividing the ecological patches in the ecological land into a plurality of small areas, performing parallel calculations on the plurality of small areas using the ELEI calculation function to obtain a calculation result for each small area, and saving the calculation result for each small area in a dictionary form to obtain a global dictionary; an identification module for generating a two-dimensional ELEI array in combination with the key value and the result mapping function in the global dictionary, so as to obtain a quantitative analysis result of the ecological land evolution pattern based on the two-dimensional ELEI array.

[0018] Optionally, in one embodiment of the present application, the acquisition module includes: a first processing unit, used to convert the ecological land data into the two-dimensional array, and label the two-dimensional array to obtain a label array for each ecological patch in the two-dimensional array; a statistical unit, used to obtain the area of ​​each ecological patch based on the number of times each label appears in the label array, and when the area is less than a preset threshold, remove the ecological patch corresponding to the area in the two-dimensional array to obtain an updated two-dimensional array; a second processing unit, used to label the updated two-dimensional array to obtain a final labeled two-dimensional array and the corresponding labeled ecological patch.

[0019] Optionally, in one embodiment of the present application, the two-dimensional array is:

[0020] grid_dataset=gdal.Open(path)

[0021] array=dataset.GetRasterBand(1).ReadAsArray()

[0022] array=(array==1).astype(int)

[0023] Among them, grid_dataset is the input raster data, array is a binary array, GetRasterBand(1).ReadAsArray() reads the first band of the raster data and converts it into an array, and (array==1).astype(int) performs a Boolean operation on the array and converts it into a binary array containing only 0 and 1.

[0024] Optionally, in one embodiment of the present application, the construction module includes: a first construction unit, used to construct a first molar neighborhood array of the labeled ecological patches based on the labeled ecological patches and the label values ​​corresponding to the labeled ecological patches; a second construction unit, used to construct a second molar neighborhood array of the changing ecological patches based on the changing ecological patches and the label values ​​corresponding to the changing ecological patches; a construction unit, used to perform quantitative analysis on the first molar neighborhood array and the second molar neighborhood array to obtain the spatial quantitative relationship of the evolving ecological patches, so as to construct an ecological land evolution index ELEI calculation function based on the spatial quantitative relationship of the evolving ecological patches.

[0025] Optionally, in one embodiment of the present application, the calculation function of the ELEI is:

[0026]

[0027] Among them, C is the number of non-zero label values ​​in the intersecting_labels array, λ is a binary variable indicating the increase or decrease of the changed ecological land patches, and N * is the number of pixels that intersect the mole area with the patch and the newly added patch, N is the number of pixels in the mole neighborhood of the newly added patch i, C max It is the maximum value of the number of intersections C between all new patches and the original patches.

[0028] The third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method for quantitatively identifying ecological land evolution patterns based on two-dimensional arrays as described in the above embodiment.

[0029] The fourth aspect of the present application provides a computer-readable storage medium, which stores a computer program. When the program is executed by a processor, it implements the above-mentioned method for quantitatively identifying ecological land evolution patterns based on two-dimensional arrays.

[0030] A fifth aspect of the present invention provides a computer program product, which, when executed, is used to implement the above-mentioned method for quantitatively identifying ecological land evolution patterns based on two-dimensional arrays.

[0031] The embodiment of the present application can collect and preprocess the land use raster data of ecological land, convert the obtained ecological land data into a two-dimensional array, and label the two-dimensional array to obtain labeled ecological patches, and then by quantitatively analyzing the labeled ecological patches and the changing ecological patches, the ecological land evolution index ELEI calculation function can be constructed, so that the ecological patches in the ecological land can be divided into multiple small areas, and the ELEI calculation function is used to perform parallel calculations on multiple small areas, and the calculation results of each small area are saved in the form of a dictionary, and the key value and result mapping function in the global dictionary are combined to generate a two-dimensional ELEI array, so as to realize the efficient parallel quantitative analysis of the ecological land evolution pattern, and effectively improve the accuracy and efficiency of the ecological land evolution analysis. Thus, the problems in the related art that the uniqueness of the ecological land evolution pattern cannot be properly captured, which may reduce the effectiveness of ecological management, and the complexity of the ecological process cannot be fully revealed due to the failure to fully consider the connectivity and time dynamics of the ecological land, which affects the accuracy and timeliness of ecological management.

[0032] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0034] Figure 1 A flowchart of a method for quantitatively identifying an ecological land evolution pattern based on a two-dimensional array according to an embodiment of the present application;

[0035] Figure 2 A flowchart of a method for quantitatively identifying ecological land evolution patterns based on a two-dimensional array according to an embodiment of the present application;

[0036] Figure 3 A schematic diagram of land use overview provided according to an embodiment of the present application;

[0037] Figure 4 A schematic diagram of array labeling provided according to an embodiment of the present application;

[0038] Figure 5 A schematic diagram of a Moore neighborhood provided according to an embodiment of the present application;

[0039] Figure 6 A schematic diagram of an ecological land evolution model provided according to an embodiment of the present application;

[0040] Figure 7 A parallel computing flow chart provided according to an embodiment of the present application;

[0041] Figure 8 A flow chart of a partition segmentation algorithm provided according to an embodiment of the present application;

[0042] Fig. 9 A schematic diagram of the spatial distribution of the ecological land evolution pattern provided according to an embodiment of the present application;

[0043] Fig.10 A schematic diagram of the structure of a device for quantitatively identifying an ecological land evolution pattern based on a two-dimensional array according to an embodiment of the present application;

[0044] Fig.11 It is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0045] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0046] The following describes the method and device for quantitatively identifying ecological land evolution patterns based on a two-dimensional array according to an embodiment of the present application with reference to the accompanying drawings. In view of the related technologies mentioned in the above background technology center, the effectiveness of ecological management may be reduced due to the failure to properly capture the uniqueness of the evolution pattern of ecological land. Due to the failure to fully consider the connectivity and temporal dynamics of ecological land, the complexity of ecological processes may not be fully revealed, affecting the accuracy and timeliness of ecological management. This application provides a quantitative identification method for ecological land evolution patterns based on two-dimensional arrays. In this method, land use raster data of ecological land can be collected and preprocessed, the obtained ecological land data can be converted into a two-dimensional array, and the two-dimensional array can be labeled to obtain labeled ecological patches. Then, by quantitatively analyzing the labeled ecological patches and the changing ecological patches, an ecological land evolution index ELEI calculation function can be constructed, so that the ecological patches in the ecological land can be divided into multiple small areas, and the ELEI calculation function can be used to perform parallel calculations on multiple small areas, and the calculation results of each small area are saved in the form of a dictionary. The key value and result mapping function in the global dictionary are combined to generate a two-dimensional ELEI array, so as to realize efficient parallel quantitative analysis of the ecological land evolution pattern, and effectively improve the accuracy and efficiency of the ecological land evolution analysis. This solves the problems in related technologies, such as failing to properly capture the uniqueness of the evolution pattern of ecological land, which may reduce the effectiveness of ecological management; failing to fully consider the connectivity and temporal dynamics of ecological land, which may not fully reveal the complexity of ecological processes, affecting the accuracy and timeliness of ecological management.

[0047] Specifically, Figure 1 A schematic flow chart of a method for quantitatively identifying ecological land evolution patterns based on a two-dimensional array provided in an embodiment of the present application.

[0048] like Figure 1 As shown, the method for quantitatively identifying the evolution pattern of ecological land based on a two-dimensional array includes the following steps:

[0049] In step S101, land use raster data of ecological land is collected, and the land use raster data is preprocessed to obtain ecological land data, the ecological land data is converted into a two-dimensional array, and the two-dimensional array is labeled to obtain labeled ecological patches.

[0050] It can be understood that the preprocessing includes: unifying the coordinates of spatial grid data; reclassifying according to whether it is ecological land (forest land, grassland, shrub, wetland) according to the classification system of land type data (different land types have different values), assigning 1 to ecological land and 0 to other land types; using multi-period ecological land data to obtain grid data of changing ecological land within a certain period of time. Ecological land data includes multi-period ecological land data and changing ecological land data.

[0051] In the actual implementation process, combined with Figure 2 As shown, the embodiment of the present application can collect and process data, including multi-period raster format land use data of the study area, and perform preprocessing to obtain multi-period ecological land data and change ecological land data, all of which are in raster format. Define raster data preprocessing functions, including functions for obtaining raster data coordinate information, functions for converting raster data into two-dimensional arrays that can be processed by NumPy, and labeling algorithms for labeling ecological land patches in two-dimensional arrays to obtain samples that can be used for quantitative calculation of evolution patterns separately.

[0052] Specifically, combined Figure 3 As shown, the embodiment of the present application preprocesses the land use raster data and unifies the coordinates of the spatial raster data; according to the classification system of land type data (different land types have different numerical values), it is reclassified according to whether it is ecological land (forest land, grassland, shrubs, wetlands), and the ecological land is assigned a value of 1 and other land types are assigned a value of 0; multi-period ecological land data are used to obtain raster data of changing ecological land within a certain period of time.

[0053] Furthermore, the embodiment of the present application can obtain the attribute information of the original input raster data, which is convenient for converting the array results into the corresponding format and then performing subsequent spatial analysis. The raster data is converted into a two-dimensional array format because the NumPy library in Python provides a large number of methods for processing array format data, and has the unique advantages of efficient calculation and memory saving. Since the basis for quantitative calculation of the ecological patch evolution pattern is to determine the spatially independent research samples, namely ecological patches (a collection of spatially continuous ecological land pixels), therefore, Figure 4 As shown in the figure, the two-dimensional array of ecological land in the study area is labeled according to the label tool in the multidimensional image processing module of SciPy, so that each ecological patch has a unique label value, which can be used as the unique sample identifier for quantitative calculation, making it convenient to perform subsequent data processing and calculation on the array with the label value as the index, thereby completing the preprocessing of the data format and quantitative calculation of the sample data.

[0054] For example, combining Figure 3As shown, the middle reaches of the Yangtze River urban agglomeration is taken as the study area, and land use classification data are collected, mainly including 9 categories such as cultivated land, forest land, shrubs, grassland, water area, ice and snow, bare land, impervious surface and wetland. Among them, the embodiment of the present application regards forest land, shrubs, grassland and wetland as ecological land. The overall accuracy of the data is 80%, of which the forest accuracy reaches 85%, the resolution is 30m, the data format is raster, the geographic coordinate system is WGS1984, and the projection coordinate system is Albers_Conic_Equal_Area. Furthermore, the data processing in the embodiment of the present application mainly includes: (1) performing unified projection transformation processing on the spatial raster data to form a raster dataset with a consistent spatial coordinate system; (2) selecting two periods of ecological land data in 1990 and 2020, and using spatial analysis tools in ArcGIS10.5 for spatial overlay to obtain raster data of ecological land changes within 30 years. When a pixel is a newly added ecological land (that is, the position that was 0 in the 1990 data is 1 in 2020), the pixel is 1, and when the pixel is a reduction in ecological land (that is, the position that was 0 in the 1990 data is 1 in 2020), the pixel is -1, and the pixels in other cases are 0.

[0055] Optionally, in one embodiment of the present application, the two-dimensional array is labeled to obtain labeled ecological patches, including: converting ecological land data into a two-dimensional array, and labeling the two-dimensional array to obtain a label array for each ecological patch in the two-dimensional array: obtaining the area of ​​each ecological patch based on the number of times each label appears in the label array, and when the area is less than a preset threshold, removing the ecological patch corresponding to the area in the two-dimensional array to obtain an updated two-dimensional array; labeling the updated two-dimensional array to obtain a final labeled two-dimensional array and corresponding labeled ecological patches.

[0056] It can be understood that the preset threshold refers to a set area threshold, which is used to filter out patches with smaller areas.

[0057] Specifically, combined Figure 2 As shown, the embodiment of the present application can use the gdal and osr modules in the osgeo library in Python to obtain the basic attribute information of the input raster, including the row number, column number, conversion form, geographic coordinate system, projection coordinate system and number of bands, so as to unify the raster attributes when writing the results. Use the gdal module to open the preprocessed ecological land raster, including the changed ecological land raster and the 2020 ecological land raster, and convert it into a binary array.

[0058] Optionally, in one embodiment of the present application, the two-dimensional array is:

[0059] grid_dataset=gdal.Open(path)

[0060] array=dataset.GetRasterBand(1).ReadAsArray()

[0061] array=(array==1).astype(int)

[0062] Among them, grid_dataset is the input raster data, array is a binary array, GetRasterBand(1).ReadAsArray() reads the first band of the raster data and converts it into an array, and (array==1).astype(int) performs a Boolean operation on the array and converts it into a binary array containing only 0 and 1.

[0063] Furthermore, the embodiment of the present application can use the labeling function label of the multidimensional image processing module ndimage in the scientific computing library scipy to label the binary array and obtain the label array of each ecological patch:

[0064] labeled_array,numbers_patch=label(array,structure=slide_window)

[0065] Among them, labeled_array represents the labeled array; array represents the binary array; label is the labeling function, the input is the binary array and the structure element, and the output is an array that marks the connected areas with the same label to identify ecological patches; structure represents the structure element:

[0066]

[0067] The structural element is used to identify the connected area, that is, the ecological land pixels with common edges and common points centered on the ecological land patch belong to the same patch and have the same label value.

[0068] label_sizes=np.bincount(labeled_array.ravel())

[0069] label_sizes represents the number of elements contained in the different label values, that is, the area corresponding to each ecological patch. np.bincount is a function that counts the number of occurrences of array elements (integers), and labeled_array.ravel() is an operation that converts a two-dimensional array into a one-dimensional array.

[0070] too_small_indexes=(label_sizes≤1)[labeled_array]

[0071] labeled_array[too_small_indexes]=0

[0072] too_small_indexes indicates the index position of the ecological patch with only one pixel in the labeled array, (label_sizes≤1) indicates the Boolean array of label values ​​of the ecological patch with an area less than one pixel, and too_small_indexes is obtained by advanced indexing with the labeled array labeled_array. Then the label element at the index position is set to 0, considering that the ecological patch needs to have a certain area, that is, the interference of sporadic patches on the quantitative results is removed.

[0073] labeled_array,numbers_patch=label(labeled_array,structure=slide_window)

[0074] Finally, combine Figure 4 As shown, the embodiment of the present application again uses the label function to label the ecological land after removing sporadic elements to obtain the final labeled two-dimensional array.

[0075] In step S102, a quantitative analysis is performed on the labeled ecological patches and the changed ecological patches to obtain the spatial quantitative relationship of the evolving ecological patches, so as to construct an ecological land evolution index ELEI calculation function based on the quantitative relationship.

[0076] During the actual implementation process, the embodiment of the present application can quantify the spatial relationship of the labeled evolving ecological patches based on the multidimensional image processing method in the NumPy scientific computing library, including obtaining the Moore neighborhood, quantifying patch intersections (including the number of patches and the number of intersecting patch pixels), and calculating the ecological land evolution index ELEI.

[0077] Optionally, in one embodiment of the present application, a quantitative analysis is performed on labeled ecological patches and changing ecological patches to obtain a spatial quantitative relationship between evolving ecological patches, so as to construct an ecological land evolution index ELEI calculation function based on the quantitative relationship, including: constructing a first molar neighborhood array of labeled ecological patches based on labeled ecological patches and the label values ​​corresponding to the labeled ecological patches; constructing a second molar neighborhood array of changing ecological patches based on changing ecological patches and the label values ​​corresponding to the changing ecological patches; quantitatively analyzing the first molar neighborhood array and the second molar neighborhood array to obtain a spatial quantitative relationship between evolving ecological patches, so as to construct an ecological land evolution index ELEI calculation function based on the spatial quantitative relationship between evolving ecological patches.

[0078] Specifically, the embodiment of the present application can define a calculation function to quantify various factors of the evolution pattern of the quantified ecological land based on the need for spatial relationship measurement in the process of quantitative ecological land evolution: including the molar neighborhood of the ecological land patch and its area N, the number of original ecological patches intersecting with the changed ecological land C, and the area N of the molar area of ​​the original ecological land and the changed ecological land overlapping in space. * The input of this function includes: ecological land patch labels, changed ecological land label array, original ecological land label array and structural elements.

[0079] First, the embodiment of the present application determines the calculation method of the Moore neighborhood of the changed ecological land array, based on the label value of the ecological patch, using the array index to extract the two-dimensional array that uniquely identifies the ecological patch, and its size is the same as the regional two-dimensional array. The formula for extracting the array is as follows:

[0080] mask i =labeled_array==patchlabel i

[0081] moore_neighborhood i =binary_dilation(mask i , structure

[0082] =structure_window).astype(np.uint8)-mask i

[0083] Among them, mask i A Boolean array representing the i-th patch, where 1 identifies the ecological land pixels belonging to patch i, 0 identifies the background, labeled_array identifies the labeled ecological land array of the study area, patchlabel iIndicates the label value of patch i. Use == to make a numerical judgment on the original labeled_array to get the label value and patchlabel i Equal array positions, form a Boolean array and assign it to mask i ,like Figure 5 As shown, the binary expansion algorithm is used to obtain the Moore neighborhood of the label array, where moore_neighborhood i Represents the Moore neighborhood array of patch i, binary_dilation represents the binary dilation algorithm, dilation is a mathematical morphological operation that uses a structuring element to expand the shape in the image. When the center of the structuring element is located within a non-zero point in the image, the binary dilation of the image by the structuring element is the set of pixels covered by the structuring element. astype(np.uint8) means converting the obtained Boolean array to an unsigned integer type. Among them, the defined structuring element structure_window is the same as that in step S101:

[0084]

[0085] That is, the pixel of the ecological land patch is the center, and the pixels with common edges and common points belong to the Moore neighborhood set of the patch, such as Figure 5 shown.

[0086] Furthermore, the embodiment of the present application can use array operations to quantify the spatial topological relationship between the molar neighborhood of the changed ecological land and the original ecological land, that is, by calculating the number C of original ecological patches intersecting with the changed ecological land to characterize the performance of the changed ecological land in enhancing connectivity / increasing fragmentation, and by calculating the area N of spatial overlap between the molar areas of the original ecological land and the changed ecological land * To describe the spatial proximity relationship between the changed ecological land and the original ecological land:

[0087] intersecting_labels=np.unique(oldpatch_labelarray[moore_neighborhood>0])

[0088] C=len(intersecting_labels[intersecting_labels!=0])

[0089] N * =np.sum(oldpatch_labelarray[moore_neighborhood>0]>0)

[0090] Among them, oldpatch_labelarray is the array of labeled original patches. The np.unique function is used to obtain the intersecting deduplication label value array intersecting_labels of the original patch array and the Moore domain array. That is, this array represents the label values ​​of the original patches that intersect with the newly added patches. The number of non-zero label values ​​C indicates how many original patches are connected to the newly added patches, which is used to indicate the connectivity of the newly added patches. np.sum is a summation function that obtains the number of pixels N where the Moore domain of the original patch intersects with the newly added patch. * , which is used to represent the proximity relationship between patches.

[0091] In addition, the embodiment of the present application can construct a calculation function of the ecological land evolution index ELEI based on the above two quantitative relationships.

[0092] Optionally, in one embodiment of the present application, the calculation function of ELEI is:

[0093]

[0094] Among them, C is the number of non-zero label values ​​in the intersecting_labels array, λ is a binary variable indicating the increase or decrease of the changed ecological land patches, and N * is the number of pixels where the patched moorish area intersects with the newly added patch, and ELEI represents the ELEI value of the changed ecological land patch, and its value range is [-1, 1]. When λ = 0, it indicates that the patch is a repaired new patch. At this time, the value of ELEI is between [0, 1]. The closer it is to 1, the higher the connectivity of the ecological patch, and the more original ecological patches connected to it; when λ = 1, it indicates that the patch is a decaying and diminishing patch. At this time, the value of ELEI is between [-1, 0]. The closer it is to -1, the higher the degree of fragmentation caused by the disappearance of the ecological patch, and the more original ecological patches connected to it lose direct connectivity; N is the moore neighborhood of the newly added patch, moore_neighborhood i The number of pixels is its area, C max It represents the maximum value of the number of intersections C between all new patches and the original patches, and is used as the denominator to normalize the data.

[0095] It is worth noting that Figure 6As shown, the embodiment of the present application can divide ecological patches into two categories according to the interval size of the ELEI value: restoration and expansion type (leap type, edge type, filling type, seed type and interconnected type) and degradation and reduction type (isolated type, adjacent type, infiltration type and fragmented type). When ELEI=0, the molar neighborhood of the changed patch does not intersect with the original patch. If the patch is a newly added patch, it is a leap type, and if it is a reduction patch, it is an isolated type. When the changed patch intersects only with one original patch, that is, C=1, and N * / N is between (0, 0.5], the ecological patch is marginal. * When / N is between [-0.5, 0), the patch is adjacent and N * / N is between (0.5, 1], the ecological patch is a filled type. * / N is between [-1, 0), the patch is of the intraosmotic type; when the changed patch intersects with more than one original patch, that is, C>1, if ELEI>0, the patch is of the interconnected type, and the larger the ELEI value, the better the connectivity of the patch; if ELEI<0, the patch is of the fragmented type, and the smaller the ELEI value, the more serious the ecological fragmentation caused by the patch.

[0096] The embodiment of the present application quantifies the evolution pattern of ecological land patches from the perspective of spatial relationships and connectivity, and quantifies the spatiotemporal evolution relationship of ecological land arrays based on a two-dimensional array scientific computing method of image processing. It innovatively replaces traditional vector data spatial analysis with array computing, and considers and quantifies the most critical connectivity of ecological land, effectively reflecting the deep characteristics of ecological land evolution.

[0097] In step S103, the ecological patches in the ecological land are divided into multiple small areas, and the ELEI calculation function is used to perform parallel calculations on the multiple small areas to obtain the calculation results of each small area, and the calculation results of each small area are saved in the form of a dictionary to obtain a global dictionary.

[0098] Specifically, the embodiment of the present application can utilize the ThreadPoolExecutor multi-threaded function in the concurrent.futures module, design a multi-threaded computing algorithm to submit the task of calculating the patch ELEI value to the computer system in a multi-threaded manner, and then divide the ELEI calculation of ecological patches in a large research area into small areas for calculation according to the designed partitioning calculation segmentation algorithm, obtain the ELEI value corresponding to the label value and the dictionary of the number C of non-zero label values ​​in the intersecting_labels array, and put the result of the label value into the dictionary.

[0099] For example, combining Figure 7As shown, the embodiment of the present application implements the calculation of ELEI values ​​of multiple ecological patches. The parallelization algorithm designed by the multi-threaded computing method in Python can improve the calculation speed and efficiency. First, it is determined that the input parameters include the labeled changed ecological land label array, the 2020 ecological land label array, and the same structural element structure as in step S101; then it is necessary to judge the valid value of the input array, that is, the number of unique values ​​in the input changed ecological land array must exceed 1, and except for the background value 0, other label values ​​are greater than 0. Then, two empty dictionaries are constructed to store the ELEI values ​​and C values ​​that correspond one-to-one to the changed ecological land labels, and then a list is constructed to store the parameters that need to be input into step S102; then the parameter list and the function of step S102 are submitted to the multi-threaded function:

[0100] futures={executor.submit(calculate_elei_or_label, arg): arg for arg inargs}

[0101] Among them, futures represents the ELEI calculation task of all ecological patches that are stored and input, calculate_elei_for_label is the calculation function in step S102, and args is the constructed parameter list, which mainly includes ecological land patch labels, changed ecological land label arrays, original ecological land label arrays and structural elements.

[0102] Therefore, a task for calculating ELEI is established for each tag. The ThreadPoolExecutor library is used for multi-threaded parallel calculation to obtain the ELEI calculation result of each patch. The result of the tag value is put into the dictionary using the following formula:

[0103]

[0104] Among them, ELEI_dic represents the dictionary storing the calculated ELEI value. The key is the plaque label value label, and the value is the ELEI corresponding to the label. Since the segmentation algorithm is used to divide the area into several areas for batch calculation, the maximum value is used to put the result into the dictionary to solve the problem of repeated calculation of patches on the segmentation boundary, so as to ensure the relative scientificity of the result.

[0105] In addition, combined Figure 8As shown in the figure, due to the wide geographical scope of the urban agglomeration in the middle reaches of the Yangtze River, the number of ecological land patches involved is nearly one million, and direct calculation will lead to huge computational workload and memory pressure. Therefore, the labeled ecological land array is divided into multiple small areas according to the split index row and column numbers, and the above parallel calculation is performed separately, as shown below:

[0106] row_batches=np.array_split(range(rows),num_batches)

[0107] col_batches=np.array_split(range(cols),num_batches)

[0108] sub_newlabels=newpatch_label[start_row:stop_row,start_col:stop_col]

[0109] Among them, row_batches represents the array containing the row numbers of all segmented labeled arrays, col_batches represents the array containing the column numbers of all segmented labeled arrays, and rows represents the row number of the total study area array. co ls represents the column number of the total study area array, np.array_split() represents a function that divides the array elements into roughly the same number, num_batches represents the number of row and column numbers to be split, and in the example, it is taken as 40 after weighing the computing time and efficiency; sub_newlabels indicates that the labeled array after segmentation includes the ecological patch label values ​​in the sub-area and is used to parallelize the calculation of its ELEI; newpatch_label represents the label array of ecological land changes in the middle reaches of the Yangtze River urban agglomeration from 1990 to 2020; start_row is the starting index row number of the sub-array after segmentation in the original array; stop_row represents the ending index row number of the sub-array after segmentation in the original array; start_col is the starting index column number of the sub-array after segmentation in the original array; stop_col represents the ending index column number of the sub-array after segmentation in the original array.

[0110] The embodiment of the present application overcomes the deficiency of insufficient computing resources due to excessive memory usage during data processing by designing a partitioning and segmentation algorithm, and provides a complete quantitative calculation process from raster data input to raster data output and a standardized method for regional specific attributes, thereby improving generalization capabilities.

[0111] In step S104, a two-dimensional ELEI array is generated by combining the key values ​​in the global dictionary and the result mapping function, so as to obtain the quantitative analysis result of the ecological land evolution pattern based on the two-dimensional ELEI array.

[0112] Specifically, after the above sub-arrays are parallelized and calculated, the results need to be merged into a global dictionary, and the one-to-one correspondence between the label values ​​and the calculation results is ensured:

[0113] global_elei_dict[label]=max(global_elei_dict.get(label, 0), value)

[0114] Among them, global_elei_dict represents the dictionary storing the global ELEI calculation results, label represents the label value of the current calculation patch, and global_elei_dict.get(label, 0) is used to represent the method of safely obtaining the value of label. When the label value exists in the global dictionary, it returns the corresponding value, and when it does not exist, it returns 0, and then takes the maximum value of the value under the current label and puts it into the global dictionary.

[0115] Furthermore, the embodiment of the present application can use the results in the global dictionary to quickly generate a two-dimensional ELEI array based on the array fancy indexing function:

[0116] elei_array=index_array[label-array]

[0117] Among them, index_array represents the list of ELEI calculation results, and its index is the element corresponding to the label value, which is the ELEI of the label. label_array represents the label array of changed ecological land. elei_array represents the two-dimensional array of results, which has the same size as the input array, and its value reflects the ELEI value of the ecological patch evolution pattern at that location.

[0118] In addition, the embodiment of the present application can convert the two-dimensional ELEI array quickly generated in the previous step into a raster format according to the original raster attribute information, and display its spatial distribution to further analyze the evolution pattern of ecological land.

[0119] Combination Fig. 9 As shown in the data, the evolution pattern of the ecological landscape of the urban agglomeration in the middle reaches of the Yangtze River from 1990 to 2020 showed a trend of gradual strengthening of restoration and addition and degradation and reduction, indicating that the ecological landscape pattern has changed dramatically under the dual drive of development and protection. Among them, the area of ​​degraded ecological land is 14,855.51 square kilometers, and the area of ​​restored ecological land is 9,364.71 square kilometers, accounting for 10.27% and 6.74% of the total ecological land area, respectively.

[0120] Specifically, the ecological connectivity of the newly added patches is showing an overall increasing trend in the region. Although the number of connected growth patches accounts for a relatively low proportion, the area accounts for a high proportion (as high as 39.97% in 2010-2020), an increase of 1,154.12 square kilometers over the previous cycle. It is the main type of restoration and is mainly distributed in mountainous and hilly areas along the river, such as the agricultural and forestry interaction areas on the edge of Mufu Mountain and Luoxiao Mountain in the center of the urban agglomeration, such as the southeastern part of Yueyang City and the southern part of Xianning City; as well as the area between the northern part of Poyang Lake and the western foot of Huaiyu Mountain, and the hilly areas between Xiangjiang River and Xuefeng Mountain; most areas of Macheng City in the southern part of Dabie Mountains, and the mountains along the Yangtze River in the west of Yichang City. These areas are generally key ecological functional areas, which undertake functions such as soil and water conservation and water conservation, and have implemented a large number of projects including returning farmland to forests, natural forest protection projects, and mine restoration projects. However, in urban dense areas such as Wuhan, Changsha, and Nanchang, land rents are expensive and restoration costs are too high, so there are fewer restoration patches. The area of ​​filling-type patches shows a decreasing trend, while the new additions of leap-type and edge-type patches show an increasing trend. Among them, the area share and number share of leap-type patches have continued to increase. The area in 2010-2020 reached 684.25 square kilometers, an increase of more than 90% over the previous cycle, indicating that with the advancement of ecological restoration projects, the ecological landscape is expanding in a point-to-surface manner, and is mainly presented in the form of interconnection; among the degraded and reduced patches, the proportion of infiltration-type patches has changed most significantly, especially in 2010-2020, when its area share increased from 27.55% in the previous cycle to 35.14%, indicating that the invasion of the hinterland-style occupation of the ecological landscape has become more and more serious during this stage. At the same time, the area share of fragmented patches has also gradually increased, indicating that with the dual erosion of ecological space by urbanization construction and the balance of cultivated land occupation and compensation, the situation of ecological fragmentation has become more serious. It is mainly distributed in the agro-forestry transition zone in the southern part of Hengyang City, Pingxiang City, Yichun City, Loudi City and other areas, as well as near the urban built-up areas in the southern part of Wuhan urban circle. Rapid urbanization and industrialization have encroached on the periphery of the ecological space, as shown in Table 1. Table 1 is a table of the area and quantity proportions of the ecological land evolution pattern.

[0121] Table 1

[0122]

[0123] It is worth noting that the embodiments of the present application can provide the government management department with a scientific basis for the quantitative evaluation of the evolution pattern of ecological land, and take more targeted ecological restoration measures, such as population evacuation, industrial transfer and economic multi-center development in areas with high land urbanization rates, so as to reduce the pressure of infiltration-type patch degradation and promote marginal and filling-type ecological restoration. In addition, effective countermeasures should be formulated for the spatial distribution and evolution trend of ecological degradation to prevent ecological degradation in key areas and promote a virtuous cycle of ecological protection and high-quality economic development. The restoration of ecological degradation in urban agglomerations is a regional problem. Through quantitative evaluation of the evolution of ecological land in different regions, the attention and participation of various cities in the ecological integrated restoration of "mountains, rivers, forests, fields, lakes, grasses and sands" should be increased to prevent the disorder and scattered distribution of ecological restoration projects. In addition, as an important ecological functional area in my country, the urban agglomeration in the middle reaches of the Yangtze River should also carry out cross-regional overall restoration of key ecological functional areas, demarcate traffic arteries and rivers as ecological corridors, promote the construction of ecological networks, organically connect ecological patches such as green spaces, wetlands and forests, and maximize the role of ecological restoration projects in enhancing ecosystem services.

[0124] The embodiment of this application quantitatively evaluates the evolution of regional ecological land use and identifies key areas for protection and restoration, which can significantly enhance landscape planning strategies and help promote landscape configurations that support biodiversity conservation and sustainable land use. By combining the results of regional ecosystem function and service assessments, we can further deepen our understanding of the regional ecosystem pattern-function-service cascade framework, thereby providing a valuable quantitative tool for researchers, planners, and decision makers engaged in sustainable management of ecological landscapes.

[0125] According to the quantitative identification method of ecological land evolution pattern based on two-dimensional array proposed in the embodiment of the present application, the land use raster data of ecological land can be collected and preprocessed, the obtained ecological land data can be converted into a two-dimensional array, and the two-dimensional array can be labeled to obtain labeled ecological patches, and then the labeled ecological patches and the changing ecological patches can be quantitatively analyzed to construct the ecological land evolution index ELEI calculation function, so that the ecological patches in the ecological land can be divided into multiple small areas, and the ELEI calculation function can be used to perform parallel calculations on multiple small areas, and the calculation results of each small area can be saved in the form of a dictionary, and the key value and result mapping function in the global dictionary can be combined to generate a two-dimensional ELEI array, so as to realize the efficient parallel quantitative analysis of the ecological land evolution pattern, and effectively improve the accuracy and efficiency of the ecological land evolution analysis. Therefore, the problems in the related art that the uniqueness of the ecological land evolution pattern cannot be properly captured, which may reduce the effectiveness of ecological management, and the complexity of the ecological process cannot be fully revealed due to the failure to fully consider the connectivity and time dynamics of the ecological land, which affects the accuracy and timeliness of ecological management. .

[0126] Next, a device for quantitatively identifying ecological land evolution patterns based on a two-dimensional array proposed in accordance with an embodiment of the present application will be described with reference to the accompanying drawings.

[0127] Fig.10 It is a block diagram of an apparatus for quantitatively identifying ecological land evolution patterns based on a two-dimensional array according to an embodiment of the present application.

[0128] like Fig.10 As shown, the device 10 for quantitatively identifying ecological land evolution patterns based on a two-dimensional array includes: a collection module 100 , a construction module 200 , a calculation module 300 and an identification module 400 .

[0129] Specifically, the acquisition module 100 is used to collect the land use raster data of the ecological land, and pre-process the land use raster data to obtain the ecological land data, convert the ecological land data into a two-dimensional array, and label the two-dimensional array to obtain labeled ecological patches;

[0130] A construction module 200 is used to perform quantitative analysis on the labeled ecological patches and the changing ecological patches, obtain the spatial quantitative relationship of the evolving ecological patches, and construct an ecological land evolution index ELEI calculation function based on the quantitative relationship;

[0131] The calculation module 300 is used to divide the ecological patch in the ecological land into multiple small areas, use the ELEI calculation function to perform parallel calculations on the multiple small areas, obtain the calculation results of each small area, and save the calculation results of each small area in the form of a dictionary to obtain a global dictionary;

[0132] The identification module 400 is used to generate a two-dimensional ELEI array by combining the key values ​​in the global dictionary and the result mapping function, so as to obtain the quantitative analysis result of the ecological land evolution pattern based on the two-dimensional ELEI array.

[0133] Optionally, in one embodiment of the present application, the acquisition module 100 includes: a first processing unit, a statistical unit and a second processing unit.

[0134] The first processing unit is used to convert the ecological land data into a two-dimensional array, and perform labeling processing on the two-dimensional array to obtain a label array for each ecological patch in the two-dimensional array:

[0135] A statistical unit, used to obtain the area of ​​each ecological patch based on the number of times each tag appears in the tag array, and when the area is less than a preset threshold, remove the ecological patch corresponding to the area in the two-dimensional array to obtain an updated two-dimensional array;

[0136] The second processing unit is used to perform labeling processing on the updated two-dimensional array to obtain a final labeled two-dimensional array and corresponding labeled ecological patches.

[0137] Optionally, in one embodiment of the present application, the two-dimensional array is:

[0138] grid_dataset=gdal.Open(path)

[0139] array=dataset.GetRasterBand(1).ReadAsArray()

[0140] array=(array==1).astype(int)

[0141] Among them, grid_dataset is the input raster data, array is a binary array, GetRasterBand(1).ReadAsArray() reads the first band of the raster data and converts it into an array, and (array==1).astype(int) performs a Boolean operation on the array and converts it into a binary array containing only 0 and 1.

[0142] Optionally, in one embodiment of the present application, the construction module 200 includes: a first construction unit, a second construction unit and a construction unit.

[0143] The first construction unit is used to construct a first Moore neighborhood array of the labeled ecological patches based on the labeled ecological patches and the label values ​​corresponding to the labeled ecological patches;

[0144] A second construction unit is used to construct a second molar neighborhood array of the changed ecological patches based on the changed ecological patches and the label values ​​corresponding to the changed ecological patches;

[0145] A construction unit is used to perform quantitative analysis on the first molar neighborhood array and the second molar neighborhood array to obtain the spatial quantitative relationship of evolving ecological patches, so as to construct an ecological land evolution index ELEI calculation function based on the spatial quantitative relationship of evolving ecological patches.

[0146] Optionally, in one embodiment of the present application, the calculation function of ELEI is:

[0147]

[0148] Among them, C is the number of non-zero label values ​​in the intersecting_labels array, λ is a binary variable indicating the increase or decrease of the changed ecological land patches, and N * is the number of pixels that intersect the mole area with the patch and the newly added patch, N is the number of pixels in the mole neighborhood of the newly added patch i, C max It is the maximum value of the number of intersections C between all new patches and the original patches.

[0149] It should be noted that the above explanation of the embodiment of the method for quantitatively identifying the evolution pattern of ecological land based on a two-dimensional array is also applicable to the device for quantitatively identifying the evolution pattern of ecological land based on a two-dimensional array of this embodiment, and will not be repeated here.

[0150] According to the device for quantitatively identifying the evolution pattern of ecological land based on a two-dimensional array proposed in the embodiment of the present application, the land use grid data of ecological land can be collected and preprocessed, the obtained ecological land data can be converted into a two-dimensional array, and the two-dimensional array can be labeled to obtain labeled ecological patches, and then the labeled ecological patches and the changing ecological patches can be quantitatively analyzed to construct the calculation function of the ecological land evolution index ELEI, so that the ecological patches in the ecological land can be divided into multiple small areas, and the ELEI calculation function can be used to perform parallel calculations on multiple small areas, and the calculation results of each small area can be saved in the form of a dictionary, and the key value and result mapping function in the global dictionary can be combined to generate a two-dimensional ELEI array, so as to realize the efficient parallel quantitative analysis of the evolution pattern of ecological land, and effectively improve the accuracy and efficiency of the analysis of the evolution of ecological land. Thus, the problems in the related art that the uniqueness of the evolution pattern of ecological land cannot be properly captured, which may reduce the effectiveness of ecological management, and the complexity of ecological processes cannot be fully revealed due to the failure to fully consider the connectivity and time dynamics of ecological land, which affects the accuracy and timeliness of ecological management.

[0151] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:

[0152] A memory 1101 , a processor 1102 , and a computer program stored in the memory 1101 and executable on the processor 1102 .

[0153] When the processor 1102 executes the program, the method for quantitatively identifying the ecological land evolution pattern based on a two-dimensional array provided in the above embodiment is implemented.

[0154] Furthermore, the electronic device further comprises:

[0155] The communication interface 1103 is used for communication between the memory 1101 and the processor 1102 .

[0156] The memory 1101 is used to store computer programs that can be executed on the processor 1102 .

[0157] The memory 1101 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0158] If the memory 1101, the processor 1102 and the communication interface 1103 are implemented independently, the communication interface 1103, the memory 1101 and the processor 1102 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.11 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0159] Optionally, in a specific implementation, if the memory 1101, the processor 1102 and the communication interface 1103 are integrated on a chip, the memory 1101, the processor 1102 and the communication interface 1103 can communicate with each other through an internal interface.

[0160] The processor 1102 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0161] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned method for quantitatively identifying ecological land evolution patterns based on a two-dimensional array.

[0162] An embodiment of the present application also provides a computer program product, which can run computer instructions. When the computer instructions are executed by a processor, the above-mentioned method for quantitatively identifying ecological land evolution patterns based on two-dimensional arrays is implemented.

[0163] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0164] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0165] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0166] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or N wirings (electronic devices), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways as necessary and then storing it in a computer memory.

[0167] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented by hardware, as in another embodiment, it can be implemented by any one or a combination of multiple of the following technologies known in the art: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0168] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0169] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0170] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A quantitative identification method for ecological land evolution pattern based on two-dimensional array, characterized in that: The following steps are involved: Collecting land use raster data of ecological land, preprocessing the land use raster data to obtain ecological land data, converting the ecological land data into a two-dimensional array, and labeling the two-dimensional array to obtain labeled ecological patches; Quantitatively analyze the labeled ecological patches and the changing ecological patches to obtain the spatial quantitative relationship of the evolving ecological patches, and construct an ecological land evolution index ELEI calculation function based on the quantitative relationship; The ecological patch in the ecological land is divided into a plurality of small areas, the ELEI calculation function is used to perform parallel calculations on the plurality of small areas to obtain a calculation result of each small area, and the calculation result of each small area is saved in a dictionary form to obtain a global dictionary; A two-dimensional ELEI array is generated by combining the key values ​​in the global dictionary and the result mapping function, so as to obtain the quantitative analysis result of the ecological land evolution pattern based on the two-dimensional ELEI array.

2. The method according to claim 1, characterized in that The labeling process of the two-dimensional array to obtain the labeled ecological patches includes: The ecological land data is converted into the two-dimensional array, and the two-dimensional array is labeled to obtain a label array of each ecological patch in the two-dimensional array: Based on the number of times each tag in the tag array appears, the area of ​​each ecological patch is obtained, and when the area is less than a preset threshold, the ecological patch corresponding to the area is removed from the two-dimensional array to obtain an updated two-dimensional array; The updated two-dimensional array is subjected to labeling processing to obtain a final labeled two-dimensional array and the corresponding labeled ecological patches.

3. The method according to claim 2, characterized in that The two-dimensional array is: grid_dataset=gdal.Open(path) array=dataset.GetRasterBand(1).ReadAsArray() array=(array==1).astype(int) Among them, grid_dataset is the input raster data, array is a binary array, GetRasterBand(1).ReadAsArray() reads the first band of the raster data and converts it into an array, and (array==1).astype(int) performs a Boolean operation on the array and converts it into a binary array containing only 0 and 1.

4. The method according to claim 1, characterized in that: The quantitative analysis of the labeled ecological patches and the changed ecological patches is performed to obtain the spatial quantitative relationship of the evolving ecological patches, and the calculation function of the ecological land evolution index ELEI is constructed based on the quantitative relationship, including: Based on the labeled ecological patch and the label value corresponding to the labeled ecological patch, construct a first molar neighborhood array of the labeled ecological patch; Based on the changed ecological patch and the label value corresponding to the changed ecological patch, construct a second Moore neighborhood array of the changed ecological patch; The first molar neighborhood array and the second molar neighborhood array are quantitatively analyzed to obtain the spatial quantitative relationship of the evolving ecological patches, so as to construct an ecological land evolution index ELEI calculation function based on the spatial quantitative relationship of the evolving ecological patches.

5. The method according to claim 4, characterized in that The calculation function of the ELEI is: Among them, C is the number of non-zero label values ​​in the intersecting_labels array, λ is a binary variable indicating the increase or decrease of the changed ecological land patches, and N * is the number of pixels that intersect the mole area with the patch and the newly added patch, N is the number of pixels in the mole neighborhood of the newly added patch i, C max It is the maximum value of the number of intersections C between all new patches and the original patches.

6. A quantitative identification device for ecological land evolution pattern based on a two-dimensional array, characterized in that: include: A collection module is used to collect land use raster data of ecological land, pre-process the land use raster data to obtain ecological land data, convert the ecological land data into a two-dimensional array, and label the two-dimensional array to obtain labeled ecological patches; A construction module is used to perform quantitative analysis on the labeled ecological patches and the changing ecological patches to obtain the spatial quantitative relationship of the evolving ecological patches, so as to construct an ecological land evolution index ELEI calculation function based on the quantitative relationship; A calculation module, used for dividing the ecological patch in the ecological land into a plurality of small areas, performing parallel calculation on the plurality of small areas by using the ELEI calculation function, obtaining a calculation result of each small area, and saving the calculation result of each small area in a dictionary form to obtain a global dictionary; The identification module is used to generate a two-dimensional ELEI array by combining the key values ​​in the global dictionary and the result mapping function, so as to obtain the quantitative analysis result of the ecological land evolution pattern based on the two-dimensional ELEI array.

7. The device according to claim 6, characterized in that The acquisition module comprises: The first processing unit is used to convert the ecological land data into the two-dimensional array, and perform labeling processing on the two-dimensional array to obtain a label array of each ecological patch in the two-dimensional array: A statistical unit, configured to obtain the area of ​​each ecological patch based on the number of times each tag in the tag array appears, and when the area is less than a preset threshold, remove the ecological patch corresponding to the area from the two-dimensional array to obtain an updated two-dimensional array; The second processing unit is used to perform labeling processing on the updated two-dimensional array to obtain a final labeled two-dimensional array and the corresponding labeled ecological patches.

8. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method for quantitatively identifying ecological land evolution patterns based on a two-dimensional array as described in any one of claims 1 to 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the method for quantitatively identifying ecological land evolution patterns based on a two-dimensional array as described in any one of claims 1 to 5.

10. A computer program product, comprising a computer program, characterized in that The computer program is executed to implement the method for quantitatively identifying ecological land evolution patterns based on a two-dimensional array as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • City group ecological space damage identification and evaluation method

    CN110298411A

  • Method for acquiring minimum scale value of ecological space and related equipment

    CN116258957A

  • Ecological source identification method and system based on ecological system service stability

    CN118246783A

  • Method and system for analyzing driving relationship between ecosystem service and urban agglomeration development

    US20230409670A1

Cited By

  • Space-time evaluation method, system, equipment and medium for ecological quality of drainage basin human settlement system

    CN120525406A