Flow Detection Method, Device, Electronic Device and Storage Medium

By reading the target flow data of the flow sensor and adjusting the pulse equivalent and pulse width, the problem of poor flexibility of the flow sensor is solved, and the flexible adjustment and adaptability of the flow sensor is achieved.

CN118293990BActive Publication Date: 2025-07-25HANGZHOU ZHONGPEI ELECTRONICS
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410435614.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-11
Publication Date
2025-07-25
Estimated Expiration
2044-04-11

AI Technical Summary

Technical Problem

The flexibility of existing flow sensors is poor, resulting in problems such as greater power consumption or poor real-time performance.

Method used

By reading the target flow data of the flow sensor when receiving the target pulse signal, and determining whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor based on the target flow data and the current pulse equivalent, and determining the target pulse equivalent and pulse width for flexible adjustment.

Benefits of technology

The pulse equivalent and pulse width of the flow sensor are flexible to adjust, avoiding the problems of large power consumption or poor real-time performance, and ensuring the flexibility and adaptability of the flow sensor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118293990B_ABST
    Figure CN118293990B_ABST
Patent Text Reader

Abstract

The present application provides a flow detection method, device, electronic device and storage medium, relating to the field of electronic technologies. The method includes: when a target pulse signal is received, reading target flow data of a flow sensor; judging whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor according to the target flow data and the current pulse equivalent, where the pulse equivalent is used to represent the change value of the detected liquid flow corresponding to each output pulse signal of the flow sensor; when it is judged that adjustment is needed, determining a target pulse equivalent and a target pulse width, and instructing the flow sensor to detect the liquid flow according to the target pulse equivalent and the target pulse width. Implementing the technical solution provided by the present application solves the technical problem of poor flexibility of the flow sensor in the related art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic technologies, and particularly to a flow detection method, apparatus, electronic device, and storage medium. Background Art

[0002] A flow sensor is a device used to measure the flow rate of a fluid (liquid or gas), which can convert the flow rate of the fluid into an electrical signal for output. Such sensors are widely used in multiple fields, such as industrial automation, environmental monitoring, the energy industry, etc. Taking the flow sensor in a water meter as an example, it is mainly used to measure the flow rate of water, and it can help users monitor the flow rate of the liquid in the pipeline in real time. There are various types of water meter flow sensors, such as mechanical water meter flow sensors and ultrasonic water meter flow sensors. However, the flow sensors in the related art generally only have pulse outputs, and both the pulse output pulse width and the pulse equivalent are fixed and unchangeable, which easily causes problems such as relatively high power consumption or poor real-time performance. For example, if the pulse equivalent is 0.01 L, then when the instantaneous flow rate is 10 L / h, there will be a pulse output approximately every 3.6 s. When the flow rate approaches 5000 L / h, there are 138 pulses per second. For some collectors, the pulse frequency is too high and the power consumption is difficult to control; if the pulse equivalent is set to 1 L, then when the instantaneous flow rate is 10 L / h, there is a pulse output only every 360 s. Obviously, the data update rate cannot meet the design requirements of users. It can be seen that the flow sensors in the related art have the problem of poor flexibility.

[0003] Regarding the technical problem of poor flexibility of the flow sensor in the related art, no effective solution has been proposed yet. Summary of the Invention

[0004] This application provides a flow detection method, apparatus, electronic device, and storage medium to at least solve the technical problem of poor flexibility of the flow sensor in the related art.

[0005] In a first aspect, this application provides a flow detection method, including: when receiving a target pulse signal, reading target flow data of a flow sensor, where the target pulse signal is output when the flow sensor detects the liquid flow rate according to the current pulse equivalent, and the target flow data is the data obtained by the flow sensor detecting the liquid flow rate; judging whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor according to the target flow data and the current pulse equivalent, where the pulse equivalent is used to represent the change value of the detected liquid flow rate corresponding to each pulse signal output by the flow sensor, and the pulse width is used to represent the width of the pulse signal; when it is judged that adjustment is required, determining a target pulse equivalent and a target pulse width, and instructing the flow sensor to detect the liquid flow rate according to the target pulse equivalent and the target pulse width.

[0006] By adopting the above technical solution, when the target pulse signal output by the flow sensor during flow detection is received, the target flow data of the flow sensor is read, and then it is judged whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor according to the target flow data and the current pulse equivalent. When it is judged that adjustment is needed, the target pulse equivalent and target pulse width are determined, and the flow sensor is instructed to detect the liquid flow according to the target pulse equivalent and target pulse width. That is, it is judged whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor according to the currently read target flow data and the current pulse equivalent, and when adjustment is needed, the target pulse equivalent and target pulse width are determined, avoiding the problem of poor flexibility of the flow sensor in the related art and achieving the purpose of flexibly adjusting the pulse equivalent and pulse width of the flow sensor.

[0007] Optionally, judging whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor according to the target flow data and the current pulse equivalent includes one of the following: when it is determined that the target flow data is less than or equal to the preset first flow threshold and the current pulse equivalent is not equal to the preset first pulse equivalent, it is judged that it is necessary to adjust the pulse equivalent and pulse width of the flow sensor; when it is determined that the target flow data is greater than the preset first flow threshold, less than the preset second flow threshold, and the current pulse equivalent is not equal to the preset second pulse equivalent, it is judged that it is necessary to adjust the pulse equivalent and pulse width of the flow sensor; when it is determined that the target flow data is greater than or equal to the preset second flow threshold and the current pulse equivalent is not equal to the preset third pulse equivalent, it is judged that it is necessary to adjust the pulse equivalent and pulse width of the flow sensor.

[0008] By adopting the above technical solution, when any of the following situations is satisfied, it can be judged that it is necessary to adjust the pulse equivalent and pulse width of the flow sensor: when it is determined that the target flow data is less than or equal to the preset first flow threshold and the current pulse equivalent is not equal to the preset first pulse equivalent; or, when it is determined that the target flow data is greater than the preset first flow threshold, less than the preset second flow threshold, and the current pulse equivalent is not equal to the preset second pulse equivalent; or, when it is determined that the target flow data is greater than or equal to the preset second flow threshold and the current pulse equivalent is not equal to the preset third pulse equivalent. Through this technical solution, the purpose of judging whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor is achieved.

[0009] Optionally, when it is determined that adjustment is required, a target pulse equivalent and a target pulse width are determined, including one of the following: when it is determined that the target flow data is less than or equal to a preset first flow threshold and the current pulse equivalent is not equal to the preset first pulse equivalent, the preset first pulse equivalent is determined as the target pulse equivalent, and the preset first pulse width is determined as the target pulse width; when it is determined that the target flow data is greater than the preset first flow threshold, less than the preset second flow threshold, and the current pulse equivalent is not equal to the preset second pulse equivalent, the preset second pulse equivalent is determined as the target pulse equivalent, and the preset second pulse width is determined as the target pulse width; when it is determined that the target flow data is greater than or equal to the preset second flow threshold and the current pulse equivalent is not equal to the preset third pulse equivalent, the preset third pulse equivalent is determined as the target pulse equivalent, and the preset third pulse width is determined as the target pulse width.

[0010] By adopting the above technical solution, when it is determined that the target flow data is less than or equal to the preset first flow threshold and the current pulse equivalent is not equal to the preset first pulse equivalent, the preset first pulse equivalent is determined as the target pulse equivalent, and the preset first pulse width is determined as the target pulse width; when it is determined that the target flow data is greater than the preset first flow threshold, less than the preset second flow threshold, and the current pulse equivalent is not equal to the preset second pulse equivalent, the preset second pulse equivalent is determined as the target pulse equivalent, and the preset second pulse width is determined as the target pulse width; when it is determined that the target flow data is greater than or equal to the preset second flow threshold and the current pulse equivalent is not equal to the preset third pulse equivalent, the preset third pulse equivalent is determined as the target pulse equivalent, and the preset third pulse width is determined as the target pulse width. The purpose of flexibly adjusting the pulse equivalent and pulse width parameters of the flow sensor according to different ranges to which the target flow data belongs is achieved, so as to match the target flow data.

[0011] Optionally, it is determined whether to adjust the pulse equivalent and pulse width of the flow sensor according to the target flow data and the current pulse equivalent, including: comparing the target flow data with the flow intervals in the target relationship table, and comparing the current pulse equivalent with the preset pulse equivalents in the target relationship table to obtain a comparison result, where the target relationship table records the corresponding relationships between the flow intervals and the preset pulse equivalents and preset pulse widths; judging whether to adjust the pulse equivalent and pulse width of the flow sensor according to the comparison result.

[0012] By adopting the above technical solution, the target flow data is compared with the flow ranges in the target relation table, and the current pulse equivalent is compared with the preset pulse equivalent in the target relation table to obtain a comparison result. Then, based on the comparison result, it is determined whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor. Among them, the target relation table records the corresponding relationships between the flow ranges and the preset pulse equivalent and preset pulse width, that is, the target relation table has already recorded the corresponding relationships between the pulse equivalent and pulse width matched by different flow ranges. When the target flow data of the current flow sensor is read, if it does not match the current pulse equivalent, it is necessary to adjust the pulse equivalent and pulse width of the flow sensor. This avoids the problem in the related art that regardless of whether the instantaneous flow rate or velocity of the liquid changes, the pulse equivalent and pulse width of the flow sensor are fixed, resulting in relatively high power consumption or poor real-time performance.

[0013] Optionally, determining whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor according to the comparison result includes: when the comparison result indicates that the target flow data belongs to the target flow range and the current pulse equivalent is not equal to the target preset equivalent, it is determined that it is necessary to adjust the pulse equivalent and pulse width of the flow sensor. Among them, the target relation table records the corresponding relationships between the target flow range and the target preset equivalent and target preset pulse width.

[0014] By adopting the above technical solution, when the comparison result indicates that the target flow data belongs to the target flow range and the current pulse equivalent is not equal to the target preset equivalent, it is determined that it is necessary to adjust the pulse equivalent and pulse width of the flow sensor. Among them, the target flow range, the target preset equivalent, and the target preset pulse width are one set of relationships recorded in the target relation table. By comparing with the target relation table, the purpose of determining whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor is achieved.

[0015] Optionally, when it is determined that adjustment is required, determining the target pulse equivalent and target pulse width includes: determining the target preset equivalent as the target pulse equivalent and determining the target preset pulse width as the target pulse width.

[0016] By adopting the above technical solution, according to the target flow range to which the target flow data belongs, the pulse equivalent of the flow sensor is adjusted to the target preset equivalent that matches it, and the pulse width of the flow sensor is adjusted to the target preset pulse width that matches it. The purpose of timely adjusting the parameters of the flow sensor is achieved.

[0017] Optionally, the target flow data includes one of the following: cumulative flow data; instantaneous flow data.

[0018] By adopting the above technical solution, the target flow data can be cumulative flow data or instantaneous flow data.

[0019] In a second aspect of the present application, a flow detection device is further provided, including: a reading module, configured to read target flow data of a flow sensor when receiving a target pulse signal, where the target pulse signal is output when the flow sensor detects the liquid flow according to the current pulse equivalent, and the target flow data is the data obtained by the flow sensor detecting the liquid flow; a judgment module, configured to judge whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor according to the target flow data and the current pulse equivalent, where the pulse equivalent is used to represent the change value of the detected liquid flow corresponding to each pulse signal output by the flow sensor, and the pulse width is used to represent the width of the pulse signal; a processing module, configured to determine the target pulse equivalent and the target pulse width when it is judged that adjustment is needed, and instruct the flow sensor to detect the liquid flow according to the target pulse equivalent and the target pulse width.

[0020] In a third aspect of the present application, an electronic device is further provided, including a memory and a processor, where a computer program is stored on the memory, and when the processor executes the program, the method steps of any one of the above are implemented.

[0021] In a fourth aspect of the present application, a computer-readable storage medium is further provided, where the computer-readable storage medium stores instructions, and when the instructions are executed, the method steps of any one of the above are executed.

[0022] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:

[0023] 1. Judging whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor according to the currently read target flow data and the current pulse equivalent, and determining the target pulse equivalent and the target pulse width when adjustment is needed, avoiding the problem of poor flexibility of the flow sensor in the related art, and achieving the purpose of flexibly adjusting the pulse equivalent and pulse width of the flow sensor.

[0024] 2. Achieving the purpose of flexibly adjusting the pulse equivalent and pulse width parameters of the flow sensor according to different ranges to which the target flow data belongs, so as to match the target flow data. Description of the Drawings

[0025] Figure 1 is a flowchart of a flow detection method provided by an embodiment of the present application;

[0026] Figure 2 is a framework diagram of a flow detection system provided by an embodiment of the present application;

[0027] Figure 3 is a structural block diagram of a flow detection device provided by an embodiment of the present application;

[0028] Figure 4 It is a schematic structural diagram of an electronic device disclosed in an embodiment of the present application.

[0029] Explanation of reference numerals: 400 - electronic device; 401 - processor; 402 - communication bus; 403 - user interface; 404 - network interface; 405 - memory. Specific embodiments

[0030] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.

[0031] In the description of the embodiments of the present application, words such as "for example" or "for illustration" are used to represent examples, illustrations or explanations. Any embodiment or design solution described as "for example" or "for illustration" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly speaking, using words such as "for example" or "for illustration" aims to present relevant concepts in a specific way.

[0032] In the description of the embodiments of the present application, the meaning of the term "plurality" refers to two or more. For example, a plurality of systems refers to two or more systems, and a plurality of screen terminals refers to two or more screen terminals. In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the technical features indicated. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. The terms "include", "comprise", "have" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0033] The present application provides a flow detection method, referring to Figure 1 , Figure 1 is a flowchart of a flow detection method provided by an embodiment of the present application, including the following steps:

[0034] Step S101, when receiving a target pulse signal, read the target flow data of the flow sensor, where the target pulse signal is output when the flow sensor detects the liquid flow according to the current pulse equivalent, and the target flow data is the data obtained by the flow sensor detecting the liquid flow;

[0035] Step S102: Determine whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor according to the target flow data and the current pulse equivalent. Here, the pulse equivalent is used to represent the change value of the detected liquid flow corresponding to each pulse signal output by the flow sensor, and the pulse width is used to represent the width of the pulse signal.

[0036] Step S103: When it is determined that adjustment is required, determine the target pulse equivalent and target pulse width, and instruct the flow sensor to detect the liquid flow according to the target pulse equivalent and target pulse width.

[0037] Among them, the execution entity of the above steps can be a controller, or a collector, or an MCU, or a chip in the controller, but not limited thereto.

[0038] In the above embodiment, taking the collector executing the above operations as an example, as Figure 2 shown, Figure 2 FIG. is a framework diagram of a flow detection system provided by an embodiment of the present application. When the collector receives the target pulse signal output by the flow sensor during flow detection, it reads the target flow data of the flow sensor. The flow sensor detects the flow according to the current pulse equivalent. For example, if the current pulse equivalent is 0.1 L (or 0.1 L / P, where P represents a pulse), the flow sensor will output a pulse signal every time it detects 0.1 L of flow. The flow sensor can obtain the target flow data. For example, it can be calculated according to its own working parameters. The target flow data can be instantaneous flow, or cumulative flow, or other flow data. The collector then determines whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor according to the target flow data and the current pulse equivalent. When it is determined that adjustment is required, the target pulse equivalent and target pulse width are determined, and the flow sensor is instructed to detect the liquid flow according to the target pulse equivalent and target pulse width. When the target flow data does not match the current pulse equivalent, it is necessary to adjust the pulse equivalent and pulse width of the flow sensor. For example, for different target flow data, the corresponding pulse equivalent and pulse width can be preset in advance. When a large change in the target flow data is detected, the pulse equivalent and pulse width can be adjusted to values matching the changed target flow data. That is, it is determined whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor according to the currently read target flow data and the current pulse equivalent, and when adjustment is required, the target pulse equivalent and target pulse width are determined. In the related art, regardless of whether the liquid instantaneous flow or flow velocity changes, the pulse equivalent and pulse width of the flow sensor remain unchanged. Therefore, the embodiment of the present application avoids the problem of poor flexibility of the flow sensor in the related art and achieves the purpose of flexibly adjusting the pulse equivalent and pulse width of the flow sensor.

[0039] In an optional embodiment, determining whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor according to the target flow data and the current pulse equivalent includes one of the following: when it is determined that the target flow data is less than or equal to a preset first flow threshold and the current pulse equivalent is not equal to the preset first pulse equivalent, it is determined that it is necessary to adjust the pulse equivalent and pulse width of the flow sensor; when it is determined that the target flow data is greater than the preset first flow threshold, less than the preset second flow threshold, and the current pulse equivalent is not equal to the preset second pulse equivalent, it is determined that it is necessary to adjust the pulse equivalent and pulse width of the flow sensor; when it is determined that the target flow data is greater than or equal to the preset second flow threshold and the current pulse equivalent is not equal to the preset third pulse equivalent, it is determined that it is necessary to adjust the pulse equivalent and pulse width of the flow sensor.

[0040] In the above embodiments, when any of the following situations is satisfied, it can be determined that the pulse equivalent and pulse width of the flow sensor need to be adjusted: When it is determined that the target flow data is less than or equal to the preset first flow threshold and the current pulse equivalent is not equal to the preset first pulse equivalent. Taking the target flow data as the instantaneous flow as an example, for instance, the preset first flow threshold is 100 L / h (or other value), and the corresponding preset first pulse equivalent is 0.01 L / P. Suppose the pulse equivalent initially set by the flow sensor (i.e., the above current pulse equivalent) is 0.1 L / P, and the initial instantaneous flow is 200 L / h. As the instantaneous flow of the liquid changes, when the instantaneous flow is less than 100 L / h and the current pulse equivalent is not equal to the above preset first pulse equivalent, at this time, the pulse equivalent and pulse width need to be adjusted; or, when it is determined that the target flow data is greater than the preset first flow threshold, less than the preset second flow threshold, and the current pulse equivalent is not equal to the preset second pulse equivalent. For example, the preset second flow threshold is 1000 L / h (or other value), and the corresponding preset second pulse equivalent is 0.1 L / P. Suppose the pulse equivalent initially set by the flow sensor (i.e., the above current pulse equivalent) is 0.01 L / P, and the initial instantaneous flow is 80 L / h. As the instantaneous flow of the liquid changes, when the instantaneous flow is 400 L / h (greater than the preset first flow threshold and less than the preset second flow threshold) and the current pulse equivalent is not equal to the above preset second pulse equivalent, at this time, the pulse equivalent and pulse width need to be adjusted; or, when it is determined that the target flow data is greater than or equal to the preset second flow threshold and the current pulse equivalent is not equal to the preset third pulse equivalent. Through this embodiment, the purpose of determining whether to adjust the pulse equivalent and pulse width of the flow sensor is achieved. It should be noted that when the above conditions are not met, there is no need to adjust the pulse equivalent and pulse width of the flow sensor. For example, when it is determined that the target flow data is less than or equal to the preset first flow threshold and the current pulse equivalent is equal to the preset first pulse equivalent, there is no need to adjust; similarly, when it is determined that the target flow data is greater than the preset first flow threshold, less than the preset second flow threshold, and the current pulse equivalent is equal to the preset second pulse equivalent, there is no need to adjust; and when it is determined that the target flow data is greater than or equal to the preset second flow threshold and the current pulse equivalent is equal to the preset third pulse equivalent, there is no need to adjust.

[0041] In an alternative embodiment, when it is determined that adjustment is needed, the target pulse equivalent and the target pulse width are determined, including one of the following: when it is determined that the target flow data is less than or equal to a preset first flow threshold and the current pulse equivalent is not equal to the preset first pulse equivalent, the preset first pulse equivalent is determined as the target pulse equivalent, and the preset first pulse width is determined as the target pulse width; when it is determined that the target flow data is greater than the preset first flow threshold, less than the preset second flow threshold, and the current pulse equivalent is not equal to the preset second pulse equivalent, the preset second pulse equivalent is determined as the target pulse equivalent, and the preset second pulse width is determined as the target pulse width; when it is determined that the target flow data is greater than or equal to the preset second flow threshold and the current pulse equivalent is not equal to the preset third pulse equivalent, the preset third pulse equivalent is determined as the target pulse equivalent, and the preset third pulse width is determined as the target pulse width.

[0042] In the above embodiment, when it is determined that the target flow data is less than or equal to the preset first flow threshold and the current pulse equivalent is not equal to the preset first pulse equivalent, the preset first pulse equivalent is determined as the target pulse equivalent, and the preset first pulse width is determined as the target pulse width; when it is determined that the target flow data is greater than the preset first flow threshold, less than the preset second flow threshold, and the current pulse equivalent is not equal to the preset second pulse equivalent, the preset second pulse equivalent is determined as the target pulse equivalent, and the preset second pulse width is determined as the target pulse width; when it is determined that the target flow data is greater than or equal to the preset second flow threshold and the current pulse equivalent is not equal to the preset third pulse equivalent, the preset third pulse equivalent is determined as the target pulse equivalent, and the preset third pulse width is determined as the target pulse width. To balance power consumption and real-time performance, for different ranges to which the target flow data (such as instantaneous flow) belongs, pulse equivalent parameters and pulse width parameters matching thereto can be preset in advance. It is realized to flexibly adjust the pulse equivalent and pulse width parameters of the flow sensor according to different ranges to which the target flow data belongs, so as to match the target flow data.

[0043] In an alternative embodiment, it is judged whether the pulse equivalent and pulse width of the flow sensor need to be adjusted according to the target flow data and the current pulse equivalent, including: comparing the target flow data with the flow intervals in the target relationship table, and comparing the current pulse equivalent with the preset pulse equivalent in the target relationship table to obtain a comparison result, wherein the corresponding relationship between the flow intervals and the preset pulse equivalent and the preset pulse width is recorded in the target relationship table; judging whether the pulse equivalent and pulse width of the flow sensor need to be adjusted according to the comparison result.

[0044] In the above embodiments, the target flow data is compared with the flow ranges in the target relation table, and the current pulse equivalent is compared with the preset pulse equivalent in the target relation table to obtain a comparison result. Then, it is determined whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor according to the comparison result. Among them, the target relation table records the corresponding relationships between the flow ranges and the preset pulse equivalent and preset pulse width, that is, the target relation table has already recorded the corresponding relationships between the pulse equivalent and pulse width matched by different flow ranges. For example, the target relation table is shown in Table 1. Table 1 only takes three gears as an example, and more gears can also be set. In addition, the demarcation values (such as 100, 1000, etc.) of different instantaneous flow ranges in the table are only one example and can be set according to needs. Of course, the pulse equivalent and pulse width parameters corresponding to each instantaneous flow range can also be set according to needs. When the target flow data of the current flow sensor is read, if it does not match the current pulse equivalent, it is necessary to adjust the pulse equivalent and pulse width of the flow sensor. This avoids the problem in the related art that regardless of whether the liquid instantaneous flow rate or flow velocity changes, the pulse equivalent and pulse width of the flow sensor are fixed, resulting in relatively large power consumption or poor real-time performance.

[0045] Table 1

[0046] Instantaneous flow rate range (L / h) Pulse equivalent (L / P) Pulse width (ms) [0,100] 0.01 1.5 (100,1000) 0.1 5 [1000,10000) 1 15

[0047] In an alternative embodiment, determining whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor according to the comparison result includes: when the comparison result indicates that the target flow data belongs to the target flow range and the current pulse equivalent is not equal to the target preset equivalent, it is determined that it is necessary to adjust the pulse equivalent and pulse width of the flow sensor. Among them, the target relation table records the corresponding relationships between the target flow range and the target preset equivalent and target preset pulse width.

[0048] In the above embodiments, when the comparison result indicates that the target flow data belongs to the target flow range and the current pulse equivalent is not equal to the target preset equivalent, it is determined that the pulse equivalent and pulse width of the flow sensor need to be adjusted. Among them, the target flow range, the target preset equivalent, and the target preset pulse width are one set of relationships recorded in the target relationship table. For example, the initial flow rate of the liquid in the pipeline is slow. If the instantaneous flow rate is 60 L / h, the initially set pulse equivalent of the flow sensor (i.e., the current pulse equivalent) is 0.01 L / P, and the corresponding initially set pulse width is 1.5 ms. As the instantaneous flow rate of the liquid changes, assume that the currently read target flow data is 500 L / h. Referring to Table 1 above, for the corresponding interval (100, 1000), the target preset equivalent corresponding to this interval (i.e., the above target flow range) is 0.1 L / P. This target preset equivalent is not equal to the current pulse equivalent. Therefore, it is determined that the pulse equivalent and pulse width of the flow sensor need to be adjusted. By comparing with the target relationship table, the purpose of determining whether the pulse equivalent and pulse width of the flow sensor need to be adjusted is achieved.

[0049] Optionally, before comparing the target flow data with the flow range in the target relationship table, the above target relationship table can be established in advance and stored locally. For example, the target relationship table can be stored locally in the collector (or MCU). After reading the target flow data from the flow sensor, the table lookup method can be used to determine whether the pulse equivalent and pulse width parameters of the flow sensor need to be adjusted.

[0050] In practical applications, for different instantaneous flow rate ranges, matching pulse equivalent parameters and pulse width parameters can be set in advance. For example, assume that the power consumption (or battery capacity) allocated to pulse acquisition by the system is C (unit: mAh), the cumulative use flow rate of the designed water meter is Q (unit: L), and the pulse equivalent can be set as δ (unit: L / P). Then the total number of pulses N = Q / δ, and the average power consumption per pulse is approximately: C' = C / N. Assuming the pulse current is I (unit: mA), then the pulse width is W = C' / I, with the unit of ms (or s). When the instantaneous flow rate is very large, the pulse equivalent parameter can be increased to avoid the flow sensor frequently outputting pulses, which will cause a problem of too high pulse frequency for the collector and thus large power consumption. On the contrary, when the instantaneous flow rate is very small, the pulse equivalent parameter can be decreased to avoid outputting a pulse only after a long time, which will cause a problem of poor real-time data update. When the pulse equivalent is large, the corresponding pulse width can be appropriately increased, and when the pulse equivalent is small, the corresponding pulse width can be appropriately decreased.

[0051] In an alternative embodiment, when it is determined that adjustment is required, determining the target pulse equivalent and the target pulse width includes: determining the target preset equivalent as the target pulse equivalent and determining the target preset pulse width as the target pulse width.

[0052] In the above embodiments, according to the target flow range to which the target flow data belongs, the pulse equivalent of the flow sensor is adjusted to a target preset equivalent that matches it, and the pulse width of the flow sensor is adjusted to a target preset pulse width that matches it. That is, when it is determined that adjustment is required, the target preset equivalent and the target preset pulse width that match the current target flow data are used as the target pulse equivalent and the target pulse width. The purpose of timely adjusting the parameters of the flow sensor is achieved.

[0053] In an alternative embodiment, the target flow data includes one of the following: cumulative flow data; instantaneous flow data.

[0054] In the above embodiments, the target flow data may be cumulative flow data or instantaneous flow data.

[0055] It should be noted that the above-described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The present application will be specifically described below in conjunction with specific embodiments.

[0056] The embodiments of the present application provide a communication method between an intelligent sensor and an instrument. The embodiments of the present application combine pulse output and uart communication to give the output of a signal, enabling the collector to simply achieve the balance processing of data real-time performance and power consumption.

[0057] The pulse width and pulse equivalent of the flow sensor can be set in real time through the uart interface, and the setting needs to comprehensively consider the system power consumption and data real-time performance.

[0058] Assume that the power consumption (or battery capacity) allocated to pulse acquisition by the system is 500 mAh; then assume a dn20 water meter, with a cumulative used flow < 12000 cubic meters, and the required flow resolution is 0.1 L; we can set the pulse equivalent to 0.05 L, and the cumulative number of generated pulses is 240000000 (i.e., 12000 m3 / 0.05 L), and the power consumption that can be obtained for each pulse is 500 mAh / (2.4 * 10^8) ≈ 2.08 * 10^-8 mAh (≈ 0.0075 mAS). Assume the pulse current is 1 mA, then we can adjust the pulse width to the maximum value of 7.5 ms.

[0059] The following cooperation between the collector and the sensor can achieve the balance of power consumption and real-time performance.

[0060] (1) Set the pulse equivalent to 0.01 L and the pulse width to 1.5 ms when the water is stationary;

[0061] (2) After the collector receives a pulse, it can read the data of the flow sensor (such as cumulative flow, instantaneous flow) through the uart;

[0062] (3) The collector can be adjusted according to its own characteristics and the instantaneous flow rate read by the sensor side;

[0063] If the power consumption of the collector itself is relatively high, the pulse equivalent and pulse width are adjusted. For example, when it is found that the instantaneous flow rate is very large (>1000 L / h), the pulse equivalent is adjusted to 1 L / P and the pulse width is adjusted to 15 ms;

[0064] When the instantaneous flow rate is relatively large (>100 L / h), the pulse equivalent is adjusted to 0.1 L / P and the pulse width is adjusted to 5 m; ensure that the pulse output frequency is greater than the data update frequency of the collector;

[0065] (4) When the finally collected instantaneous flow rate is small (<=100 L / h), it is reset to a pulse equivalent of 0.01 L and a pulse width of 1.5 ms;

[0066] (5) In the absence of pulses, the collector can perform a handshake communication with the sensor at a very low frequency (e.g., once every minute).

[0067] In the above embodiments, when the instantaneous flow rate is very large, generally the pulse equivalent can be set larger and the corresponding pulse width can also be set larger; when the instantaneous flow rate is very small, the pulse equivalent can be set smaller and the corresponding pulse width can also be set smaller. In the embodiments of the present application, according to the different magnitudes of the current instantaneous flow rate, the pulse equivalent and pulse width of the flow sensor are adjusted in a timely manner.

[0068] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present application.

[0069] In the present application, a flow detection device is also provided, as Figure 3 shown, Figure 3 is a structural block diagram of a flow detection device provided by an embodiment of the present application. The device includes:

[0070] A reading module 301, configured to read target flow rate data of a flow sensor when receiving a target pulse signal, where the target pulse signal is output when the flow sensor detects the liquid flow rate according to the current pulse equivalent, and the target flow rate data is the data obtained by the flow sensor detecting the liquid flow rate;

[0071] A judgment module 302, configured to judge whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor according to the target flow data and the current pulse equivalent, where the pulse equivalent is used to represent the change value of the detected liquid flow corresponding to each output pulse signal of the flow sensor, and the pulse width is used to represent the width of the pulse signal;

[0072] A processing module 303, configured to determine the target pulse equivalent and the target pulse width when it is judged that adjustment is required, and instruct the flow sensor to detect the liquid flow according to the target pulse equivalent and the target pulse width.

[0073] In an optional embodiment, the above-mentioned judgment module 302 includes one of the following: a first judgment unit, configured to judge that it is necessary to adjust the pulse equivalent and pulse width of the flow sensor when it is determined that the target flow data is less than or equal to a preset first flow threshold and the current pulse equivalent is not equal to the preset first pulse equivalent; a second judgment unit, configured to judge that it is necessary to adjust the pulse equivalent and pulse width of the flow sensor when it is determined that the target flow data is greater than the preset first flow threshold, less than the preset second flow threshold, and the current pulse equivalent is not equal to the preset second pulse equivalent; a third judgment unit, configured to judge that it is necessary to adjust the pulse equivalent and pulse width of the flow sensor when it is determined that the target flow data is greater than or equal to the preset second flow threshold and the current pulse equivalent is not equal to the preset third pulse equivalent.

[0074] In an optional embodiment, the above-mentioned processing module 303 includes one of the following: a first determination unit, configured to determine the preset first pulse equivalent as the target pulse equivalent and the preset first pulse width as the target pulse width when it is determined that the target flow data is less than or equal to the preset first flow threshold and the current pulse equivalent is not equal to the preset first pulse equivalent; a second determination unit, configured to determine the preset second pulse equivalent as the target pulse equivalent and the preset second pulse width as the target pulse width when it is determined that the target flow data is greater than the preset first flow threshold, less than the preset second flow threshold, and the current pulse equivalent is not equal to the preset second pulse equivalent; a third determination unit, configured to determine the preset third pulse equivalent as the target pulse equivalent and the preset third pulse width as the target pulse width when it is determined that the target flow data is greater than or equal to the preset second flow threshold and the current pulse equivalent is not equal to the preset third pulse equivalent.

[0075] In an alternative embodiment, the above-mentioned determination module 302 includes: a comparison unit configured to compare the target flow data with the flow ranges in the target relationship table, and compare the current pulse equivalent with the preset pulse equivalent in the target relationship table to obtain a comparison result, wherein the target relationship table records the corresponding relationships between the flow ranges and the preset pulse equivalent and the preset pulse width; a fourth determination unit configured to determine whether it is necessary to adjust the pulse equivalent and the pulse width of the flow sensor according to the comparison result.

[0076] In an alternative embodiment, the above-mentioned fourth determination unit includes: a determination subunit configured to determine that it is necessary to adjust the pulse equivalent and the pulse width of the flow sensor when the comparison result indicates that the target flow data belongs to the target flow range and the current pulse equivalent is not equal to the target preset equivalent, wherein the target relationship table records the corresponding relationships between the target flow range and the target preset equivalent and the target preset pulse width.

[0077] In an alternative embodiment, the above-mentioned processing module 303 includes: a fourth determination unit configured to determine the target preset equivalent as the target pulse equivalent and determine the target preset pulse width as the target pulse width.

[0078] In an alternative embodiment, the above-mentioned target flow data includes one of the following: cumulative flow data; instantaneous flow data.

[0079] The present application also provides a computer-readable storage medium storing instructions that, when executed, perform the method steps described in any one of the above.

[0080] In an exemplary embodiment, the above-mentioned computer-readable storage medium may include, but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disc, and other media that can store computer programs.

[0081] The present application also discloses an electronic device. As Figure 4 shown, Figure 4 is a schematic structural diagram of an electronic device disclosed in an embodiment of the present application. The electronic device 400 may include: at least one processor 401, at least one network interface 404, a user interface 403, a memory 405, and at least one communication bus 402.

[0082] Among them, the communication bus 402 is used to implement connection communication between these components.

[0083] Among them, the user interface 403 may include a display screen and a camera. Optionally, the user interface 403 may further include a standard wired interface and a wireless interface.

[0084] Among them, the network interface 404 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).

[0085] Among them, the processor 401 may include one or more processing cores. The processor 401 connects various parts within the entire electronic device (such as a server) through various interfaces and circuits. By running or executing instructions, programs, code sets, or instruction sets stored in the memory 405, and by calling the data stored in the memory 405, it executes various functions of the server and processes data. Optionally, the processor 401 may be implemented in at least one of the hardware forms of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 401 may integrate one or a combination of several of a central processing unit (CPU), a graphics processing unit (GPU), and a modem, etc. Among them, the CPU mainly processes the operating system, user interface, and application programs, etc.; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 401 and may be implemented separately by a single chip.

[0086] Among them, the memory 405 may include a random access memory (RAM) and may also include a read-only memory. Optionally, the memory 405 includes a non-transitory computer-readable storage medium. The memory 405 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 405 may include a program storage area and a data storage area. Among them, the program storage area may store instructions for implementing the operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store the data involved in the above-mentioned various method embodiments. Optionally, the memory 405 may further be at least one storage device located far from the aforementioned processor 401. Refer toFigure 4 In the memory 405, which is a computer storage medium, an operating system, a network communication module, a user interface module, and an application program of a traffic detection method may be included.

[0087] In Figure 4 In the illustrated electronic device 400, the user interface 403 is mainly used to provide an interface for the user to obtain the data input by the user; and the processor 401 may be used to call the application program of a traffic detection method stored in the memory 405. When executed by one or more processors 401, the electronic device 400 is caused to execute one or more of the methods as described in the above embodiments. It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, certain steps may be adopted in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.

[0088] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

[0089] In several implementation manners provided by 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 merely illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, 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 displayed or discussed coupling or direct coupling or communication connection to each other can be through some service interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical or other form.

[0090] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0091] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.

[0092] When the integrated unit is implemented in the form of a software functional unit 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 application, 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. This computer software product is stored in a memory and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in various embodiments of the present application. The aforementioned memory includes various media such as USB flash drives, mobile hard disks, magnetic disks, or optical discs that can store program codes.

[0093] The above are only exemplary embodiments of the present disclosure, and the scope of the present disclosure cannot be limited thereby. That is, any equivalent changes and modifications made in accordance with the teachings of the present disclosure still fall within the scope covered by the present disclosure. Those skilled in the art will readily think of other embodiments of the present disclosure after considering the specification and the practice of the present disclosure.

[0094] The present application aims to cover any variations, uses, or adaptive changes of the present disclosure, which follow the general principles of the present disclosure and include common general knowledge or conventional technical means in the technical field not recorded in the present disclosure.

Claims

1. A flow detection method, characterized in that, Including: When a target pulse signal is received, reading target flow data of a flow sensor, where the target pulse signal is output when the flow sensor detects a liquid flow rate according to a current pulse equivalent, and the target flow data is obtained by the flow sensor detecting the liquid flow rate; Judging whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor according to the target flow data and the current pulse equivalent, where the pulse equivalent is used to represent the change value of the detected liquid flow rate corresponding to each output pulse signal of the flow sensor, and the pulse width is used to represent the width of the pulse signal; When it is judged that adjustment is needed, determining a target pulse equivalent and a target pulse width, and instructing the flow sensor to detect the liquid flow rate according to the target pulse equivalent and the target pulse width; Among them, judging whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor according to the target flow data and the current pulse equivalent includes: comparing the target flow data with a flow range in a target relationship table, and comparing the current pulse equivalent with a preset pulse equivalent in the target relationship table to obtain a comparison result, where the target relationship table records the corresponding relationship between the flow range and the preset pulse equivalent and the preset pulse width; judging whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor according to the comparison result; Among them, the corresponding relationship between the preset pulse equivalent and the preset pulse width in the target relationship table is determined according to the following formula: W = (C×δ) / (Q×I), where δ represents the preset pulse equivalent, W represents the preset pulse width, C represents the power consumption allocated by the system to pulse acquisition, I represents the pulse current, and Q represents the designed cumulative use flow rate of the water meter.

2. The method according to claim 1, wherein Judging whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor according to the target flow data and the current pulse equivalent includes one of the following: When it is determined that the target flow data is less than or equal to a preset first flow threshold and the current pulse equivalent is not equal to a preset first pulse equivalent, it is judged that it is necessary to adjust the pulse equivalent and pulse width of the flow sensor; When it is determined that the target flow data is greater than the preset first flow threshold, less than a preset second flow threshold, and the current pulse equivalent is not equal to a preset second pulse equivalent, it is judged that it is necessary to adjust the pulse equivalent and pulse width of the flow sensor; When it is determined that the target flow data is greater than or equal to the preset second flow threshold and the current pulse equivalent is not equal to a preset third pulse equivalent, it is judged that it is necessary to adjust the pulse equivalent and pulse width of the flow sensor.

3. The method according to claim 2, characterized in that, When it is judged that adjustment is needed, determining a target pulse equivalent and a target pulse width includes one of the following: When it is determined that the target flow data is less than or equal to the preset first flow threshold and the current pulse equivalent is not equal to the preset first pulse equivalent, determining the preset first pulse equivalent as the target pulse equivalent and determining a preset first pulse width as the target pulse width; When it is determined that the target flow data is greater than the preset first flow threshold, less than the preset second flow threshold, and the current pulse equivalent is not equal to the preset second pulse equivalent, the preset second pulse equivalent is determined as the target pulse equivalent, and the preset second pulse width is determined as the target pulse width; When it is determined that the target flow data is greater than or equal to the preset second flow threshold and the current pulse equivalent is not equal to the preset third pulse equivalent, the preset third pulse equivalent is determined as the target pulse equivalent, and the preset third pulse width is determined as the target pulse width.

4. The method according to claim 1, wherein Judging whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor according to the comparison result, including: When the comparison result indicates that the target flow data belongs to the target flow range and the current pulse equivalent is not equal to the target preset equivalent, it is judged that it is necessary to adjust the pulse equivalent and pulse width of the flow sensor, wherein the corresponding relationship between the target flow range and the target preset equivalent and the target preset pulse width is recorded in the target relationship table.

5. The method according to claim 4, wherein When it is judged that adjustment is needed, determining the target pulse equivalent and the target pulse width, including: Determining the target preset equivalent as the target pulse equivalent and determining the target preset pulse width as the target pulse width.

6. The method according to any one of claims 1 to 5, characterized in that, The target flow data includes one of the following: Accumulated flow data; Instantaneous flow data.

7. A flow detection device, characterized in that, Including: A reading module, configured to read the target flow data of the flow sensor when receiving a target pulse signal, wherein the target pulse signal is output when the flow sensor detects the liquid flow according to the current pulse equivalent, and the target flow data is obtained by the flow sensor detecting the liquid flow; A judging module, configured to judge whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor according to the target flow data and the current pulse equivalent, wherein the pulse equivalent is used to represent the change value of the detected liquid flow corresponding to each output pulse signal of the flow sensor, and the pulse width is used to represent the width of the pulse signal; A processing module, configured to determine the target pulse equivalent and the target pulse width when it is judged that adjustment is needed, and instruct the flow sensor to detect the liquid flow according to the target pulse equivalent and the target pulse width; Wherein, the above-mentioned judging module includes: a comparison unit, configured to compare the target flow data with the flow range in the target relationship table, and compare the current pulse equivalent with the preset pulse equivalent in the target relationship table to obtain a comparison result, wherein the corresponding relationship between the flow range and the preset pulse equivalent and the preset pulse width is recorded in the target relationship table; a fourth judging unit, configured to judge whether it is necessary to adjust the pulse equivalent and pulse width of the flow sensor according to the comparison result; Among them, the correspondence relationship between the preset pulse equivalent and the preset pulse width in the target relationship table is determined according to the following formula: W = (C × δ) / (Q × I), where δ represents the preset pulse equivalent, W represents the preset pulse width, C represents the power consumption allocated by the system to pulse acquisition, I represents the pulse current, and Q represents the cumulative usage flow rate of the designed water meter.

8. An electronic device, comprising a memory and a processor, wherein a computer program is stored on the memory, characterized in that, When the processor executes the program, it implements the method described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed, perform the method described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Calibration system and method applied to ultrasonic gas meter

    CN112964337A