Quantitative inversion method and device for surface matrix nutrient content based on hyperspectral characteristics

By constructing a standard spectral library of multiple types of surface matrix and combining hyperspectral technology with machine learning algorithms, the shortcomings of existing technologies in monitoring surface matrix nutrients below 2 meters have been solved, realizing dynamic real-time monitoring and high-precision inversion.

CN121783883APending Publication Date: 2026-04-03CHINA GEOLOGICAL SURVEY NATURAL RESOURCES COMPREHENSIVE SURVEY COMMAND CENT
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-12
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing technologies cannot effectively monitor and invert the nutrient content of surface matrix below 2 meters, and have failed to achieve dynamic real-time monitoring and accurate monitoring adapted to complex matrix environments. The spectral analysis technology is limited and has not been deeply integrated with machine learning algorithms, resulting in insufficient accuracy of the inversion model.

Method used

A standard spectral library of multiple types of land surface matrix was constructed using a portable hyperspectral instrument. Nutrient characteristics were extracted by combining envelope removal, spectral differentiation and spectral coding methods. A quantitative inversion model was constructed using random forest and partial least squares regression algorithms. Data was collected in real time by a hyperspectral sensor for dynamic monitoring.

Benefits of technology

It enables dynamic real-time monitoring of surface matrix nutrients below 2 meters, breaking through the limitations of traditional static testing, improving the accuracy of the inversion model, and adapting to precise monitoring in complex matrix environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121783883A_ABST
    Figure CN121783883A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of surface matrix nutrient monitoring, and provides a surface matrix nutrient content quantitative inversion method and equipment based on hyperspectral characteristics. The method comprises the following steps: carrying out spectrum collection on a plurality of areas and a plurality of types of surface matrix samples by using a portable hyperspectrometer, and constructing a surface matrix standard spectrum library containing a plurality of matrix types so as to extract spectrum diagnosis characteristics of organic matters and nitrogen, phosphorus and potassium nutrients in the surface matrix; according to a preset machine learning algorithm, processing the extracted spectral diagnosis features to obtain spectral feature variables related to the surface matrix nutrient content, and constructing a quantitative inversion model including spectral feature-nutrient content; deploying a hyperspectral sensor on the surface substrate layer, collecting hyperspectral data of the surface substrate layer in real time through the hyperspectral sensor, and inputting the hyperspectral data collected in real time into the quantitative inversion model to realize dynamic real-time monitoring of the nutrient content of the surface substrate layer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of surface matrix nutrient monitoring technology, and in particular to a method and equipment for quantitative inversion of surface matrix nutrient content based on hyperspectral characteristics. Background Technology

[0002] The surface matrix, as the fundamental material that nurtures soil and supports various natural resources such as forests, grasslands, and wetlands, has a crucial impact on agricultural production and vegetation ecological restoration due to its deep (below 2 meters) nutrient content. Traditional techniques suffer from the following significant drawbacks: 1. Limited monitoring depth: Existing studies focus on shallow soil layers of 0-2 meters, obtaining nutrient data through sample collection and laboratory testing. However, there is a lack of effective monitoring methods for the nutrient characteristics and dynamic changes of the surface matrix layer below 2 meters, which cannot meet the needs of deep matrix nutrient assessment.

[0003] 2. Lack of dynamic monitoring: The use of sensor technology to directly monitor the nutrient content of the surface matrix layer has not yet been realized, and there is no real-time dynamic inversion method based on hyperspectral technology, which makes it impossible to grasp the spatiotemporal variation of nutrients in a timely manner.

[0004] 3. Insufficient coverage of matrix types: Traditional methods do not classify and model the differences in spectral characteristics of different types of surface matrices such as rock, gravel, sand, soil, and mud, making it difficult to adapt to accurate monitoring in complex matrix environments.

[0005] 4. Limited spectral analysis techniques: Existing spectral analysis methods mostly use basic preprocessing methods without combining them with targeted feature extraction techniques such as envelope removal, spectral differentiation, and spectral encoding. Furthermore, they are not deeply integrated with machine learning algorithms such as random forests and partial least squares regression, resulting in insufficient accuracy of the inversion model.

[0006] Therefore, a method is urgently needed to solve at least one of the above problems. Summary of the Invention

[0007] This application provides a method and equipment for quantitative inversion of surface matrix nutrient content based on hyperspectral characteristics. It aims to solve the problem that existing technologies only focus on static analysis of shallow soil and lack technical inspiration for modeling, dynamic inversion and real-time monitoring of multi-type spectral characteristics of deep matrix. It is urgent to break through the technical bottleneck of quantitative inversion of deep matrix nutrients.

[0008] In a first aspect, embodiments of this application provide a method for quantitative inversion of surface matrix nutrient content based on hyperspectral characteristics, the method comprising: A portable hyperspectral analyzer was used to collect spectra of surface matrix samples from multiple regions and of various types. The collected spectral curves were preprocessed by outlier removal, spectral averaging, and calibration. Based on the processed spectral data, a standard spectral library of surface matrix containing multiple matrix types was constructed. The matrix types include at least any one of rock, gravel, sand, soil, and clay. For spectral data in the standard spectral library, the analytical methods of envelope removal, spectral differentiation and spectral coding are used to extract the spectral diagnostic features of organic matter and nitrogen, phosphorus and potassium nutrients in the surface matrix. Based on the preset machine learning algorithm, the extracted spectral diagnostic features are processed to obtain spectral feature variables related to the nutrient content of the surface matrix. Based on the spectral feature variables and the corresponding nutrient content data, a quantitative inversion model including spectral features and nutrient content is constructed. The accuracy of the quantitative inversion model is evaluated by the coefficient of determination and the relative root mean square error, and the quantitative inversion model is optimized according to the corresponding evaluation results. A hyperspectral sensor is deployed in the surface matrix layer to collect hyperspectral data of the surface matrix layer in real time. The real-time collected hyperspectral data is input into the quantitative inversion model, which outputs the content of organic matter and nutrients such as nitrogen, phosphorus and potassium in the surface matrix layer, thereby realizing dynamic real-time monitoring of the nutrient content of the surface matrix layer.

[0009] In some embodiments, the use of a portable hyperspectral analyzer to collect spectroscopic data from multiple regions and types of surface matrix samples includes: collecting surface matrix samples at a preset sampling density for multiple geomorphic regions and multiple land use types; the surface matrix samples include matrix layer samples with a depth of less than 2 meters; controlling environmental parameters during spectral collection and repeatedly scanning each sample to obtain raw spectral data; wherein the geomorphic regions include at least one of plains and basins, mountains and hills, and special geomorphic regions, and the multiple land use types include at least cultivated land, orchards, forest land, grassland, and wetlands; wherein the special geomorphic regions include permafrost regions, karst regions, and coastal zones.

[0010] In some embodiments, the preprocessing operations of outlier removal, spectral averaging, and calibration of the acquired spectral curves include: identifying and removing samples with abnormal reflectance fluctuations in the spectral curves using a preset statistical method; performing an arithmetic average of the effective spectral curves of the same type of matrix to generate an average spectral curve for the corresponding type of matrix; and performing radiometric calibration using a standard reference plate to convert the original spectral data into reflectance spectral data.

[0011] In some embodiments, constructing a standard spectral library of surface matrices containing multiple matrix types based on the processed spectral data includes: classifying and storing the average spectral curves according to matrix types such as rock, gravel, sand, soil, and mud, with each matrix type including sample spectral data of multiple different nutrient content gradients; associating each spectral data with a corresponding matrix type label, sampling area geographic coordinates, depth information, and laboratory-measured organic matter, nitrogen, phosphorus, and potassium nutrient content data to form a structured spectral database.

[0012] In some embodiments, the analytical methods of de-envelope analysis, spectral differentiation, and spectral coding are used to extract spectral diagnostic features of organic matter and nitrogen, phosphorus, and potassium nutrients in the surface matrix based on spectral data from a standard spectral library. These methods include: de-envelope processing of reflectance spectral data to eliminate the influence of baseline drift in the spectral curve; performing first- or second-order differential differentiation on the de-envelope spectrum to enhance spectral differences in nutrient-sensitive bands; and encoding the reflectance variation patterns of characteristic bands using a binary coding method to generate spectral diagnostic feature vectors. Specifically, organic matter corresponds to the 400-600 nm band, nitrogen corresponds to the absorption valleys at 1500 nm ± 10 nm and 2100 nm ± 10 nm, and potassium corresponds to the characteristic peak range at 2200 nm ± 10 nm.

[0013] In some embodiments, the step of processing the extracted spectral diagnostic features according to a preset machine learning algorithm to obtain spectral feature variables related to the nutrient content of the surface matrix includes: calculating the variable importance score of each spectral diagnostic feature using a random forest algorithm, determining the spectral feature variable based on the variable importance score, and / or performing a correlation analysis between the spectral diagnostic features and nutrient content using a partial least squares regression algorithm, determining the spectral feature variable based on the corresponding absolute loading value; and obtaining an input dataset containing multiple spectral feature variables.

[0014] In some embodiments, constructing a quantitative inversion model based on spectral feature variables and corresponding nutrient content data includes: dividing the dataset into a training set and a validation set according to a preset ratio; training a random forest model and a partial least squares regression model using the spectral feature variables of the training set as input and the measured nutrient content as output; setting the parameters of the random forest model and the partial least squares regression model; optimizing the model hyperparameters through cross-validation; and completing the construction of the quantitative inversion model. The random forest model parameters include at least the number of decision trees and the maximum depth, and the partial least squares regression model parameters include at least the number of principal components.

[0015] In some embodiments, the step of evaluating the accuracy of the quantitative inversion model using the coefficient of determination and the relative root mean square error (RMSE) to optimize the quantitative inversion model based on the corresponding evaluation results includes: calculating the coefficient of determination and the relative root mean square error of the quantitative inversion model using validation set data; if either the coefficient of determination or the relative root mean square error fails to meet the standard, returning to the feature variable screening step, adjusting the variable importance screening threshold or changing the machine learning algorithm, and reconstructing and training the quantitative inversion model until the accuracy requirements are met.

[0016] In some embodiments, the step of inputting real-time acquired hyperspectral data into the quantitative inversion model, and the quantitative inversion model outputting the organic matter and nutrient content of nitrogen, phosphorus, and potassium in the surface matrix layer, includes: deploying hyperspectral sensors in a grid pattern in areas below 2 meters in depth corresponding to the surface matrix layer; the sensors integrating a global positioning system module to record the sampling location; the real-time acquired spectral data first undergoes outlier removal, spectral averaging, and calibration operations consistent with the preprocessing steps of a standard spectral library, and is then input into the optimized quantitative inversion model, outputting the organic matter, nitrogen, phosphorus, and potassium content values ​​and timestamp information of the matrix layer at the corresponding location, thereby realizing dynamic data storage and updating.

[0017] In a second aspect, this application provides a computer device, the computer device including a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and, when executing the computer program, implement the method provided in any embodiment of this application.

[0018] This application fills a technological gap in deep matrix dynamic monitoring by applying hyperspectral technology to nutrient inversion in surface matrix layers below 2 meters. A standard spectral library encompassing multiple matrix types, including rock, gravel, sand, soil, and clay, is constructed, solving the problem of spectral characteristic differentiation analysis in complex matrix environments. Existing technologies do not address the systematic classification and modeling of multiple matrix types. Combining specialized analytical methods such as envelope removal, spectral differentiation, and spectral coding, the spectral diagnostic features of organic matter and nitrogen, phosphorus, and potassium are accurately extracted. Furthermore, machine learning algorithms are used to optimize feature variables and construct a high-precision quantitative inversion model. Existing technologies do not disclose such a combined technical solution. By deploying hyperspectral sensors to collect data in real time and calling the inversion model, real-time dynamic output of deep matrix nutrients is achieved, overcoming the limitations of traditional static testing. No similar real-time monitoring solution exists in existing technologies.

[0019] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

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

[0021] Figure 1 This is a schematic flowchart illustrating the steps of a method for quantitative inversion of surface matrix nutrient content based on hyperspectral features, provided in an embodiment of this application. Figure 2 This is a schematic diagram illustrating the principle of a method for quantitative inversion of surface matrix nutrient content based on hyperspectral features, provided in one embodiment of this application. Figure 3 This is a schematic block diagram of a surface matrix nutrient content quantitative inversion system based on hyperspectral features provided in an embodiment of this application; Figure 4 This is a schematic block diagram of the structure of a computer device provided in an embodiment of this application.

[0022] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Detailed Implementation

[0023] 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, 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.

[0024] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.

[0025] It should be understood that, in order to clearly describe the technical solutions of the embodiments of the present invention, the terms "first" and "second" are used in the embodiments of the present invention to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.

[0026] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0027] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0028] The surface matrix, as the fundamental material that nurtures soil and supports various natural resources such as forests, grasslands, and wetlands, has a crucial impact on agricultural production and vegetation ecological restoration due to its deep (below 2 meters) nutrient content. Traditional techniques suffer from the following significant drawbacks: 1. Limited monitoring depth: Existing studies focus on shallow soil layers of 0-2 meters, obtaining nutrient data through sample collection and laboratory testing. However, there is a lack of effective monitoring methods for the nutrient characteristics and dynamic changes of the surface matrix layer below 2 meters, which cannot meet the needs of deep matrix nutrient assessment.

[0029] 2. Lack of dynamic monitoring: The use of sensor technology to directly monitor the nutrient content of the surface matrix layer has not yet been realized, and there is no real-time dynamic inversion method based on hyperspectral technology, which makes it impossible to grasp the spatiotemporal variation of nutrients in a timely manner.

[0030] 3. Insufficient coverage of matrix types: Traditional methods do not classify and model the differences in spectral characteristics of different types of surface matrices such as rock, gravel, sand, soil, and mud, making it difficult to adapt to accurate monitoring in complex matrix environments.

[0031] 4. Limited spectral analysis techniques: Existing spectral analysis methods mostly use basic preprocessing methods without combining them with targeted feature extraction techniques such as envelope removal, spectral differentiation, and spectral encoding. Furthermore, they are not deeply integrated with machine learning algorithms such as random forests and partial least squares regression, resulting in insufficient accuracy of the inversion model.

[0032] Therefore, existing technologies are limited to static analysis of shallow soil layers and offer no technical insights into modeling, dynamic inversion, and real-time monitoring of multi-type spectral characteristics of deep matrices. There is an urgent need to overcome the technical bottleneck in the quantitative inversion of nutrients in deep matrices.

[0033] To solve the above problem, please refer to Figures 1 to 2This application provides a method for quantitative inversion of surface matrix nutrient content based on hyperspectral features, applied to computer equipment. The computer equipment can be deployed on a single server or server cluster. It can also be deployed on handheld terminals, laptops, wearable devices, or robots, etc. The provided method for quantitative inversion of surface matrix nutrient content based on hyperspectral features includes steps S101 to S104, detailed below: Step S101. Use a portable hyperspectral analyzer to collect spectra of surface matrix samples from multiple regions and of various types. Perform outlier removal, spectral averaging, and calibration preprocessing on the collected spectral curves. Based on the processed spectral data, construct a standard spectral library of surface matrix containing multiple matrix types. The matrix types include at least any one of rock, gravel, sand, soil, and mud.

[0034] Specifically, spectral data of surface matrices from multiple regions and of multiple types were collected using a portable hyperspectral analyzer. After preprocessing, a standard spectral library containing matrix types such as rock, gravel, sand, soil, and mud was constructed to provide basic data for subsequent feature extraction and model building.

[0035] A portable ground-based spectrometer equipped with a diffuse reflectance probe was used to support spectral acquisition of deep matrix samples (below 2 meters) in the field. For deep samples, columnar samples were obtained using drilling equipment (such as soil sampling drills and core samplers), and samples were taken in layers at 0.5-meter intervals (2-10 meters deep), with at least 3 parallel samples collected from each layer. The sampling area covered different landform types (such as plains and basins, mountains and hills, permafrost areas, karst areas, and coastal zones), with at least 50 samples collected from each area to ensure that the spectral library covered matrix data from different climate zones and parent material types.

[0036] Outlier removal employs the Z-score or IQR (interquartile range) method to eliminate spectral curves with abnormal reflectance fluctuations (such as samples with noise peaks exceeding 3σ). Spectral averaging is performed by arithmetic averaging of multiple spectra collected from the same matrix sample (≥3 times) to reduce the impact of random noise.

[0037] Calibration and calibration are performed using a standard diffuse white board (such as a Spectralon white board) for radiometric calibration, converting the original voltage signal into a reflectance spectrum. The formula is: Reflectance = (Sample Signal) / (Sample Spectralon White Board) Dark current signal / (whiteboard signal) Dark current signal); a standard spectral library is constructed to store spectral data categorized by matrix type (rock, gravel, sand, soil, mud), with each sample accompanied by metadata (sampling depth, geographical location, measured nutrient values, particle size composition, etc.). The data format adopts a common spectral data format (such as ENVI's spectral library format), supporting batch calls to subsequent feature extraction algorithms.

[0038] Step S102. For the spectral data in the standard spectral library, use the analysis methods of envelope removal, spectral differentiation and spectral coding to extract the spectral diagnostic features of organic matter and nitrogen, phosphorus and potassium nutrients in the surface matrix.

[0039] Specifically, for standard spectral library data, methods such as envelope removal, spectral differentiation, and spectral coding are used to extract the specific spectral characteristics of organic matter and nitrogen, phosphorus, and potassium nutrients, eliminate background noise, and enhance the signal in nutrient-sensitive bands.

[0040] Envelope removal involves fitting the envelope of the original reflectance spectrum (400-2500nm) and using polynomial interpolation (usually 3rd-5th order polynomials) to fit the overall trend of the spectral curve. The envelope-normalized spectrum is then calculated as: Rnorm(λ) = R(λ) / E(λ), where R(λ) is the original reflectance and E(λ) is the envelope value. This process highlights the subtle spectral differences in organic matter (400-600nm negative correlation band), nitrogen (1500nm and 2100nm absorption valleys), and potassium (2200nm characteristic peak).

[0041] After applying Savitzky-Golay smoothing filter (window width 5-9 bands, polynomial order 2) to the spectral derivative, the first or second derivative is calculated using the formula: R′(λ)=R(λ+Δλ). R(λ Δλ) / 2Δλ. Derivative processing can eliminate baseline drift and enhance weak absorption characteristics (such as the derivative extremum of nitrogen at the absorption valley at 2100 nm).

[0042] Band selection encoding is based on nutrient-sensitive bands (such as 400-600 nm for organic matter, 1500 nm and 2100 nm for nitrogen, and 2200 nm for potassium), encoding continuous spectra into feature vectors, or using principal component analysis (PCA) to reduce high-dimensional spectra to the top 10 principal components (such as cumulative variance contribution rate ≥95%).

[0043] Binary encoding constructs a binary feature matrix by binarizing specific absorption peak / valley positions (such as the 2200nm±10nm range for potassium), which facilitates machine learning models to quickly identify feature patterns.

[0044] Step S103. Process the extracted spectral diagnostic features according to the preset machine learning algorithm to obtain spectral feature variables related to the nutrient content of the surface matrix. Based on the spectral feature variables and the corresponding nutrient content data, construct a quantitative inversion model including spectral features and nutrient content. Use the coefficient of determination and relative root mean square error to evaluate the accuracy of the quantitative inversion model, and optimize the quantitative inversion model according to the corresponding evaluation results.

[0045] Specifically, machine learning algorithms such as random forest and partial least squares regression (PLSR) are used to screen key spectral feature variables, construct a quantitative model of "spectral features-nutrient content," and then use the coefficient of determination (COP) to... R 2 ) and relative root mean square error ( RMSEr Evaluate the accuracy of the optimized model.

[0046] Feature variable selection employs the Mean Decrease Gini ranking of features in random forests or the Variable Projection Importance (VIP) of PLSR, selecting spectral feature variables with VIP>1 or ranking in the top 20% (such as the 450nm and 550nm bands after removing the envelope, and the feature values ​​at 1500nm and 2200nm of the first derivative).

[0047] The random forest model sets the number of decision trees to 50-200 and the maximum depth to 10-30 layers. It uses bootstrap sampling to divide the training set (70%) and the test set (30%), inputs spectral feature variables, and outputs regression values ​​of organic matter, nitrogen, phosphorus and potassium content.

[0048] Partial least squares regression (PLSR) extracts principal components from spectral data and selects the number of principal components (usually ≤15) to minimize the root mean square error of cross-validation. RMSECV To minimize the spectral principal components, a linear regression model of nutrient content was established.

[0049] The evaluation metric is calculated by using the coefficient of determination on the test set. and relative root mean square error ( RMSEr = RMSE / (×100%), requiring organic matter, nitrogen, phosphorus, and potassium. R 2 ≥0.8, RMSEr ≤15%.

[0050] If the accuracy is not up to standard, adjust the algorithm parameters (such as the tree depth of the random forest, the number of principal components of the PLSR), or return to step S102 to re-extract features (such as adding second derivative features) until the model accuracy meets the requirements.

[0051] Step S104. Deploy a hyperspectral sensor in the surface matrix layer, collect hyperspectral data of the surface matrix layer in real time through the hyperspectral sensor, input the real-time collected hyperspectral data into the quantitative inversion model, and output the organic matter and nutrient content of nitrogen, phosphorus and potassium in the surface matrix layer to realize dynamic real-time monitoring of the nutrient content of the surface matrix layer.

[0052] Specifically, by using hyperspectral sensors deployed in the surface matrix layer (below 2 meters) to collect data in real time, and inputting it into the optimized inversion model, dynamic output and real-time monitoring of nutrient content can be achieved.

[0053] The sensor selection adopts embedded hyperspectral sensors (such as miniature fiber optic spectrometers with a wavelength range of 400-2500nm, equipped with waterproof and pressure-resistant probes), which are vertically deployed in the target monitoring area (such as farmland and forest land) through drilling (5-10cm in diameter), with a depth coverage of 2-10 meters. One sensor is deployed at a interval of 1 meter to form a distributed monitoring network.

[0054] Data acquisition involves setting a sampling frequency (e.g., once per hour), during which the sensor automatically collects spectral data and transmits it to an edge computing device or cloud server via wired (fiber optic) or wireless (LoRa, 4G) connections.

[0055] Real-time data processing involves performing the same preprocessing (outlier removal and calibration) on the real-time acquired spectral data as in step S101, and matching it to the corresponding standard spectral library subset according to the matrix type (preset by previous geological exploration). The feature extraction algorithm (envelope removal, differentiation, and encoding) from step S102 is then invoked to generate real-time spectral feature vectors.

[0056] The model invocation and result output involve inputting real-time feature vectors into the trained quantitative inversion model, simultaneously outputting real-time values ​​of organic matter, nitrogen, phosphorus, and potassium content. The results are displayed through visualization platforms (such as web and mobile apps), supporting historical data queries and nutrient change trend analysis, providing real-time data support for agricultural fertilization decisions (such as precision fertilization) and vegetation ecological restoration (such as vegetation nutrient supplementation).

[0057] In some embodiments, the use of a portable hyperspectral analyzer to collect spectroscopic data from multiple regions and types of surface matrix samples includes: collecting surface matrix samples at a preset sampling density for multiple geomorphic regions and multiple land use types; the surface matrix samples include matrix layer samples with a depth of less than 2 meters; controlling environmental parameters during spectral collection and repeatedly scanning each sample to obtain raw spectral data; wherein the geomorphic regions include at least one of plains and basins, mountains and hills, and special geomorphic regions, and the multiple land use types include at least cultivated land, orchards, woodlands, grasslands, and wetlands; wherein the special geomorphic regions include permafrost regions, karst regions, and coastal zones.

[0058] For areas with multiple landform and land use types, surface matrix samples were collected at depths of more than 2 meters, environmental parameters were controlled, and raw spectral data were obtained by repeated scanning.

[0059] The sampling area coverage includes: Landform type: covering typical landforms such as plains and basins, mountains and hills (at least 3 representative areas for each landform type), with deep matrix distribution determined through geological survey reports (e.g., mountains are mainly rocky and gravelly, plains are mainly soil). Land use type: targeting scenarios such as cultivated land (farmland), orchards (orchards), forests (forests), grasslands (steppes), and wetlands (swamps), 5-10 sample areas are selected for each type, with a sample area spacing ≥ 5 km to avoid spatial autocorrelation.

[0060] Deep sample collection utilizes hydraulic drilling equipment (such as a deep soil sampling drill rig, with a drilling depth ≥10 meters) to collect columnar rock core / soil samples at the target depth (2-10 meters, at 0.5-meter intervals), with a single sample volume ≥100 cm³. 3 To avoid surface contamination (clean drilling equipment before sampling).

[0061] Environmental conditions should be selected on sunny, cloudless days (light intensity ≥ 2000 lux). During sampling, ambient temperature (20±5℃) and humidity (40%-60%RH) should be controlled, and strong winds (wind speed ≤ level 3) should be avoided to prevent spectral noise. Each sample should be scanned 3-5 times. During scanning, the probe should be vertically aligned with the sample surface at a distance of 10-15 cm to ensure a uniform spectral acquisition area (avoiding impurity particles). Raw data should be stored in ASCII format (including wavelength-reflectance correspondence values).

[0062] In some embodiments, the preprocessing operations of outlier removal, spectral averaging, and calibration of the acquired spectral curves include: identifying and removing samples with abnormal reflectance fluctuations in the spectral curves using a preset statistical method; performing an arithmetic average of the effective spectral curves of the same type of matrix to generate an average spectral curve for the corresponding type of matrix; and performing radiometric calibration using a standard reference plate to convert the original spectral data into reflectance spectral data.

[0063] Data quality is improved by preprocessing the raw spectral data, including outlier removal, spectral averaging, and radiometric calibration.

[0064] Outlier removal uses the IQR method: the reflectance quartiles (Q1, Q3) of the spectral curve across the entire wavelength range are calculated, and the outlier range is defined as Q1. Spectral curves exceeding 1.5 IQR or Q3+1.5 IQR will be removed (integer curves will be removed if the number of abnormal bands in a single sample is ≥5).

[0065] Spectral averaging is performed by averaging the effective spectral curves (≥3) of the same matrix type and the same sample. The formula is as follows: ; Where n is the number of valid scans, Ri(λ) is the reflectance of the i-th scan.

[0066] Radiometric calibration is performed using a standard diffuse white board (such as a Spectralon 99% reflectivity white board). The white board is scanned before each sampling to obtain a reference signal. The calibration formula is Rcal(λ) = (Ssample(λ)). Sdark(λ))×Rwhite(λ) / (Swhite(λ) Sdark(λ)); where Ssample is the sample signal, Sdark is the dark current signal (collected when the lens is blocked), and Rwhite is the known reflectivity of the whiteboard.

[0067] In some embodiments, constructing a standard spectral library of surface matrices containing multiple matrix types based on the processed spectral data includes: classifying and storing the average spectral curves according to matrix types such as rock, gravel, sand, soil, and mud, with each matrix type including sample spectral data of multiple different nutrient content gradients; associating each spectral data with a corresponding matrix type label, sampling area geographic coordinates, depth information, and laboratory-measured organic matter, nitrogen, phosphorus, and potassium nutrient content data to form a structured spectral database.

[0068] Spectral data is stored by classifying it according to matrix type, and a structured standard spectral library is constructed by associating metadata.

[0069] The types are divided into rocky, gravelly, sandy, soily and muddy, and each type contains samples with low, medium and high nutrient content gradients (≥50 samples per gradient).

[0070] Metadata association is achieved by attaching the following to each spectral data point: Basic information: matrix type label, latitude and longitude of sampling point (accuracy ±0.001°), sampling depth (accuracy to 0.1 meters); Measured data: content of organic matter (potassium dichromate oxidation method), total nitrogen (Kjeldahl method), total phosphorus (molybdenum antimony colorimetric method), and total potassium (flame photometry method) in laboratory tests (unit: g / kg, accuracy ±0.1 g / kg); Quality control: sampling time, instrument model, and pretreatment steps.

[0071] The database structure uses a relational database (such as MySQL) for storage, and the fields include: spectral ID, matrix type, geographic coordinates, depth, organic matter, nitrogen, phosphorus, potassium content, and spectral data file path (linked to ENVI format spectral files). It supports SQL retrieval and batch import.

[0072] In some embodiments, the analytical methods of de-envelope analysis, spectral differentiation, and spectral coding are used to extract spectral diagnostic features of organic matter and nitrogen, phosphorus, and potassium nutrients in the surface matrix based on spectral data from a standard spectral library. These methods include: de-envelope processing of reflectance spectral data to eliminate the influence of baseline drift in the spectral curve; performing first- or second-order differential differentiation on the de-envelope spectrum to enhance spectral differences in nutrient-sensitive bands; and encoding the reflectance variation patterns of characteristic bands using a binary coding method to generate spectral diagnostic feature vectors. Specifically, organic matter corresponds to the 400-600 nm band, nitrogen corresponds to the absorption valleys at 1500 nm ± 10 nm and 2100 nm ± 10 nm, and potassium corresponds to the characteristic peak range at 2200 nm ± 10 nm.

[0073] Nutrient-sensitive spectral features are extracted by removing the envelope, spectral differentiation, and binary encoding to clarify the characteristic band range.

[0074] Envelope removal is achieved by fitting the envelope of the 400-2500 nm reflectance spectrum using a third-order polynomial (implemented via the UnivariateSpline function in Python's SciPy library) and calculating the normalized spectrum: Renv(λ) = Rcal(λ) / E(λ); this process eliminates the masking of organic matter, nitrogen, phosphorus, and potassium characteristics by the mineral background (such as the high reflectance baseline of the rock matrix).

[0075] The spectral derivative is first smoothed by Savitzky-Golay (window width of 7 bands, order 2) on the envelope-free spectrum, and then the first derivative is calculated (formula see Example S102) to enhance the spectral difference between the absorption valleys of nitrogen (1500nm±10nm, 2100nm±10nm) and the characteristic peaks of potassium (2200nm±10nm) (derivative extrema are used as features).

[0076] Binary encoding is achieved by defining characteristic wavelength ranges: organic matter: 400-600nm (21 ranges in total, each 10nm interval); nitrogen: 1490-1510nm, 2010-2110nm (each 20nm interval); potassium: 2190-2210nm (20nm interval). For each range, a binary encoding is performed to determine if there is a significant decrease in reflectance (organic matter) or a peak (potassium) (1 if present, 0 otherwise), generating a feature vector with a dimension of 21+2+1=24.

[0077] In some embodiments, the step of processing the extracted spectral diagnostic features according to a preset machine learning algorithm to obtain spectral feature variables related to the nutrient content of the surface matrix includes: calculating the variable importance score of each spectral diagnostic feature using a random forest algorithm, determining the spectral feature variable based on the variable importance score, and / or performing a correlation analysis between the spectral diagnostic features and nutrient content using a partial least squares regression algorithm, determining the spectral feature variable based on the corresponding absolute loading value; and obtaining an input dataset containing multiple spectral feature variables.

[0078] Key spectral feature variables were selected through random forest variable importance and PLSR loading analysis to construct the input dataset.

[0079] Random forest variable importance is calculated by training a model using Scikit-learn's RandomForestRegressor, calculating the feature_importances_score for each spectral feature (based on the reduction in Gini impurity), and selecting the top 30% of features (such as the top 20 band derivative extreme points).

[0080] PLSR load analysis calculates the load matrix of spectral features and nutrient content using the plsregress function (MATLAB or Python's plsPy library). Features with an absolute load value ≥ 0.3 (reflecting strong correlation) are selected, such as the band with a first derivative load value > 0.4 at 1500 nm.

[0081] The input dataset is constructed by merging features selected by two methods and removing duplicates to form an input dataset containing 50-80 spectral feature variables (such as 450nm and 550nm after removing the envelope, 1500nm and 2200nm of the first derivative, binary encoded features, etc.). Each row of data corresponds to the feature vector and measured nutrient value of a sample.

[0082] In some embodiments, constructing a quantitative inversion model based on spectral feature variables and corresponding nutrient content data includes: dividing the dataset into a training set and a validation set according to a preset ratio; training a random forest model and a partial least squares regression model using the spectral feature variables of the training set as input and the measured nutrient content as output; setting the parameters of the random forest model and the partial least squares regression model; optimizing the model hyperparameters through cross-validation; and completing the construction of the quantitative inversion model. The random forest model parameters include at least the number of decision trees and the maximum depth, and the partial least squares regression model parameters include at least the number of principal components.

[0083] By dividing the training set and validation set, random forest and PLSR models are trained, and a quantitative inversion model is constructed through hyperparameter optimization.

[0084] The dataset was randomly divided into a training set (containing spectral features of measured nutrient values) and a validation set in a 7:3 ratio. Stratified sampling was used to ensure a balanced distribution of matrix types and nutrient gradients (using the StratifiedShuffleSplit method).

[0085] Random forests include: Hyperparameter range: number of decision trees n_estimators = 50-200 (step size 50), maximum depth max_depth = 10-30 (step size 10); 5-fold cross-validation is used to select the parameter combination that minimizes the RMSE of the validation set (e.g., n_estimators = 150, max_depth = 20). PLSR: number of principal components n_components = 5-20 (step size 5), selected using leave-one-out cross-validation to minimize the RMSECV (e.g., n_components = 12).

[0086] Model storage serializes the model with optimal parameters (such as Python's pickle or joblib) and stores it as a .pkl file, which includes the model structure, training parameters, and feature selection rules.

[0087] In some embodiments, the step of evaluating the accuracy of the quantitative inversion model using the coefficient of determination and the relative root mean square error (RMSE) to optimize the quantitative inversion model based on the corresponding evaluation results includes: calculating the coefficient of determination and the relative root mean square error of the quantitative inversion model using validation set data; if either the coefficient of determination or the relative root mean square error fails to meet the standard, returning to the feature variable screening step, adjusting the variable importance screening threshold or changing the machine learning algorithm, and reconstructing and training the quantitative inversion model until the accuracy requirements are met.

[0088] By the determination coefficient ( R 2 ) and relative root mean square error ( RMSEr Evaluate the accuracy of the model and iterate and optimize if it fails to meet the target.

[0089] The determination coefficient corresponding to the accuracy evaluation index: ; Requirements for organic matter, nitrogen, phosphorus, and potassium R 2 ≥0.8 (the closer to 1, the higher the accuracy). Relative root mean square error: ; Require RMSEr ≤15% (reflecting the relative error level).

[0090] The optimization process includes: If any indicator fails to meet the standard: ① Return to the above example and adjust the variable importance screening threshold (e.g., increase it from 30% to 40%) or add features (e.g., add second derivative features); ② Change the algorithm (e.g., change it from PLSR to Gradient Boosting Tree GBDT) and retrain the model; ③ Repeat the evaluation until all nutrient indicators meet the accuracy requirements, and record the model iteration versions during the optimization process.

[0091] In some embodiments, the step of inputting real-time acquired hyperspectral data into the quantitative inversion model, and the quantitative inversion model outputting the organic matter and nutrient content of nitrogen, phosphorus, and potassium in the surface matrix layer, includes: deploying hyperspectral sensors in a grid pattern in areas below 2 meters in depth corresponding to the surface matrix layer; the sensors integrating a global positioning system module to record the sampling location; the real-time acquired spectral data first undergoes outlier removal, spectral averaging, and calibration operations consistent with the preprocessing steps of a standard spectral library, and is then input into the optimized quantitative inversion model, outputting the organic matter, nitrogen, phosphorus, and potassium content values ​​and timestamp information of the matrix layer at the corresponding location, thereby realizing dynamic data storage and updating.

[0092] By deploying GPS-enabled hyperspectral sensors in the deep matrix, data is collected and preprocessed in real time, and then input into the model to output dynamic nutrient data.

[0093] Sensor deployment includes: Grid layout: Sensors are deployed in a 1000m × 1000m grid within the monitoring area (e.g., farmland). A hole (8cm in diameter) is drilled at the center of each grid to the target depth (2-5 meters, depending on requirements). The sensor probe is fixed to the inner wall of the borehole (equipped with an anti-settlement bracket), with the probe facing the matrix layer. One depth measurement point is deployed at 1-meter intervals. Sensor configuration: A miniature spectrometer (e.g., a Headwall Photonics miniature spectrometer) is selected, integrating a GPS module (positioning accuracy ±2m), a lithium battery (7-day battery life), and a wireless transmission module (4G / LoRa), supporting timed wake-up data acquisition (e.g., automatic data acquisition at 0:00 every hour).

[0094] Real-time data processing includes: Preprocessing: Real-time spectral data is first subjected to outlier removal (same as in Example 2, only spectra consistent from 3 consecutive scans are retained), spectral averaging (average of 3 scans), and calibration (calibrated daily using the built-in whiteboard). Matrix type matching: Based on the geographic coordinates of the sampling points and associated with previous geological survey data, the matrix type is automatically matched (e.g., wetlands are mostly muddy, and cultivated land is mostly soil), and the corresponding sub-model is called.

[0095] Results output and storage include: Model output includes: organic matter, nitrogen, phosphorus, and potassium content (retaining 2 decimal places), sampling timestamp (accurate to the second), GPS coordinates, and depth information; data is uploaded to a cloud database (such as InfluxDB) via the MQTT protocol, supports API calls, and the data for the most recent 7 days is stored locally as a backup for offline analysis.

[0096] In some embodiments, by constructing a surface matrix spectral knowledge graph and integrating multi-source heterogeneous data, intelligent retrieval and nutrient association reasoning are achieved, replacing the single storage mode of traditional relational databases.

[0097] The knowledge graph architecture design includes: entity types: matrix type (rock / gravel, etc.), geographic entity (plain / wetland), nutrient index (organic matter / nitrogen, etc.), spectral features (band range / derivative extreme value); relation types: belonging to (sample-matrix type), containing (region-land use type), sensitive to (nutrient-feature band), measured to (sample-laboratory data); attribute design: spectral data is stored as node attributes (serialized vectors), and geographic coordinates are stored in WKT format (such as POINT(116.3 39.9)).

[0098] The graph construction process includes: data extraction: using the BERT-NER model to extract matrix type entities from sampling reports and literature; relation inference: training a relation prediction model through a graph neural network (GCN), for example, inferring "high potassium content" based on "a sample's spectrum has a characteristic peak at 2200nm±10nm" (confidence > 0.85); the storage engine uses the Neo4j graph database, which supports complex queries (such as "querying the spectral characteristics of all mountain gravelly matrices with potassium content > 15g / kg" with a response time < 200ms).

[0099] Rapid matrix type matching involves inputting an unknown spectrum and searching the graph database for the most similar spectral nodes (cosine similarity > 0.95) to automatically associate them with the matrix type and nutrient range. Data quality assessment detects contradictory data through graph path reasoning (e.g., "the geographical location of the muddy matrix sample is marked as woodland" triggers geographical location logic verification, since muddy matrix is ​​mostly distributed in wetlands).

[0100] Please see Figure 3 As shown, Figure 3This is a schematic diagram of the structure of a hyperspectral feature-based quantitative inversion system 200 for land surface matrix nutrient content, provided in an embodiment of this application. This hyperspectral feature-based quantitative inversion system 200 is used to execute the steps of the hyperspectral feature-based quantitative inversion method for land surface matrix nutrient content as shown in the above embodiments. The hyperspectral feature-based quantitative inversion system 200 can be a single server or a server cluster, or it can be a terminal, such as a handheld terminal, laptop computer, wearable device, or robot.

[0101] like Figure 3 As shown, the surface matrix nutrient content quantitative inversion system 200 based on hyperspectral characteristics includes: The spectral acquisition unit 201 is used to acquire spectra of surface matrix samples from multiple regions and of various types using a portable hyperspectral analyzer, and to perform outlier removal, spectral averaging, and calibration preprocessing on the acquired spectral curves; based on the processed spectral data, a standard spectral library of surface matrix containing multiple matrix types is constructed; the matrix types include at least any one of rock, gravel, sand, soil, and clay. The feature extraction unit 202 is used to extract the spectral diagnostic features of organic matter and nitrogen, phosphorus and potassium nutrients in the surface matrix from the spectral data in the standard spectral library by using analysis methods such as envelope removal, spectral differentiation and spectral coding. The model building unit 203 is used to process the extracted spectral diagnostic features according to the preset machine learning algorithm, obtain spectral feature variables related to the nutrient content of the surface matrix, construct a quantitative inversion model including spectral features and nutrient content based on the spectral feature variables and the corresponding nutrient content data, and evaluate the accuracy of the quantitative inversion model using the coefficient of determination and the relative root mean square error, so as to optimize the quantitative inversion model according to the corresponding evaluation results. The real-time monitoring unit 204 is used to deploy a hyperspectral sensor in the surface matrix layer, and to collect hyperspectral data of the surface matrix layer in real time through the hyperspectral sensor. The real-time collected hyperspectral data is input into the quantitative inversion model, and the quantitative inversion model outputs the organic matter and nutrient content of nitrogen, phosphorus and potassium in the surface matrix layer, thereby realizing dynamic real-time monitoring of the nutrient content of the surface matrix layer.

[0102] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the above-described quantitative inversion system for surface matrix nutrient content based on hyperspectral features and each module can be referred to the corresponding content in the various embodiments of the above-described quantitative inversion method for surface matrix nutrient content based on hyperspectral features, and will not be repeated here.

[0103] The aforementioned method for quantitative inversion of surface matrix nutrient content based on hyperspectral characteristics can be implemented as a computer program, which can be used in applications such as... Figure 3 It runs on the device shown.

[0104] Please see Figure 4 , Figure 4 This is a schematic block diagram of the structure of a computer device provided in an embodiment of this application. The computer device includes a processor, a memory, and a network interface connected via a device bus, wherein the memory may include a storage medium and internal memory.

[0105] The storage medium can store operating devices and computer programs. The computer program includes program instructions that, when executed, cause the processor to perform any method for quantitative inversion of surface matrix nutrient content based on hyperspectral features.

[0106] The processor provides computing and control capabilities, supporting the operation of the entire computer device.

[0107] The internal memory provides an environment for the execution of computer programs in non-volatile storage media. When the computer program is executed by the processor, it enables the processor to execute any method for quantitative inversion of surface matrix nutrient content based on hyperspectral features.

[0108] This network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the terminal to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0109] It should be understood that the processor 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. Among these, a general-purpose processor can be a microprocessor or any conventional processor.

[0110] In one embodiment, the processor is configured to run a computer program stored in memory to perform the following steps: A portable hyperspectral analyzer was used to collect spectra of surface matrix samples from multiple regions and of various types. The collected spectral curves were preprocessed by outlier removal, spectral averaging, and calibration. Based on the processed spectral data, a standard spectral library of surface matrix containing multiple matrix types was constructed. The matrix types include at least any one of rock, gravel, sand, soil, and clay. For spectral data in the standard spectral library, the analytical methods of envelope removal, spectral differentiation and spectral coding are used to extract the spectral diagnostic features of organic matter and nitrogen, phosphorus and potassium nutrients in the surface matrix. Based on the preset machine learning algorithm, the extracted spectral diagnostic features are processed to obtain spectral feature variables related to the nutrient content of the surface matrix. Based on the spectral feature variables and the corresponding nutrient content data, a quantitative inversion model including spectral features and nutrient content is constructed. The accuracy of the quantitative inversion model is evaluated by the coefficient of determination and the relative root mean square error, and the quantitative inversion model is optimized according to the corresponding evaluation results. A hyperspectral sensor is deployed in the surface matrix layer to collect hyperspectral data of the surface matrix layer in real time. The real-time collected hyperspectral data is input into the quantitative inversion model, which outputs the content of organic matter and nutrients such as nitrogen, phosphorus and potassium in the surface matrix layer, thereby realizing dynamic real-time monitoring of the nutrient content of the surface matrix layer.

[0111] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the steps of the method for quantitative inversion of surface matrix nutrient content based on hyperspectral features as provided in any embodiment of this application.

[0112] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiments, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, SmartMedia Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device.

[0113] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for quantitative inversion of surface matrix nutrient content based on hyperspectral characteristics, characterized in that, include: A portable hyperspectral analyzer was used to collect spectra of surface matrix samples from multiple regions and of various types. The collected spectral curves were preprocessed by outlier removal, spectral averaging, and calibration. Based on the processed spectral data, a standard spectral library of surface matrices containing multiple matrix types was constructed. The matrix types include at least any one of rock, gravel, sand, soil, and clay. For spectral data in the standard spectral library, we use analysis methods such as envelope removal, spectral differentiation, and spectral coding to extract spectral diagnostic features of organic matter and nitrogen, phosphorus, and potassium nutrients in the surface matrix. Based on the preset machine learning algorithm, the extracted spectral diagnostic features are processed to obtain spectral feature variables related to the nutrient content of the surface matrix. Based on the spectral feature variables and the corresponding nutrient content data, a quantitative inversion model including spectral features and nutrient content is constructed. The accuracy of the quantitative inversion model is evaluated by the coefficient of determination and the relative root mean square error, and the quantitative inversion model is optimized according to the corresponding evaluation results. A hyperspectral sensor is deployed in the surface matrix layer to collect hyperspectral data of the surface matrix layer in real time. The real-time collected hyperspectral data is input into the quantitative inversion model, which outputs the content of organic matter and nutrients such as nitrogen, phosphorus and potassium in the surface matrix layer, thereby realizing dynamic real-time monitoring of the nutrient content of the surface matrix layer.

2. The method according to claim 1, characterized in that, The method of using a portable hyperspectral analyzer to acquire spectroscopic data from multiple regions and various types of surface matrix samples includes: For different landform types and land use types, surface matrix samples are collected according to a preset sampling density; the surface matrix samples include matrix layer samples with a depth of less than 2 meters; Environmental parameters are controlled during spectral acquisition, and each sample is scanned repeatedly to obtain raw spectral data; The landform type region includes at least one of plains and basins, mountains and hills, and special landform regions; the multiple land use types include at least cultivated land, orchards, forest land, grassland, and wetlands; and the special landform regions include permafrost regions, karst regions, and coastal zones.

3. The method according to claim 1, characterized in that, The preprocessing steps for collecting spectral curves, including outlier removal, spectral averaging, and calibration, include: A pre-defined statistical method is used to identify and remove samples with abnormally fluctuating reflectance in the spectral curves; The effective spectral curves of the same type of matrix are arithmetically averaged to generate the average spectral curve of the corresponding type of matrix. Radiometric calibration was performed using a standard reference plate to convert the raw spectral data into reflectance spectral data.

4. The method according to claim 1, characterized in that, The process involves constructing a standard spectral library of land matrix containing multiple matrix types based on the processed spectral data, including: The average spectral curves are classified and stored according to the matrix type of rock, gravel, sand, soil and mud. Each matrix type includes sample spectral data with multiple different nutrient content gradients. Each spectral data point is associated with a corresponding matrix type label, sampling area geographic coordinates, depth information, and laboratory-measured data on organic matter, nitrogen, phosphorus, and potassium nutrient content, forming a structured spectral database.

5. The method according to claim 1, characterized in that, The aforementioned analytical methods, including envelope removal, spectral differentiation, and spectral coding, are used to extract spectral diagnostic features of organic matter and nitrogen, phosphorus, and potassium nutrients in the surface matrix from spectral data in the standard spectral library. These features include: The reflectance spectral data are de-envelope processed to eliminate the influence of baseline drift in the spectral curve. By performing first or second derivatives on the spectrum after removing the envelope, the spectral differences in the nutrient-sensitive bands can be enhanced. A binary encoding method is used to encode the reflectance variation pattern of the characteristic bands to generate a spectral diagnostic feature vector; Among them, organic matter corresponds to the 400-600nm band, nitrogen corresponds to the absorption valleys of 1500nm±10nm and 2100nm±10nm, and potassium corresponds to the characteristic peak range of 2200nm±10nm.

6. The method according to claim 1, characterized in that, The step of processing the extracted spectral diagnostic features according to a preset machine learning algorithm to obtain spectral feature variables related to the nutrient content of the surface matrix includes: The random forest algorithm is used to calculate the variable importance score of each spectral diagnostic feature, and the spectral feature variable is determined based on the variable importance score. Alternatively, the partial least squares regression algorithm is used to perform correlation analysis between the spectral diagnostic features and nutrient content, and the spectral feature variable is determined based on the corresponding absolute loading value. Obtain the input dataset containing multiple spectral feature variables.

7. The method according to claim 1, characterized in that, The quantitative inversion model, which constructs a spectral feature-nutrient content model based on spectral feature variables and corresponding nutrient content data, includes: The dataset is divided into a training set and a validation set according to a preset ratio. The spectral feature variables of the training set are used as input and the measured nutrient content is used as output to train the random forest model and the partial least squares regression model, respectively. The parameters of the random forest model and the partial least squares regression model are set, and the hyperparameters of the model are optimized through cross-validation to complete the construction of the quantitative inversion model. The random forest model parameters include at least the number of decision trees and the maximum depth, and the partial least squares regression model parameters include at least the number of principal components.

8. The method according to claim 1, characterized in that, The process of evaluating the accuracy of the quantitative inversion model using the coefficient of determination and the relative root mean square error, and then optimizing the quantitative inversion model based on the evaluation results, includes: The determination coefficients and relative root mean square error of the quantitative inversion model were calculated using validation set data. If either the coefficient of determination or the relative root mean square error fails to meet the standard, return to the feature variable screening step, adjust the variable importance screening threshold or change the machine learning algorithm, and reconstruct and train the quantitative inversion model until the accuracy requirements are met.

9. The method according to claim 1, characterized in that, The process involves inputting real-time acquired hyperspectral data into the quantitative inversion model, which outputs the organic matter and nutrient content (nitrogen, phosphorus, and potassium) in the surface matrix layer, including: Hyperspectral sensors were deployed in a grid pattern in the area below 2 meters in the surface matrix layer. The sensors integrated a global positioning system module to record the sampling location. The real-time acquired spectral data first undergoes outlier removal, spectral averaging, and calibration operations consistent with the standard spectral library preprocessing steps. It is then input into the optimized quantitative inversion model and outputs the organic matter, nitrogen, phosphorus, and potassium content values ​​and timestamp information of the matrix layer at the corresponding location, thus realizing dynamic data storage and updating.

10. A computer device, characterized in that, The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is configured to execute the computer program and, in executing the computer program, implement the method as described in any one of claims 1 to 9.