Grassland survey heterogeneous data standardization processing method and system adopting two-stage matching

By employing a two-level matching and differentiated parsing strategy, the problem of scattered storage of grassland census data was solved, achieving efficient and accurate data aggregation and standardization, and supporting querying and analysis across sample plots, species, and time dimensions.

CN123138244APending Publication Date: 2026-11-20INNER MONGOLIA AUTONOMOUS REGION FORESTRY MONITORING & PLANNING INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611294887.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-25
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

Grassland census data is scattered across different worksheets in multiple Excel files, with unfixed column positions and merged cells. Existing tools cannot be directly applied, resulting in low data processing efficiency, poor accuracy, frequent human errors, and an inability to perform queries and comparisons across sample plots, species, and time dimensions.

Method used

A two-level matching method for standardizing heterogeneous grassland survey data is adopted. Through a two-level indexing mechanism of file name and plant name, the data is automatically mapped to the target database. Differentiated field parsing strategies are designed, including scattered cell location, priority backoff algorithm and safe writing of merged cells, to achieve cross-table matching and deduplication aggregation.

Benefits of technology

It significantly improves the efficiency and accuracy of standardized processing of grassland survey data, processing 431 sample plots in just 20 minutes, increasing efficiency by nearly 650 times, and reducing the error rate to below 0.3%, providing high-quality data support for grassland degradation assessment and biodiversity analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123138244A_ABST
    Figure CN123138244A_ABST
Patent Text Reader

Abstract

The application discloses a kind of prairie census heterogeneous data standardization processing method and system using two-stage matching, belong to prairie census data standardization processing technical field.The application realizes sample site level data automatic convergence with file name as first index, realizes species level data automatic aggregation with plant name as second index, does not preset field mapping rule, only relies on table semantic keyword and relative position of row and column to complete the automatic mapping of heterogeneous data to unified target database;Meanwhile, six types of prairie census table are designed scattered cell positioning algorithm, priority rollback algorithm, simple anchor extraction algorithm, primary and secondary keyword algorithm and other differential analysis strategies.The application can gather the heterogeneous data scattered in multiple worksheets into structured standardized data set, realize the automatic standardization processing of prairie census heterogeneous data, provide data basis for cross-site, cross-species, cross-time dimension query, comparison and ecological analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of grassland census data standardization processing technology, and in particular to a method and system for standardizing grassland census heterogeneous data using two-level matching. Background Technology

[0002] In the 1980s, China organized its first nationwide grassland resource survey, systematically recording basic data such as grassland types, plant composition, and biodiversity. This data forms an indispensable ecological foundation for a series of ecological assessments, including grassland degradation and the spatiotemporal evolution of biodiversity. However, the aforementioned grassland survey data was long stored in paper form or early Excel spreadsheets. Although it has been gradually transcribed into Excel files in recent years, the following challenges remain in achieving data aggregation, analysis, mining, and evaluation due to differences in data entry personnel and standards: The census data covers information from thousands of monitoring plots, each stored in a separate Excel file (Excel source file). This necessitates extensive data processing and writing for these plots. Data from the same plot's Excel file is distributed across multiple worksheets, with basic plot information recorded in Table 1 (Plot Basic Information Table) (see...). Figure 2 Herbal data is stored in Table 3, Herbal Plot Record Table (see...). Figure 3 Table 4. Herbaceous Grass Yield Measurement Table (see Table 4) Figure 4 ) and Table 5 Herb Frequency Quadrat Table (see Figure 5 Shrub data is stored in Table 6, the Shrub Height Record Table (see...). Figure 6 (See Table 7 for shrub yield records) Figure 7 The current system cannot support cross-plot, cross-species, and cross-time dimension queries and comparisons. Furthermore, different indicators for the same species are scattered across different worksheets. For example, the height, canopy, and abundance of the same herbaceous plant are stored in Table 3, dry weight in Table 4, and frequency in Table 5; the height of the same shrub is stored in Table 6, while the number of shrubs, canopy, and dry weight are stored in Table 7. In terms of table structure, column positions are not fixed, and merged header cells are common. Field formats are also highly varied, with latitude and longitude scattered across multiple cells, and the column position of key fields such as "dry weight" is not fixed. Manual data entry is inefficient, inaccurate, and time-consuming, and is prone to human errors such as misplaced rows, omissions, and unit confusion.

[0003] Existing general-purpose ETL tools (such as Kettle and DataGrip) and data cleaning frameworks (such as OpenRefine) rely on pre-defined target data structures and fixed field mapping rules, requiring relatively consistent table header naming and column order in the source data. Grassland census data from the 1980s is typical historical heterogeneous data; issues such as random column position shifts and merged cells make existing tools unusable directly, causing errors and interruptions upon encountering column offsets or merged cells. Furthermore, existing tools lack parsing solutions for the table structures specific to grassland census data (such as herbaceous quadrat record tables, herbaceous yield measurement tables, herbaceous frequency quadrat tables, shrub height record tables, shrub yield record tables, and basic information tables for sample plots), making it impossible to automatically extract and aggregate data from scattered shrub, herbaceous, and sample plot information tables. Summary of the Invention

[0004] The purpose of this invention is to provide a method and system for standardizing heterogeneous grassland survey data using two-level matching, so as to solve the technical problems mentioned in the background art.

[0005] The technical problem solved by this invention can be achieved by the following solutions: The first aspect of the present invention provides a method for standardizing heterogeneous grassland census data using two-level matching, comprising the following steps: Shrub layer data writing: Traverse the Excel source file, using the file name as the first-level index, and match the corresponding plot row in the target database; extract all plant names from the shrub height record table in the source file as second-level indexes, and extract the corresponding height of each plant and write it into the species row below the plot row; using the same plant name as the association key, match the number of clumps, canopy coverage, and dry weight of the corresponding plant from the shrub yield record table, and write it into the corresponding species row; if the species row already exists, append the written indicators, otherwise create a new species row; Herbaceous layer data writing: Locate the plot row using the file name as the primary index; extract all plant names from the herbaceous quadrat record table in the source file as secondary indexes, and extract the height, cover, and abundance indices corresponding to each plant and write them into the species row below the plot row; Using the same plant name as the association key, match the dry weight index from the herbaceous yield measurement table and the frequency index from the herbaceous frequency quadrat table, and write them into the corresponding species row; Write the herbaceous layer data and shrub layer data into the same plot data area, and perform cross-table matching and deduplication aggregation using the same plant name as the association key; When processing the latter table, if the plant species has already been written in the previous step, append the corresponding species row; otherwise, create a new species row and write it. Plot attribute association and data cleaning: Extract spatial attribute information and survey attribute information from the basic information table of the plot in the source file and write it into the plot row of the corresponding plot; delete redundant data rows with empty plant names.

[0006] Furthermore, in the shrub layer data writing step, before writing the shrub layer data into the target database, there is also an automatic summation preprocessing step for the subtotal row in the shrub production record table: identifying the data row marked as subtotal in the shrub production record table of each source file, summing the values ​​of each column in the preset number of rows above the row, and filling the summation result back into the corresponding cell of the subtotal row.

[0007] Furthermore, in the herbaceous layer data writing step, the extraction of the dry weight index in the herbaceous yield measurement table adopts a priority backoff algorithm, which includes the following steps: Priority targeting: Target the cell containing the keyword "average weight per square meter", and use the column immediately below or to the right of that cell that contains dry weight as the target column; Backtracking: If the priority positioning step fails, scan all columns in the header area with values ​​of dry weight, sort them from left to right, and select the second dry weight column as the target column; Data extraction: Use the middle column as the anchor to obtain a list of plant names, and extract values ​​row by row for the target column according to the plant name.

[0008] Furthermore, in the sample plot attribute association and data cleaning steps, the extraction of latitude and longitude from the spatial attribute information of the sample plot adopts a scattered cell positioning algorithm, which includes: Using the cell containing the keyword longitude or latitude as the baseline, scan column by column to the right starting from the column containing that cell to extract the numerical values ​​and unit symbols; Scanning stops when the content of the scanned cell belongs to a preset stop word; the preset stop words include altitude, slope, recorded area, investigator, administrative region, sample plot number, and date; The extracted values ​​are concatenated into a complete latitude and longitude string in the order of degrees, minutes, and seconds.

[0009] Furthermore, in the sample plot attribute association and data cleaning step, deleting redundant data rows with empty plant names includes the following steps: Get the range of all rows written during this process; Check each row in the specified row number range to see if the value of the plant name column is empty or contains only blank characters; If the line is empty or contains only whitespace characters, mark it as a line to be deleted. Automatically protects the headers of a preset number of rows from being deleted before deletion; Batch delete all rows to be deleted, and then continuously move the remaining data rows upwards.

[0010] Furthermore, the data writing operations in the shrub layer data writing step, the herbaceous layer data writing step, and the sample plot attribute association and data cleaning step adopt the merged cell secure writing algorithm, which includes the following steps: Before performing a write operation, check whether the target cell belongs to any merged cell range; If it does not belong to a merged cell range, write it directly to the target cell; If the data belongs to a merged cell range, the top-left cell of the merged cell range will be automatically located and the data to be written will be written to the top-left cell.

[0011] Furthermore, the shrub layer data writing step also includes: extracting the total coverage of shrubs and tall herbs in the sample plot from the shrub height record table, summing the number of shrubs and the dry weight of each shrub in the table, and writing the total coverage of shrubs and tall herbs, the sum of the number of shrubs and the dry weight into the corresponding field of the corresponding sample plot row in the target database. The herbaceous layer data writing step further includes: extracting the natural reproductive branch height, natural leaf layer height, and total cover of the sample plot from the herbaceous quadrat record table, and summing the abundance of each herbaceous plant in the table; summing the dry weight in the herbaceous yield measurement table; and writing the natural reproductive branch height, natural leaf layer height, total cover, abundance, and dry weight into the corresponding fields of the corresponding sample plot row in the target database.

[0012] A second aspect of the present invention provides a grassland census heterogeneous data standardization processing system employing two-level matching, comprising: Shrub layer data writing module: It iterates through the Excel source file, using the file name as the first-level index, and matches the corresponding plot row in the target database; it extracts all plant names from the shrub height record table in the source file as second-level indexes, and extracts the corresponding height of each plant and writes it into the species row below the plot row; using the same plant name as the association key, it matches the number of clumps, canopy coverage, and dry weight of the corresponding plant from the shrub yield record table and writes it into the corresponding species row; if the species row already exists, it appends the written indicators, otherwise it creates a new species row; Herbaceous layer data writing module: used to locate plot rows using filenames as primary indexes; extracting all plant names as secondary indexes from the herbaceous quadrat record table in the source file, and extracting the corresponding height, cover, and abundance indices for each plant and writing them into the species row below the plot row; using the same plant name as the association key, matching the dry weight index from the herbaceous yield measurement table and the frequency index from the herbaceous frequency quadrat table, and writing the corresponding species row; writing herbaceous layer data and shrub layer data into the same plot data area, performing cross-table matching and deduplication aggregation using the same plant name as the association key; when processing the latter table, if the plant species has already been written in the previous step, appending the corresponding species row; otherwise, creating a new species row and writing it. The plot attribute association and data cleaning module is used to extract spatial attribute information and survey attribute information from the plot basic information table in the source file, write it into the plot row of the corresponding plot, and delete redundant data rows with empty plant names.

[0013] A third aspect of the present invention provides a computer device including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method described in the first aspect.

[0014] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect above.

[0015] Compared with the prior art, the present invention has the following beneficial effects: First, this invention achieves automatic association between plot-level and species-level data through a two-level matching mechanism of filename and plant name. The first level uses the plot filename as an index label to accurately map the shrub layer, herbaceous layer, and basic plot information of each plot to the plot data area below the same plot row in the target database, achieving automatic aggregation of plot-level data. The second level uses the plant name as an index label to completely write the ecological indicators (height, cover, abundance, dry weight, frequency, etc.) of the same plant, scattered across multiple worksheets, into the same species row, achieving automatic aggregation of species-level data. This mechanism does not pre-set any field mapping rules, relying solely on the semantic keywords of the tables themselves and the relative positions of rows and columns to achieve automated mapping of heterogeneous data to a unified target database. Through these two levels of linkage, heterogeneous data originally scattered across multiple worksheets is completely and accurately aggregated into a structured, continuously arranged standardized dataset, providing a directly usable data foundation for subsequent cross-plot, cross-species, and cross-time dimension queries, comparisons, and ecological analyses.

[0016] Second, this invention designs differentiated field parsing strategies for six types of tables in grassland census data, which can effectively adapt to typical problems of historical heterogeneous data such as variable column positions and merged cells. To address the issue of latitude and longitude values ​​being scattered across multiple cells in the basic information table for sample plots, a scattered cell positioning algorithm is employed, automatically terminating the scan upon encountering stop words, accurately extracting degree, minute, and second values, and concatenating them into a complete latitude and longitude string. For the herbaceous yield measurement table, which contains multiple "dry weight" columns in different units with inconsistent column positions, a priority backtracking algorithm is used to ensure that dry weight data in a unified International System of Units (SI) can be extracted regardless of column layout. For the herbaceous quadrat record table and herbaceous frequency quadrat table, a simple anchor point extraction algorithm is used, locating the plant name list using the "Chinese Name" column as the anchor point, matching indicator columns through keyword scanning, and extracting values ​​row by row. For the shrub height record table and shrub yield record table, a primary and secondary keyword algorithm is used, locating data block areas through primary keywords and precisely locating target columns within those areas through secondary keywords, achieving dual locking to overcome the vulnerability of single keywords to header interference. A merged cell secure write algorithm is employed, automatically identifying merged areas and locating the upper left corner for writing, avoiding abnormal data entry interruptions caused by merged cells.

[0017] Third, this invention significantly improves the efficiency and accuracy of standardized processing of historical grassland survey data. Using the method and system of this invention, processing 431 sample plots takes only about 20 minutes, while manual data entry of the same workload would take approximately 216 hours, representing an efficiency improvement of nearly 650 times. In terms of accuracy, the error rate of manual data entry is approximately 5%, while this invention reduces the error rate to below 0.3%, a reduction of more than 20 times. This dual improvement in efficiency and accuracy enables the effective organization and utilization of large-scale historical grassland survey data, providing high-quality data support for ecological assessments such as grassland degradation assessment and spatiotemporal evolution analysis of biodiversity. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart illustrating a method for standardizing heterogeneous grassland survey data using two-level matching, as provided in an embodiment of the present invention. Figure 2 This is a schematic diagram of the table structure of the sample plot basic information table in Table 1; Figure 3 This is a schematic diagram of the table structure of the herbal quadrat record table in Table 3; Figure 4This is a schematic diagram of the table structure for determining the yield of herbaceous plants in Table 4. Figure 5 This is a schematic diagram of the table structure of the herb frequency quadrat table in Table 5; Figure 6 This is a schematic diagram of the table structure for the shrub height recording table in Table 6; Figure 7 This is a schematic diagram of the table structure of the shrub yield record table in Table 7; Figure 8 This is a schematic diagram of the structure of the target database table in an embodiment of the present invention; Figure 9 This is a structural block diagram of a grassland census heterogeneous data standardization processing system using two-level matching, provided in an embodiment of the present invention. Figure 10 This is the desktop graphical user interface of the system of the present invention. Detailed Implementation

[0020] To make the objectives, technical solutions and advantages of the present invention clearer, the embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.

[0021] The grassland survey data covers information from thousands of monitoring plots, each stored in a separate Excel file (Excel source file). The data from the same plot's Excel file is scattered across multiple worksheets. This invention follows... Figure 1 The method shown employs a two-level matching approach to standardize heterogeneous grassland survey data, extracting data from the Excel source file as follows: Figure 2-7 The data from the multiple worksheets shown will be extracted and finally written into the following format: Figure 8 The standardized Excel database shown (i.e., the target database) enables automated parsing and standardized data entry of sample plot data.

[0022] In the Excel file containing the sample plots, Table 1 is the basic information table for the sample plots, recording basic information such as the administrative division, latitude and longitude, altitude, date, field name, and dominance name of the sample plots. Figure 2 The diagram illustrates one of the table structures in Table 1. Tables 3 to 5 store the herbaceous data of the sample plots, with Table 3 being the herbaceous quadrat record table, recording information such as plant name, height, cover, and abundance of the herbaceous layer in the sample plot. Figure 3 The diagram illustrates one of the table structures in Table 3; Table 4 is a table for measuring herbaceous yield, recording information such as the plant names and dry weights of the herbaceous plants in the sample plot. Figure 4 The diagram illustrates one of the table structures in Table 4; Table 5 is a herbaceous frequency quadrat table, recording information such as the plant names and frequencies of the herbaceous layer in the quadrat plots. Figure 5The diagram illustrates one possible table structure for Table 5. Tables 6 and 7 store shrub data for the sample plots. Table 6 is a shrub height record table, which records information such as the plant name and height of the shrub layer in the sample plot. Figure 6 The diagram illustrates one of the table structures in Table 6; Table 7 is a shrub yield record table, recording information such as plant name, number of shrubs, canopy coverage, and dry weight of the shrub layer in the sample plot. Figure 7 The diagram illustrates one of the table structures in Table 7. Since Table 2 is a textual, qualitative descriptive table, this invention analyzes six types of tables (Tables 1, 3, to 7) and does not involve Table 2.

[0023] like Figure 8 As shown, the target database table has the following structural features: the data of each sample plot is in an independent block, with the sample plot row at the top of the block, followed by the records of each plant species within the sample plot (species rows); the sample plot row includes the serial number, source file name, administrative division (league / city / banner / township), latitude and longitude, altitude, date, field name, etc.; the species row includes the Chinese name (i.e., plant name), plant type (herb / shrub), height, canopy, abundance, dry weight, frequency, etc.; there are no blank rows within or between sample plots, and all data are arranged continuously.

[0024] Figure 1 This invention provides a method for standardizing heterogeneous grassland census data using two-level matching, which specifically includes the following steps: Step S100, writing shrub layer data: Traverse the Excel source file, using the file name as the first-level index, and match the corresponding sample plot row in the target database; in the shrub height record table (Table 6) of the source file, extract all plant names as second-level indexes, and extract the height corresponding to each plant and write it into the species row below the sample plot row; using the same plant name as the association key, match the number of plants, canopy coverage, and dry weight index of the corresponding plant from the shrub yield record table (Table 7), and write it into the corresponding species row; if the species row already exists, append the index; otherwise, create a new species row.

[0025] Optionally, in step S100, before writing the shrub layer data into the target database, an automatic summation preprocessing step is included for the subtotal rows in Table 7, which includes identifying the data rows marked as subtotals in the shrub yield record table of each source file, summing the values ​​in each column of the preset number row above that row, and filling the summation result back into the corresponding cell of the subtotal row. Figure 7 As shown, in one embodiment, the preset quantity row consists of 3 rows. In this embodiment, the 3 rows above the subtotal row represent the large, medium, and small shrubs. This step involves summing up the large, medium, and small shrubs and writing the final summary data into the target database to ensure the accuracy of the shrub yield summary data.

[0026] Optionally, in step S100, the extraction of indicators in Tables 6 and 7 employs a primary and secondary keyword algorithm. For Table 6, this algorithm includes the following steps: scanning the primary keywords "Chinese name" and "height (cm)" to locate the starting row of the shrub data area; scanning row by row downwards from the starting row (up to a maximum of 200 rows) to find the secondary keyword "average"; and extracting the average height of shrubs in the column containing the secondary keyword. For Table 7, the primary and secondary keyword algorithm includes the following steps: locating the shrub count column using "number of shrubs per acre"; and using the primary keyword "area occupied by shrubs" in conjunction with the secondary keyword "area per acre (m²)". 2 "or 'acreage'" Figure 7 The secondary keyword in Table 7 shown is "area per mu (m²)". 2 ) Locating coverage column; using the main keyword "average weight per mu (jin)" or "weight per mu ( Figure 7 In Table 7, the primary keyword is "average weight per acre (jin)" and the secondary keyword is "dry weight" to locate the dry weight column. The plant names are scanned row by row from the starting row down to find the "subtotal" row below each plant and extract the number of plants, coverage, and dry weight values.

[0027] Optionally, step S100 further includes: extracting the total shrub and tall herbaceous cover of the sample plot from the shrub height record table (Table 6). Figure 6 (The header position in the table), write it into the corresponding field of the corresponding sample plot row in the target database (e.g., Figure 8 As shown, the corresponding field is "shrub plot coverage". Step S100 also includes: summing the number of shrub bushes (i.e., the number of bushes per acre in Table 7) and the dry weight (the "dry weight" index below "average weight per acre (jin)") of each shrub in the shrub yield record table (Table 7), and writing the sum of the number of bushes into the corresponding field of the corresponding plot row in the target database (e.g., ...). Figure 8 As shown, the corresponding field is "number of shrubs per acre"). The sum of dry weights should also be written into the corresponding field of the corresponding sample plot row in the standard database (e.g., ...). Figure 8 As shown, the corresponding field is "average weight of shrubs per acre".

[0028] Optionally, in step S100, when the source file data is entered into the target database, the filename of the source file is extracted and written into the "source filename" field corresponding to the sample row in the target database (see...). Figure 8 This field serves as a unique identifier linking the sample plot data to the original file, facilitating subsequent steps to locate and read the corresponding source file based on this filename, thereby extracting basic information such as leagues, banners, counties, and townships. It also provides a convenient basis for data tracing and error investigation.

[0029] Step S200, Herbaceous layer data writing: Locate the sample plot row using the filename of the Excel source file as the primary index; In the herbaceous quadrat record table (Table 3) of the source file, extract all plant names as secondary indexes, and extract the height, cover, and abundance indicators corresponding to each plant and write them into the species row below the sample plot row; Using the same plant name as the association key, match the dry weight index from the herbaceous yield measurement table (Table 4) and the frequency index from the herbaceous frequency quadrat table (Table 5) in sequence, and write them into the corresponding species row; Write the herbaceous layer data and shrub layer data into the same sample plot data area, and perform cross-table matching and deduplication aggregation using the plant name as the association key; When processing the latter table, if the plant species has been written in the previous step, append the corresponding species row; otherwise, create a new species row and write it.

[0030] The "Dry Weight" field in Table 4 is located near the keyword "Average per Square Meter," but there are two variations in the actual original data: (1) the cell below "Average per Square Meter" may be blank, causing direct location to fail; (2) there are multiple "Dry Weight" columns with different units in the same table, such as "Dry Weight (g / m²)". 2 "Dry weight (catties / mu)" (or "dry weight (g)"). To accommodate the above variations, optionally, in step S200, the extraction of the "dry weight" index from the herbaceous yield determination table in Table 4 adopts a priority backtracking algorithm, which includes the following steps: Step S201, Prioritize positioning: Locate the cell containing the keyword "average per square meter" and select the column containing "dry weight" immediately below or to the right of that cell as the target column; the column containing "dry weight" to the right is chosen as the target column because if the cell below "average per square meter" is blank, then the "dry weight" column is located to the right of the cell containing "average per square meter".

[0031] Step S202, Backtrack Positioning: If the priority positioning step fails, scan all columns in the header area with the value "dry weight", sort them from left to right, and select the second "dry weight" (corresponding to grams / m³). 2 The "Units" column is used as the target column; the selection of the second dry weight column is based on the fixed design specifications of the original grassland census forms: Table 4 has "Dry Weight (catties / mu)" (or "Dry Weight (g)") and "Dry Weight (g / m³)" columns set from left to right. 2 Two columns, Figure 4 The table structure shown in the image has a left column labeled "Dry Weight (grams)". This method uses the International System of Units (g / m³). 2 Therefore, the second "dry weight" column after sorting from left to right is forcibly selected.

[0032] Step S203: Data extraction: Obtain a list of plant names using the "Chinese Name" column as the anchor point, and extract values ​​row by row from the target column according to the plant name.

[0033] Step S204, Exception Handling: If no valid duplicate column is located in all the above steps, record the exception log and skip the file.

[0034] Optionally, in step S200, the extraction of each indicator in Tables 3 and 5 adopts a simple anchor point extraction algorithm. The simple anchor point extraction algorithm includes the following steps: locating the plant name list with the "Chinese Name" column as the anchor point; matching indicator columns such as "average height", "coverage", "abundance", and "frequency" through keyword scanning; and extracting the corresponding indicator values ​​of each plant row by row from the anchor point row downwards.

[0035] Optionally, step S200 further includes: extracting the natural reproductive branch height, natural leaf layer height, and total canopy of the sample plot from the herbaceous quadrat record table (Table 3). Figure 3 The table header position), and summarize the abundance of each herbaceous plant in the table; summarize the dry weight in the herbaceous yield measurement table (Table 4); write the natural reproductive branch height, natural leaf layer height, total canopy, sum of abundance, and sum of dry weight into the target database respectively ( Figure 8 The corresponding field in the sample plot row; such as Figure 8 As shown, the height of natural reproductive branches is written into the reproductive branch (average height) field of the plot row, the height of natural leaf layer is written into the leaf layer (average height) field of the plot row, the total cover is written into the cover field of the plot row, the sum of abundance is written into the abundance (density) field of the plot row, and the sum of dry weight is written into the dry weight / gram per square meter field of the plot row.

[0036] Step S300, Plot Attribute Association and Data Cleaning: Extract spatial attribute information and survey attribute information from the basic information table of the plot (Table 1) in the source file and write it into the plot row of the corresponding plot; delete redundant data rows with empty plant names.

[0037] Optionally, in step S300, as follows: Figure 2 As shown, the spatial attribute information of the sample plot includes latitude and longitude, administrative region, altitude, etc., and the survey attribute information includes sample plot number, surveyor, date, field name, etc. The latitude and longitude in the spatial attribute information are extracted using a scattered cell positioning algorithm, which includes the following steps: using the row containing the keyword "latitude" or "longitude" as the baseline, scanning column by column to the right from the column containing that cell, extracting the numerical value and unit symbol; stopping scanning when the scanned cell content belongs to a preset stop word; the preset stop words include altitude, slope, recorded area, surveyor, administrative region, sample plot number, and date; concatenating the extracted numerical values ​​into a complete latitude and longitude string in the order of degrees, minutes, and seconds (°, ′, ″).

[0038] Optionally, in step S300, the altitude extraction uses the same scanning logic as the latitude and longitude extraction, but with different preset stop words, directly extracting the numerical value; the date extraction is also based on scanning to the right to identify the numbers and unit markers (year, month, day) and concatenating them; the administrative region uses a left-scanning strategy, extracting from the left with "League (City)", "Banner (County)", and "Commune" as anchor points (the value extracted with "Commune" as the anchor point is written into...). Figure 8 The target database's "township" field); field naming uses a right-scanning strategy to directly extract text.

[0039] Optionally, in step S300, deleting redundant data rows with empty plant names includes the following steps: obtaining the range of all row numbers written during the current processing (from the smallest written row to the largest written row); checking each row within the range of row numbers to see if the value of the plant name column is empty or contains only blank characters; if it is empty or contains only blank characters, marking the row as a row to be deleted; automatically protecting the header of a preset number of rows from deletion before deletion, ensuring that the output file always retains the standard header structure, in one embodiment the preset number of rows is 3 rows; batch deleting all rows to be deleted, and continuously shifting the remaining data rows upwards. This data cleaning step ensures that the plant data in each sample plot is continuously arranged and there are no blank row intervals between sample plots, eliminating the interference of blank rows on subsequent statistical analysis (such as species count and diversity index calculation).

[0040] One embodiment of the present invention is developed based on Python 3.12, with pandas (table positioning, field scanning, plant name matching, etc.), openpyxl (formula value reading, merged cell recognition, target database writing, etc.), and pathlib (filename extraction, etc.) as core dependency libraries.

[0041] The original grassland census form contains a large number of merged cells (such as headers merging across columns, sample plot information merging across rows, etc.), and the target database also contains merged cell ranges. Directly writing data to non-top-left cells in the merged cell range will trigger an AttributeError exception in openpyxl, causing the program to crash or fail to extract data.

[0042] Therefore, optionally, the data writing operations in steps S100, S200, and S300 employ a merged cell safe write algorithm. This algorithm is implemented through the safe write function (safe_write_cell) and includes the following steps: Before performing the write operation, it checks whether the target cell (row, col) belongs to any merged cell region; if it does not belong to a merged cell region, the data is written directly to the target cell; if it belongs to a merged cell region, the top-left cell (min_row, min_col) of the merged cell region is automatically located, and the data to be written is written to the top-left cell. The write operation uses the merged_cells attribute of openpyxl to traverse and identify all merged cell regions, ensuring that the write operation is always effective. This algorithm is uniformly called in the shrub data entry of Tables 6 and 7, and the herb data entry of Tables 3, 4, and 5, ensuring stable writing without abnormal interruption when facing any merged cell layout.

[0043] Optionally, in the data reading operations of steps S100, S200 and S300, if the cell contains a formula, the result value calculated by the formula is read through the data_only=True parameter of openpyxl.

[0044] Correspondingly, one embodiment of the present invention also provides a method such as... Figure 9 The system shown employs a two-level matching approach for standardizing heterogeneous grassland census data. This system includes: Shrub layer data writing module 601: It is used to traverse the Excel source file, using the file name as the first-level index, and match the corresponding sample plot row in the target database; in the shrub height record table of the source file, it extracts all plant names as second-level indexes, and extracts the corresponding height of each plant and writes it into the species row below the sample plot row; using the same plant name as the association key, it matches the number of clumps, canopy and dry weight of the corresponding plant from the shrub yield record table and writes it into the corresponding species row; if the species row already exists, it appends the written index, otherwise it creates a new species row; Herbaceous layer data writing module 602: used to locate plot rows using file names as primary indexes; extracting all plant names as secondary indexes from the herbaceous quadrat record table in the source file, and extracting the height, cover, and abundance indices corresponding to each plant and writing them into the species row below the plot row; using the same plant name as the association key, matching the dry weight index from the herbaceous yield measurement table and the frequency index from the herbaceous frequency quadrat table in sequence, and writing the corresponding species row; writing the herbaceous layer data and shrub layer data into the same plot data area, and performing cross-table matching and deduplication aggregation using the same plant name as the association key; when processing the latter table, if the plant species has already been written in the previous step, the corresponding species row is appended and written; otherwise, a new species row is created and written. The plot attribute association and data cleaning module 603 is used to extract spatial attribute information and survey attribute information from the plot basic information table in the source file, write them into the plot row of the corresponding plot, and delete redundant data rows with empty plant names.

[0045] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0046] Optionally, the system of the present invention adopts a three-layer architecture design, specifically including: (1) User Interaction Layer (GUI Layer): Based on Web front-end technologies (HTML / CSS / JavaScript) and the Vue framework, a graphical user interface is built and encapsulated into a cross-platform desktop application using the Electron framework. It provides functions such as source folder selection, one-click start operation, and log output panel. Users do not need to write or modify any code; they can start a fully automated processing flow by clicking a button. The front-end interface and back-end business logic are completely decoupled; the interface is only responsible for interactive display and receiving user commands. Figure 10 The desktop graphical user interface of the system of the present invention is shown.

[0047] (2) Core Processing Layer (Processing Engine Layer): Developed based on Python 3.12, with pandas (table positioning, field scanning, plant name matching) and openpyxl (formula value reading, merged cell recognition, target database writing) as core dependency libraries. This layer encapsulates two-level matching algorithms and various differentiated parsing strategies (priority backtracking algorithm, scattered cell positioning algorithm, simple anchor point extraction algorithm, primary and secondary keyword algorithm), merged cell safe writing algorithm, automatic summation of subtotal rows in Table 7, and automatic blank row cleanup, among other core functional modules. The core processing layer can run and debug independently without a graphical user interface, facilitating development and maintenance.

[0048] (3) Result Reading Layer (Output Layer): The standardized data is uniformly written into the target database, generating a structured, continuously arranged standardized dataset (including plot rows and species rows). Simultaneously, a detailed processing log file is generated, recording the execution status and exception information of each processing step. (User clicks...) Figure 10 After the "Generate Summary Table" button completes the process, the system will display the save location of the standardized result file, and supports one-click opening of the output file. Abnormal files are automatically skipped and logged.

[0049] Optionally, the user interaction layer adopts a three-layer decoupling pattern to achieve complete separation of the interface, scheduling, and algorithm: (1) Front-end presentation layer: The graphical user interface is built based on Web front-end technologies (HTML / CSS / JavaScript) and the Vue framework, and packaged into a cross-platform desktop application by the Electron framework. The front-end is responsible for providing functions such as source folder selection, one-click start operation and log output panel, and undertakes the responsibility of interactive display and user command collection, without involving any business logic processing.

[0050] (2) Backend Scheduling Layer: Built on a lightweight web service framework (Flask), it receives frontend instructions via a RESTful API, calls the core processing script as an independent subprocess, and captures processing log information in real time through standard input and output streams. The scheduling layer uses an asynchronous thread mechanism to push status updates to the frontend, ensuring that the interface remains responsive during long-running tasks. The scheduling layer is only responsible for task routing, status maintenance, and log relay, and does not involve specific data parsing algorithms.

[0051] (3) Core processing layer: Encapsulated in an independent Python module, it carries a two-level matching mechanism and a differentiated parsing strategy to realize the automated and standardized storage of heterogeneous table data. The core algorithm layer can run and debug independently without a graphical user interface and supports passing input and output paths via command-line parameters.

[0052] The three layers communicate through standardized interfaces, ensuring that modifications to any layer do not affect the normal operation of other layers. This model achieves complete decoupling of the interface, scheduling, and algorithm, significantly improving the system's maintainability, scalability, and cross-platform deployment capabilities.

[0053] The system operating environment requirements of this invention are Windows 7–11 (64-bit) and Python 3.6+ (pandas and openpyxl need to be pre-installed). If the environment does not meet the requirements, Python 3.14 needs to be installed and the required libraries need to be configured.

[0054] The user's operation process for using the system of this invention is as follows: (1) Double-click to run the desktop application and open the system user interface; (2) Click the "Select Folder" button and select the folder where the original grassland survey Excel source file is stored through the file browser; (3) Click the "Generate Summary Table" button and the system automatically executes the data standardization processing method in the above embodiment (including the input of shrub data in Table 6 / 7 and the automatic summation of subtotal rows in Table 7, the input of herb data in Table 3 / 4 / 5, the input of basic information of sample plots in Table 1 and the cleaning of blank rows, etc.); (3) After the processing is completed, the system pops up a prompt box to inform the user of the save location of the standardization result file and supports one-click opening of the output folder; (4) The user can view the detailed processing log of each step in the interface processing log area, which is convenient for verification and traceability.

[0055] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory. When the processor executes the computer program, it implements the steps described in the above-described method for standardizing heterogeneous grassland census data using two-level matching.

[0056] The processor referred to can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0057] In some embodiments, the memory may be an internal storage unit of the computer device, such as a hard drive or RAM. In other embodiments, the memory may be an external storage device of the computer device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory may include both internal and external storage units of the computer device. The memory is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory can also be used to temporarily store data that has been output or will be output.

[0058] An embodiment of the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps described above in the method for standardizing heterogeneous grassland census data using two-level matching.

[0059] The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to a photographic device / terminal device, recording media, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0060] In one experimental case, taking the grassland survey data of Hulunbuir City, Inner Mongolia in the 1980s as an example, a total of 431 Excel source files were involved, covering 9 banners and counties (Xin Barag Right Banner, Evenk Autonomous Banner, Chen Barag Banner, Xin Barag Left Banner, Hailar District, Yakeshi City, Zhalantun City, Arong Banner, Ergun City). The standardized processing method and system of the present invention were used for processing, and the results are as follows: (1) Processing time: 20 minutes (manual input takes about 216 hours); (2) Accuracy: The error rate was reduced from 5% for manual input to below 0.3%; (3) Fault tolerance: In processing 431 files, one file with abnormal format or missing key fields was identified and skipped. The system did not experience any interruption or crash. The abnormal files were all recorded in the processing log for subsequent manual review; (4) Standardization results: 247 complete standardized community parameter datasets (including height, cover, abundance, dry weight, etc.) were successfully constructed.

[0061] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for standardizing heterogeneous grassland survey data using two-level matching, characterized in that, Includes the following steps: Shrub layer data writing: Traverse the Excel source file, using the file name as the first-level index, and match the corresponding plot row in the target database; extract all plant names from the shrub height record table in the source file as second-level indexes, and extract the corresponding height of each plant and write it into the species row below the plot row; using the same plant name as the association key, match the number of clumps, canopy coverage, and dry weight of the corresponding plant from the shrub yield record table, and write it into the corresponding species row; if the species row already exists, append the written indicators, otherwise create a new species row; Herbaceous layer data writing: Locate the plot row using the file name as the primary index; extract all plant names from the herbaceous quadrat record table in the source file as secondary indexes, and extract the height, cover, and abundance indices corresponding to each plant and write them into the species row below the plot row; Using the same plant name as the association key, match the dry weight index from the herbaceous yield measurement table and the frequency index from the herbaceous frequency quadrat table, and write them into the corresponding species row; Write the herbaceous layer data and shrub layer data into the same plot data area, and perform cross-table matching and deduplication aggregation using the same plant name as the association key; When processing the latter table, if the plant species has already been written in the previous step, append the corresponding species row; otherwise, create a new species row and write it. Plot attribute association and data cleaning: Extract spatial attribute information and survey attribute information from the basic information table of the plot in the source file and write it into the plot row of the corresponding plot; delete redundant data rows with empty plant names.

2. The method for standardizing heterogeneous grassland survey data using two-level matching as described in claim 1, characterized in that, In the shrub layer data writing step, before writing the shrub layer data into the target database, there is also an automatic summation preprocessing step for the subtotal row in the shrub production record table: identifying the data row marked as subtotal in the shrub production record table of each source file, summing the values ​​of each column in the preset number of rows above the row, and filling the summation result back into the corresponding cell of the subtotal row.

3. The method for standardizing heterogeneous grassland survey data using two-level matching as described in claim 1, characterized in that, In the herbaceous layer data writing step, the extraction of the dry weight index in the herbaceous yield measurement table adopts a priority backoff algorithm, which includes the following steps: Priority targeting: Target the cell containing the keyword "average weight per square meter", and use the column immediately below or to the right of that cell that contains dry weight as the target column; Backtracking: If the priority positioning step fails, scan all columns in the header area with values ​​of dry weight, sort them from left to right, and select the second dry weight column as the target column; Data extraction: Use the middle column as the anchor to obtain a list of plant names, and extract values ​​row by row for the target column according to the plant name.

4. The method for standardizing heterogeneous grassland survey data using two-level matching as described in claim 1, characterized in that, In the sample plot attribute association and data cleaning steps, the extraction of latitude and longitude from the spatial attribute information of the sample plots adopts the scattered cell positioning algorithm, which includes: Using the row containing the keywords of longitude or latitude as the baseline, scan column by column to the right starting from the column containing that cell to extract the numerical values ​​and unit symbols; Scanning stops when the content of the scanned cell belongs to a preset stop word; the preset stop words include altitude, slope, recorded area, investigator, administrative region, sample plot number, and date; The extracted values ​​are concatenated into a complete latitude and longitude string in the order of degrees, minutes, and seconds.

5. The method for standardizing heterogeneous grassland survey data using two-level matching as described in claim 1, characterized in that, In the sample plot attribute association and data cleaning step, deleting redundant data rows with empty plant names includes the following steps: Get the range of all row numbers written during this process; Check each row in the specified row number range to see if the value of the plant name column is empty or contains only blank characters; If the line is empty or contains only whitespace characters, mark it as a line to be deleted. Automatically protects the headers of a preset number of rows from being deleted before deletion; Batch delete all rows to be deleted, and then continuously move the remaining data rows upwards.

6. The method for standardizing heterogeneous grassland survey data using two-level matching as described in claim 1, characterized in that, The data writing operations in the shrub layer data writing step, the herbaceous layer data writing step, and the sample plot attribute association and data cleaning step adopt the merged cell safe writing algorithm, which includes the following steps: Before performing a write operation, check whether the target cell belongs to any merged cell range; If it does not belong to a merged cell range, write it directly to the target cell; If the data belongs to a merged cell range, the top-left cell of the merged cell range will be automatically located and the data to be written will be written to the top-left cell.

7. The method for standardizing heterogeneous grassland survey data using two-level matching as described in claim 1, characterized in that, The step of writing shrub layer data further includes: extracting the total coverage of shrubs and tall herbs in the sample plot from the shrub height record table, summing the number of shrubs and the dry weight of each shrub in the table, and writing the total coverage of shrubs and tall herbs, the sum of the number of shrubs and the dry weight into the corresponding field of the corresponding sample plot row in the target database. The herbaceous layer data writing step further includes: extracting the natural reproductive branch height, natural leaf layer height, and total cover of the sample plot from the herbaceous quadrat record table, and summing the abundance of each herbaceous plant in the herbaceous quadrat record table; summing the dry weight in the herbaceous yield measurement table; and writing the natural reproductive branch height, natural leaf layer height, total cover, abundance, and dry weight into the corresponding fields of the corresponding sample plot row in the target database.

8. A system for standardizing heterogeneous grassland survey data using a two-level matching method, characterized in that, include: Shrub layer data writing module: It iterates through the Excel source file, using the file name as the first-level index, and matches the corresponding plot row in the target database; it extracts all plant names from the shrub height record table in the source file as second-level indexes, and extracts the corresponding height of each plant and writes it into the species row below the plot row; using the same plant name as the association key, it matches the number of clumps, canopy coverage, and dry weight of the corresponding plant from the shrub yield record table and writes it into the corresponding species row; if the species row already exists, it appends the written indicators, otherwise it creates a new species row; Herbaceous layer data writing module: used to locate plot rows using filenames as primary indexes; extracting all plant names as secondary indexes from the herbaceous quadrat record table in the source file, and extracting the corresponding height, cover, and abundance indices for each plant and writing them into the species row below the plot row; using the same plant name as the association key, matching the dry weight index from the herbaceous yield measurement table and the frequency index from the herbaceous frequency quadrat table, and writing the corresponding species row; writing herbaceous layer data and shrub layer data into the same plot data area, performing cross-table matching and deduplication aggregation using the same plant name as the association key; when processing the latter table, if the plant species has already been written in the previous step, appending the corresponding species row; otherwise, creating a new species row and writing it. The plot attribute association and data cleaning module is used to extract spatial attribute information and survey attribute information from the plot basic information table in the source file, write it into the plot row of the corresponding plot, and delete redundant data rows with empty plant names.

9. A computer device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.