Hybrid substance spectral component identification method and system under edge computing architecture
Patent Information
- Application Number
- CN202610961420.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-30
- Publication Date
- 2026-09-08
AI Technical Summary
然而,随着光谱库规模不断扩大和样品复杂度增加,直接在全部标准光谱上进行计算会带来较高的计算开销
在本申请实施例中,通过在云端服务器中采用稀疏回归方法从大规模标准光谱库中筛选出候选成分光谱集合,并下发至边缘计算节点构建边缘光谱子库,减少了边缘计算节点在实时识别过程中需要处理的光谱数量,从而降低了边缘计算节点的计算开销和存储压力,使其能够适应资源受限的现场检测环境。
Smart Images

Figure CN122709355A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent recognition technology, and in particular to a method and system for identifying the spectral composition of mixed substances under an edge computing architecture. Background Technology
[0002] Raman spectroscopy, based on the inelastic scattering effect of molecules, can obtain information about the unique molecular vibrations and structures of substances, and is widely used in chemical analysis, biomedical diagnostics, and food safety testing. In practical applications, the samples to be tested are usually multi-component mixtures, whose spectra are linear superpositions of the spectra of the individual pure substances. Therefore, accurately estimating the components and their contents from the mixed spectra is an important research topic in the field of spectroscopic analysis.
[0003] Methods for identifying components in mixed spectral datasets mainly include least squares regression, partial least squares regression, nonnegative matrix factorization, and sparse regression. These methods typically assume that the mixed spectrum can be represented as a linear combination of several standard spectra, and obtain the weight coefficients of each component by solving an optimization problem. However, as the size of the spectral library continues to expand and the complexity of the samples increases, directly performing calculations on all standard spectra leads to high computational costs. Furthermore, negative weights or redundant components may be generated during the solution process, affecting the physical rationality and stability of the identification results.
[0004] Furthermore, with the rapid development of portable Raman spectroscopy equipment and online detection technology, spectral analysis is gradually evolving towards real-time and on-site processing. In such application scenarios, systems are typically deployed on resource-constrained edge devices. How to improve the accuracy of mixture component identification and the physical plausibility of the results while ensuring computational efficiency is a pressing technical problem that needs to be solved. Summary of the Invention
[0005] The purpose of this application is to provide a method and system for identifying the spectral components of mixed substances under an edge computing architecture, which can reduce the computational overhead of identifying mixed spectral components, improve the physical rationality and accuracy of component identification, and adapt to the resource-constrained edge computing environment, thereby realizing real-time, on-site spectral analysis of mixed samples.
[0006] To solve the above-mentioned technical problems, this application is implemented as follows: A first aspect of this application discloses a method for identifying the spectral composition of hybrid materials under an edge computing architecture, the method comprising: In the cloud server, a candidate component spectral set is obtained by screening based on a standard spectral library and historical sample data using a sparse regression method. The standard spectral library consists of the spectra of each pure substance, the historical sample data is the mixed sample spectral data uploaded by edge computing nodes in the past, and the candidate component spectral set is a subset of the standard spectra that are ranked first in importance in the historical sample data. The candidate component spectral set is distributed to the edge computing node and stored locally to construct an edge spectral sub-library; After receiving the spectral data of the mixed sample to be tested, the edge computing node performs a linear combination solution on the edge spectral sub-library based on the non-negative least squares algorithm to obtain the non-negative weight coefficients of each component; the non-negative weight coefficients are used to characterize the relative contribution of each component in the mixed sample to be tested. Based on the non-negative weighting coefficients, the composition and proportion of each component in the mixed sample to be tested are determined.
[0007] Optionally, based on a standard spectral library and historical sample data, a sparse regression method is used to screen and obtain a set of candidate component spectra, including: Each mixed sample spectrum in the historical sample data is represented as a linear combination of standard spectra in the standard spectral library, and a non-negative constraint and an L1 norm sparse regularization term are introduced to construct a non-negative Lasso sparse regression model. The nonnegative Lasso sparse regression model is solved to obtain the sparse weight vector corresponding to each standard spectrum; the sparse weight vector is used to characterize the frequency or importance of each standard spectrum in the historical sample data; Based on the weight values of each standard spectrum in the sparse weight vector, the top K standard spectra with the highest weight values are selected as the candidate component spectrum set, where K is less than the total number of spectra in the standard spectrum library.
[0008] Optionally, the marginal spectral sub-library is solved by linear combination based on the non-negative least squares algorithm to obtain the non-negative weight coefficients of each component, including: The edge spectral sub-library is solved by linear combination using a non-negative least squares algorithm to obtain an initial weight vector, and the corresponding spectral reconstruction error is calculated. If the spectral reconstruction error is less than a preset error threshold, then the initial weight vector is used as the non-negative weight coefficient of each component.
[0009] Optionally, the method further includes: If the spectral reconstruction error is not less than a preset error threshold, the spectral data of the mixed sample to be tested will be uploaded to the cloud server. In the cloud server, based on the standard spectral library and the spectral data of the mixed sample to be tested, a new set of candidate component spectra is obtained by re-screening, and the new set of candidate component spectra is sent to the edge computing node to replace the original edge spectral sub-library.
[0010] Optionally, a non-negative least squares algorithm is used to solve the marginal spectral sub-library using linear combination to obtain an initial weight vector, including: Using the spectral data of the mixed sample to be tested as the observation vector and the standard spectra in the marginal spectral sub-library as the basis vectors, a non-negative least squares optimization objective function is constructed. The non-negative least squares optimization objective function minimizes the sum of squared residuals between the linear combination of the observation vector and the basis vectors, and constrains that each element in the weight vector to be solved is greater than or equal to zero. The non-negative least squares objective function is solved using a numerical optimization algorithm to obtain an initial weight vector that satisfies the non-negative constraint.
[0011] Optionally, the composition and proportion of each component in the mixed sample to be tested are determined based on the non-negative weighting coefficients, including: Components whose values in the non-negative weighting coefficients are greater than a preset threshold are identified as components in the mixed sample to be tested. The content ratio of each component in the mixed sample to be tested is calculated based on the ratio of the non-negative weight coefficient of each component to the sum of the non-negative weight coefficients of all components.
[0012] Optionally, it also includes an edge-cloud collaborative update step: The cloud server periodically receives historical mixed sample spectral data uploaded by the edge computing nodes; Based on the historical mixed sample spectral data, the standard spectral library was re-screened using the sparse regression method to obtain an updated set of candidate component spectra. The updated candidate component spectrum set is redeployed to the edge computing node to replace the original edge spectrum sub-library.
[0013] Optionally, based on the historical mixed sample spectral data, the standard spectral library is re-screened using a sparse regression method to obtain an updated set of candidate component spectra, including: For each historical mixed sample spectral data received within the current time period, a non-negative Lasso sparse regression model is used to solve the problem and obtain the sparse weight vector corresponding to each standard spectrum. The weighted average of the spectral data of all historical mixed samples within the current time period for each standard spectrum is calculated and used as the current period score for that standard spectrum. Obtain the historical scores of each standard spectrum in the previous time period, and then weight and fuse the current period score with the historical scores according to a preset weight to obtain the updated importance score of each standard spectrum. Based on the updated importance scores, the top K standard spectra are selected from the standard spectral library to form the updated candidate component spectrum set.
[0014] Optionally, the current periodic score and the historical score are weighted and fused according to a preset weight to obtain an updated importance score for each standard spectrum, including: Obtain a preset momentum update rate, wherein the momentum update rate is a value between 0 and 1; The first weighted value is obtained by multiplying the historical score of the previous time period by 1 and the difference between it and the momentum update rate. Multiply the current period score by the momentum update rate to obtain the second weighted value; The first weighted value is added to the second weighted value to obtain the updated importance score of each standard spectrum.
[0015] A second aspect of this application discloses a hybrid material spectral composition identification system under an edge computing architecture, the system comprising: The cloud-based spectral management module is used to screen candidate component spectral sets in a cloud server based on a standard spectral library and historical sample data using a sparse regression method. The standard spectral library consists of the spectra of various pure substances, the historical sample data is the mixed sample spectral data uploaded by edge computing nodes in the past, and the candidate component spectral set is a subset of the standard spectra that are ranked first in importance in the historical sample data. The edge spectral sub-library construction module is used to receive the candidate component spectrum set sent by the cloud server and build the edge spectral sub-library in the edge computing node; The edge fast identification module is used to perform linear combination solution on the edge spectral sub-library based on the non-negative least squares algorithm after the edge computing node receives the spectral data of the mixed sample to be tested, and obtain the non-negative weight coefficients of each component; the non-negative weight coefficients are used to characterize the relative contribution of each component in the mixed sample to be tested; and the component composition and proportion of each component in the mixed sample to be tested are determined according to the non-negative weight coefficients.
[0016] A third aspect of this application discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the method for identifying the spectral composition of mixed substances under the edge computing architecture described in the first aspect of this application.
[0017] A fourth aspect of this application discloses a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the method for identifying the spectral composition of mixed substances under the edge computing architecture described in the first aspect of this application.
[0018] A fifth aspect of this application discloses a computer program product, including a computer program that, when executed by a processor, implements the steps of the method for identifying the spectral composition of mixed substances under the edge computing architecture described in the first aspect of this application.
[0019] The embodiments of this application have the following advantages: In this embodiment of the application, a set of candidate component spectra is selected from a large-scale standard spectral library by using a sparse regression method in the cloud server and then distributed to the edge computing nodes to build an edge spectral sub-library. This reduces the number of spectra that the edge computing nodes need to process during real-time identification, thereby reducing the computational overhead and storage pressure on the edge computing nodes and enabling them to adapt to resource-constrained on-site detection environments.
[0020] Meanwhile, after receiving the spectral data of the mixed sample to be tested, the edge computing node directly performs a linear combination solution on the small edge spectral sub-library based on the non-negative least squares algorithm. This eliminates the need for a global search or additional matching steps on the standard spectral library, further simplifying the identification process, improving the response speed of spectral identification, and meeting real-time requirements. When solving for component weights, the non-negative least squares algorithm applies a non-negative constraint to the weight vector, ensuring that no negative weights appear in the solution. This gives the relative contribution of each component a clear physical meaning, avoiding negative values or redundant components, and improving the physical rationality and accuracy of the identification results.
[0021] Through the aforementioned edge-cloud collaborative architecture, the task of screening and updating a large-scale standard spectral library is deployed in the cloud, while the lightweight non-negative least squares solution task is deployed at the edge. This fully leverages the respective advantages of abundant computing resources in the cloud and rapid response at the edge, achieving a reasonable allocation of computing load. Attached Figure Description
[0022] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a flowchart illustrating the steps of a method for identifying the spectral composition of mixed materials under an edge computing architecture, as provided in an embodiment of this application. Figure 2 This is an overall architecture diagram of a method for identifying the spectral composition of mixed materials under an edge computing architecture, provided in an embodiment of this application. Figure 3 This is a schematic diagram of the structure of a hybrid material spectral composition identification system under an edge computing architecture provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0024] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the technical solutions in 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 in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0025] To address the issues of high computational cost, difficulty in deployment on resource-constrained edge devices, and lack of physical plausibility in the results of existing methods for identifying mixed spectral components under large-scale spectral libraries, this application proposes a method for identifying the spectral components of mixed substances using an edge computing architecture. The technical concept involves: analyzing historical sample data on a cloud server using non-negative Lasso sparse regression to screen candidate component spectra with high frequency or strong correlation, constructing a small-scale edge spectral sub-library, and distributing it to edge computing nodes. At the edge computing nodes, a non-negative least squares algorithm is used to linearly combine and solve the edge spectral sub-library to determine the non-negative weight coefficients of each component, thereby determining the component composition and content ratio of the mixed sample. Furthermore, the cloud server can dynamically update the edge sub-library based on historical mixed sample spectral data periodically uploaded by the edge computing nodes, continuously adapting to changes in the detection scenario. This approach, through sparse screening in the cloud and non-negative constraint demixing at the edge, significantly reduces the computational load at the edge while maintaining identification accuracy, meeting the needs of real-time on-site detection.
[0026] Reference Figure 1 As shown, Figure 1 This is a flowchart illustrating the steps of a method for identifying the spectral composition of mixed materials under an edge computing architecture, as provided in an embodiment of this application. Figure 1 As shown, the method may include steps S110 to S140: Step S110: On the cloud server, a candidate component spectral set is obtained by screening based on the standard spectral library and historical sample data using a sparse regression method; the standard spectral library consists of the spectra of each pure substance, the historical sample data is the mixed sample spectral data uploaded by the edge computing nodes in the past, and the candidate component spectral set is a subset of the standard spectra that are ranked first in importance in the historical sample data.
[0027] In this step, the standard spectral library is a database pre-established on a cloud server, containing N standard spectra, each corresponding to the spectral data of a pure substance. It is understood that the spectrum referred to in this embodiment can be Raman spectroscopy, infrared spectroscopy, near-infrared spectroscopy, ultraviolet-visible absorption spectroscopy, fluorescence spectroscopy, or terahertz spectroscopy, etc., as long as the spectra of the mixed sample satisfy the linear superposition assumption, the technical solution of this application can be applied.
[0028] Each standard spectrum contains L wavenumber sampling points, so the standard spectral library can be represented as:
[0029] in, Indicates the first The standard spectrum of a pure substance For spectral dimensions, This represents the standard number of spectra.
[0030] Historical sample data consists of mixed sample spectral data accumulated by edge computing nodes (edge devices) during actual detection and uploaded to the cloud server. Sparse regression is a statistical learning method that automatically identifies a small number of key components that significantly contribute to the mixed spectrum. Specifically, the cloud server uses sparse regression to analyze the historical sample data, assessing the frequency or contribution of each standard spectrum within the data, and selecting the most important standard spectra to form a candidate component spectrum set. This candidate component spectrum set is much smaller than the complete standard spectrum library, laying the foundation for rapid identification at the edge.
[0031] Step S120: The candidate component spectrum set is sent to the edge computing node and stored locally to build an edge spectrum sub-library.
[0032] In this step, the cloud server sends the selected candidate component spectral set to the edge computing node via a wired or wireless network. The edge computing node stores the received spectral data in its local storage, forming an edge spectral sub-library. This edge spectral sub-library is a simplified subset of the complete standard spectral library, stored on the edge device side, for rapid matching during subsequent real-time detection.
[0033] Step S130: After the edge computing node receives the spectral data of the mixed sample to be tested, it performs a linear combination solution on the edge spectral sub-library based on the non-negative least squares algorithm to obtain the non-negative weight coefficients of each component; the non-negative weight coefficients are used to characterize the relative contribution of each component in the mixed sample to be tested.
[0034] In this step, after the edge computing node collects or receives the spectral data of the mixed sample to be tested, it performs a non-negative least squares solution using the locally stored edge spectral sub-library. The non-negative least squares algorithm is a class of optimization methods for solving linear regression problems and forcing all regression coefficients to be non-negative.
[0035] Specifically, using the spectral data of the mixed sample to be tested as the observation vector and the standard spectra in the edge spectral sub-library as the basis vectors, an optimization problem is constructed: minimizing the sum of squared residuals between the linear combinations of the observation vectors and the basis vectors, while constraining that all weight coefficients to be solved are greater than or equal to zero. This problem is solved using numerical optimization algorithms (such as the active set method or the projected gradient method) to obtain a set of optimal weight vectors, i.e., the non-negative weight coefficients of each component. Due to the small size of the edge spectral sub-library, the solution process is computationally inexpensive and can be completed quickly at the edge nodes. The magnitude of these weight coefficients directly reflects the relative contribution of the corresponding component in the mixed sample, and the non-negative constraint ensures the physical reasonableness of the results.
[0036] Step S140: Determine the composition and proportion of each component in the mixed sample to be tested based on the non-negative weighting coefficient.
[0037] In this step, based on the non-negative weighting coefficients obtained in step S130, components with non-negative weighting coefficients greater than a preset threshold are typically considered as actually existing components. For these components, the proportion of their weighting coefficients in the sum of all weighting coefficients is calculated to obtain the relative content percentage of each component. Finally, a list of the material components of the mixed sample and their quantitative proportions are output, completing the spectral component identification.
[0038] The technical solution adopted in this embodiment reduces the number of spectra that edge computing nodes need to process during real-time identification by pre-screening candidate component spectra in the cloud using sparse regression and constructing an edge spectral sub-library. This lowers computational overhead and storage requirements, making it adaptable to resource-constrained on-site detection environments. The edge only needs to perform a small-scale non-negative least squares solution within the sub-library, improving the identification response speed and meeting real-time requirements. Simultaneously, the non-negative least squares algorithm ensures the non-negativity of the weight coefficients, avoiding negative weights or redundant components, giving the identification results clear physical meaning and improving the accuracy and reliability of component estimation. Through an edge-cloud collaborative architecture, a reasonable allocation of computational load is achieved, combining the powerful processing capabilities of the cloud with the real-time response advantages of the edge.
[0039] In one specific implementation, step S110, "based on the standard spectral library and historical sample data, a sparse regression method is used to screen and obtain a set of candidate component spectra," may include steps S110-1 to S110-3: Step S110-1: Represent each mixed sample spectrum in the historical sample data as a linear combination of standard spectra in the standard spectral library, and introduce non-negativity constraints and L1 norm sparse regularization terms to construct a non-negative Lasso sparse regression model.
[0040] In this step, the spectrum of each mixed sample in the historical sample data can be regarded as a weighted superposition of the various standard spectra in the standard spectral library, that is:
[0041] Where y represents the spectrum of the mixed sample. For standard spectral library, This indicates that the weights of the substances are sparse. This represents the noise term. Because standard spectral libraries contain a large number of substances, while actual mixed samples typically contain only a small number of components, the vector... It usually exhibits sparsity.
[0042] To screen out the few potentially existing components from a large number of standard spectra, a regression model with nonnegativity constraints and L1 norm sparse regularization terms (i.e., a nonnegative Lasso sparse regression model) is constructed. The nonnegativity constraint ensures that all solved weight coefficients are nonnegative, conforming to the physical law that the actual content of substances cannot be negative; the L1 norm sparse regularization term causes most weight coefficients to become zero, retaining only a few non-zero weights, thus achieving sparse selection of components.
[0043] For example, a nonnegative Lasso sparse regression model can be expressed as:
[0044] in, The spectral reconstruction error represents the sum of squared residuals between the linear combination of the mixed sample spectra and the standard spectrum; This is the L1 norm sparse regularization term, which is the sum of the absolute values of all weight coefficients; The weighting coefficient for the i-th standard spectrum; The regularization parameter controls the sparsity of the solutions. The larger the value, the sparser the solution.
[0045] Step S110-2: Solve the non-negative Lasso sparse regression model to obtain the sparse weight vector corresponding to each standard spectrum; the sparse weight vector is used to characterize the frequency or importance of each standard spectrum in the historical sample data.
[0046] In this step, the nonnegative Lasso sparse regression model is solved using numerical optimization methods (such as coordinate descent) to obtain the sparse weight vectors corresponding to each standard spectrum. ,Right now:
[0047] in, These represent the weight values for the 1st, 2nd, ..., Nth standard spectra in the standard spectral library. This sparse weight vector is sparsity-based, meaning most elements are zero, and only a few are positive. The magnitude of the weight value reflects the importance of the corresponding standard spectrum in fitting all historical sample data; a larger weight indicates a higher frequency of occurrence of the substance in historical detection scenarios or a more significant contribution to the mixed spectrum.
[0048] Step S110-3: Based on the weight values of each standard spectrum in the sparse weight vector, select the top K standard spectra with the highest weight values as the candidate component spectrum set, where K is less than the total number of spectra in the standard spectrum library.
[0049] In this step, based on the sparse weight vector obtained in step S110-2, the standard spectra are sorted from largest to smallest according to their weight values. The top K standard spectra are selected to form a candidate component spectrum set. ,Right now:
[0050] in, These are the 1st, 2nd, ..., Kth standard spectra in the candidate component spectral set. This achieves effective compression of a large-scale standard spectral library. The candidate component spectral set contains the standard spectra of the most common or important substances in historical detection scenarios.
[0051] Understandably, the construction of the candidate component spectrum set is adaptively updated as the detected substance is detected. After screening a batch of historical detected substances of a certain edge computing node, the common substances and their candidate spectra of that node during this period can be obtained. These common candidate spectra are distributed to the edge computing node through the cloud server and stored locally.
[0052] Thus, this implementation method, by constructing and solving a nonnegative Lasso sparse regression model, can automatically select a representative set of candidate component spectra with clear physical meaning from a large-scale standard spectral library. The nonnegativity constraint ensures the rationality of the selection results, while the L1 sparse regularization term enables automatic selection of key components, avoiding the tedious process of manually setting thresholds or relying on prior knowledge. The resulting candidate set is small in size and highly targeted, providing a high-quality spectral sub-library foundation for efficient identification at the edge, while reducing data transmission overhead between the cloud and the edge.
[0053] In one specific implementation, step S130, "solving the edge spectral sub-library using a linear combination based on a non-negative least squares algorithm to obtain the non-negative weight coefficients of each component," may include steps S130-1 to S130-2: Step S130-1: Use the non-negative least squares algorithm to solve the edge spectral sub-library linearly to obtain the initial weight vector, and calculate the corresponding spectral reconstruction error.
[0054] In this step, after the edge computing node receives the spectral data of the mixed sample to be tested, it first performs a rapid matching or coarse screening with the edge spectral sub-library to determine the possible set of components. Specifically, it uses the locally stored edge spectral sub-library (a set of candidate component spectra pre-screened in the cloud) to perform a non-negative least squares solution to find a set of non-negative weighting coefficients that minimizes the sum of squared residuals between the linear combination of the standard spectra in the edge spectral sub-library and the spectral data of the mixed sample to be tested.
[0055] Furthermore, the reconstruction error between the linear combination and the spectrum to be measured was calculated. The magnitude of the reconstruction error reflects whether the current edge spectral sub-library can fit the sample to be measured well. The smaller the reconstruction error, the more accurately the candidate components corresponding to the edge spectral sub-library can represent the true components in the sample to be measured.
[0056] Further, step S130-1 may include steps S130-1-1 to S130-1-2: Step S130-1-1: Using the spectral data of the mixed sample to be tested as the observation vector and the standard spectra of each element in the edge spectral sub-library as the basis vector, construct a non-negative least squares optimization objective function; the non-negative least squares optimization objective function is to minimize the sum of squared residuals between the linear combination of the observation vector and the basis vector, and to constrain that each element in the weight vector to be solved is greater than or equal to zero.
[0057] In this step, solving for the weighting coefficients of each component in the mixed sample is transformed into a constrained optimization problem. The spectral data of the mixed sample to be tested is used as the observation vector, and each standard spectrum in the marginal spectral sub-library is used as the basis vector. The spectral data of the mixed sample to be tested is represented as a linear combination of these basis vectors. For example, the nonnegative least squares optimization objective function can be expressed as:
[0058] in, Let be the candidate component weight vector, and y be the spectral data of the mixture sample to be tested. For edge spectral sublibraries The weight value of the i-th standard spectrum in the spectrum.
[0059] S130-1-2: The non-negative least squares optimization objective function is solved using a numerical optimization algorithm to obtain an initial weight vector that satisfies the non-negative constraint.
[0060] In this step, numerical optimization methods (such as the active set algorithm and the projected gradient method) can be used to solve the problem. Numerical optimization algorithms can start from an initial solution and iteratively update to gradually approach the optimal solution, ensuring that the weight vector always satisfies the non-negativity constraint in each iteration. Since the edge spectral sub-library is relatively small, the solution process can be completed quickly on the edge computing nodes, meeting real-time requirements.
[0061] Step S130-2: If the spectral reconstruction error is less than a preset error threshold, then the initial weight vector is used as the non-negative weight coefficient of each component.
[0062] In this step, a preset error threshold is introduced as a judgment criterion. When the spectral reconstruction error calculated in step S130-1 is less than this threshold, it indicates that the edge spectral sub-library can reconstruct the spectrum of the sample with high accuracy, meaning that the components contained in the sub-library are sufficient to explain the main substances in the sample. At this time, the edge computing node does not need to request cloud intervention and directly uses the initial weight vector as the final non-negative weight coefficient for subsequent component identification and proportion calculation. This mechanism enables most common or simple mixed samples to be quickly identified at the edge, avoiding unnecessary cloud communication and calculation, and ensuring real-time response capability.
[0063] Thus, the above implementation achieves efficient autonomous identification at the edge through a two-stage strategy of first solving the edge problem and then judging the error. For samples that can be covered by the edge sub-library, the results are output directly with a fast response speed; for complex samples that exceed the characterization capabilities of the sub-library, a subsequent cloud-based fine screening process is triggered (see subsequent embodiments). This design leverages the low latency advantage of edge computing while ensuring overall identification accuracy.
[0064] In one specific implementation, the method further includes steps S130-3 to S130-4: Step S130-3: If the spectral reconstruction error is not less than a preset error threshold, then the spectral data of the mixed sample to be tested is uploaded to the cloud server.
[0065] Specifically, when the spectral reconstruction error calculated in step S130-1 is not less than a preset error threshold, it indicates that the candidate components in the current edge spectral sub-library cannot accurately fit the spectrum of the mixed sample to be tested. This means the sample may contain new substances outside the sub-library, or the estimated proportions of certain components in the sub-library may be too large. At this point, the edge computing node uploads the spectral data of the sample to the cloud server, requesting the cloud to utilize its more comprehensive standard spectral library for more refined analysis. This mechanism ensures that when encountering complex or unknown samples beyond the scope of existing knowledge, in-depth identification can be performed using the powerful computing capabilities and complete data resources of the cloud, avoiding erroneous results output by the edge due to knowledge limitations.
[0066] Step S130-4: In the cloud server, based on the standard spectral library and the spectral data of the mixed sample to be tested, a new set of candidate component spectra is obtained by re-screening, and the new set of candidate component spectra is sent to the edge computing node to replace the original edge spectral sub-library.
[0067] After receiving the spectrum to be tested, the cloud server uses the spectral data of the mixed sample as the analysis target and re-screens it using a standard spectral library. Specifically, the cloud server employs a sparse regression method (such as non-negative Lasso) similar to the initial screening to evaluate the contribution of each standard spectrum to the spectrum to be tested, and selects the standard spectra with the highest importance to form a new set of candidate component spectra for the sample to be tested. This set is usually more closely related to the current sample than the original marginal sublime library and may contain new substances or exclude irrelevant components.
[0068] The cloud server distributes this new set of candidate component spectra to the edge computing nodes. Upon receiving it, the edge nodes replace their locally stored edge spectral sub-libraries with this new sub-library. After replacement, the edge nodes can perform non-negative least squares calculations again based on this new sub-library to obtain more accurate non-negative weight coefficients. In this way, the coverage of the edge sub-library can be dynamically expanded when encountering unknown or complex samples, achieving knowledge self-evolution and directly obtaining high-precision results in the detection of similar samples without the need for repeated uploading.
[0069] Thus, this implementation constructs a closed-loop feedback mechanism between the edge and the cloud. When the edge cannot reliably identify a problem, it triggers precise screening in the cloud and distributes the optimized sub-library to the edge, enabling edge devices to gradually enrich their local knowledge. This design avoids frequent cloud communication while ensuring adaptability to unknown samples.
[0070] In one specific implementation, step S140, "determining the composition and proportion of each component in the mixed sample to be tested based on the non-negative weighting coefficients," may include steps S140-1 to S140-2: Step S140-1: Identify the components in the non-negative weighting coefficients that have values greater than a preset threshold as components in the mixed sample to be tested.
[0071] The non-negative weighting coefficients may be very close to or exactly zero. These minimum values are usually caused by calculation errors, noise interference, or model overfitting, and do not necessarily indicate the actual presence of the corresponding substance in the sample. Therefore, a preset threshold needs to be set as a judgment criterion. Only components with non-negative weighting coefficients greater than this threshold are considered to truly exist in the mixed sample; otherwise, they are considered non-existent spurious components. This filters out noise and redundant candidates, improving the accuracy of component identification.
[0072] Step S140-2: Calculate the content ratio of each component in the mixed sample to be tested based on the ratio of the non-negative weight coefficient of each component to the sum of the non-negative weight coefficients of all components.
[0073] After determining the actual components, the content of each component needs to be quantitatively calculated. Specifically, the non-negative weighting coefficient corresponding to each component is divided by the sum of the weighting coefficients of all components to obtain the normalized proportion of that component in the mixed sample. This proportion value is between 0 and 1, and is usually presented as a percentage, representing the relative content of each substance in the sample, i.e.:
[0074] in, Let be the content ratio of the i-th component in the mixed sample to be tested. The non-negative weight coefficients corresponding to the i-th component are: is the non-negative weight coefficient corresponding to the j-th component.
[0075] Thus, this implementation method removes spurious components caused by noise or calculation errors from non-negative weight coefficients through preset threshold filtering, improving the reliability of component identification. Simultaneously, calculating the relative content of each component based on normalized ratios gives the identification results qualitative significance.
[0076] In one specific implementation, an edge-cloud collaborative update step is also included: Step A1: The cloud server periodically receives historical mixed sample spectral data uploaded by the edge computing nodes.
[0077] In this step, edge computing nodes continuously collect a large amount of spectral data from mixed samples during the actual detection process. To continuously optimize the relevance and accuracy of the edge spectral sub-library, the cloud server actively receives this historical mixed sample spectral data uploaded by the edge nodes according to a preset time period (e.g., daily, weekly, or after processing a certain number of samples). This data reflects the types and distribution of substances actually present in the recent detection scenario. The upload period can be dynamically adjusted according to the frequency of changes in the detection scenario; the period can be shortened when the scenario changes rapidly and appropriately extended when the changes are slow to save transmission and computing resources.
[0078] Step A2: Based on the historical mixed sample spectral data, the standard spectral library is re-screened using the sparse regression method to obtain an updated set of candidate component spectra.
[0079] In this step, after receiving the historical mixed sample spectral data uploaded within the current cycle, the cloud server analyzes this data again using a sparse regression method. Similar to step S110, this method evaluates the frequency or importance of each standard spectrum in the current batch of historical mixed sample spectral data, and reselects the higher-ranked standard spectra from the standard spectral library to form an updated candidate component spectral set. This update process can promptly reflect changes in the detection scenario, such as the addition of certain common substances or a significant decrease in the frequency of certain existing substances.
[0080] Step A3: The updated candidate component spectrum set is redeployed to the edge computing node to replace the original edge spectrum sub-library.
[0081] In this step, the cloud server distributes the updated candidate component spectral set to the corresponding edge computing nodes via wired or wireless networks. Upon receiving the updated set, the edge computing nodes replace their locally stored old edge spectral sub-libraries with the new set. This replacement mechanism ensures that the edge computing nodes' spectral sub-libraries always match the most recent detection scenario, thereby guaranteeing the accuracy and efficiency of subsequent real-time identification.
[0082] The technical solution of this embodiment achieves dynamic adaptability of the edge spectral sub-library by periodically receiving historical detection data from edge nodes in the cloud and re-screening candidate component spectra. When the detection scenario changes (such as the appearance of new substances or changes in the frequency of existing substances), the edge sub-library can be updated in a timely manner, avoiding the decline in recognition performance caused by the outdated factor library.
[0083] In one specific implementation, step A2, "based on the historical mixed sample spectral data, re-screening the standard spectral library using a sparse regression method to obtain an updated candidate component spectral set," may include steps A2-1 to A2-4: Step A2-1: For each historical mixed sample spectral data received within the current time period, a non-negative Lasso sparse regression model is used to solve the problem and obtain the sparse weight vector corresponding to each standard spectrum.
[0084] In this step, within the current time period t, the edge computing node uploaded a batch of historical mixed sample spectral data. ,Right now:
[0085] in, For the j-th time period of the t-th time period ) Spectral data of historical mixed samples, This represents the amount of data in the t-th time period.
[0086] For historical mixed sample spectral data, the cloud server used a non-negative Lasso sparse regression model for solving each sample. The non-negative Lasso sparse regression model outputs a sparse weight vector when solving for each sample. This vector has a dimension equal to the total number of spectra in the standard spectral library, with most elements being zero and only a few non-zero elements. Each non-zero weight value reflects the contribution of the corresponding standard spectrum to the sample. By solving for each sample separately, a batch of sparse weight vectors can be obtained. ,Right now:
[0087] in, For the j-th time period of the t-th time period The batch sparse weight vector corresponding to the spectral data of ) historical mixed samples.
[0088] Step A2-2: Calculate the weighted average of the spectral data of all historical mixed samples for each standard spectrum within the current time period, and use it as the current period score for that standard spectrum.
[0089] For each standard spectrum in the standard spectral library, the weight values obtained from solving for it across all samples in the current period are summed, and then divided by the total number of samples in the current period. The weighted average value of the standard spectrum is obtained. This average value represents the average contribution or frequency of the standard spectrum in the current detection period; the higher the weighted average value, the more common the substance is in the current period or the greater its contribution to the mixed spectrum.
[0090] Step A2-3: Obtain the historical scores of each standard spectrum in the previous time period, and perform weighted fusion of the current period score and the historical score according to the preset weight to obtain the updated importance score of each standard spectrum.
[0091] In this step, to avoid drastic changes in the spectral set of candidate components due to occasional fluctuations in single-period data, the score of the current period is weighted and fused with the historical score of the previous period to achieve a smooth update.
[0092] Specifically, the current period score and the historical score are weighted and fused according to a preset weight to obtain the updated importance score of each standard spectrum, including: obtaining a preset momentum update rate, wherein the momentum update rate is a value between 0 and 1; multiplying the historical score of the previous time period by 1 and the difference between the momentum update rate to obtain a first weighted value; multiplying the current period score by the momentum update rate to obtain a second weighted value; and adding the first weighted value and the second weighted value to obtain the updated importance score of each standard spectrum.
[0093] The momentum update rate is used to control the weight of historical and current information. When the momentum update rate is small, historical scores dominate and updates are relatively smooth; when the momentum update rate is large, the current period score has a greater impact and the response to scene changes is more sensitive.
[0094] For example, the updated importance score of the standard spectrum can be expressed as:
[0095] in, For the i-th standard spectrum in Importance score after update within the cycle; For the i-th standard spectrum in -1 cycle of historical scores; The preset momentum update rate; The current period score for the i-th standard spectrum (i.e., the weighted average of the i-th standard spectrum in all samples of the current period); No. Spectrum in the Weights in historical mixed sample spectral data.
[0096] Step A2-4: Based on the updated importance scores, select the top K standard spectra from the standard spectral library to form the updated candidate component spectrum set.
[0097] In this step, based on the updated importance score of each standard spectrum, all standard spectra are sorted from highest to lowest score. The top K standard spectra are selected, and these spectra constitute the updated candidate component spectrum set.
[0098] For example, the updated candidate component spectral set can be represented as:
[0099] in, Let be the importance score vector for all standard spectra after the update in period t; This is the set of indexes for the top K standard spectra ranked by importance score after the update; This is the updated spectral set of candidate components. This updated spectral set inherits historical information and incorporates new changes from the current period, accurately reflecting the material distribution patterns in the current detection scenario.
[0100] The technical solution in this embodiment achieves smooth and adaptive updates to the candidate spectral sub-library by independently solving for sparse weights and average scores within a statistical period for each historical sample, and then performing exponential sliding weighted fusion with these historical scores. On one hand, the weighted fusion mechanism effectively suppresses the adverse effects of random fluctuations in single-period data, avoiding frequent oscillations in the candidate set. On the other hand, the momentum update rate provides an adjustable response speed, adapting to the varying speeds of changes in different scenarios. The resulting updated candidate component spectral set retains historically accumulated knowledge while incorporating the latest detection data, ensuring that the edge spectral sub-library remains highly matched to the current detection scenario, continuously guaranteeing recognition accuracy and computational efficiency.
[0101] like Figure 2 As shown, Figure 2 This is an overall architecture diagram of a method for identifying the spectral components of mixed substances under an edge computing architecture, as provided in an embodiment of this application. Specifically, on the cloud server side, a standard spectral library is pre-built and maintained, which stores standard spectral data of various pure substances. The cloud server also receives mixed sample spectral data (i.e., historical sample data) uploaded historically by edge computing nodes, and uses a non-negative Lasso sparse regression model to analyze this historical data, screening out a set of candidate component spectra that appear frequently or are of high importance in historical detection scenarios. The size of this candidate set is much smaller than the complete standard spectral library, and it is then distributed to the edge computing nodes.
[0102] On the edge computing node side, the candidate component spectral set sent from the cloud is received and stored locally to form an edge spectral sub-library. When real-time detection is required, the edge computing node collects or receives the spectral data of the mixed sample to be tested. First, a non-negative least squares algorithm is used to linearly combine and solve the edge spectral sub-library to obtain an initial weight vector, and the corresponding spectral reconstruction error is calculated. If the spectral reconstruction error is less than a preset error threshold, the initial weight vector is used as the non-negative weight coefficient of each component. If the spectral reconstruction error is not less than the preset error threshold, the spectral data of the mixed sample to be tested is uploaded to the cloud server. The cloud server, based on the standard spectral library and the spectral data of the mixed sample to be tested, re-selects and obtains a new candidate component spectral set, and sends the new candidate component spectral set to the edge computing node to replace the original edge spectral sub-library. Finally, the component composition and content ratio of each component in the mixed sample are determined according to the non-negative weight coefficients of each component, and the identification result is output.
[0103] In addition, edge computing nodes periodically upload the mixed sample spectral data accumulated in daily detection to the cloud server. The cloud server uses this new data to re-perform nonnegative Lasso sparse regression screening, updates the candidate component spectral set, and then distributes it back to the edge computing nodes to replace the original edge spectral sub-library, thereby achieving dynamic adaptive updating of the edge sub-library.
[0104] Through the aforementioned edge-cloud collaborative architecture, the cloud is responsible for screening and periodically updating the large-scale spectral library, while the edge is responsible for lightweight real-time matching and accurate demixing. This fully leverages the computing resources of the cloud while ensuring the real-time response capability of the edge, significantly reducing the computing load and storage pressure on edge devices and meeting the needs of rapid on-site detection.
[0105] This application also provides a hybrid material spectral composition identification system under an edge computing architecture, referring to... Figure 3 As shown, Figure 3 This is a schematic diagram of a hybrid material spectral composition identification system under an edge computing architecture provided in an embodiment of this application. The system includes: The cloud-based spectral management module 310 is used to screen candidate component spectral sets in a cloud server based on a standard spectral library and historical sample data using a sparse regression method. The standard spectral library consists of the spectra of each pure substance, the historical sample data is the mixed sample spectral data uploaded by edge computing nodes in the past, and the candidate component spectral set is a subset of the standard spectra that are ranked first in importance in the historical sample data. The edge spectral sub-library construction module 320 is used to receive the candidate component spectrum set sent by the cloud server and build the edge spectral sub-library in the edge computing node; The edge fast identification module 330 is used to, after receiving the spectral data of the mixed sample to be tested at the edge computing node, perform linear combination solution on the edge spectral sub-library based on the non-negative least squares algorithm to obtain the non-negative weight coefficients of each component; the non-negative weight coefficients are used to characterize the relative contribution of each component in the mixed sample to be tested; and determine the component composition and the proportion of each component in the mixed sample to be tested based on the non-negative weight coefficients.
[0106] In an optional embodiment, the cloud-based spectral management module 310 is further configured to: Each mixed sample spectrum in the historical sample data is represented as a linear combination of standard spectra in the standard spectral library, and a non-negative constraint and an L1 norm sparse regularization term are introduced to construct a non-negative Lasso sparse regression model. The nonnegative Lasso sparse regression model is solved to obtain the sparse weight vector corresponding to each standard spectrum; the sparse weight vector is used to characterize the frequency or importance of each standard spectrum in the historical sample data; Based on the weight values of each standard spectrum in the sparse weight vector, the top K standard spectra with the highest weight values are selected as the candidate component spectrum set, where K is less than the total number of spectra in the standard spectrum library.
[0107] In an optional embodiment, the edge fast recognition module 330 is further configured to: The edge spectral sub-library is solved by linear combination using a non-negative least squares algorithm to obtain an initial weight vector, and the corresponding spectral reconstruction error is calculated. If the spectral reconstruction error is less than a preset error threshold, then the initial weight vector is used as the non-negative weight coefficient of each component.
[0108] In an optional embodiment, the component ratio estimation module 330 is further configured to: If the spectral reconstruction error is not less than a preset error threshold, the spectral data of the mixed sample to be tested will be uploaded to the cloud server. In the cloud server, based on the standard spectral library and the spectral data of the mixed sample to be tested, a new set of candidate component spectra is obtained by re-screening, and the new set of candidate component spectra is sent to the edge computing node to replace the original edge spectral sub-library.
[0109] In an optional embodiment, the component ratio estimation module 330 is further configured to: Using the spectral data of the mixed sample to be tested as the observation vector and the standard spectra in the marginal spectral sub-library as the basis vectors, a non-negative least squares optimization objective function is constructed. The non-negative least squares optimization objective function minimizes the sum of squared residuals between the linear combination of the observation vector and the basis vectors, and constrains that each element in the weight vector to be solved is greater than or equal to zero. The non-negative least squares objective function is solved using a numerical optimization algorithm to obtain an initial weight vector that satisfies the non-negative constraint.
[0110] In an optional embodiment, the component ratio estimation module 330 is further configured to: Components whose values in the non-negative weighting coefficients are greater than a preset threshold are identified as components in the mixed sample to be tested. The content ratio of each component in the mixed sample to be tested is calculated based on the ratio of the non-negative weight coefficient of each component to the sum of the non-negative weight coefficients of all components.
[0111] In an optional embodiment, the cloud-based spectral management module 310 is further configured to: The cloud server periodically receives historical mixed sample spectral data uploaded by the edge computing nodes; Based on the historical mixed sample spectral data, the standard spectral library was re-screened using the sparse regression method to obtain an updated set of candidate component spectra. The updated candidate component spectrum set is redeployed to the edge computing node to replace the original edge spectrum sub-library.
[0112] In an optional embodiment, the cloud-based spectral management module 310 is further configured to: For each historical mixed sample spectral data received within the current time period, a non-negative Lasso sparse regression model is used to solve the problem and obtain the sparse weight vector corresponding to each standard spectrum. The weighted average of the spectral data of all historical mixed samples within the current time period for each standard spectrum is calculated and used as the current period score for that standard spectrum. Obtain the historical scores of each standard spectrum in the previous time period, and then weight and fuse the current period score with the historical scores according to a preset weight to obtain the updated importance score of each standard spectrum. Based on the updated importance scores, the top K standard spectra are selected from the standard spectral library to form the updated candidate component spectrum set.
[0113] In an optional embodiment, the cloud-based spectral management module 310 is further configured to: Obtain a preset momentum update rate, wherein the momentum update rate is a value between 0 and 1; The first weighted value is obtained by multiplying the historical score of the previous time period by 1 and the difference between it and the momentum update rate. Multiply the current period score by the momentum update rate to obtain the second weighted value; The first weighted value is added to the second weighted value to obtain the updated importance score of each standard spectrum.
[0114] It is understood that the hybrid material spectral composition identification system under the edge computing architecture in this application embodiment can realize the hybrid material spectral composition identification method under the edge computing architecture in the above embodiment. The hybrid material spectral composition identification system under the edge computing architecture has the same advantages as the hybrid material spectral composition identification method under the edge computing architecture in the prior art, and will not be repeated here.
[0115] This application also provides an electronic device, see embodiments thereof. Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. For example... Figure 4 As shown, the electronic device 400 includes a memory 410 and a processor 420. The memory 410 and the processor 420 are connected via a bus for communication. The memory 410 stores a computer program that can run on the processor 420 to implement the steps of the method for identifying the spectral composition of mixed substances under the edge computing architecture described in the embodiments of this application.
[0116] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the method for identifying the spectral composition of mixed substances under the edge computing architecture described in this application.
[0117] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method for identifying the spectral composition of mixed substances under the edge computing architecture described in this application.
[0118] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0119] This application describes embodiments of methods and apparatus according to flowchart illustrations and / or block diagrams. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0120] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0121] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0122] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0123] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only 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 terminal device 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 terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0124] The above provides a detailed description of a method and system for identifying the spectral composition of mixed materials under an edge computing architecture. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and its core ideas. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for identifying the spectral composition of hybrid substances under an edge computing architecture, characterized in that, include: In the cloud server, a sparse regression method is used to screen and obtain a set of candidate component spectra based on a standard spectral library and historical sample data; The standard spectral library consists of the spectra of each pure substance, the historical sample data is the mixed sample spectral data uploaded by the edge computing nodes in the past, and the candidate component spectral set is a subset of the standard spectra ranked first in importance in the historical sample data. The candidate component spectral set is distributed to the edge computing node and stored locally to construct an edge spectral sub-library; After receiving the spectral data of the mixed sample to be tested, the edge computing node performs a linear combination solution on the edge spectral sub-library based on the non-negative least squares algorithm to obtain the non-negative weight coefficients of each component. The non-negative weighting coefficient is used to characterize the relative contribution of each component in the mixed sample to be tested. Based on the non-negative weighting coefficients, the composition and proportion of each component in the mixed sample to be tested are determined.
2. The method according to claim 1, characterized in that, Based on standard spectral libraries and historical sample data, a sparse regression method was used to screen and obtain a set of candidate component spectra, including: Each mixed sample spectrum in the historical sample data is represented as a linear combination of standard spectra in the standard spectral library, and a non-negative Lasso sparse regression model is constructed by introducing non-negative constraints and L1 norm sparse regularization terms. The nonnegative Lasso sparse regression model is solved to obtain the sparse weight vector corresponding to each standard spectrum; the sparse weight vector is used to characterize the frequency or importance of each standard spectrum in the historical sample data. Based on the weight values of each standard spectrum in the sparse weight vector, the top K standard spectra with the highest weight values are selected as the candidate component spectrum set, where K is less than the total number of spectra in the standard spectrum library.
3. The method according to claim 1, characterized in that, The marginal spectral sub-library is solved linearly using a non-negative least squares algorithm to obtain the non-negative weight coefficients of each component, including: The edge spectral sub-library is solved by linear combination using a non-negative least squares algorithm to obtain an initial weight vector, and the corresponding spectral reconstruction error is calculated. If the spectral reconstruction error is less than a preset error threshold, then the initial weight vector is used as the non-negative weight coefficient of each component.
4. The method according to claim 3, characterized in that, The method further includes: If the spectral reconstruction error is not less than a preset error threshold, the spectral data of the mixed sample to be tested will be uploaded to the cloud server. In the cloud server, based on the standard spectral library and the spectral data of the mixed sample to be tested, a new set of candidate component spectra is obtained by re-screening, and the new set of candidate component spectra is sent to the edge computing node to replace the original edge spectral sub-library.
5. The method according to claim 3, characterized in that, The marginal spectral sub-library is solved by linear combination using a non-negative least squares algorithm to obtain an initial weight vector, including: Using the spectral data of the mixed sample to be tested as the observation vector and the standard spectra in the marginal spectral sub-library as the basis vectors, a non-negative least squares optimization objective function is constructed. The non-negative least squares optimization objective function minimizes the sum of squared residuals between the linear combination of the observation vector and the basis vectors, and constrains that each element in the weight vector to be solved is greater than or equal to zero. The non-negative least squares objective function is solved using a numerical optimization algorithm to obtain an initial weight vector that satisfies the non-negative constraint.
6. The method according to claim 1, characterized in that, Based on the non-negative weighting coefficients, the composition and proportion of each component in the mixed sample to be tested are determined, including: Components whose values in the non-negative weighting coefficients are greater than a preset threshold are identified as components in the mixed sample to be tested. The content ratio of each component in the mixed sample to be tested is calculated based on the ratio of the non-negative weight coefficient of each component to the sum of the non-negative weight coefficients of all components.
7. The method according to claim 1, characterized in that, It also includes the edge-cloud collaborative update steps: The cloud server periodically receives historical mixed sample spectral data uploaded by the edge computing nodes; Based on the historical mixed sample spectral data, the standard spectral library was re-screened using the sparse regression method to obtain an updated set of candidate component spectra. The updated candidate component spectrum set is redeployed to the edge computing node to replace the original edge spectrum sub-library.
8. The method according to claim 7, characterized in that, Based on the historical mixed sample spectral data, the standard spectral library was re-screened using a sparse regression method to obtain an updated set of candidate component spectra, including: For each historical mixed sample spectral data received within the current time period, a non-negative Lasso sparse regression model is used to solve the problem and obtain the sparse weight vector corresponding to each standard spectrum. The weighted average of the spectral data of all historical mixed samples within the current time period for each standard spectrum is calculated and used as the current period score for that standard spectrum. Obtain the historical scores of each standard spectrum in the previous time period, and then perform a weighted fusion of the current period score and the historical scores according to a preset weight to obtain the updated importance score of each standard spectrum. Based on the updated importance scores, the top K standard spectra are selected from the standard spectral library to form the updated candidate component spectrum set.
9. The method according to claim 8, characterized in that, The current periodic score and the historical score are weighted and fused according to a preset weight to obtain the updated importance score of each standard spectrum, including: Obtain a preset momentum update rate, wherein the momentum update rate is a value between 0 and 1; The first weighted value is obtained by multiplying the historical score of the previous time period by 1 and the difference between the score and the momentum update rate. Multiply the current period score by the momentum update rate to obtain the second weighted value; The first weighted value is added to the second weighted value to obtain the updated importance score of each standard spectrum.
10. A hybrid material spectral composition identification system under an edge computing architecture, characterized in that, include: The cloud-based spectral management module is used to screen candidate component spectral sets in a cloud server based on a standard spectral library and historical sample data using a sparse regression method. The standard spectral library consists of the spectra of each pure substance, the historical sample data is the mixed sample spectral data uploaded by the edge computing nodes in the past, and the candidate component spectral set is a subset of the standard spectra ranked first in importance in the historical sample data. The edge spectral sub-library construction module is used to receive the candidate component spectrum set sent by the cloud server and build the edge spectral sub-library in the edge computing node; The edge fast identification module is used to obtain the non-negative weight coefficients of each component by linearly combining the edge spectral sub-library based on the non-negative least squares algorithm after the edge computing node receives the spectral data of the mixed sample to be tested. The non-negative weighting coefficient is used to characterize the relative contribution of each component in the mixed sample to be tested; based on the non-negative weighting coefficient, the component composition and the proportion of each component in the mixed sample to be tested are determined.