Tree biomass calculation method and system
By acquiring the database file selected by the user and the tree parameters input, and utilizing database management and automated calculation technologies, the problem of low efficiency in traditional tree biomass measurement is solved, and rapid and automated biomass calculation is achieved.
Patent Information
- Application Number
- CN202511270173.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-05
- Publication Date
- 2025-12-12
AI Technical Summary
Traditional methods for measuring tree biomass rely on manual measurement and calculation, resulting in low efficiency and failing to meet the need for speed and real-time measurement.
By acquiring the database file selected by the user and the tree parameters input, and using database management and automated calculation technologies, the biomass model and calculation parameters corresponding to the tree species are extracted, automated calculations are performed, and any anomalies during the calculation process are identified and handled to obtain the final result.
It improves the efficiency of biomass measurement and enables rapid and automated tree biomass calculation.
Smart Images

Figure CN121122433A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method and system for calculating tree biomass. Background Technology
[0002] In the fields of ecology, forestry management, and environmental protection, the measurement of tree biomass is a crucial research step. Tree biomass is not only fundamental data for assessing the health of forest resources, monitoring carbon storage, and studying ecological balance, but it is also an important basis for formulating forest protection policies, management, and sustainable development. Therefore, the measurement of tree biomass is of paramount importance.
[0003] Traditional methods for estimating tree biomass typically rely on field surveys and sampling, combined with manual calculations. This involves researchers first selecting sample trees in the forest and measuring their key parameters, including diameter at breast height (DBH) and height. Finally, these data are input into a calculation formula or a regional regression model to estimate the tree biomass.
[0004] However, traditional methods for measuring tree biomass rely on manual measurement and calculation. Especially in large-scale forest resource surveys, the amount of data is huge, and the calculation process is cumbersome and time-consuming, resulting in low measurement efficiency and failing to meet the needs for speed and real-time measurement. Summary of the Invention
[0005] In view of the shortcomings of the prior art, this application provides a method and system for calculating tree biomass to solve the problem of low calculation efficiency caused by the prior art.
[0006] To achieve the above objectives, this application provides the following technical solution:
[0007] The first aspect of this application provides a method for calculating tree biomass, including:
[0008] The system obtains a database file selected by the user and tree parameters input by the user; wherein the database file is pre-created and stored based on the data file selected by the user; the tree parameters include at least diameter at breast height (DBH), tree height, and tree species.
[0009] Extract the biomass model and calculation parameters corresponding to the tree species from the database file;
[0010] The diameter at breast height (DBH), tree height, and calculation parameters are input into the biomass model for calculation, and it is determined whether there are any abnormalities during the calculation process.
[0011] If any abnormal situation occurs during the calculation process, the abnormal situation is handled to obtain the calculation result;
[0012] If no abnormal situation occurs during the calculation process, the calculation result is obtained.
[0013] Optionally, in the above-described method for calculating tree biomass, before obtaining the user-selected database file and the input tree parameters, the method further includes:
[0014] In response to triggering the database build operation in the menu bar of the biomass calculation tool, the database build interface is displayed;
[0015] Create a database based on the data file and database output name entered in the database construction interface;
[0016] Determine whether the data file and the database output name meet the preset requirements;
[0017] If the data file and the database output name meet the preset requirements, the database is determined to have been created successfully, and the data in the data file is written into the database to obtain the database file;
[0018] If the data file and the database output name do not meet the preset requirements, a prompt message will be sent to the user.
[0019] Optionally, in the above method for calculating tree biomass, obtaining the user-selected database file and the input tree parameters includes:
[0020] In response to the biomass calculation operation in the menu bar of the biomass calculation tool, the biomass calculation interface is displayed;
[0021] Based on the database file and the data summary table entered in the biomass calculation interface, obtain the database file and the data summary table;
[0022] Based on the master data table, a data table is determined, and based on the data table, the tree parameters input by the user on the biomass calculation interface are obtained.
[0023] Optionally, in the above-described method for calculating tree biomass, the step of extracting the biomass model and calculation parameters corresponding to the tree species from the database file includes:
[0024] Use an SQL query statement to retrieve the query field corresponding to the tree species from the database file;
[0025] Determine whether the query field matches a preset field;
[0026] If the query field matches a preset word, then the biomass model and calculation parameters corresponding to the tree species are extracted from the query field.
[0027] Optionally, in the above method for calculating tree biomass, determining whether there are any abnormalities during the calculation process includes:
[0028] Determine whether there is an error in the calculation formula corresponding to the biomass model, or whether there is an error in the format corresponding to the diameter at breast height and the tree height;
[0029] If the calculation formula corresponding to the biomass model is incorrect, or the format corresponding to the diameter at breast height and the tree height is incorrect, then it is determined that there is an abnormal situation in the calculation process;
[0030] If the calculation formula corresponding to the biomass model is correct, or the format corresponding to the diameter at breast height (DBH) and the tree height is correct, then it is determined that there are no abnormalities in the calculation process.
[0031] Optionally, the above-mentioned method for calculating tree biomass also includes:
[0032] Check whether the calculation results are reasonable;
[0033] If the calculation result is reasonable, then the calculation result is derived.
[0034] If the calculation result is not reasonable, a prompt message is sent to the user, and the process returns to extracting the biomass model and calculation parameters corresponding to the tree species from the database file.
[0035] Optionally, in the above method for calculating tree biomass, deriving the calculation result includes:
[0036] Obtain the export path and export name of the calculation results;
[0037] Based on the export path and the export name, export the calculation results and determine whether the calculation results have been successfully exported.
[0038] If the calculation result is successfully exported, then the calculation result is retrieved from the export path;
[0039] If the calculation result is not exported successfully, the process of retrieving the export path and export name of the calculation result will be returned.
[0040] A second aspect of this application provides a system for calculating tree biomass, comprising:
[0041] The data acquisition unit is used to acquire the database file selected by the user and the tree parameters input; wherein, the database file is created and stored in advance based on the data file selected by the user; the tree parameters include at least diameter at breast height (DBH), tree height, and tree species;
[0042] The data extraction unit is used to extract the biomass model and calculation parameters corresponding to the tree species from the database file;
[0043] The judgment unit is used to input the diameter at breast height, the tree height and the calculation parameters into the biomass model for calculation, and to judge whether there are any abnormalities in the calculation process;
[0044] The processing unit is configured to process the abnormal situation if an abnormal situation exists during the calculation process, and obtain the calculation result.
[0045] The result acquisition unit is used to acquire the calculation result if no abnormal situation exists during the calculation process.
[0046] Optionally, the above-mentioned tree biomass calculation system also includes:
[0047] The first display unit is used to display the database construction interface in response to the database construction operation in the menu bar of the biomass calculation tool.
[0048] A creation unit is used to create a database based on the data file and database output name entered in the database construction interface;
[0049] The requirement is to determine whether the data file and the database output name meet preset requirements;
[0050] The writing unit is used to determine that the database has been successfully created if the data file and the database output name meet the preset requirements, and to write the data in the data file into the database to obtain a database file;
[0051] The feedback unit is used to provide a prompt message to the user if the data file and the database output name do not meet the preset requirements.
[0052] Optionally, in the above-described tree biomass calculation system, the data acquisition unit includes:
[0053] The second display unit is used to display the biomass calculation interface in response to the biomass calculation operation in the menu bar of the trigger biomass calculation tool.
[0054] The file acquisition unit is used to acquire the database file and the data summary table based on the database file and the data summary table entered in the biomass calculation interface.
[0055] The data acquisition subunit is used to determine a data table based on the master data table, and to acquire the tree parameters input by the user on the biomass calculation interface based on the data table.
[0056] Optionally, in the above-described tree biomass calculation system, the data extraction unit includes:
[0057] The query unit is used to query the query field corresponding to the tree species from the database file using an SQL query statement;
[0058] A field judgment unit is used to determine whether the query field matches a preset field;
[0059] The data extraction subunit is used to extract the biomass model and calculation parameters corresponding to the tree species from the query field if the query field matches a preset word.
[0060] Optionally, in the above-described tree biomass calculation system, the judgment unit includes:
[0061] The form judgment unit is used to determine whether there is an error in the calculation formula corresponding to the biomass model, or whether there is an error in the format corresponding to the diameter at breast height and the tree height;
[0062] The first determining unit is used to determine that there is an abnormal situation in the calculation process if there is an error in the calculation formula corresponding to the biomass model, or if there is an error in the format corresponding to the diameter at breast height and the tree height.
[0063] The second determining unit is used to determine that there are no abnormalities in the calculation process if the calculation formula corresponding to the biomass model is correct, or the format corresponding to the diameter at breast height and the tree height is correct.
[0064] Optionally, the above-mentioned tree biomass calculation system also includes:
[0065] A detection unit is used to detect whether the calculation result is reasonable;
[0066] An export unit is used to export the calculation result if the calculation result is reasonable.
[0067] The first execution unit is used to provide feedback to the user if the calculation result is not reasonable, and then return to execute the step of extracting the biomass model and calculation parameters corresponding to the tree species from the database file.
[0068] Optionally, in the above-described tree biomass calculation system, the derivation unit includes:
[0069] The acquisition unit is used to acquire the export path and export name of the calculation result;
[0070] An export judgment unit is used to export the calculation result according to the export path and the export name, and to determine whether the calculation result has been successfully exported.
[0071] The result query unit is used to query the calculation result from the export path if the calculation result is successfully exported.
[0072] The second execution unit is used to return to the process of obtaining the export path and export name of the calculation result if the calculation result is not successfully exported.
[0073] This application provides a method for calculating tree biomass. The method involves acquiring a user-selected database file and inputting tree parameters. The database file is pre-created and stored based on the user-selected data file. Tree parameters include at least diameter at breast height (DBH), tree height, and tree species. Then, the biomass model and calculation parameters corresponding to the tree species are extracted from the database file. Finally, the DBH, tree height, and calculation parameters are input into the biomass model for calculation. The method also checks for anomalies during the calculation process. If anomalies are found, they are handled, and the calculation result is obtained. If no anomalies are found, the calculation result is obtained. This method effectively improves the efficiency of biomass measurement through database management and automated calculation technology. Attached Figure Description
[0074] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0075] Figure 1 A flowchart illustrating a method for calculating tree biomass provided in this application embodiment;
[0076] Figure 2 A schematic flowchart illustrating a database creation method provided in another embodiment of this application;
[0077] Figure 3 A first structural schematic diagram of a database construction interface provided in another embodiment of this application;
[0078] Figure 4 A second structural schematic diagram of a database construction interface provided in another embodiment of this application;
[0079] Figure 5 An ER diagram of database relationships is provided as another embodiment of this application;
[0080] Figure 6 A third structural diagram of a database construction interface provided for another embodiment of this application;
[0081] Figure 7 A flowchart illustrating a method for obtaining parameters and database files according to another embodiment of this application;
[0082] Figure 8 A first structural schematic diagram of a biomass calculation interface provided in another embodiment of this application;
[0083] Figure 9 A flowchart illustrating a method for extracting calculation formulas and coefficients, provided for another embodiment of this application;
[0084] Figure 10 A flowchart illustrating an abnormal situation determination method provided in another embodiment of this application;
[0085] Figure 11 A second structural schematic diagram of a biomass calculation interface provided in another embodiment of this application;
[0086] Figure 12 A flowchart illustrating a method for deriving calculation results according to another embodiment of this application;
[0087] Figure 13 This is a schematic diagram of a tree biomass calculation system provided in another embodiment of this application. Detailed Implementation
[0088] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0089] In this application, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0090] This application provides a method for calculating tree biomass, such as... Figure 1 As shown, the specific steps include:
[0091] S101. Obtain the database file selected by the user and the tree parameters entered.
[0092] The database file is created and stored in advance based on the data file selected by the user.
[0093] It should be noted that, in this embodiment, the user can select the tree biomass they wish to calculate and send it to the system. The user needs to select a database file using the system's provided interface, as the database file is crucial for the calculation formulas and parameters used in subsequent tree biomass calculations. Therefore, the user must provide the database file. This database file can be a preset national standard standing tree parameter formula or a user-defined formula.
[0094] In addition, after uploading the database file, users also need to input tree parameters for calculating tree biomass based on the input interface provided by the system. These tree parameters may include diameter at breast height (DBH), tree height, and tree species.
[0095] It should also be noted that in this embodiment, a database is created to store the massive amount of data and calculation formulas for calculating tree biomass. Only after the database is created can the file path be passed to the biomass calculation module for calculation. This biomass calculation module, based on user-configured parameters, calls the database to extract formulas, calculates biomass, and transmits the results to the result management module. In addition to the biomass calculation module, this embodiment also includes a file selection and import module: providing the user-selected data file and database path for use by the database construction module and the biomass calculation module. The database construction module: after constructing the database, passes the result file path to the biomass calculation module. The progress bar display module: updates the status in real time during database construction and calculation, displaying the operation progress. The result management module: receives the calculation results sent by the biomass calculation module and displays and stores them.
[0096] Therefore, alternatively, another embodiment of this application provides a method for creating a database, such as... Figure 2 As shown, the specific steps include:
[0097] S201. In response to the database construction operation in the menu bar of the biomass calculation tool, display the database construction interface.
[0098] Specifically, in this embodiment of the application, a method is provided for a biomass calculation tool to interact with the user. Therefore, before creating a database, the user needs to click on the database construction operation in the menu bar provided by the biomass calculation tool so that the system can respond to the user's operation and perform the database construction operation.
[0099] Furthermore, after the user clicks the database construction operation, the biomass calculation tool will display the database construction interface, allowing the user to provide the necessary data for the construction. The database construction interface can be found here. Figure 3 The content shown.
[0100] S202. Create a database based on the data file and database output name entered in the database construction interface.
[0101] Specifically, users need to click the "Browse" button in the database construction interface and select an Excel file (data file) to use for database construction. After selection, the file path will be displayed in the text box of the database construction interface, making it easy for users to verify the data file and avoid selecting the wrong file. Then, users need to enter the database output name in the "Database Output Name" text box of the database construction interface. A default name or a custom name can be used for easy identification. For details, please refer to [link / reference]. Figure 4 The content shown is as follows. Additionally, if the user does not enter a name, the system will provide default naming suggestions (such as "New Database_Date and Time"). If the user enters invalid characters or the database name is already taken, the system should prompt the user when attempting to create the database.
[0102] Finally, after selecting the data file and entering the database output name, the user can click the "Create Database" button. The system will then create the database based on the selected Excel file and output name. Clicking the button will also display a progress bar or loading animation to let the user know that the database is being created.
[0103] It should be emphasized that the embodiments in this application use an SQLite database. Therefore, the following design principles should be followed when designing an SQLite database:
[0104] (1) Standardization principle
[0105] Data table design must conform to the third normal form (3NF) to avoid data redundancy and ensure data access efficiency.
[0106] (2) Flexibility and scalability
[0107] The database structure needs to be flexible to support multiple tree types, multiple calculation formulas, and dynamic field expansion.
[0108] (3) Data integrity and consistency
[0109] Use field constraints (primary key, foreign key, NOT NULL constraint) to ensure data accuracy and consistency.
[0110] (4) Performance optimization
[0111] Set up indexes for frequently queried fields and plan the relationships between tables reasonably to avoid performance bottlenecks.
[0112] It should also be emphasized that you can refer to Figure 5 The ER diagram shown depicts the main entities of the system and the relationships between them:
[0113] (1) Entity:
[0114] Tree species table: Stores different tree species.
[0115] Aboveground biomass model table: stores calculation formulas uploaded by users.
[0116] Numbering table: Stores the numbering of tree species in different regions.
[0117] Indicator Table: Stores the error of the current calculation formula.
[0118] (2) Relationship:
[0119] The tree species table and the indicator table have a one-to-many relationship: each tree species corresponds to multiple indicators.
[0120] There is a one-to-one relationship between the tree species table, the aboveground biomass model table, and the numbering table: each tree species corresponds to a unique calculation formula and number.
[0121] S203. Determine whether the output names of the data file and database meet the preset requirements.
[0122] It should be noted that during the database creation process, the system checks the file format and data integrity of the data files, as well as the validity of the database output name, to identify potential problems. Therefore, if the data files and database output names meet the preset requirements, it means the data files conform to the file format and data integrity standards, and the database output names are valid; in this case, step S204 will be executed. If the data files and database output names do not meet the preset requirements, it means the data files do not conform to the file format and data integrity standards, and the database output names are invalid; in this case, step S205 will be executed.
[0123] S204. Confirm that the database was created successfully, and write the data from the data file into the database to obtain the database file.
[0124] It should be noted that when the data file and database output names meet the preset requirements, the database creation is successful, and a "Database created successfully" message will be displayed in the prompt box below. For details, please refer to [link to relevant documentation]. Figure 6 The content shown.
[0125] It should also be noted that after the database is created successfully, you need to use pandas.read_excel() to read all the sheets (data) in the Excel file, then iterate through each sheet and convert it into a DataFrame object, and then use pandas.DataFrame.to_sql() to write the data to the SQLite database. The import status should be displayed through a progress bar module to ensure that the data from the data file exists in the SQLite database.
[0126] It should also be noted that SQLite databases support the storage of multiple Excel files.
[0127] It is important to emphasize that the system supports importing data from Excel files and mapping it to the database structure, and also supports exporting results from the database to Excel files. The specific mapping rules are as follows:
[0128] The header of the Excel file must correspond to the field names of the TreeData table in the SQLite database (such as Diameter, Height, SpeciesName).
[0129] During import, the system automatically detects the tree species name (SpeciesName) in the Excel file and maps it to the SpeciesID in the TreeSpecies table.
[0130] S205. Provide feedback and prompts to the user.
[0131] Understandably, when the data file and database output names do not meet the preset requirements, the system will display the error message "Database creation failed" in the prompt box below, so that users can check whether the data file and database output names are correct.
[0132] Optionally, in one embodiment of this application, step S101 is implemented as follows: Figure 7 As shown, the specific steps include:
[0133] S701, In response to the biomass calculation operation in the menu bar of the biomass calculation tool, the biomass calculation interface is displayed.
[0134] Understandably, when a user has a need to calculate tree biomass, the biomass calculation operation in the menu bar of the biomass calculation tool will be triggered, and the system will then display the biomass calculation interface to the user.
[0135] S702. Obtain the database file and data summary table based on the database file and data summary table entered in the biomass calculation interface.
[0136] Specifically, according to the content displayed on the biomass calculation interface, users need to click the "Browse" button in the "Select Excel file for biomass calculation" section, select the Excel file (data summary sheet) containing biomass calculation data, and then the system will receive the data summary sheet uploaded by the user and display the file path in the text box for the user to check. The data summary sheet contains multiple worksheets, all of which contain the fields required for calculation.
[0137] Then, the user needs to select the pre-built database (i.e., the database file) from the drop-down menu in "Select Biomass Calculation Database". After selection, the system will automatically load the relevant tables and field information in the database file to obtain the database file.
[0138] S703. Based on the master data table, determine the data table, and based on the data table, obtain the tree parameters entered by the user on the biomass calculation interface.
[0139] It should be noted that since the master data table contains multiple worksheets (i.e., data tables), after selecting the master data table, the user also needs to select the target data table from the "Select table for biomass calculation" dropdown menu. The system will then display the fields from this table in the biomass calculation interface, allowing the user to input tree parameters for tree biomass based on these fields. For details, please refer to [link to documentation]. Figure 8 The content shown.
[0140] The specific input tree parameters are as follows:
[0141] Chest Diameter Field: Select the field representing chest diameter from the "Select Chest Diameter Field" drop-down list.
[0142] Tree height field: Select the field that represents the tree height.
[0143] Tree species field: Select the field that represents the tree species to differentiate biomass calculations for different tree species.
[0144] Unique value field: Select a unique identifier field (such as ID) to avoid duplicate records interfering with calculations.
[0145] S102. Extract the biomass model and calculation parameters corresponding to the tree species from the database file.
[0146] Specifically, the system reads records one by one from the TreeData table contained in the database file, and extracts the calculation coefficients and biomass models, i.e., the calculation formulas, from the TreeSpecies table based on the SpeciesID (tree species).
[0147] Optionally, in another embodiment of this application, one specific implementation of step S102 is as follows: Figure 9As shown, the specific steps include:
[0148] S901. Use SQL query statements to query the query fields corresponding to the tree species from the database file.
[0149] Specifically, the system will execute the corresponding SQL statement to extract the corresponding query fields based on the array input by the user, such as SELECT a, b, c FROM Sheet1 WHERE Tree type='Pine'.
[0150] S902. Determine whether the query field matches the preset field.
[0151] It should be noted that since the format of the table uploaded by the user may contain fields that do not conform to the predefined format, which may lead to subsequent calculation failures or errors, it is necessary to determine whether the queried fields match the predefined fields. If the queried fields match the predefined fields, it means that the format of the table uploaded by the user does not contain any fields that do not conform to the predefined format, so step S903 is executed.
[0152] Optionally, if the query field does not match the preset field, it means that the format of the table uploaded by the user may contain fields that do not conform to the established format. In this case, the user needs to reselect the file to be uploaded, which means returning to the execution step S101.
[0153] S903. Extract the biomass model and calculation parameters corresponding to the tree species from the query fields.
[0154] Specifically, when a query field matches a preset word, the corresponding biomass model and calculation parameters for the tree species are extracted from the query field using SQL statements.
[0155] S103. Input the diameter at breast height (DBH), tree height, and calculation parameters into the biomass model for calculation, and determine whether there are any abnormalities during the calculation process.
[0156] It should be noted that, in this embodiment, a suitable biomass model, i.e., calculation formula, needs to be selected according to different tree species, and the system pre-stores the equation forms and coefficients (such as a, b, c) corresponding to various tree species in the database. After the user inputs the tree species, the system extracts the corresponding equation data through SQL query, and then the system calls the calculate() function to perform biomass calculation.
[0157] Specifically, this application uses the allometric growth equation as the biomass model, therefore the specific form of the biomass model is: Y = aD b H c .
[0158] Where: Y: tree biomass (result), D: diameter at breast height (DBH) (input parameter), H: tree height (input parameter), a, b, c: calculation coefficients dynamically obtained from the database file.
[0159] It should also be noted that abnormal situations may occur during the calculation process, leading to calculation failure. Therefore, it is necessary to judge whether there are abnormal situations during the calculation process in real time. If there are abnormal situations during the calculation process, proceed to step S104. If there are no abnormal situations during the calculation process, proceed to step S105.
[0160] It should be emphasized that the embodiments of this application support grouped statistics and the simultaneous import of multiple data files, and generate corresponding calculation results. Grouped statistics refer to the system's ability to perform biomass statistics based on a calculated data table using selected grouping fields, such as for fixed regions or fixed sample plots.
[0161] Optionally, in another embodiment of this application, one specific implementation of step S103 is as follows: Figure 10 As shown, the specific steps include:
[0162] S1001. Determine if there are any errors in the calculation formula corresponding to the biomass model, or if there are any errors in the format of the corresponding diameter at breast height (DBH) and tree height.
[0163] It should be noted that abnormal situations refer to errors in the formulas in the database (inability to use Python's `eval` function) or problems with the Excel file in the data table to be calculated (text format, invalid characters). Therefore, it is necessary to determine whether there are errors in the calculation formula corresponding to the biomass model, or whether there are errors in the format of the diameter at breast height (DBH) and tree height. If there are errors in the calculation formula corresponding to the biomass model, or the format of the DBH and tree height, then proceed to step S1002. If there are no errors in the calculation formula corresponding to the biomass model, or the format of the DBH and tree height, then proceed to step S1003.
[0164] S1002. Determine if there are abnormal situations during the calculation process.
[0165] S1003. Confirm that there are no abnormalities during the calculation process.
[0166] S104. Handle abnormal situations and obtain calculation results.
[0167] It should be noted that if there are abnormal situations during the calculation process, deleting or skipping the erroneous rows will still yield the calculation result.
[0168] S105. Obtain the calculation results.
[0169] Specifically, if there are no abnormal situations during the calculation process, the system will directly output the calculation result.
[0170] It should be noted that when outputting the calculation results, users need to enter the name of the calculation result file in the "Calculation result output name" text box, and click "Browse" to select the output path to ensure that the calculation results are saved to the specified location.
[0171] Additionally, if users need to generate a table containing unique identifiers, they can enter a filename in the "Unique Value Table Output Name" field and select a save path. For details, please refer to [link / reference]. Figure 11 The content shown.
[0172] Optionally, after obtaining the calculation result, the calculation result can also be exported. Therefore, in another embodiment of this application, a method for exporting the calculation result is also provided, which specifically includes the following steps:
[0173] Check whether the calculation results are reasonable.
[0174] Understandably, when exporting calculation results, it is also necessary to check whether the calculation results are reasonable to avoid errors. Therefore, this can be done by checking whether the system outputs an error message. If the calculation results are reasonable, it means that the system did not output an error message, and the calculation results can be exported. If the calculation results are not reasonable, it means that the system outputs an error message, and the user should be prompted that the calculation results are incorrect and asked to re-upload the file, i.e., return to step S102.
[0175] Optionally, in another embodiment of this application, a specific implementation of the above-described method for deriving the calculation results is as follows: Figure 12 As shown, the specific steps include:
[0176] S1201. Obtain the export path and export name of the calculation results.
[0177] It should be noted that in this embodiment of the application, the system provides a preview function for the calculation results. Users will pre-set the export path and export name of the calculation results for the system to save the calculation results. Therefore, the system needs to obtain the export path and export name of the calculation results in advance.
[0178] S1202. Export the calculation results according to the export path and export name, and determine whether the calculation results have been exported successfully.
[0179] Specifically, the system exports and saves the calculation results according to the export path. The filename of the exported result also needs to be named after the export path to facilitate user retrieval and viewing. Furthermore, during the export process, there may be instances where the export fails. Therefore, to address this, the system needs to continuously check whether the calculation results have been exported successfully. If the calculation results are exported successfully, step S1203 is executed. If the calculation results are not exported successfully, it indicates that the export path and export name used to obtain the calculation results may be incorrect. Therefore, it needs to be obtained again, meaning the system needs to return to step S1201.
[0180] S1203. Query the calculation results from the export path.
[0181] Specifically, when the calculation results are successfully exported, users can find the calculation results in the pre-set export path and view the calculation results by export name.
[0182] This application provides a method for calculating tree biomass. The method involves acquiring a user-selected database file and inputting tree parameters. The database file is pre-created and stored based on the user-selected data file. Tree parameters include at least diameter at breast height (DBH), tree height, and tree species. Then, the biomass model and calculation parameters corresponding to the tree species are extracted from the database file. Finally, the DBH, tree height, and calculation parameters are input into the biomass model for calculation. The method also checks for anomalies during the calculation process. If anomalies are found, they are handled, and the calculation result is obtained. If no anomalies are found, the calculation result is obtained. This method effectively improves the efficiency of biomass measurement through database management and automated calculation technology.
[0183] Another embodiment of this application provides a system for calculating tree biomass, such as Figure 13 As shown, it includes the following units:
[0184] The data acquisition unit 1301 is used to acquire the database file selected by the user and the input tree parameters. The database file is pre-created and stored based on the data file selected by the user. The tree parameters include at least diameter at breast height (DBH), tree height, and tree species.
[0185] The data extraction unit 1302 is used to extract the biomass model and calculation parameters corresponding to the tree species from the database file.
[0186] The judgment unit 1303 is used to input the diameter at breast height (DBH), tree height, and calculation parameters into the biomass model for calculation, and to judge whether there are any abnormalities in the calculation process.
[0187] The processing unit 1304 is used to handle abnormal situations if there are any during the calculation process and obtain the calculation result.
[0188] The result acquisition unit 1305 is used to acquire the calculation result if there are no abnormalities during the calculation process.
[0189] It should be noted that the specific working process of the above modules in the embodiments of this application can be referred to steps S101 to S105 in the above method embodiments, and will not be repeated here.
[0190] Optionally, another embodiment of this application provides a tree biomass calculation system that further includes:
[0191] The first display unit is used to display the database construction interface in response to the database construction operation in the menu bar of the biomass calculation tool.
[0192] Create a cell to create a database based on the data file and database output name entered in the database build interface.
[0193] The requirement is to have a judgment unit to determine whether the output names of data files and databases meet the preset requirements.
[0194] The write unit is used to determine that the database creation was successful if the data file and the database output name meet the preset requirements, and then write the data from the data file into the database to obtain the database file.
[0195] The feedback unit is used to provide a prompt message to the user if the output names of the data file and database do not meet the preset requirements.
[0196] Optionally, in another embodiment of this application, a tree biomass calculation system includes a data acquisition unit 1301, comprising:
[0197] The second display unit is used to display the biomass calculation interface in response to the biomass calculation operation in the menu bar of the biomass calculation tool.
[0198] The file acquisition unit is used to acquire the database file and the data summary table based on the database file and data summary table entered in the biomass calculation interface.
[0199] The data acquisition subunit is used to determine the data table based on the master data table, and to obtain the tree parameters entered by the user on the biomass calculation interface based on the data table.
[0200] Optionally, in another embodiment of this application, a tree biomass calculation system includes a data extraction unit 1302, comprising:
[0201] The query unit is used to retrieve the corresponding query fields for a tree species from a database file using SQL query statements.
[0202] The field judgment unit is used to determine whether the query field matches the preset field.
[0203] The data extraction subunit is used to extract the biomass model and calculation parameters corresponding to the tree species from the query field if the query field matches the preset words.
[0204] Optionally, in another embodiment of this application, a tree biomass calculation system includes a judgment unit 1303, comprising:
[0205] The format judgment unit is used to determine whether there are errors in the calculation formula corresponding to the biomass model, or whether there are errors in the format corresponding to diameter at breast height (DBH) and tree height.
[0206] The first determining unit is used to determine if there is an abnormal situation in the calculation process if there is an error in the calculation formula corresponding to the biomass model, or if there is an error in the format corresponding to diameter at breast height and tree height.
[0207] The second determining unit is used to determine that there are no abnormalities in the calculation process if the calculation formula corresponding to the biomass model is correct, or the format corresponding to diameter at breast height and tree height is correct.
[0208] Optionally, another embodiment of this application provides a tree biomass calculation system that further includes:
[0209] The detection unit is used to check whether the calculation results are reasonable.
[0210] The export unit is used to export the calculation results if the calculation results are reasonable.
[0211] The first execution unit is used to provide feedback to the user if the calculation result is not reasonable, and then return to the database file to extract the biomass model and calculation parameters corresponding to the tree species.
[0212] Optionally, in another embodiment of this application, a tree biomass calculation system includes an export unit comprising:
[0213] The acquisition unit is used to obtain the export path and export name of the calculation results.
[0214] The export judgment unit is used to export the calculation results according to the export path and export name, and to determine whether the calculation results have been exported successfully.
[0215] The result query unit is used to query the calculation results from the export path if the calculation results are successfully exported.
[0216] The second execution unit is used to return the export path and export name for obtaining the calculation result if the calculation result is not exported successfully.
[0217] It should be noted that the specific working process of each module provided in the above embodiments of this application can be referred to the corresponding steps in the above method embodiments, and will not be repeated here.
[0218] It should also be noted that the tree biomass calculation system provided in this application has the technical effects of any of the above embodiments, and will not be described in detail here.
[0219] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0220] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for calculating tree biomass, characterized in that, include: The system obtains a database file selected by the user and tree parameters input by the user; wherein the database file is pre-created and stored based on the data file selected by the user; the tree parameters include at least diameter at breast height (DBH), tree height, and tree species. Extract the biomass model and calculation parameters corresponding to the tree species from the database file; The diameter at breast height (DBH), tree height, and calculation parameters are input into the biomass model for calculation, and it is determined whether there are any abnormalities during the calculation process. If any abnormal situation occurs during the calculation process, the abnormal situation is handled to obtain the calculation result; If no abnormal situation occurs during the calculation process, the calculation result is obtained.
2. The method according to claim 1, characterized in that, Before obtaining the user-selected database file and the input tree parameters, the process also includes: In response to triggering the database build operation in the menu bar of the biomass calculation tool, the database build interface is displayed; Create a database based on the data file and database output name entered in the database construction interface; Determine whether the data file and the database output name meet the preset requirements; If the data file and the database output name meet the preset requirements, the database is determined to have been created successfully, and the data in the data file is written into the database to obtain the database file; If the data file and the database output name do not meet the preset requirements, a prompt message will be sent to the user.
3. The method according to claim 1, characterized in that, The process of obtaining the user-selected database file and the input tree parameters includes: In response to the biomass calculation operation in the menu bar of the biomass calculation tool, the biomass calculation interface is displayed; Based on the database file and the data summary table entered in the biomass calculation interface, obtain the database file and the data summary table; Based on the master data table, a data table is determined, and based on the data table, the tree parameters input by the user on the biomass calculation interface are obtained.
4. The method according to claim 1, characterized in that, The step of extracting the biomass model and calculation parameters corresponding to the tree species from the database file includes: Use an SQL query statement to retrieve the query field corresponding to the tree species from the database file; Determine whether the query field matches a preset field; If the query field matches a preset word, then the biomass model and calculation parameters corresponding to the tree species are extracted from the query field.
5. The method according to claim 1, characterized in that, The determination of whether there are any abnormalities in the calculation process includes: Determine whether there is an error in the calculation formula corresponding to the biomass model, or whether there is an error in the format corresponding to the diameter at breast height and the tree height; If the calculation formula corresponding to the biomass model is incorrect, or the format corresponding to the diameter at breast height and the tree height is incorrect, then it is determined that there is an abnormal situation in the calculation process; If the calculation formula corresponding to the biomass model is correct, or the format corresponding to the diameter at breast height (DBH) and the tree height is correct, then it is determined that there are no abnormalities in the calculation process.
6. The method according to claim 1, characterized in that, Also includes: Check whether the calculation results are reasonable; If the calculation result is reasonable, then the calculation result is derived. If the calculation result is not reasonable, a prompt message is sent to the user, and the process returns to extracting the biomass model and calculation parameters corresponding to the tree species from the database file.
7. The method according to claim 6, characterized in that, The process of deriving the calculation result includes: Obtain the export path and export name of the calculation results; Based on the export path and the export name, export the calculation results and determine whether the calculation results have been successfully exported. If the calculation result is successfully exported, then the calculation result is retrieved from the export path; If the calculation result is not exported successfully, the process of retrieving the export path and export name of the calculation result will be returned.
8. A system for calculating tree biomass, characterized in that, include: The data acquisition unit is used to acquire the database file selected by the user and the tree parameters input; wherein, the database file is created and stored in advance based on the data file selected by the user; the tree parameters include at least diameter at breast height (DBH), tree height, and tree species; The data extraction unit is used to extract the biomass model and calculation parameters corresponding to the tree species from the database file; The judgment unit is used to input the diameter at breast height, the tree height and the calculation parameters into the biomass model for calculation, and to judge whether there are any abnormalities in the calculation process; The processing unit is configured to process the abnormal situation if an abnormal situation exists during the calculation process, and obtain the calculation result. The result acquisition unit is used to acquire the calculation result if no abnormal situation exists during the calculation process.
9. The system according to claim 8, characterized in that, Also includes: The first display unit is used to display the database construction interface in response to the database construction operation in the menu bar of the biomass calculation tool. A creation unit is used to create a database based on the data file and database output name entered in the database construction interface; The requirement is to determine whether the data file and the database output name meet preset requirements; The writing unit is used to determine that the database has been successfully created if the data file and the database output name meet the preset requirements, and to write the data in the data file into the database to obtain a database file; The feedback unit is used to provide a prompt message to the user if the data file and the database output name do not meet the preset requirements.
10. The system according to claim 8, characterized in that, The data acquisition unit includes: The second display unit is used to display the biomass calculation interface in response to the biomass calculation operation in the menu bar of the trigger biomass calculation tool. The file acquisition unit is used to acquire the database file and the data summary table based on the database file and the data summary table entered in the biomass calculation interface. The data acquisition subunit is used to determine a data table based on the master data table, and to acquire the tree parameters input by the user on the biomass calculation interface based on the data table.