A water quality detection method and device, electronic equipment and storage medium

CN122598846APending Publication Date: 2026-08-18CHINA INST OF WATER RESOURCES & HYDROPOWER RES
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610695292.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-20
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0002]地表水109项全参数检测是当前环境监测、第三方检测实验室的核心强制性检测项目,检测指标覆盖挥发性有机物、半挥发性有机物、重金属、营养盐、微生物及常规理化等多个类别,检测流程复杂、检测周期长、数据量巨大;检测涉及大量精密分析仪器,核心以气相色谱仪、高效液相色谱仪、气相色谱-质谱联用仪、液相色谱-质谱联用仪为主,同时搭配部分常规理化检测设备,仪器品牌多样、数据输出协议不统一、检测数据格式繁杂,且109项指标对应计算公式、修约标准、检出限判定、平行样偏差核算规则各不相同,数据处理工作量极大

Benefits of technology

[0009] The technical solution of this invention, by constructing an automated rule base that includes a three-layer mapping relationship of detection methods, detection equipment, and spectral analysis scripts, realizes the automatic acquisition of detection experimental results and the automatic calculation of data throughout the entire process without human intervention. This effectively alleviates the workload of laboratory personnel, improves the accuracy of detection results, reduces the detection risk caused by human error, and has strong industry applicability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122598846A_ABST
    Figure CN122598846A_ABST
Patent Text Reader

Abstract

This invention discloses a water quality testing method, apparatus, electronic device, and storage medium, relating to the field of water quality testing technology. The method includes: extracting target detection parameters from a user-input water quality testing task; determining the target detection equipment corresponding to each target detection parameter from a mapping relationship; collecting the experimental result spectra output by each target detection equipment; using a target spectra analysis script to parse the matched experimental result spectra to obtain the raw data of the detection parameters; and performing multi-dimensional calculations on the matched raw parameters according to the target detection method to obtain the water quality testing results. By constructing an automated rule base, the method achieves automatic acquisition of testing experimental results and automatic calculation of data throughout the entire process, eliminating the need for manual intervention. This effectively alleviates the workload of laboratory personnel, improves the accuracy of testing results, reduces the testing risks caused by human error, and possesses strong industry applicability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water quality testing technology, and in particular to a water quality testing method, apparatus, electronic device, and storage medium. Background Technology

[0002] The comprehensive testing of 109 parameters in surface water is a core mandatory testing item for current environmental monitoring and third-party testing laboratories. The testing indicators cover multiple categories such as volatile organic compounds, semi-volatile organic compounds, heavy metals, nutrients, microorganisms, and routine physicochemical properties. The testing process is complex, the testing cycle is long, and the amount of data is huge. The testing involves a large number of precision analytical instruments, with gas chromatographs, high-performance liquid chromatographs, gas chromatography-mass spectrometry, and liquid chromatography-mass spectrometry as the core, and some routine physicochemical testing equipment. There are various brands of instruments, inconsistent data output protocols, and complex test data formats. In addition, the calculation formulas, rounding standards, detection limit determination, and parallel sample deviation calculation rules for the 109 indicators are different, resulting in a huge workload for data processing.

[0003] Traditional water quality testing systems typically only support simple integration with a limited number of general-purpose instruments, failing to achieve parallel and targeted data collection from multiple devices and indicators. This leads to issues such as missed or incorrect data collection, data corruption, and inconsistent formats. They also only support simple addition and subtraction operations, requiring extensive manual calculation, rounding, and judgment of data, which can result in calculation errors, improper rounding, and judgment biases. Furthermore, they cannot be linked to national standard testing methods, making compliance difficult to guarantee. Original records are still primarily filled out manually; with 109 indicators and complex tables, manual entry is time-consuming and prone to omissions and errors. The lack of a robust record-keeping mechanism for original data, calculation processes, and modification records makes it difficult to withstand reviews and regulatory inspections. Therefore, existing water quality testing systems cannot meet the demands of 109 surface water tests for automated data collection, intelligent calculation, standardized recording, and full traceability, severely restricting testing efficiency and data quality, becoming a common pain point in the industry. Summary of the Invention

[0004] This invention provides a water quality testing method, apparatus, electronic device, and storage medium to achieve an automated water quality testing process.

[0005] In a first aspect, a water quality testing method is provided, the method comprising: constructing an automated rule base for water quality testing, wherein the automated rule base includes the mapping relationship between testing methods, testing equipment and spectral analysis scripts corresponding to each testing parameter; Extract target detection parameters from the water quality testing task input by the user, determine the target detection device corresponding to each target detection parameter from the mapping relationship, and collect the experimental result spectrum output by each target detection device; The target spectrum parsing script corresponding to each target detection device is determined from the mapping relationship, and the target spectrum parsing script is used to parse the matched experimental result spectrum to obtain the raw data of the detection parameters; Obtain the target detection method corresponding to each target detection parameter from the mapping relationship, and perform multi-dimensional calculations on the matched original parameters according to the target detection method to obtain the water quality detection result.

[0006] According to another aspect of the present invention, a water quality testing device is provided, the device comprising: an automated rule base construction module for constructing an automated rule base for water quality testing, wherein the automated rule base includes a mapping relationship between testing methods, testing equipment and spectral analysis scripts corresponding to each testing parameter; The experimental result spectrum acquisition module is used to extract target detection parameters from the water quality testing task input by the user, determine the target detection device corresponding to each target detection parameter from the mapping relationship, and acquire the experimental result spectrum output by each target detection device; The experimental result spectrum analysis module is used to determine the target spectrum analysis script corresponding to each of the target detection devices from the mapping relationship, and use the target spectrum analysis script to analyze the matched experimental result spectrum to obtain the raw data of the detection parameters; The water quality test result acquisition module is used to obtain the target detection method corresponding to each of the target detection parameters from the mapping relationship, and to perform multi-dimensional calculations on the matched original parameters according to the target detection method to obtain the water quality test result.

[0007] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: one or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any embodiment of the present invention.

[0008] According to another aspect of the present invention, a storage medium for computer-executable instructions is provided, on which a computer program is stored, which, when executed by a processor, implements the method as described in any of the embodiments of the present invention.

[0009] The technical solution of this invention, by constructing an automated rule base that includes a three-layer mapping relationship of detection methods, detection equipment, and spectral analysis scripts, realizes the automatic acquisition of detection experimental results and the automatic calculation of data throughout the entire process without human intervention. This effectively alleviates the workload of laboratory personnel, improves the accuracy of detection results, reduces the detection risk caused by human error, and has strong industry applicability.

[0010] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

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

[0012] Figure 1 This is a flowchart of a water quality testing method provided in Embodiment 1 of the present invention; Figure 2 This is a flowchart of another water quality testing method provided in Embodiment 2 of the present invention; Figure 3 This is a schematic diagram of the structure of a water quality testing device according to Embodiment 3 of the present invention; Figure 4 This is a structural block diagram of an electronic device provided in Embodiment 4 of the present invention. Detailed Implementation

[0013] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0014] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, apparatus, product, or terminal device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or terminal devices.

[0015] Example 1 Figure 1This is a flowchart of a water quality testing method provided in Embodiment 1 of the present invention. This embodiment is applicable to the automated testing of water quality. The method can be executed by a water quality testing device, which can be implemented in hardware and / or software, and can be integrated into an electronic device with data processing capabilities. Figure 1 As shown, the method includes: S101, Construct an automated rule base for water quality testing.

[0016] Optionally, an automated rule base for water quality testing is constructed, including: acquiring all testing parameters associated with water quality testing and the corresponding testing methods for each parameter; constructing a testing method library based on the testing methods, wherein the testing methods include concentration calculation formulas, rounding rules, detection limits, and quality control limits; determining the testing equipment involved in testing each parameter, and configuring the information of each testing equipment to construct a device library, wherein the configuration information includes model, communication protocol, and output format; acquiring the spectral analysis scripts written for each testing equipment, and constructing a spectral analysis script library based on each spectral analysis script; determining a first mapping relationship between testing methods and testing equipment based on the testing equipment library and the testing method library, determining a second mapping relationship between testing equipment and spectral analysis scripts based on the testing equipment library and the spectral analysis script library, and constructing an automated rule base based on the first and second mapping relationships.

[0017] Specifically, this implementation method primarily targets scenarios involving surface water quality testing. Before system startup, it acquires all parameters associated with surface water quality testing, specifically 109 testing parameters for surface water, such as chloroform and carbon tetrachloride. Additionally, it acquires the corresponding testing methods for each parameter and binds the national environmental protection standard methods for each parameter. These methods include concentration calculation formulas, rounding rules, detection limits, and quality control limits. A testing method library is then constructed based on the binding results. The concentration calculation formula converts the raw data from the testing equipment (such as peak area and peak height) into a mathematical expression representing the actual content. Rounding rules refer to the fact that in laboratory testing, mathematical rounding cannot be used simply; instead, nationally mandated numerical rounding rules must be followed. For example, surface water testing often requires retaining two decimal places. The detection limit refers to the minimum concentration or amount of an analyte that a specific analytical method can detect in a sample within a given confidence level. If the concentration corresponding to the detection result is higher than the detection limit, the specific value is displayed. If the concentration is lower than the detection limit, the system cannot display 0 or a very small number, but must mark it as "not detected." This is to ensure the authenticity of the data, because substances below the detection limit mean that they may be present, but the detection equipment is insufficient to measure them accurately, and 0 cannot be arbitrarily written. The quality control limit is used to determine whether the local detection results are reliable. This embodiment does not limit the specific content included in the detection method. In addition, this embodiment also identifies the detection equipment involved in the detection of each detection parameter. For example, it is determined that chloroform is detected by a gas chromatograph with the serial number GC-01. That is, it clarifies which detection equipment is responsible for which detection parameter and creates a file for the detection equipment. After the detection equipment is entered into the system, information is configured for each detection equipment. The configured information includes model, communication protocol and output format. The communication protocol refers to the method by which the system communicates with the detection equipment. Because different detection equipment manufacturers use different connection standards, the system must adapt to these standards to connect. For example, the TCP / IP communication protocol connects through a network port and is suitable for modern intelligent instruments, while the serial port protocol connects through a traditional serial interface and is often used for older equipment or specific analyzers. By configuring the communication protocol, the physical connection channel is established to ensure that the system can connect to each detection equipment. The output format refers to the file format output by each testing device, such as a PDF report, a TXT text file, or a CSV table. Because the file format generated by each testing device is different, the system needs to know this format in advance to facilitate data capture in subsequent steps. This implementation method will build a device library based on the information configured for the testing devices.

[0018] Furthermore, this implementation uses specialized spectral analysis scripts tailored to different brands and signal types of detection devices. These scripts clearly specify which data from the file to extract, such as peak area or retention time. The scripts also include invalid data removal rules (e.g., automatically filtering peaks with areas less than 1 / 10 of the detection limit). Therefore, although each detection device outputs complex text or PDF reports, the system can extract valid data from the output data of each device based on the corresponding spectral analysis script. With the detection method library, equipment library, and spectrum analysis script library all built, a first mapping relationship between detection methods and detection equipment can be established, that is, determining which detection equipment should be used for each detection parameter. A second mapping relationship between detection equipment and spectrum analysis script can also be established, that is, determining which script should be used to analyze the data of each detection equipment. Therefore, when a task is issued, the system can automatically find the corresponding detection equipment according to the task. After the detection equipment completes the experiment, it will automatically use the corresponding script to capture the data. After capturing the data, it will automatically use the corresponding formula to perform the calculation. Therefore, this implementation method, by building an automated rule library, can set up a whole set of logic before detection, such as what to detect, what equipment to use to measure, how to read the data, and how to calculate. This is the foundation for the subsequent fully automated pipeline operation of the system.

[0019] S102, extract target detection parameters from the water quality testing task input by the user, determine the target detection device corresponding to each target detection parameter from the mapping relationship, and collect the experimental result spectrum output by each target detection device.

[0020] Optionally, the experimental result spectra output by each target detection device are collected, including: establishing a communication connection with each target detection device via a network and monitoring the operating status of each target detection device in real time; automatically generating a collection command when it is determined that each target detection device has completed the detection work for the matched target detection parameters; and instructing the collection component to collect the experimental result spectra output by each target detection device according to the collection command.

[0021] Specifically, in this implementation, the testing personnel only need to complete task registration at the front end and select the target detection parameters for surface water. The system will determine the target detection equipment corresponding to each target detection parameter based on the target detection parameters and the mapping relationship constructed above. The system will connect to all instruments that need to collect data via network cable or WiFi (TCP / IP and other protocols). Once the connection is successful, the system will read the status signals of the instruments in real time, such as idle, running, or malfunction, just like a surveillance camera. The purpose is to ensure that the system knows what the instruments are doing at all times, in preparation for the next step of accurate data acquisition. Only when it is determined that each target detection device has completed its assigned detection task and generated an experimental result spectrum will the system automatically generate a data acquisition command to acquire data, rather than blindly acquiring data. Once the acquisition command is generated, the system will instruct the underlying acquisition component to read the final file generated by the instrument—that is, the experimental result spectrum. In this implementation, the system monitors each target detection device in real time via the network. Once a target detection device completes the specified detection task, it immediately and automatically issues a command to capture the spectrum file generated by that target detection device. This realizes the transformation from human searching for data to data searching for human, completely eliminating the lag and error risk of manual file copying.

[0022] S103, determine the target spectrum analysis script corresponding to each target detection device from the mapping relationship, and use the target spectrum analysis script to analyze the matched experimental result spectrum to obtain the raw data of the detection parameters.

[0023] Optionally, a target spectrum parsing script is used to parse the matched experimental result spectrum to obtain the raw data of the detection parameters. This includes: using the target spectrum parsing script to extract the valid data of the detection parameters from the matched experimental result spectrum and removing the invalid data of the detection parameters. The valid data includes peak area and retention time. The valid data is then converted according to a standard format to obtain the raw data of the detection parameters.

[0024] Specifically, because different brands and types of instruments output different file formats and data structures, the system will automatically identify which target detection device output the currently acquired target spectrum based on the previously configured "device-script mapping relationship," and then call the dedicated target spectrum parsing script written for that target detection device. The target spectrum parsing script analyzes the matched experimental result spectrum. During runtime, the script extracts valid data from the detection parameters, such as only capturing the core indicators necessary for concentration calculation, namely peak area and retention time. It also deletes invalid data, such as automatically filtering out meaningless peaks, noise, or tiny signals below the detection limit to prevent interference with subsequent calculations. Of course, this embodiment is merely an example and does not limit the specific content of the valid data.

[0025] Since the formats of each target spectrum are different, the formats of the valid data obtained from parsing these spectra also vary. To ensure data format uniformity and facilitate subsequent system calculations and analyses, the extracted peak areas and retention times are converted into a standard data format commonly used within the LIMS system (such as JSON or specific database fields). This process transforms all target spectra, whether in TXT or PDF format, into uniform raw data, ready for direct use by subsequent intelligent computing components. Therefore, in this implementation, the system automatically calls the corresponding target spectrum parsing script based on the type of target detection device, accurately extracting key values ​​such as peak areas and retention times from complex experimental result spectra, discarding useless noise, and organizing this data into a standard format that the system can understand. This is a crucial step in achieving unmanned computation, ensuring that the data entering the concentration calculation formula is accurate, clean, and uniformly formatted.

[0026] S104: Obtain the target detection method corresponding to each target detection parameter from the mapping relationship, and perform multi-dimensional calculations on the matched original parameters according to the target detection method to obtain the water quality detection results.

[0027] Optionally, the target detection method corresponding to each target detection parameter is obtained from the mapping relationship, and the water quality detection results are obtained by multi-dimensional calculation of the matched original parameters according to the target detection method. This includes: automatically retrieving the target detection method corresponding to each target detection parameter from the mapping relationship through an intelligent calculation component; calculating the initial concentration value of the detection parameter using the concentration calculation formula in the target detection method for each target detection parameter, and rounding the initial concentration value according to the rounding rule to obtain the rounded concentration value; determining the detection limit value of the rounded concentration value based on the detection limit value, and marking the rounded concentration value with the detection limit determination result being less than the detection limit value as not detected; when the detection limit determination result is greater than the detection limit value, performing quality verification on the rounded concentration value to obtain the true concentration value, and determining compliance based on the quality control limit value to obtain the compliance determination result; and using the true concentration value, detection limit determination result, and compliance determination result corresponding to each target detection parameter as the water quality detection result.

[0028] Optionally, when the detection limit determination result is greater than the detection limit, the rounded concentration value is subjected to quality verification to obtain the true concentration value, and the true concentration value is subjected to compliance determination to obtain the compliance determination result, including: when the detection limit determination result is greater than the detection limit, the relative deviation of parallel samples corresponding to the target detection parameter is automatically calculated; when the relative deviation of parallel samples is less than a preset threshold, the rounded concentration value is corrected and verified using the blank sample concentration to obtain the corrected true concentration value; and the true concentration value is subjected to quality control limit determination based on the quality control limit to obtain the compliance determination result, wherein the compliance determination result includes qualified or unqualified.

[0029] Specifically, the raw data in a uniform format corresponding to each detection parameter is uploaded to the central processing unit in real time. If some target detection devices are offline, offline data import is supported. Once the target detection devices are connected to the network, the raw data is automatically synchronized, with no manual transcription intervention throughout the process. The central processing unit transmits the raw data to the intelligent computing component, which automatically retrieves the corresponding target detection method from the database based on the target detection parameters, thereby ensuring that each target detection parameter is calculated using its own specific standard. Since each target detection method includes a concentration calculation formula, rounding rules, detection limits, and quality control limits, the matched original parameters are calculated in multiple dimensions according to the target detection method. Specifically, the initial concentration value of the detection parameter can be obtained by calculating the original data using the concentration calculation formula in the target detection method. Then, the initial concentration value is rounded according to the national standard requirements included in the rounding rules (such as retaining two decimal places and rounding to even numbers) to obtain the rounded concentration value, avoiding the error of manually retaining decimal places. For example, according to HJ 639-2011, the initial concentration of chloroform is rounded to two decimal places, that is, the initial concentration value of 1.234 μg / L is rounded to the rounded concentration value of 1.23 μg / L. Of course, this embodiment is only an example and does not limit the specific size of the rounded concentration value.

[0030] In addition, after obtaining the rounded concentration value for each target detection parameter, the system will determine the detection limit for the rounded concentration value based on the detection limit, that is, compare the rounded concentration value of each target detection parameter with the corresponding detection limit. If the rounded concentration value is less than the detection limit, the system directly determines it as not detected and marks it, without performing subsequent complex quality accounting. If the rounded concentration value is greater than the detection limit, quality accounting is performed on the rounded concentration value. Among them, when performing quality accounting, first check whether the rounded concentration value is stable based on the relative deviation of parallel samples. When it is determined to be stable, then obtain the true concentration value by subtracting the background interference from the blank sample concentration. Finally, determine whether the true concentration value is qualified. Among them, the relative deviation of parallel samples refers to the same water sample being measured twice, and the system will automatically calculate the degree of difference between the two results, that is, the relative deviation of parallel samples. If the difference is very small (less than the preset threshold, such as 20%), it means that the target detection equipment is operating stably, the operation is correct, and the data is reliable, allowing it to enter the next step. If the difference is too large (exceeding the threshold), it means that the data is unreliable, and the system usually directly reports an error and does not perform subsequent calculations. Among them, the blank sample concentration refers to using pure water instead of the water sample for testing to measure the background interference value brought by reagents, utensils or the environment. The system will use the result of subtracting the blank sample concentration from the obtained rounded concentration value as the true concentration value. Among them, when the true concentration value of each target detection parameter is known, a compliance determination will be further performed on the true concentration value to obtain a compliance determination result, that is, compare the true concentration value with the corresponding quality control limit. When the true concentration value is less than the corresponding quality control limit, it is determined to be qualified, otherwise it is determined to be unqualified. In this embodiment, all processed information is packaged, including the true concentration value, the detection limit determination result, and the compliance determination result, and the packaged information result is used as the water quality detection result.

[0031] Optionally, after obtaining the water quality detection result by performing multi-dimensional calculations on the matched original parameters according to the target detection method, it further includes: obtaining the full-process information of the water quality detection when the compliance determination result is qualified, where the full-process information includes the calculation time, the detection equipment identifier, the operator, and the detection method version; generating an audit tracking log based on the full-process information of the water quality detection, where the audit tracking log has non-repudiation and traceability.

[0032] It's important to note that the system doesn't just save a final concentration value. Instead, it immediately packages and saves all information related to the entire water quality testing process, including calculation time, testing equipment identification, operator, and testing method version. The calculation time is a timestamp accurate to the second, proving when the data was generated. The testing equipment identification indicates which specific testing equipment was used (e.g., GC-01 gas chromatograph), ensuring equipment traceability. The operator refers to who operated the target testing equipment or performed the audit task, ensuring accountability. The testing method version indicates which version of the national standard method was used (e.g., HJ 639-2012), ensuring correct application. This forms a complete chain of evidence proving the qualified result is genuine, valid, and of clear origin. The system generates an audit trail log from all the collected information and writes it to a dedicated audit log database. Once generated, this log is locked by the system (usually using blockchain or encryption technology), making it impossible for anyone to modify, delete, or overwrite. Even if someone attempts to modify it, the system retains a trace of the original record, noting who modified what data and when. This allows for the retrieval of this audit trail log at any time to reconstruct the testing scenario in the future when faced with inspections by environmental protection departments, qualification reviews, or data challenges.

[0033] The technical solution of this invention, by constructing an automated rule base that includes a three-layer mapping relationship of detection methods, detection equipment, and spectral analysis scripts, realizes the automatic acquisition of detection experimental results and the automatic calculation of data throughout the entire process without human intervention. This effectively alleviates the workload of laboratory personnel, improves the accuracy of detection results, reduces the detection risk caused by human error, and has strong industry applicability.

[0034] Example 2 Figure 2 This is a flowchart of another water quality testing method provided by an embodiment of the present invention. Based on the above embodiment, after obtaining water quality testing results by performing multi-dimensional calculations on the matched original parameters according to the target testing method, this embodiment further includes: obtaining full-dimensional data and experimental conditions during the water quality testing process; automatically matching the original record template according to the target testing parameters, automatically filling the full-dimensional data and experimental conditions into the corresponding positions in the original record template to obtain the original testing record; performing integrity verification on the original testing record, and outputting the original testing record when the integrity verification passes. The original testing record meets the qualification review requirements, such as... Figure 2 As shown, the method includes: S201, Construct an automated rule base for water quality testing.

[0035] Optionally, an automated rule base for water quality testing is constructed, including: acquiring all testing parameters associated with water quality testing and the corresponding testing methods for each parameter; constructing a testing method library based on the testing methods, wherein the testing methods include concentration calculation formulas, rounding rules, detection limits, and quality control limits; determining the testing equipment involved in testing each parameter, and configuring the information of each testing equipment to construct a device library, wherein the configuration information includes model, communication protocol, and output format; acquiring the spectral analysis scripts written for each testing equipment, and constructing a spectral analysis script library based on each spectral analysis script; determining a first mapping relationship between testing methods and testing equipment based on the testing equipment library and the testing method library, determining a second mapping relationship between testing equipment and spectral analysis scripts based on the testing equipment library and the spectral analysis script library, and constructing an automated rule base based on the first and second mapping relationships.

[0036] S202: Extract target detection parameters from the water quality testing task input by the user, determine the target detection equipment corresponding to each target detection parameter from the mapping relationship, and collect the experimental result spectrum output by each target detection equipment.

[0037] Optionally, the experimental result spectra output by each target detection device are collected, including: establishing a communication connection with each target detection device via a network and monitoring the operating status of each target detection device in real time; automatically generating a collection command when it is determined that each target detection device has completed the detection work for the matched target detection parameters; and instructing the collection component to collect the experimental result spectra output by each target detection device according to the collection command.

[0038] S203, determine the target spectrum analysis script corresponding to each target detection device from the mapping relationship, and use the target spectrum analysis script to analyze the matched experimental result spectrum to obtain the raw data of the detection parameters.

[0039] Optionally, a target spectrum parsing script is used to parse the matched experimental result spectrum to obtain the raw data of the detection parameters. This includes: using the target spectrum parsing script to extract the valid data of the detection parameters from the matched experimental result spectrum and removing the invalid data of the detection parameters. The valid data includes peak area and retention time. The valid data is then converted according to a standard format to obtain the raw data of the detection parameters.

[0040] S204: Obtain the target detection method corresponding to each target detection parameter from the mapping relationship, and perform multi-dimensional calculations on the matched original parameters according to the target detection method to obtain the water quality detection results.

[0041] Optionally, the target detection method corresponding to each target detection parameter is obtained from the mapping relationship, and the water quality detection results are obtained by multi-dimensional calculation of the matched original parameters according to the target detection method. This includes: automatically retrieving the target detection method corresponding to each target detection parameter from the mapping relationship through an intelligent calculation component; calculating the initial concentration value of the detection parameter using the concentration calculation formula in the target detection method for each target detection parameter, and rounding the initial concentration value according to the rounding rule to obtain the rounded concentration value; determining the detection limit value of the rounded concentration value based on the detection limit value, and marking the rounded concentration value with the detection limit determination result being less than the detection limit value as not detected; when the detection limit determination result is greater than the detection limit value, performing quality verification on the rounded concentration value to obtain the true concentration value, and determining compliance based on the quality control limit value to obtain the compliance determination result; and using the true concentration value, detection limit determination result, and compliance determination result corresponding to each target detection parameter as the water quality detection result.

[0042] Optionally, when the detection limit determination result is greater than the detection limit, the rounded concentration value is subjected to quality verification to obtain the true concentration value, and the true concentration value is subjected to compliance determination to obtain the compliance determination result, including: when the detection limit determination result is greater than the detection limit, the relative deviation of parallel samples corresponding to the target detection parameter is automatically calculated; when the relative deviation of parallel samples is less than a preset threshold, the rounded concentration value is corrected and verified using the blank sample concentration to obtain the corrected true concentration value; and the true concentration value is subjected to quality control limit determination based on the quality control limit to obtain the compliance determination result, wherein the compliance determination result includes qualified or unqualified.

[0043] Optionally, after obtaining the water quality test results by performing multi-dimensional calculations on the matched raw parameters according to the target detection method, the method further includes: obtaining the full process information of water quality testing when the compliance judgment result is qualified, wherein the full process information includes calculation time, testing equipment identification, operator and testing method version; generating an audit trail log based on the full process information of water quality testing, wherein the audit trail log is tamper-proof and traceable.

[0044] S205: Acquire full-dimensional data and experimental conditions during the water quality testing process, automatically match the original record template according to the target detection parameters, and automatically fill the full-dimensional data and experimental conditions into the corresponding positions in the original record template to obtain the original detection record.

[0045] Specifically, in this embodiment, the system comprehensively collects all information from the experimental site. The full-dimensional data includes sample information related to water quality testing, raw data corresponding to each target detection parameter, water quality testing results, and audit trail logs. Sample information includes sample number, sampling time, sampling location, and storage conditions. The raw data, water quality testing results, and audit trail logs are all intermediate parameters obtained during the testing process described in the above embodiments. Experimental conditions include laboratory temperature, ambient temperature, and carrier gas flow rate, etc. This embodiment does not limit the specific content of the full-dimensional data and experimental conditions.

[0046] In this system, the system automatically matches the original record template based on the target detection parameters, automatically filling in the corresponding positions in the original record template with all-dimensional data and experimental conditions. For example, the peak area returned by the target detection device is filled in the target detection device reading column, the temperature and humidity sensor values ​​are filled in the environmental conditions column, and the calculated results are filled in the measurement results column. The final filled result is then used as the original detection record. Therefore, in this embodiment, the system automatically collects all the details (data + environment) of the experiment, then automatically calls the corresponding original record template for all relevant data, fills in all the details, and directly generates an original detection record. This greatly frees up the hands of the testing personnel, freeing them from tedious paperwork, and also avoids the risks of typos and data falsification that may occur with manual copying, achieving true paperless and traceable management.

[0047] S206, perform integrity verification on the original detection record, and output the original detection record when the integrity verification passes.

[0048] The system automatically verifies the completeness of the original testing records, ensuring they include all elements such as sampling information, experimental conditions, target testing equipment parameters, testing data, calculation processes, and verification records. This guarantees that every original testing record is complete. Only when all verifications pass will the system perform output operations, such as generating a PDF file, pushing it to an electronic archive, or allowing printing. If verification fails, the system will intercept the output and automatically alert the user to complete the information. Furthermore, this implementation supports electronic signatures, enabling two-way binding of original data, calculation logs, and original records. Traceability can be retrieved with a single click using the sample number or task number, fully meeting the requirements for accreditation review.

[0049] It is worth mentioning that this implementation method has developed a dedicated protocol parsing module for 109 core surface water testing devices, which is compatible with various precision testing devices such as gas chromatography and liquid chromatography. This enables multi-device linkage and targeted data collection based on indicators, supports online real-time collection and offline synchronization, eliminates data omissions, errors, and confusion, and breaks down data barriers between devices and the system. It abandons the manual calculation mode and has built-in a complete set of dedicated calculation, rounding, and judgment rules. The system automatically completes the entire process of data processing, and the calculation process is traceable and tamper-proof. It is synchronously linked with national standard methods, requiring no manual intervention and completely solving the problem of human calculation errors. It achieves seamless linkage between data collected by testing devices, intelligent calculation results, and compliant original records, and automatically generates original records that meet the qualification requirements with one click, eliminating the need for manual filling and significantly reducing the time for original record preparation. It automatically completes the standardization of data formats for multiple devices, and the three-way binding of testing data, calculation logs, and original records enables one-click traceability, ensuring that the data is fully traceable, compliant, and controllable.

[0050] The technical solution of this invention, by constructing an automated rule base that includes a three-layer mapping relationship of detection methods, detection equipment, and spectral analysis scripts, realizes the automatic acquisition of detection experimental results and the automatic calculation of data throughout the entire process without human intervention. This effectively alleviates the workload of laboratory personnel, improves the accuracy of detection results, reduces the detection risk caused by human error, and has strong industry applicability.

[0051] Example 3 Figure 3 This is a schematic diagram of a water quality testing device provided in an embodiment of the present invention. Figure 3 As shown, the device includes: an automated rule base construction module 310, an experimental result spectrum acquisition module 320, an experimental result spectrum analysis module 330, and a water quality detection result acquisition module 340.

[0052] The automated rule base construction module 310 is used to construct an automated rule base for water quality testing. The automated rule base includes the mapping relationship between the detection method, detection equipment and spectrum analysis script corresponding to each detection parameter. The experimental result spectrum acquisition module 320 is used to extract target detection parameters from the water quality testing task input by the user, determine the target detection device corresponding to each target detection parameter from the mapping relationship, and acquire the experimental result spectrum output by each target detection device. The experimental result spectrum analysis module 330 is used to determine the target spectrum analysis script corresponding to each target detection device from the mapping relationship, and to use the target spectrum analysis script to analyze the matched experimental result spectrum to obtain the raw data of the detection parameters. The water quality test result acquisition module 340 is used to obtain the target detection method corresponding to each target detection parameter from the mapping relationship, and to perform multi-dimensional calculations on the matched original parameters according to the target detection method to obtain the water quality test result.

[0053] Optionally, an automated rule base construction module is used to obtain all detection parameters associated with water quality testing and the detection methods corresponding to each detection parameter, and to construct a detection method library based on the detection methods. The detection methods include concentration calculation formulas, rounding rules, detection limits, and quality control limits. Identify the testing equipment involved in testing each testing parameter, and build a device library by configuring the information of each testing equipment. The configuration information includes the model, communication protocol and output format. Obtain the spectrum analysis scripts written for each detection device, and build a spectrum analysis script library based on each spectrum analysis script; The first mapping relationship between detection methods and detection equipment is determined based on the detection equipment library and the detection method library. The second mapping relationship between detection equipment and spectrum analysis script is determined based on the detection equipment library and the spectrum analysis script library. An automated rule base is then constructed based on the first and second mapping relationships.

[0054] Optionally, an experimental result spectrum acquisition module is used to establish a communication connection with each target detection device via a network and to monitor the operating status of each target detection device in real time. When it is determined that each target detection device has completed the detection work for the matched target detection parameters, an acquisition command is automatically generated. According to the acquisition command, the acquisition component acquires the experimental result spectra output by each target detection device.

[0055] Optionally, the experimental result spectrum analysis module is used to extract valid data of detection parameters from the matched experimental result spectrum using the target spectrum analysis script, and remove invalid data of detection parameters. Valid data includes peak area and retention time. The valid data is converted according to the standard format to obtain the raw data of the detection parameters.

[0056] Optionally, a water quality test result acquisition module is used to automatically retrieve the target detection method corresponding to each target detection parameter from the mapping relationship through an intelligent computing component; For each target detection parameter, the initial concentration value of the detection parameter is obtained by calculating the concentration formula in the target detection method using the original data, and the initial concentration value is rounded according to the rounding rule to obtain the rounded concentration value. The rounding concentration values ​​are determined based on the detection limit, and the rounding concentration values ​​whose detection limit determination result is less than the detection limit are marked as not detected; When the detection limit determination result is greater than the detection limit, the rounded concentration value is subjected to quality accounting to obtain the true concentration value, and the true concentration value is subjected to compliance determination based on the quality control limit to obtain the compliance determination result; The actual concentration value, detection limit determination result, and compliance determination result corresponding to each target detection parameter are used as the water quality detection result.

[0057] Optionally, the water quality test result acquisition module is also used to automatically calculate the relative deviation of the parallel samples corresponding to the target test parameters when the detection limit judgment result is greater than the detection limit. When the relative deviation of parallel samples is less than the preset threshold, the rounded concentration value is corrected and calculated using the blank sample concentration to obtain the corrected true concentration value. Based on the quality control limits, the actual concentration value is determined to obtain a compliance judgment result, which includes qualified or unqualified.

[0058] Optionally, the device also includes an audit trail log generation module, which is used to obtain full-process information on water quality testing when the compliance determination result is qualified. The full-process information includes calculation time, testing equipment identification, operator and testing method version. An audit trail log is generated based on information from the entire water quality testing process. This audit trail log is tamper-proof and traceable.

[0059] Optionally, the device also includes a detection raw record output module for acquiring full-dimensional data and experimental conditions during the water quality testing process. The full-dimensional data includes sample information involved in the water quality testing, raw data corresponding to each target detection parameter, water quality testing results, and audit trail logs. The original record template is automatically matched based on the target detection parameters, and the full-dimensional data and experimental conditions are automatically filled into the corresponding positions in the original record template to obtain the original detection record. The original test records are verified for integrity. When the integrity verification passes, the original test records are output, and the original test records meet the requirements of the accreditation review.

[0060] The water quality testing device provided in this embodiment of the invention can execute a water quality testing method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the method.

[0061] Example 4 Figure 4A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0062] The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the invention described and / or claimed herein.

[0063] like Figure 4 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0064] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other electronic devices through computer networks such as the Internet and / or various telecommunications networks.

[0065] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as water quality detection methods.

[0066] That is, to build an automated rule base for water quality testing, which includes the mapping relationship between the testing methods, testing equipment and spectrum analysis scripts corresponding to each testing parameter; Extract target detection parameters from the water quality testing task input by the user, determine the target detection equipment corresponding to each target detection parameter from the mapping relationship, and collect the experimental result spectrum output by each target detection equipment; The target spectrum analysis script corresponding to each target detection device is determined from the mapping relationship, and the target spectrum analysis script is used to analyze the matched experimental result spectrum to obtain the raw data of the detection parameters. The target detection method corresponding to each target detection parameter is obtained from the mapping relationship, and the water quality detection result is obtained by multi-dimensional calculation of the matched original parameters based on the target detection method.

[0067] In some embodiments, the water quality testing method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the water quality testing method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the water quality testing method by any other suitable means (e.g., by means of firmware).

[0068] Various embodiments of the apparatuses and techniques described above herein can be implemented in digital electronic circuit devices, integrated circuit devices, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), device-on-a-chip (SoC) devices, complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable device including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage device, at least one input device, and at least one output device, and transmitting data and instructions to the storage device, the at least one input device, and the at least one output device.

[0069] Computer programs used to implement the water quality testing method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to the processor of a general-purpose computer or a special-purpose computer, such that when executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer programs can be executed entirely on the machine, partially on the machine, or as a standalone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0070] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution apparatus, device, or electronic device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage electronics, magnetic storage electronics, or any suitable combination thereof.

[0071] To provide interaction with a user, the devices and techniques described herein can be implemented on an electronic device having: a display device (e.g., a touchscreen) for displaying information to the user; and buttons through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0072] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0073] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A water quality testing method, characterized in that, The method includes: An automated rule base for water quality testing is constructed, wherein the automated rule base includes the mapping relationship between the testing methods, testing equipment and spectral analysis scripts corresponding to each testing parameter; Extract target detection parameters from the water quality testing task input by the user, determine the target detection device corresponding to each target detection parameter from the mapping relationship, and collect the experimental result spectrum output by each target detection device; The target spectrum parsing script corresponding to each target detection device is determined from the mapping relationship, and the target spectrum parsing script is used to parse the matched experimental result spectrum to obtain the raw data of the detection parameters; Obtain the target detection method corresponding to each target detection parameter from the mapping relationship, and perform multi-dimensional calculations on the matched original parameters according to the target detection method to obtain the water quality detection result.

2. The method according to claim 1, characterized in that, The construction of the automated rule base for water quality testing includes: Obtain all detection parameters associated with water quality testing and the corresponding detection methods for each detection parameter, and construct a detection method library based on the detection methods, wherein the detection methods include concentration calculation formulas, rounding rules, detection limits and quality control limits; Identify the testing equipment involved in testing each testing parameter, and build a device library by configuring the information of each testing equipment. The configuration information includes the model, communication protocol and output format. Obtain the spectrum analysis scripts written for each detection device, and construct a spectrum analysis script library based on each of the spectrum analysis scripts; A first mapping relationship between detection methods and detection devices is determined based on the detection device library and the detection method library. A second mapping relationship between detection devices and spectrum analysis scripts is determined based on the detection device library and the spectrum analysis script library. The automated rule library is then constructed based on the first mapping relationship and the second mapping relationship.

3. The method according to claim 1, characterized in that, The acquisition of the experimental result spectra output by each of the target detection devices includes: Establish communication connections with each of the target detection devices through the network, and monitor the operating status of each of the target detection devices in real time; When it is determined that each of the target detection devices has completed the detection work for the matched target detection parameters, an acquisition command is automatically generated. The acquisition command instructs the acquisition component to acquire the experimental result spectra output by each of the target detection devices.

4. The method according to claim 1, characterized in that, The step of using the target spectrum parsing script to parse the matched experimental result spectrum to obtain the raw data of the detection parameters includes: The target spectrum analysis script is used to extract valid data of the detection parameters from the matched experimental result spectrum and remove invalid data of the detection parameters. The valid data includes peak area and retention time. The valid data is converted according to a standard format to obtain the raw data of the detection parameters.

5. The method according to claim 2, characterized in that, The step of obtaining the target detection method corresponding to each of the target detection parameters from the mapping relationship, and performing multi-dimensional calculations on the matched original parameters according to the target detection method to obtain the water quality detection result includes: The target detection method corresponding to each target detection parameter is automatically retrieved from the mapping relationship by the intelligent computing component; For each target detection parameter, the initial concentration value of the detection parameter is obtained by calculating the original data using the concentration calculation formula in the target detection method, and the initial concentration value is rounded according to the rounding rule to obtain the rounded concentration value. The rounded concentration value is determined based on the detection limit, and the rounded concentration value whose detection limit determination result is less than the detection limit is marked as not detected; When the detection limit determination result is greater than the detection limit, the rounded concentration value is subjected to quality accounting to obtain the true concentration value, and the true concentration value is subjected to compliance determination based on the quality control limit to obtain the compliance determination result; The actual concentration value corresponding to each target detection parameter, the detection limit determination result, and the compliance determination result are used as the water quality detection result.

6. The method according to claim 5, characterized in that, When the detection limit determination result is greater than the detection limit, the rounded concentration value is subjected to quality verification to obtain the true concentration value, and the true concentration value is subjected to compliance determination to obtain the compliance determination result, including: When the detection limit determination result is greater than the detection limit, the relative deviation of the parallel samples corresponding to the target detection parameter is automatically calculated; When the relative deviation of the parallel samples is less than a preset threshold, the rounded concentration value is corrected and calculated using the blank sample concentration to obtain the corrected true concentration value. The compliance determination result is obtained by determining the actual concentration value based on the quality control limit, wherein the compliance determination result includes qualified or unqualified.

7. The method according to claim 6, characterized in that, After obtaining the water quality detection results by performing multi-dimensional calculations on the matched original parameters according to the target detection method, the method further includes: When the compliance determination result is qualified, the full process information of water quality testing is obtained, wherein the full process information includes calculation time, testing equipment identification, operator and testing method version; An audit trail log is generated based on the information from the entire water quality testing process, wherein the audit trail log is immutable and traceable.

8. The method according to claim 7, characterized in that, After obtaining the water quality detection results by performing multi-dimensional calculations on the matched original parameters according to the target detection method, the method further includes: Acquire comprehensive data and experimental conditions during the water quality testing process, wherein the comprehensive data includes sample information involved in the water quality testing, the raw data corresponding to each target testing parameter, the water quality testing results, and the audit trail log; The original record template is automatically matched according to the target detection parameters, and the full-dimensional data and experimental conditions are automatically filled into the corresponding positions in the original record template to obtain the detection original record. The original test records are subjected to integrity verification. When the integrity verification passes, the original test records are output, wherein the original test records meet the qualification assessment requirements.

9. A water quality testing device, characterized in that, The device includes: An automated rule base construction module is used to build an automated rule base for water quality testing. The automated rule base includes the mapping relationship between the detection method, detection equipment and spectrum analysis script corresponding to each detection parameter. The experimental result spectrum acquisition module is used to extract target detection parameters from the water quality testing task input by the user, determine the target detection device corresponding to each target detection parameter from the mapping relationship, and acquire the experimental result spectrum output by each target detection device; The experimental result spectrum analysis module is used to determine the target spectrum analysis script corresponding to each of the target detection devices from the mapping relationship, and use the target spectrum analysis script to analyze the matched experimental result spectrum to obtain the raw data of the detection parameters; The water quality test result acquisition module is used to obtain the target detection method corresponding to each of the target detection parameters from the mapping relationship, and to perform multi-dimensional calculations on the matched original parameters according to the target detection method to obtain the water quality test result.

10. An electronic device, characterized in that, The electronic device includes: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-8.

11. A storage medium for computer-executable instructions, wherein a computer program is stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-8.