Method, device and system for detecting salt content of water softener
By combining the quality heart -based algorithm and the KNN algorithm in the soft water machine, the TOF sensor data is used to solve the problem of inaccurate salt detection of the soft water machine, achieve higher detection accuracy and stability, and ensure the normal operation of the soft water equipment.
Patent Information
- Application Number
- CN202411421126.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-01-24
AI Technical Summary
The existing salt quantity detection methods of water softener are difficult to meet the actual needs when the salt particle sizes are different and the salt level surface is uneven, resulting in inaccurate salt quantity measurement data, affecting the operation and equipment life of the water softener.
Combined with the quality heart algorithm and the recent neighboring neighbor (KNN) algorithm, the measuring right diagram data and distance data of salt can be obtained through the TOF sensor to calculate the salt information information to improve the accuracy and stability of salt detection.
Through the combination of the mass -hearted algorithm and the KNN algorithm, the accuracy and stability of the salt amount detection of the soft water machine is improved, the normal operation of the soft water equipment is ensured, and the user's maintenance workload is reduced.
Smart Images

Figure CN119354300A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of water softeners, and in particular to a method, a device and a system for detecting the amount of salt in a water softener. Background Art
[0002] Water softeners are widely used in household and industrial water treatment systems. Their working principle is to soften water by consuming salt in a salt storage container. Household water softening equipment uses ion exchange technology to exchange the functional ions on the resin with calcium and magnesium ions in the water, thereby absorbing excess calcium and magnesium ions in the water to achieve the purpose of removing scale (such as calcium carbonate or magnesium carbonate).
[0003] In order to ensure the normal operation of the water softener, it is necessary to determine the amount of salt in the water softener. However, the existing water softener salt detection method is difficult to meet actual needs when faced with the situation of different salt particle sizes and uneven salt surface, and often produces inaccurate salt measurement data. This inaccuracy may cause the water softener to operate abnormally, affecting the softening effect and equipment life.
[0004] Therefore, it is particularly important to develop a technical solution that can improve the accuracy of salt detection. Summary of the invention
[0005] In view of the technical problems existing in the prior art, the present application provides a detection solution for the salt content of a water softener, which combines the centroid algorithm and the K-Nearest Neighbor (KNN) algorithm to improve the accuracy of measuring the salt content of a water softener.
[0006] According to a first aspect of the present application, a method for detecting the amount of salt in a water softener is provided, characterized in that it comprises:
[0007] Obtaining measurement histogram data and corresponding distance data of salt in the water softener through a TOF sensor of the water softener;
[0008] Calculating first salt level information in the water softener by a centroid algorithm according to the measured histogram data and the corresponding distance data;
[0009] Calculating second salt level information in the water softener by using a KNN algorithm according to the measured histogram data; and
[0010] The salt level information of the water softener is determined according to the first salt level information and the second salt level information.
[0011] According to a second aspect of the present application, a device for detecting the amount of salt in a water softener is provided, characterized in that it comprises:
[0012] An acquisition module, used for acquiring measurement histogram data and corresponding distance data of salt in the water softener through a TOF sensor of the water softener;
[0013] A centroid algorithm calculation module, used to calculate the first salt level information in the water softener by using a centroid algorithm according to the measured histogram data and the corresponding distance data;
[0014] A KNN algorithm calculation module, used to calculate the second salt level information in the water softener by using a KNN algorithm according to the measured histogram data; and
[0015] A determination module is used to determine the salt level information of the water softener according to the first salt level information and the second salt level information.
[0016] According to a third aspect of the present application, a system for detecting the amount of salt in a water softener is provided, characterized in that it comprises:
[0017] A TOF sensor for obtaining measurement histogram data of salt in the water softener and corresponding distance data; and
[0018] A data processor, configured to execute the method according to the first aspect.
[0019] According to a fourth aspect of the present application, there is provided an electronic device, including:
[0020] Processor; and
[0021] A memory storing computer instructions, which, when executed by the processor, causes the processor to execute the method described in the first aspect.
[0022] According to a fifth aspect of the present application, a non-transitory computer storage medium is provided, storing a computer program, which, when executed by multiple processors, enables the processors to execute the method described in the first aspect.
[0023] According to the detection method, detection device and detection system of the salt content of the water softener provided by the present application, the centroid algorithm is used to provide a preliminary estimate by analyzing the histogram data output by the TOF (Time-of-Flight) sensor, and the KNN algorithm is used for fine adjustment, and the results of the two algorithms are combined to improve the accuracy and stability of the salt content measurement. According to the scheme of the present application, while ensuring the accurate operation of the water softener, the maintenance workload of the user is reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without exceeding the scope of protection required by the present application.
[0025] Figure 1 is a schematic diagram of a detection system for the amount of salt in a water softener according to an embodiment of the present application.
[0026] Figure 2 It is a flow chart of a method for detecting the amount of salt in a water softener according to an embodiment of the present application.
[0027] Figure 3 is a schematic diagram of a device for detecting the amount of salt in a water softener according to an embodiment of the present application.
[0028] Figure 4 It is a structural diagram of an electronic device provided by this application. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0030] The inventive concept of the present application is as follows: ① Using the histogram data and corresponding distance data obtained by the TOF sensor, a preliminary salt level estimation is provided by calculating the centroid position; ② Using the samples in the historical data set, the nearest neighbor samples are selected by calculating the Euclidean distance, and the salt level is estimated in combination with the sample salt level and weight; ③ The weights of the centroid algorithm and the KNN algorithm are set, and the results of the two algorithms are combined by the weighted average method to improve the accuracy and stability of the salt level measurement; ④ The weights of the centroid algorithm and the KNN algorithm are adjusted according to the application scenario and experimental results, so that the comprehensive algorithm can maintain a high detection accuracy under different conditions.
[0031] Figure 1 Schematic diagram of a detection system for the amount of salt in a water softener according to an embodiment of the present application. Figure 1As shown, the system includes a TOF sensor and a data processor, wherein the distance measurement principle of the TOF sensor is to continuously send light pulses to the target, then receive the light returned from the object through the sensor, and obtain the distance of the target object by detecting the flight (round trip) time of the light pulse. In the present application, the TOF sensor obtains the distance data and corresponding histogram data of multiple positions on the surface of the salt by continuously sending light pulses to the salt in the salt storage container of the water softener. In this way, the TOF sensor is used to collect the measurement histogram data and corresponding distance data of the salt in the water softener, and the data processor is used to process the TOF sensor to obtain the salt level information in the water softener, thereby determining the salt content. Among them, the data processor includes various processors, devices or equipment that can process information, such as GPU (Graphics Processing Unit), CPU (Central Processing Unit), ARM (Advanced RISC Machine), etc.
[0032] According to one embodiment, the measurement histogram data of salt in the water softener collected by the TOF sensor and the corresponding distance data can be represented by H and d, respectively, where H = [h1, h2, ..., h n ],d=[d1,d2,…,d n ], n is a positive integer, where h i Indicates the corresponding distance data d i The number of, 1≤i≤n. The data processor calculates the centroid position of the histogram using a centroid algorithm based on the measured histogram data and the corresponding distance data, thereby estimating the salt level in the water softener.
[0033] According to a specific embodiment, it is assumed that the acquired histogram data H and the corresponding distance data d are:
[0034] H=[10,20,30,40,30,20,10],d=[1,2,3,4,5,6,7]
[0035] Calculate the weight W for the above H:
[0036]
[0037] W=10+20+30+40+30+20+10=160
[0038] Then, calculate the centroid position:
[0039]
[0040] Then, the centroid position of the histogram is 4.0, and the corresponding salt position information obtained by the centroid algorithm is also 4.0.
[0041] In this application, the salt level information obtained by the centroid algorithm is referred to as first salt level information.
[0042] According to another embodiment, the data processor calculates the centroid position of the histogram using a KNN algorithm based on the measured histogram data, thereby further estimating the salt level in the water softener.
[0043] Before executing the KNN algorithm, some historical data needs to be determined. These historical data include known salt levels and corresponding historical histogram data. Historical data is accurate data and is used to compare with the data collected by the TOF sensor.
[0044] Assuming that the histogram data collected by the TOF sensor is H = [10, 20, 30, 40, 30, 20, 10], in order to execute the KNN algorithm, the historical data used can have multiple samples. For example, four samples in the historical data are used, including historical histogram data H1, H2, H3, H4 and corresponding salt level information L1, L2, L3, L4, where:
[0045] H1=[9,19,29,39,29,19,9],L1=5
[0046] H2=[11,21,31,41,31,21,11],L1=6
[0047] H3=[9,25,29,39,23,19,9],L1=5.5
[0048] H4=[11,21,22,39,25,19,9],L1=6.5
[0049] Then, the Euclidean distances between the histogram data H measured by the TOF sensor and the historical histogram data H1, H2, H3, and H4 are calculated respectively, which are called the first Euclidean distances:
[0050]
[0051] The above embodiment only uses four samples to illustrate the KNN algorithm. It can be understood that any other number of samples can also be used to execute the KNN algorithm, and this application does not list them one by one.
[0052] Next, a preset number of historical histogram data with the smallest Euclidean distance is determined from the first Euclidean distance, wherein the preset number can be set based on actual needs, experience, or experimental results.
[0053] According to a specific embodiment, assuming that the preset number is 2, in the above embodiment, the Euclidean distances d1 and d2 are two minimum Euclidean distances, referred to as second Euclidean distances.
[0054] Then, a preset number of second weights are determined according to the preset number of second Euclidean distances: Among them, ω j represents the second weight, d j Represents the second Euclidean distance.
[0055] According to the above specific embodiment, the second weight is calculated according to the two smallest Euclidean distances d1 and d2:
[0056]
[0057] Finally, according to the preset number of second weights and their corresponding salt level information, the salt level information of this measurement is calculated:
[0058]
[0059] In this application, the salt level information obtained by the KNN algorithm is referred to as the second salt level information.
[0060] After obtaining the first salt level information through the centroid algorithm and the second salt level information through the KNN algorithm, the two pieces of information are integrated to determine the salt level information of the water softener.
[0061] According to some specific embodiments, the weights of the centroid algorithm result and the KNN algorithm result can be set respectively. For example, the weights of the centroid algorithm result and the KNN algorithm result are ω centroid and ω KNN , both satisfy:
[0062] ω centroid +ω KNN =1
[0063] According to one embodiment, the two weights can be adjusted according to the application scenario and experimental results. For example, ω centroid =0.5,ω KNN =0.5. The first salt level information and the second salt level information are weighted according to the specific gravity to determine the salt level information of the water softener. According to the above embodiment, the comprehensive salt level information of the water softener is:
[0064] Comprehensive salt level = ω centroid ·d centroid +ω KNN Estimated Level
[0065] Comprehensive salt level = 0.5·4.0+0.5·5.5=4.75
[0066] In this way, by analyzing the histogram data output by the TOF sensor, using the centroid algorithm to provide a preliminary estimate, and fine-tuning through the KNN algorithm, the estimated salt level information of the two is integrated to determine a comprehensive salt level information as the salt level information of the water softener.
[0067] After the salt level information of the water softener is obtained, the salt level information can be displayed through a display device, so as to be used to know the current salt content.
[0068] Based on the above system, according to one aspect of the present application, a method for detecting the salt content of a water softener is provided. Figure 2 Flow chart of the method for detecting the amount of salt in a water softener according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:
[0069] Step S201, obtaining measurement histogram data and corresponding distance data of salt in the water softener through the TOF sensor of the water softener;
[0070] Step S202, calculating first salt level information in the water softener by a centroid algorithm according to the measured histogram data and the corresponding distance data;
[0071] Step S203, calculating the second salt level information in the water softener by using a KNN algorithm according to the measured histogram data; and
[0072] Step S204: determining the salt level information of the water softener according to the first salt level information and the second salt level information.
[0073] According to one embodiment, a detection system for the amount of salt in a water softener includes a TOF sensor and a data processor. The TOF sensor is used to collect and obtain the measurement histogram data and corresponding distance data of the salt in the water softener, which can be represented by H and d respectively, where H = [h1, h2, ..., h n ],d=[d1,d2,…,d n ], n is a positive integer. The data processor uses a centroid algorithm to calculate the centroid position of the histogram according to the measured histogram data and the corresponding distance data, thereby estimating the salt level in the water softener. The salt level information obtained by the centroid algorithm is referred to as the first salt level information.
[0074] Thus, according to an optional embodiment, step S202 may specifically include:
[0075] determining a first weight according to the measured histogram data; and
[0076] The first salt level information is determined according to the first weight, the measurement histogram data and the corresponding distance data.
[0077] According to another embodiment, the data processor calculates the centroid position of the histogram using a KNN algorithm based on the measured histogram data, thereby further estimating the salt level in the water softener.
[0078] Before executing the KNN algorithm, some historical data needs to be determined. These historical data include known salt levels and corresponding historical histogram data. Historical data is accurate data and is used to compare with the data collected by the TOF sensor.
[0079] Then, the Euclidean distance between the histogram data measured by the TOF sensor and the historical histogram data is calculated respectively, which is called the first Euclidean distance. Next, a preset number of historical histogram data with the smallest Euclidean distance is determined from the above-mentioned first Euclidean distance, wherein the preset number can be set according to actual needs, can be set based on experience, or can be set based on experimental results. Then, a preset number of second weights is determined based on the preset number of second Euclidean distances. Finally, the salt level information measured this time is calculated based on the preset number of second weights and their respective corresponding salt level information, which is called the second salt level information.
[0080] Thus, according to an optional embodiment, step S203 may specifically include:
[0081] Obtain multiple historical histogram data and their corresponding salt level information;
[0082] respectively calculating first Euclidean distances between the measured histogram data and the plurality of historical histogram data;
[0083] Determine a preset number of second Euclidean distances with the smallest values from among the first Euclidean distances;
[0084] Determining the preset number of second weights according to the preset number of second Euclidean distances; and
[0085] The second salt level information is calculated according to the preset number of second weights and their respective corresponding salt level information.
[0086] After obtaining the first salt level information through the centroid algorithm and the second salt level information through the KNN algorithm, the two pieces of information are integrated to determine the salt level information of the water softener. According to some specific embodiments, the weights of the centroid algorithm result and the KNN algorithm result can be set respectively. For example, the weights of the centroid algorithm result and the KNN algorithm result are ω centroid and ω KNN , both satisfy:
[0087] ω centroid +ω KNN =1
[0088] According to an embodiment, the two proportions may be adjusted according to the application scenario and the experimental results. Finally, the first salt level information and the second salt level information are weightedly calculated according to the proportions to determine the salt level information of the water softener.
[0089] Thus, according to an optional embodiment, step S204 may specifically include:
[0090] determining specific gravities corresponding to the first salt level information and the second salt level information respectively; and
[0091] The first salt level information and the second salt level information are weightedly calculated according to the specific gravity to determine the salt level information of the water softener.
[0092] Based on the above system, according to another aspect of the present application, a device for detecting the salt content of a water softener is provided. Figure 3 Schematic diagram of a device for detecting the amount of salt in a water softener according to an embodiment of the present application. Figure 3 As shown, the device includes an acquisition module 301, a centroid algorithm calculation module 302, a KNN algorithm calculation module 303 and a determination module 304. The acquisition module 301 is used to obtain the measured histogram data and corresponding distance data of the salt in the water softener through the TOF sensor of the water softener; the centroid algorithm calculation module 302 is used to calculate the first salt level information in the water softener through the centroid algorithm according to the measured histogram data and the corresponding distance data; the KNN algorithm calculation module 303 is used to calculate the second salt level information in the water softener through the KNN algorithm according to the measured histogram data; the determination module 304 is used to determine the salt level information of the water softener according to the first salt level information and the second salt level information.
[0093] According to an optional embodiment, the centroid algorithm calculation module 302 may be specifically used for:
[0094] determining a first weight according to the measured histogram data; and
[0095] The first salt level information is determined according to the first weight, the measurement histogram data and the corresponding distance data.
[0096] According to an optional embodiment, the KNN algorithm calculation module 303 may be specifically used for:
[0097] Obtain multiple historical histogram data and their corresponding salt level information;
[0098] respectively calculating first Euclidean distances between the measured histogram data and the plurality of historical histogram data;
[0099] Determine a preset number of second Euclidean distances with the smallest values from among the first Euclidean distances;
[0100] Determining the preset number of second weights according to the preset number of second Euclidean distances; and
[0101] The second salt level information is calculated according to the preset number of second weights and their respective corresponding salt level information.
[0102] According to an optional embodiment, the determination module 304 may be specifically configured to:
[0103] determining specific gravities corresponding to the first salt level information and the second salt level information respectively; and
[0104] The first salt level information and the second salt level information are weightedly calculated according to the specific gravity to determine the salt level information of the water softener.
[0105] According to the detection method, detection device and detection system of the salt content of the water softener provided by the present application, the centroid algorithm is used to provide a preliminary estimate by analyzing the histogram data output by the TOF (Time-of-Flight) sensor, and the KNN algorithm is used for fine adjustment, and the results of the two algorithms are combined to improve the accuracy and stability of the salt content measurement. According to the scheme of the present application, while ensuring the accurate operation of the water softener, the maintenance workload of the user is reduced.
[0106] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0107] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0108] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the device or unit can be electrical connection or other forms.
[0109] See also Figure 4 , Figure 4 An electronic device is provided, comprising a processor and a memory. The memory stores computer instructions, and when the computer instructions are executed by the processor, the processor executes the computer instructions to achieve the following Figure 2 The method and refinement scheme shown.
[0110] It should be understood that the above device embodiments are only illustrative, and the device disclosed in the present invention can also be implemented in other ways. For example, the division of units / modules described in the above embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.
[0111] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present invention may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.
[0112] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. If not otherwise specified, the processor or chip may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. If not otherwise specified, the on-chip cache, the off-chip memory, and the memory may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc.
[0113] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer electronic device (which can be a personal computer, a server or a network electronic device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.
[0114] The present application also provides a non-transitory computer storage medium storing a computer program. When the computer program is executed by a plurality of processors, the processors execute the following Figure 2 The method and refinement scheme shown.
[0115] The embodiments of the present application are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. At the same time, changes or deformations made by those skilled in the art based on the ideas of the present application, the specific implementation methods and the scope of application of the present application, all belong to the scope of protection of the present application. In summary, the content of this specification should not be construed as a limitation on the present application.
Claims
1. A method for detecting the amount of salt in a water softener, characterized in that: include: Obtaining measurement histogram data and corresponding distance data of salt in the water softener through a TOF sensor of the water softener; Calculating first salt level information in the water softener by a centroid algorithm according to the measured histogram data and the corresponding distance data; Calculating second salt level information in the water softener by using a KNN algorithm according to the measured histogram data; as well as The salt level information of the water softener is determined according to the first salt level information and the second salt level information.
2. The method according to claim 1, characterized in that The step of calculating the first salt level information in the water softener by a centroid algorithm according to the measured histogram data and the corresponding distance data includes: determining a first weight according to the measured histogram data; and The first salt level information is determined according to the first weight, the measurement histogram data and the corresponding distance data.
3. The method according to claim 1, characterized in that The step of calculating the second salt level information in the water softener by using a KNN algorithm according to the measured histogram data includes: Obtain multiple historical histogram data and their corresponding salt level information; respectively calculating first Euclidean distances between the measured histogram data and the plurality of historical histogram data; Determine a preset number of second Euclidean distances with the smallest values from among the first Euclidean distances; Determining the preset number of second weights according to the preset number of second Euclidean distances; and The second salt level information is calculated according to the preset number of second weights and their respective corresponding salt level information.
4. The method according to any one of claims 1 to 3, characterized in that The determining the salt level information of the water softener according to the first salt level information and the second salt level information includes: determining specific gravities corresponding to the first salt level information and the second salt level information respectively; and The first salt level information and the second salt level information are weightedly calculated according to the specific gravity to determine the salt level information of the water softener.
5. A device for detecting the amount of salt in a water softener, characterized in that: include: An acquisition module, used for acquiring measurement histogram data and corresponding distance data of salt in the water softener through a TOF sensor of the water softener; A centroid algorithm calculation module, used to calculate the first salt level information in the water softener by using a centroid algorithm according to the measured histogram data and the corresponding distance data; A KNN algorithm calculation module, used to calculate the second salt level information in the water softener by using a KNN algorithm according to the measured histogram data; as well as A determination module is used to determine the salt level information of the water softener according to the first salt level information and the second salt level information.
6. The device according to claim 5, characterized in that The centroid algorithm calculation module is used for: determining a first weight according to the measured histogram data; and The first salt level information is determined according to the first weight, the measurement histogram data and the corresponding distance data.
7. The device according to claim 5, characterized in that The KNN algorithm calculation module is used for: Obtain multiple historical histogram data and their corresponding salt level information; respectively calculating first Euclidean distances between the measured histogram data and the plurality of historical histogram data; Determine a preset number of second Euclidean distances with the smallest values from among the first Euclidean distances; Determining the preset number of second weights according to the preset number of second Euclidean distances; as well as The second salt level information is calculated according to the preset number of second weights and their respective corresponding salt level information.
8. The device according to any one of claims 5 to 7, characterized in that The determination module is used for: determining specific gravities corresponding to the first salt level information and the second salt level information respectively; and The first salt level information and the second salt level information are weightedly calculated according to the specific gravity to determine the salt level information of the water softener.
9. A water softener salt detection system, characterized in that: include: A TOF sensor for obtaining measurement histogram data of salt in the water softener and corresponding distance data; as well as A data processor, configured to execute the method according to any one of claims 1 to 4.
10. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the method according to any one of claims 1 to 4 when executing the computer program in the memory.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.