Data collection method and device, storage medium and program product

By setting only one target interface on the water meter and using the temperature and pressure detection component to detect the device identity, the problem of increasing hardware costs and waste of interface resources in the prior art is solved, and temperature and pressure data acquisition without adding interfaces is achieved .

CN119299478APending Publication Date: 2025-01-10GOLDEN CARD WATER TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411303772.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The prior art provides interfaces for temperature sensors and pressure transmitters on the water meter, which increases hardware costs and causes waste of interface resources when pressure transmitters are not required.

Method used

Only one target interface is set on the water meter, and the connected devices are detected in the power supply state. If it is a temperature sensor, the temperature data is collected. If it is a temperature transmitter, the temperature and pressure data are collected. The temperature and pressure detection component is used. Send detection instructions and parse the returned index data, judge the device identity to determine the collected data type.

Benefits of technology

Reduce hardware costs, save interface resources, and realize the function of collecting temperature and pressure data without increasing interfaces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119299478A_ABST
    Figure CN119299478A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data collection method and device, a storage medium and a program product. The method is applied to data processing technology. The method comprises the following steps: detecting an accessed device based on a target interface in response to a current entering power supply state; if the accessed device is determined to be the temperature sensor, acquiring temperature data based on the temperature sensor; the temperature sensor is a device used for detecting temperature indexes; if it is determined that the accessed device is the temperature and pressure transmitter, temperature data and pressure data are collected based on the temperature and pressure transmitter; the temperature and pressure transmitter is a device used for detecting a temperature index and a pressure index. The method is used for achieving the effects of reducing hardware cost and saving interface resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data acquisition method, device, storage medium and program product. Background Art

[0002] With the continuous development of industrial fields and data processing technology, temperature sensors and pressure transmitters are more and more widely used in water meters. Among them, temperature sensors are essential components of water meters because they participate in measurement correction, and pressure transmitters are used for pressure monitoring and are optional components of water meters. It is necessary to collect relevant indicator data based on the connection between water meters and temperature sensors and pressure transmitters in order to monitor relevant indicators.

[0003] Currently, when collecting relevant indicator data based on the access status of the water meter, temperature sensor and pressure transmitter, corresponding interfaces are generally set for the temperature sensor and pressure transmitter based on the water meter in advance. When temperature data needs to be collected, the temperature sensor is connected to the corresponding interface. When temperature data and pressure data need to be collected, the temperature sensor and pressure transmitter are connected to the corresponding interfaces respectively, so as to collect temperature data, or temperature data and pressure data according to the specific access situation.

[0004] However, this data collection method requires setting up two interfaces on the water meter, which increases hardware costs and causes a waste of interface resources when a pressure transmitter is not needed. Summary of the invention

[0005] The embodiments of the present application provide a data collection method, device, storage medium and program product to reduce hardware costs and save interface resources.

[0006] In a first aspect, an embodiment of the present application provides a data collection method, the method being applied to a water meter, the water meter comprising a target interface, the water meter executing the data collection method when sensing that the target interface is connected, the method comprising: in response to currently entering a power supply state, detecting a connected device based on the target interface;

[0007] If it is determined that the connected device is a temperature sensor, temperature data is collected based on the temperature sensor; the temperature sensor is a device for detecting temperature indicators;

[0008] If it is determined that the connected device is a temperature and pressure transmitter, temperature data and pressure data are collected based on the temperature and pressure transmitter; the temperature and pressure transmitter is a device for detecting temperature indicators and pressure indicators.

[0009] In a possible implementation, the detection of the connected device based on the target interface includes: using a temperature and pressure detection component to send a detection instruction to the connected device, the temperature and pressure detection component is used to detect the index data returned by the temperature and pressure transmitter; receiving the index data returned by the connected device, and using the temperature and pressure detection component to perform protocol parsing on the returned index data; determining that the connected device is a temperature and pressure transmitter when the protocol parsing is normal; obtaining the parsing time when the protocol parsing is abnormal, and judging whether the parsing time is greater than a preset time threshold; if not, determining that the connected device is a temperature sensor.

[0010] In a possible implementation, after determining whether the analysis time is greater than a preset time threshold, it also includes: if so, obtaining the number of times the detection instruction is sent, and determining whether the number of times the detection instruction is sent is greater than a preset number of times; when it is determined to be less than or equal to, again using the temperature and pressure detection component to send the detection instruction to the connected device again; again receiving the index data returned by the connected device, and using the temperature and pressure detection component to perform protocol analysis on the returned index data again; when it is determined to be greater than, determining that the connected device is a temperature sensor.

[0011] After determining whether the number of times the detection instruction is sent is greater than the preset number of times, it also includes: when it is determined to be less than or equal to, using the temperature and pressure detection component to send the detection instruction to the connected device again, and receiving the index data returned by the connected device again; using the temperature and pressure detection component to perform protocol analysis on the returned index data again.

[0012] In a possible implementation, the temperature data collection based on the temperature sensor includes: acquiring the temperature data based on a communication connection with the temperature sensor; when it is determined that the temperature data is normal, filtering the temperature data, and displaying the processed temperature data on a corresponding operation interface.

[0013] In a possible implementation, the collecting of temperature data and pressure data based on the temperature and pressure transmitter includes: acquiring the pressure data based on a communication connection with the temperature and pressure transmitter; when it is determined that the pressure data is normal, filtering the pressure data, and acquiring the temperature data based on the communication connection with the temperature and pressure transmitter; when it is determined that the temperature data is normal, filtering the temperature data, and displaying the processed pressure data and the processed temperature data on a corresponding operation interface.

[0014] In a possible implementation, when it is determined that the pressure data is abnormal, it also includes: acquiring the pressure data again based on a retry timer; in response to the pressure data acquired again being always abnormal within the range allowed by the retry timer, displaying the abnormal pressure data on a corresponding operation interface and performing a power-off operation; in response to the pressure data acquired again returning to normal within the range allowed by the retry timer, clearing the retry timer; filtering the normal pressure data, and continuing the process of acquiring temperature data.

[0015] In a possible implementation, when it is determined that the temperature data is abnormal, it also includes: acquiring the temperature data again based on a retry timer; in response to the temperature data acquired again being always abnormal within the range allowed by the retry timer, displaying the abnormal temperature data on the corresponding operation interface and performing a power-off operation; in response to the temperature data acquired again returning to normal within the range allowed by the retry timer, clearing the retry timer; filtering the normal temperature data, and continuing to display the processed temperature data, or the processed pressure data and the processed temperature data.

[0016] In a second aspect, an embodiment of the present application provides a data acquisition device, the device comprising: a processing module, configured to detect a connected device based on a target interface in response to currently entering a power supply state;

[0017] The acquisition module is used to collect temperature data based on the temperature sensor if it is determined that the connected device is a temperature sensor; the temperature sensor is a device for detecting temperature indicators; if it is determined that the connected device is a temperature and pressure transmitter, the temperature data and pressure data are collected based on the temperature and pressure transmitter; the temperature and pressure transmitter is a device for detecting temperature indicators and pressure indicators.

[0018] In a possible implementation manner, when the processing module detects the connected device based on the target interface, it is specifically used to:

[0019] A temperature and pressure detection component is used to send a detection instruction to the connected device, and the temperature and pressure detection component is used to detect the index data returned by the temperature and pressure transmitter; the index data returned by the connected device is received, and the temperature and pressure detection component is used to perform protocol parsing on the returned index data; when the protocol parsing is normal, it is determined that the connected device is a temperature and pressure transmitter; when the protocol parsing is abnormal, the parsing time is obtained, and it is determined whether the parsing time is greater than a preset time threshold; if not, it is determined that the connected device is a temperature sensor.

[0020] The device also includes: a transceiver module.

[0021] In a possible implementation, the processing module is also used to determine whether the analysis time is greater than a preset time threshold. If so, obtain the number of detection instruction sending times and determine whether the detection instruction sending times is greater than a preset sending times; when it is determined to be less than or equal to, use the temperature and pressure detection component to send the detection instruction to the connected device again; receive the index data returned by the connected device again, and use the temperature and pressure detection component to perform protocol analysis on the returned index data again; when it is determined to be greater than, determine that the connected device is a temperature sensor.

[0022] In a possible implementation, when the acquisition module acquires temperature data based on the temperature sensor, it is specifically used to:

[0023] The temperature data is acquired based on the communication connection with the temperature sensor; when it is determined that the temperature data is normal, the temperature data is filtered and the processed temperature data is displayed on a corresponding operation interface.

[0024] In a possible implementation, when the acquisition module acquires temperature data and pressure data based on the temperature and pressure transmitter, it is specifically used to:

[0025] The pressure data is acquired based on the communication connection with the temperature and pressure transmitter; when it is determined that the pressure data is normal, the pressure data is filtered, and the temperature data is acquired based on the communication connection with the temperature and pressure transmitter; when it is determined that the temperature data is normal, the temperature data is filtered, and the processed pressure data and the processed temperature data are displayed on the corresponding operation interface.

[0026] In a possible implementation, the processing module is further used to, when determining that the pressure data is abnormal, reacquire the pressure data based on a retry timer; in response to the pressure data reacquired being always abnormal within the range allowed by the retry timer, display the abnormal pressure data on a corresponding operation interface and perform a power-off operation; in response to the pressure data reacquired returning to normal within the range allowed by the retry timer, clear the retry timer; filter the normal pressure data, and continue the process of acquiring temperature data.

[0027] In a possible implementation, the processing module is further used to, when it is determined that the temperature data is abnormal, reacquire the temperature data based on a retry timer; in response to the temperature data reacquired being always abnormal within the range allowed by the retry timer, display the abnormal temperature data on a corresponding operation interface and perform a power-off operation; in response to the temperature data reacquired returning to normal within the range allowed by the retry timer, perform a clearing operation on the retry timer; filter the normal temperature data, and continue to display the processed temperature data, or the processed pressure data and the processed temperature data.

[0028] In a third aspect, an embodiment of the present application provides a water meter device, including: a memory, a processor, and a target interface;

[0029] The memory stores computer-executable instructions; the target interface is used to access a temperature sensor or a temperature and pressure transmitter;

[0030] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.

[0031] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.

[0032] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.

[0033] The data acquisition method, device, storage medium and program product provided in the embodiments of the present application have only one target interface set on the water meter, and the temperature sensor and the temperature and pressure transmitter are set based on the specific acquisition requirements. Therefore, when the water meter senses that the target interface is connected to a certain device, by detecting the connected device based on the target interface under the power supply state, when it is determined that the connected device is a temperature sensor, temperature data can be collected based on the temperature sensor, and when it is determined that the connected device is a temperature and pressure transmitter, temperature data and pressure data can be collected based on the temperature and pressure transmitter. There is no need to set two interfaces, which reduces hardware costs and saves interface resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0035] Figure 1 An application scenario diagram of the data collection method provided in this application;

[0036] Figure 2 Schematic diagram of the data collection method provided for this application Figure 1 ;

[0037] Figure 3 Schematic diagram of the data collection method provided for this application Figure 2 ;

[0038] Figure 4 A hardware connection diagram for the water meter provided in this application when executing the data collection method;

[0039] Figure 5 A schematic diagram of the structure of the data acquisition device provided in this application;

[0040] Figure 6 A schematic diagram of the structure of the water meter equipment provided for this application.

[0041] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0042] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application.

[0043] First, the terms involved in this application are explained:

[0044] Water meter: A measuring instrument used to continuously measure, memorize and display the volume of water flowing through the measuring pipe under rated working conditions.

[0045] Temperature sensor: The temperature sensor used in water meters is a device specially designed to monitor and record the temperature changes of water when it flows through the water meter. It is usually installed inside the water meter or on the pipe connected to the water meter to ensure accurate measurement and recording of water temperature data.

[0046] Pressure transmitter: The pressure transmitter used in water meters is a sensor device specially designed to measure and convert pressure signals in water flow.

[0047] Temperature and pressure transmitter: The temperature and pressure transmitter used in water meters can simultaneously measure and convert the temperature and pressure signals in the water flow, and convert them into standard electrical signals (such as 4-20mA current signals, 0-5V / 0-10V voltage signals or RS485 digital signals) for output. Specifically, it can include two parts: a temperature sensor and a pressure sensor.

[0048] In the prior art, when collecting relevant index data based on the access between the water meter and the temperature sensor and the pressure transmitter, two interfaces are generally set on the water meter in advance, one of which corresponds to the temperature sensor and the other corresponds to the pressure transmitter. When the user needs to collect temperature data, the temperature sensor is connected to the corresponding interface. When the user needs to collect temperature data and pressure data, the temperature sensor and the pressure transmitter are connected to the corresponding interfaces respectively. Then, the water meter responds to the interface corresponding to the temperature sensor being connected, or responds to the interface corresponding to the temperature sensor and the interface corresponding to the pressure transmitter being connected, and collects temperature data based on the connected temperature sensor, or collects temperature data and pressure data based on the connected temperature sensor and the pressure transmitter. However, this collection method requires setting two interfaces on the water meter, which increases the hardware cost, and for the water meter, the collection of pressure data is optional. In some application scenarios, there is no need to insert a pressure transmitter, resulting in a waste of interface resources.

[0049] In response to the above technical problems, the present application proposes the following technical concept: In order to reduce hardware costs and save interface resources, instead of setting an interface for the temperature sensor and the pressure transmitter respectively, only one interface is set based on the temperature sensor and the temperature and pressure transmitter, and the temperature and pressure transmitter can capture temperature data and pressure data. When the user needs to collect temperature data, the temperature sensor is connected to the interface, and when the user needs to collect temperature data and pressure data, the temperature and pressure transmitter is connected to the interface. Then the water meter detects the connected device in response to the interface being connected. If it is determined that the connected device is a temperature sensor, temperature data is collected based on the device. If it is determined that the connected device is a temperature and pressure transmitter, temperature data and pressure data are collected based on the device. In this way, there is no need to set two interfaces, which reduces hardware costs and saves interface resources.

[0050] Figure 1 The application scenario diagram of the data collection method provided in this application is as follows: Figure 1As shown, the specific application scenarios of the present application include: a water meter 1, a temperature sensor 2, and a temperature and pressure transmitter 3. Among them, the water meter 1 is a device for collecting water resource related indicator data, and the related indicators may be temperature indicators, pressure indicators, etc. Among them, the temperature sensor 2 is a device for detecting temperature indicators, and temperature data can be obtained. The temperature and pressure transmitter 3 is a device for detecting temperature indicators and pressure indicators, and temperature data and pressure data can be obtained. Among them, the water meter 1 includes a target interface, and the target interface is used to insert the temperature sensor 2 or the temperature and pressure transmitter 3, so that the water meter 1 establishes a communication connection with the temperature sensor 2 or the temperature and pressure transmitter 3 according to the specific insertion situation, thereby collecting the corresponding indicator data.

[0051] First, the user inserts the temperature sensor 2 or the temperature and pressure transmitter 3 into the target interface. Then, when the water meter 1 senses that the target interface is connected, in response to the current power supply state, the connected device is detected based on the target interface. If it is determined that the connected device is the temperature sensor 2, temperature data is collected based on the temperature sensor 2. If it is determined that the connected device is the temperature and pressure transmitter 3, temperature data and pressure data are collected based on the temperature and pressure transmitter 3.

[0052] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0053] Figure 2 Schematic diagram of the data collection method provided for this application Figure 1 ,like Figure 2 As shown, the execution subject of the method is a data acquisition device, which is specifically located in a water meter. The water meter includes a target interface. When the water meter senses that the target interface is connected, the data acquisition method is executed. The method includes the following steps:

[0054] S201 : In response to currently entering a power supply state, detecting a connected device based on a target interface.

[0055] The water meter is any water meter used to monitor water resource related indicators. The target interface is an interface pre-set on the water meter, which can be connected to a temperature sensor or a temperature and pressure transmitter. The specific setting position of the target interface on the water meter can be flexibly determined according to user needs. For example, it can be set inside the water meter housing to avoid the interface and its connected devices being affected by the external environment and improve the durability of the interface and the devices. Or it can be set outside the water meter housing to make it more convenient to replace the device and improve the flexibility of replacing the device. This embodiment does not limit the specific setting position of the target interface.

[0056] Among them, the power supply status is the state in which the power supply of the water meter is turned on.

[0057] It is understandable that the water meter can be in a normal power supply state or an emergency power supply state. When in the normal power supply state, if the target interface is connected, the next operation is performed directly based on the current power supply state. When in the emergency power supply state, if the target interface is connected, the power supply state can be entered based on the preset power supply cycle and the next operation can be performed, or the user's power-on operation based on the water meter can be monitored in real time, and the power supply state can be performed when it is determined that the above-mentioned start-up operation is triggered, and the next operation can be performed, thereby reducing the power consumption of the system.

[0058] It is understandable that, since only one target interface is provided in this embodiment, when the water meter senses that the target interface is connected, in response to entering the current power supply state, it needs to detect the device currently connected to the target interface.

[0059] Specifically, a component for detecting the identity of a device may be pre-set in the water meter, and the component is used to detect the device currently connected to the target interface.

[0060] S202: If it is determined that the connected device is a temperature sensor, temperature data is collected based on the temperature sensor; the temperature sensor is a device for detecting a temperature index.

[0061] The temperature data is data representing the temperature change of water when the water flows through the water meter.

[0062] In this embodiment, after the device currently connected to the target interface is detected, if it is determined according to the detection result that the connected device is a temperature sensor, temperature data is collected based on the temperature sensor.

[0063] Specifically, a temperature sensor can be set in advance based on the measurement requirements of the temperature index, and the connected temperature sensor can detect the temperature of water flowing through the water meter. Then, when the water meter determines that the device connected to the target interface is a temperature sensor, it collects the water temperature detected by the temperature sensor based on the communication connection with the connected temperature sensor, and determines the value of the water temperature as the temperature data.

[0064] S203: If it is determined that the connected device is a temperature and pressure transmitter, temperature data and pressure data are collected based on the temperature and pressure transmitter; the temperature and pressure transmitter is a device for detecting temperature indicators and pressure indicators.

[0065] Among them, the pressure data is the data that characterizes the change in water pressure when water flows through the water meter.

[0066] In this embodiment, after the device currently connected to the target interface is detected, if it is determined according to the detection result that the connected device is a temperature and pressure transmitter, temperature data and pressure data are collected based on the temperature and pressure transmitter.

[0067] Specifically, a temperature and pressure transmitter can be set in advance based on the measurement requirements of temperature indicators and pressure indicators, and the connected temperature and pressure transmitter can detect the temperature and pressure signals of water flowing through the water meter. When the water meter determines that the device connected to the target interface is a temperature and pressure transmitter, it collects the water temperature and pressure signals detected by the temperature and pressure transmitter based on the communication connection with the connected temperature and pressure transmitter, and determines the value of the water temperature as temperature data, and determines the value of the pressure signal as pressure data.

[0068] The data collection method provided in this embodiment has only one target interface set on the water meter, and the temperature sensor and the temperature and pressure transmitter are set based on specific collection requirements. Therefore, when the water meter senses that the target interface is connected to a device, the connected device is detected based on the target interface in the power supply state. When it is determined that the connected device is a temperature sensor, temperature data can be collected based on the temperature sensor, and when it is determined that the connected device is a temperature and pressure transmitter, temperature data and pressure data can be collected based on the temperature and pressure transmitter. There is no need to set two interfaces, which reduces hardware costs and saves interface resources.

[0069] As an optional embodiment, based on the above embodiment, this embodiment further refines the detection of the connected device based on the target interface. When the connected device is detected based on the target interface, this embodiment specifically includes the following steps:

[0070] Step a1: Use the temperature and pressure detection component to send a detection instruction to the connected device. The temperature and pressure detection component is used to detect the index data returned by the temperature and pressure transmitter.

[0071] Among them, the temperature and pressure detection component is a component pre-set in the water meter to detect the identity of the device connected to the target interface, and can be specifically used to detect the index data returned by the temperature and pressure transmitter.

[0072] The detection instruction is an instruction for instructing the connected device to return corresponding indicator data so as to detect its identity.

[0073] It can be understood that the temperature and pressure detection component can detect the index data returned by the temperature and pressure transmitter because a communication protocol module is set inside the temperature and pressure detection component, and the communication protocol module can communicate with the temperature and pressure transmitter that supports the same communication protocol, but cannot communicate with the temperature sensor that supports different communication protocols. Therefore, if the index data returned by the connected device can be read by the temperature and pressure detection component, it can be determined that the connected device is a temperature and pressure transmitter. If the index data returned by the connected device cannot be read by the temperature and pressure detection component, it can be determined that the connected device is a temperature sensor.

[0074] Based on this, when the connected device is detected based on the target interface, the temperature and pressure detection component can be used to send a detection instruction to the connected device.

[0075] Among them, the above-mentioned communication protocol module can be, for example, an IIC (Inter-Integrated Circuit) communication protocol module, the above-mentioned same communication protocol can be, for example, an IIC communication protocol, and the above-mentioned different communication protocols can be, for example, a HART (Highway Addressable Remote Transducer) protocol. This embodiment does not limit the specific communication protocols involved.

[0076] Step a2: receiving the index data returned by the connected device, and performing protocol analysis on the returned index data using the temperature and pressure detection component.

[0077] In this embodiment, after sending the detection instruction, the connected device obtains the currently detected index data according to the detection instruction and returns the index data to the water meter. Correspondingly, the index data returned by the connected device is received, and the temperature and pressure detection component is used to decode the returned index data according to the format specified by the protocol, and whether the protocol parsing process is normal is determined according to the decoding result.

[0078] Step a3: When the protocol analysis is normal, it is determined that the connected device is a temperature and pressure transmitter.

[0079] In this embodiment, if the protocol analysis is normal, it means that the indicator data returned by the connected device meets the format required by the protocol, and it can be determined that the connected device is a temperature and pressure transmitter.

[0080] Step a4: when the protocol parsing is abnormal, the parsing time is obtained, and it is determined whether the parsing time is greater than a preset time threshold; if not, it is determined that the connected device is a temperature sensor.

[0081] The parsing time is the time for the temperature and pressure detection component to parse the indicator data. The preset time threshold is a preset maximum time value that allows the temperature and pressure detection component to parse the indicator data, such as 200ms.

[0082] In this embodiment, if the protocol parsing is abnormal, it means that the indicator data returned by the connected device may not meet the format required by the protocol, and the connected device may be a temperature sensor. However, the cause of the protocol parsing abnormality may also be caused by communication delay. Based on this, in order to further determine the identity of the connected device, the parsing time is obtained, and it is determined whether the parsing time is greater than the preset time threshold. If not, it means that no communication delay occurs during the protocol parsing process, and it is determined that the connected device is a temperature sensor.

[0083] The data acquisition method provided in this embodiment, since the temperature and pressure detection component can detect the index data returned by the temperature and pressure transmitter, by using the temperature and pressure detection component to send a detection instruction to the connected device, the index data returned by the connected device can be received, and the temperature and pressure detection component can be used to perform protocol analysis on the returned index data. Therefore, by judging whether the protocol analysis process is normal, it can be determined that the connected device is a temperature and pressure transmitter when it is normal, and the analysis time can be further obtained when it is abnormal, and then when it is determined that the analysis time does not exceed the preset time threshold, it is determined that the connected device is a temperature sensor. In this way, the temperature and pressure transmitter or temperature sensor is successfully detected, and the success rate of subsequent data collection is improved.

[0084] As an optional embodiment, based on the above embodiment, after determining whether the parsing time is greater than a preset time threshold, this embodiment further includes the following steps:

[0085] Step b1: If yes, obtain the number of times the detection instruction is sent, and determine whether the number of times the detection instruction is sent is greater than the preset number of times.

[0086] The detection instruction sending times is the number of times the detection instruction is sent to the connected device. The preset sending times is a preset maximum number of times the detection instruction is allowed to be sent to the connected device, such as 3 times.

[0087] In this embodiment, based on whether the parsing time is greater than the preset time threshold, if so, it means that a communication delay has occurred during the protocol parsing process, and it is necessary to resend the detection instruction to the connected device to avoid the impact of the communication delay. The number of times the detection instruction is sent is obtained, and it is determined whether the number of times the detection instruction is sent is greater than the preset number of times.

[0088] Step b2: When it is determined to be less than or equal to, the temperature and pressure detection component is used again to send a detection instruction to the connected device; the index data returned by the connected device is received again, and the temperature and pressure detection component is used to perform protocol analysis on the returned index data again.

[0089] In this embodiment, based on determining whether the number of times the detection instruction is sent is greater than the preset number of times, if not, that is, when it is determined to be less than or equal to, the temperature and pressure detection component is used again to send the detection instruction to the connected device again, and the indicator data returned by the connected device is received again, and further, the temperature and pressure detection component is used to perform protocol analysis on the returned indicator data again. The specific execution method is similar to step a1-step a2, and will not be repeated here.

[0090] It is understandable that if the result of the protocol analysis is normal again, it means that the current execution avoids the influence of communication delay, and it is determined that the connected device is a temperature and pressure transmitter.

[0091] If the result of the protocol parsing again is abnormal and the parsing time is greater than the preset time threshold, it means that this execution may still be affected by communication delays. Based on the result that the number of detection instruction sending times is less than or equal to the preset number of sending times, the temperature and pressure detection component is further used to send the detection instruction to the connected device again; the indicator data returned by the connected device is received again, and the temperature and pressure detection component is used to perform protocol parsing on the returned indicator data again.

[0092] Step b3: When it is determined that is greater than, determine that the connected device is a temperature sensor.

[0093] In this embodiment, it is determined whether the number of detection instruction sending times is greater than the preset number of sending times. If so, that is, when it is determined to be greater than, it means that based on the result that the analysis time is greater than the preset time threshold, multiple detection instructions have been repeatedly sent to the connected device, but the protocol analysis result is still abnormal, then it can be determined that the result is not related to the communication delay, and it can be determined that the connected device is a temperature sensor.

[0094] The data acquisition method provided in this embodiment, since communication delay will affect the protocol parsing process, when it is determined that the parsing time is greater than the preset time threshold, by obtaining the number of detection instruction sending times and judging whether the number of detection instruction sending times is greater than the preset sending times, the temperature and pressure detection component can be used to send the detection instruction to the connected device again when it is determined to be less than or equal to, and the index data returned by the connected device can be received again, so that the temperature and pressure detection component is used to perform protocol parsing on the returned index data again, and when it is determined to be greater than, it can be determined that the connected device is a temperature sensor. In this way, the influence of communication delay on the protocol parsing process is eliminated, and the accuracy of detecting the identity of the device is improved.

[0095] As an optional embodiment, in this embodiment Figure 2 On the basis of the corresponding embodiment, the temperature data collected based on the temperature sensor is further refined. When the temperature data is collected based on the temperature sensor, this embodiment specifically includes the following steps:

[0096] Step c1: Acquire temperature data based on the communication connection with the temperature sensor.

[0097] It is understandable that when the water meter senses that the target interface is connected, it establishes a communication connection with the connected device. Based on this, when collecting temperature data based on the temperature sensor, based on the communication connection with the temperature sensor, the specific value of the water temperature is obtained according to the temperature of the water flowing through the water meter detected by the temperature sensor, thereby obtaining the temperature data.

[0098] Step c2: When it is determined that the temperature data is normal, filter the temperature data and display the processed temperature data on a corresponding operation interface.

[0099] It is understandable that the temperature of water flowing through the water meter may be abnormal due to factors such as system failure, water pipe leakage, water meter failure, etc. Therefore, the acquired temperature data may be abnormal temperature data.

[0100] Based on this, after obtaining the temperature data, first determine whether the temperature data is normal. For example, a range can be set for the temperature data in advance. When the temperature data is not within the range, it is determined that the temperature data is abnormal. When the temperature data is within the range, it is determined that the temperature data is normal. Further, if the water meter is a hot water meter, the range of the temperature data can be set in advance to "30 degrees-90 degrees". Then, when the obtained temperature data is 60 degrees, it can be determined that the temperature data is normal. When the obtained temperature data is 100 degrees, it can be determined that the temperature data is abnormal.

[0101] In this embodiment, when it is determined that the temperature data is normal, the temperature data is filtered and the processed temperature data is displayed on the operation interface corresponding to the water meter.

[0102] Among them, filtering processing is a processing method for removing data noise to retain the useful features of the data, which may specifically be sliding average filtering processing, exponential smoothing filtering processing, etc. This embodiment does not limit the specific filtering processing method.

[0103] The data collection method provided in this embodiment establishes a communication connection with the temperature sensor after being connected. Therefore, by acquiring temperature data based on the communication connection, the temperature data can be filtered when it is determined that the temperature data is normal, and the processed temperature data can be displayed on the corresponding operation interface, so that the user can smoothly obtain the water temperature through the operation interface, thereby improving the success rate of collecting temperature data.

[0104] As an optional embodiment, in this embodiment Figure 2On the basis of the corresponding embodiment, the temperature data and pressure data collected based on the temperature and pressure transmitter are further refined. When the temperature data and pressure data are collected based on the temperature and pressure transmitter, this embodiment specifically includes the following steps:

[0105] Step d1: Obtaining pressure data based on the communication connection with the temperature and pressure transmitter.

[0106] It is understandable that the application principle of the temperature and pressure transmitter is that a temperature sensor and a pressure transmitter are set inside it. Therefore, when collecting temperature data and pressure data based on the temperature and pressure transmitter, the pressure signal of the water flowing through the water meter detected by the pressure transmitter is first obtained through the communication connection between the water meter and the temperature and pressure transmitter, and the value of the pressure signal is obtained, thereby obtaining the pressure data.

[0107] Step d2: When it is determined that the pressure data is normal, the pressure data is filtered and the temperature data is acquired based on the communication connection with the temperature and pressure transmitter.

[0108] Similarly, the pressure signal of water flowing through the water meter may become abnormal due to factors such as pipe blockage, water pressure fluctuation, and water meter aging. Therefore, the pressure data obtained may be abnormal pressure data.

[0109] Based on this, after obtaining the pressure data, first determine whether the pressure data is normal. For example, a range can be set for the pressure data in advance. When the pressure data is not within the range, the pressure data is determined to be abnormal. When the pressure data is within the range, the pressure data is determined to be normal. Further, if the range set for the pressure data is "0.2-0.5MPa", then when the obtained temperature data is 0.3MPa, the pressure data can be determined to be normal, and when the obtained pressure data is 0.6MPa, the pressure data can be determined to be abnormal.

[0110] In this embodiment, when it is determined that the pressure data is normal, the pressure data is filtered, and further based on the communication connection with the temperature and pressure transmitter, the temperature of the water flowing through the water meter detected by the temperature sensor therein is obtained, the specific value of the water temperature is obtained, and thus the temperature data is obtained.

[0111] Step d3: When it is determined that the temperature data is normal, the temperature data is filtered and the processed pressure data and the processed temperature data are displayed on a corresponding operation interface.

[0112] Specifically, after obtaining the temperature data, if it is determined that the temperature data is normal, the temperature data is filtered, and the specific execution method is similar to step c2, which will not be repeated here. Further, after the processing is completed, the processed pressure data and the processed temperature data are displayed on the operation interface corresponding to the water meter.

[0113] The data acquisition method provided in this embodiment establishes a communication connection with the temperature and pressure transmitter after accessing the temperature and pressure transmitter. Therefore, by acquiring pressure data based on the communication connection, the pressure data can be filtered when the pressure data is determined to be normal. And by further acquiring temperature data based on the communication connection with the temperature and pressure transmitter, the temperature data can be filtered when the temperature data is determined to be normal, so that the processed pressure data and the processed temperature data are displayed on the corresponding operation interface, so that the user can smoothly obtain the water temperature and water pressure conditions through the operation interface, thereby improving the success rate of collecting temperature data and pressure data.

[0114] As an optional embodiment, based on the above embodiment, this embodiment further includes the following steps when determining that the pressure data is abnormal:

[0115] Step e1: Obtain pressure data again based on the retry count timer.

[0116] The retry count timer is a timer that allows the operation to be retried when a specified operation fails until the operation succeeds or the maximum number of retries is reached.

[0117] In this embodiment, based on judging whether the pressure data is normal, when it is determined that the pressure data is abnormal, the retry timer is automatically triggered, and the pressure data is acquired again within the range allowed by the retry timer. The specific acquisition method is similar to step d1 and will not be repeated here.

[0118] Step e2: In response to the pressure data acquired again being always abnormal within the range allowed by the retry timer, the abnormal pressure data is displayed on the corresponding operation interface and a power-off operation is performed.

[0119] It is understandable that for each re-acquisition operation, the pressure data obtained are the latest. Based on this, after the pressure data is obtained again, it is determined again whether the pressure data is normal.

[0120] If the pressure data obtained each time is abnormal within the range allowed by the retry timer, the last abnormal pressure data will be obtained and displayed on the corresponding operation interface to inform the user of the abnormal pressure data. At the same time, the power-off operation will be performed to avoid further damage to the water meter equipment.

[0121] Step e3: In response to the pressure data acquired again returning to normal within the range allowed by the retry timer, the retry timer is cleared; the normal pressure data is filtered, and the process of acquiring temperature data is continued.

[0122] In this embodiment, based on the re-determination of whether the pressure data is normal, if the pressure data obtained by a certain re-acquisition operation returns to normal within the range allowed by the retry timer, the normal pressure data is acquired and the retry timer is reset. Further, the normal pressure data is filtered and the process of acquiring temperature data in step d2 is continued.

[0123] The data acquisition method provided in this embodiment has a retry timer pre-set, so by acquiring pressure data again within the range allowed by the retry timer, when it is determined that the pressure data acquired again is always abnormal, the abnormal pressure data can be displayed on the corresponding operation interface and a power-off operation can be performed, and when it is determined that the pressure data acquired again is back to normal, the retry timer can be cleared, and the normal pressure data can be filtered, so as to continue the process of acquiring temperature data. This gives the system an opportunity to automatically resolve pressure data anomalies and improve user experience.

[0124] As an optional embodiment, based on the fourth or fifth embodiment, this embodiment further includes the following steps when determining that the temperature data is abnormal:

[0125] Step f1: Acquire temperature data again based on the retry count timer.

[0126] In this embodiment, based on judging whether the temperature data is normal, when it is determined that the temperature data is abnormal, the retry timer is automatically triggered, and the temperature data is obtained again within the range allowed by the retry timer. The specific acquisition method is similar to the method of obtaining temperature data in step c1 or step d2, and will not be repeated here.

[0127] Step f2: In response to the temperature data acquired again being abnormal within the range allowed by the retry timer, the abnormal temperature data is displayed on the corresponding operation interface and a power-off operation is performed.

[0128] Similarly, for each re-acquisition operation, the temperature data obtained is the latest, based on which, after the temperature data is acquired again, it is determined whether the temperature data is normal. Then, in response to the temperature data being acquired again being abnormal within the range allowed by the retry timer, the abnormal temperature data is displayed on the corresponding operation interface and a power-off operation is performed. The specific execution method is similar to step e2 and will not be repeated here.

[0129] Step f3: In response to the temperature data acquired again returning to normal within the range allowed by the retry timer, the retry timer is cleared; the normal temperature data is filtered, and the process of displaying the processed temperature data, or the processed pressure data and the processed temperature data is continued.

[0130] In this embodiment, based on the process of re-determining whether the temperature data is normal, if the temperature data acquired again returns to normal within the range allowed by the retry timer, the retry timer is cleared and the normal temperature data is filtered. The specific execution method is similar to the execution method for normal pressure data in step e3, and will not be repeated here.

[0131] Based on this, the process of displaying the processed temperature data in step c2 or the process of displaying the processed pressure data and the processed temperature data in step d3 is continued.

[0132] The data acquisition method provided in this embodiment has a retry timer pre-set, so by reacquiring temperature data within the range allowed by the retry timer, when it is determined that the temperature data acquired again is always abnormal, the abnormal temperature data can be displayed on the corresponding operation interface and a power-off operation can be performed. When it is determined that the temperature data acquired again has returned to normal, the retry timer can be cleared and the normal temperature data can be filtered, thereby continuing to display the processed temperature data, or displaying the processed pressure data and the processed temperature data. This gives the system an opportunity to automatically resolve temperature data anomalies, further improving user experience.

[0133] It should be noted that in step a4, when the protocol parsing is abnormal, the parsing time is obtained, and it is determined whether the parsing time is greater than the preset time threshold. If not, the indicator data returned by the connected device can be received again based on the retry timer, and the temperature and pressure detection component can be used to perform protocol parsing on the returned indicator data again. Then, in response to the result of performing the protocol parsing again being abnormal within the range allowed by the retry timer, it is determined that the connected device is a temperature sensor. In response to the result of performing the protocol parsing again being normal within the range allowed by the retry timer, it is determined that the connected device is a temperature and pressure sensor, thereby further improving the accuracy of detecting the identity of the device.

[0134] Figure 3 Schematic diagram of the data collection method provided for this application Figure 2 ,like Figure 3 As shown, this embodiment describes in detail the complete execution process of the data collection method, and the data collection method provided by this embodiment includes:

[0135] S301. In response to entering the current power supply state, a temperature and pressure detection component is used to send a detection instruction to the connected device, and the temperature and pressure detection component is used to detect the index data returned by the temperature and pressure transmitter.

[0136] S302, receiving the index data returned by the connected device, and using the temperature and pressure detection component to perform protocol analysis on the returned index data.

[0137] S303, determine whether the protocol analysis result is normal, if so, execute S304, if not, execute S322.

[0138] S304, determine that the connected device is a temperature and pressure transmitter, and execute S305-S321.

[0139] S305. Obtain pressure data based on the communication connection with the temperature and pressure transmitter.

[0140] S306: Determine whether the pressure data is normal. If so, execute S307-S308; if not, execute S309-S313.

[0141] S307: Filter the pressure data.

[0142] S308. Acquire temperature data based on the communication connection with the temperature and pressure transmitter, and execute S314.

[0143] S309: Obtain pressure data again based on the retry count timer.

[0144] S310. Determine whether the pressure data acquired again returns to normal within the range allowed by the retry timer. If so, execute S311-S312; if not, execute S313.

[0145] S311. Clear the retry count timer.

[0146] S312: Filter the normal pressure data and continue to execute S308.

[0147] S313, displaying the abnormal pressure data on the corresponding operation interface and performing a power-off operation.

[0148] S314, determine whether the temperature data is normal, if so, execute S315-S316, if not, execute S317-S321.

[0149] S315: Filter the temperature data.

[0150] S316: Display the processed pressure data and the processed temperature data on the corresponding operation interface.

[0151] S317: Obtain temperature data again based on the retry count timer.

[0152] S318. Determine whether the temperature data acquired again returns to normal within the range allowed by the retry timer. If so, execute S319-S320; if not, execute S321.

[0153] S319: Clear the retry count timer.

[0154] S320, filter the normal temperature data, and continue to execute S316.

[0155] S321, displaying abnormal temperature data on a corresponding operation interface and executing a power-off operation.

[0156] S322, obtaining the parsing time, and determining whether the parsing time is greater than a preset time threshold, if so, executing S323, if not, executing S324.

[0157] S323, obtaining the number of times the detection instruction is sent, and determining whether the number of times the detection instruction is sent is greater than the preset number of times, if so, executing S324, if not, returning to S301.

[0158] S324: Determine that the connected device is a temperature sensor, and execute S325-S333.

[0159] S325. Acquire temperature data based on the communication connection with the temperature sensor.

[0160] S326: Determine whether the temperature data is normal. If so, execute S327-S328; if not, execute S329-S333.

[0161] S327: Filter the temperature data.

[0162] S328. Display the processed temperature data on the corresponding operation interface.

[0163] S329. Obtain temperature data again based on the retry count timer.

[0164] S330. Determine whether the temperature data acquired again returns to normal within the range allowed by the retry timer. If so, execute S331-S332; if not, execute S333.

[0165] S331. Clear the retry count timer.

[0166] S332: Filter the normal temperature data and continue to execute S328.

[0167] S333, displaying the abnormal temperature data on the corresponding operation interface and executing a power-off operation.

[0168] Figure 4 The hardware connection diagram for the water meter provided in this application when executing the data collection method is as follows: Figure 4 As shown, the ground wire GND and input / output port IO_1 corresponding to the temperature sensor are pre-configured on the acquisition circuit, and the voltage source VCC, ground wire GND, input / output port IO_2 and input / output port IO_3 corresponding to the temperature and pressure transmitter are configured. Among them, IO_2 corresponds to the temperature sensor in the temperature and pressure transmitter, and IO_3 corresponds to the pressure transmitter in the temperature and pressure transmitter. Further, according to the device to which the input / output port belongs, the corresponding general input / output port GPIO_1 for connecting to the processor MCU is configured for the input / output port of the temperature sensor, and the corresponding GPIO_2 for connecting to the MCU is configured for the input / output port of the pressure transmitter.

[0169] Then, when the device inserted into the target interface is a temperature sensor, the MCU controls the system to enter the power supply state based on the ground wire GND corresponding to the temperature sensor, and collects the temperature data detected by the temperature sensor based on the path formed by GPIO_1 and IO_1. When the device inserted into the target interface is a temperature and pressure transmitter, the MCU controls the system to enter the power supply state based on the voltage source VCC and ground wire GND corresponding to the temperature and pressure transmitter, and collects the temperature data detected by the temperature and pressure transmitter based on the path formed by GPIO_1 and IO_2, and collects the pressure data detected by the temperature and pressure transmitter based on the path formed by GPIO_2 and IO_3.

[0170] It can be understood that the above-mentioned MCU is located in the water meter, and the above-mentioned acquisition circuit can be directly integrated into the target interface, or can be connected to the target interface through an appropriate connecting line, which is not limited in this embodiment.

[0171] Figure 5 The structural diagram of the data acquisition device provided in this application is as follows: Figure 5 As shown, the data acquisition device 50 provided in this embodiment includes: a processing module 51 and a collection module 52.

[0172] Among them, the processing module 51 is used to detect the connected device based on the target interface in response to the current power supply state; the acquisition module 52 is used to collect temperature data based on the temperature sensor if it is determined that the connected device is a temperature sensor; the temperature sensor is a device for detecting temperature indicators; if it is determined that the connected device is a temperature and pressure transmitter, temperature data and pressure data are collected based on the temperature and pressure transmitter; the temperature and pressure transmitter is a device for detecting temperature indicators and pressure indicators.

[0173] Optionally, the processing module 51, when detecting the connected device based on the target interface, is specifically configured to:

[0174] A temperature and pressure detection component is used to send a detection instruction to the connected device, and the temperature and pressure detection component is used to detect the index data returned by the temperature and pressure transmitter; the index data returned by the connected device is received, and the temperature and pressure detection component is used to perform protocol analysis on the returned index data; when the protocol analysis is normal, it is determined that the connected device is a temperature and pressure transmitter; when the protocol analysis is abnormal, the analysis time is obtained, and it is determined whether the analysis time is greater than the preset time threshold; if not, it is determined that the connected device is a temperature sensor.

[0175] Optionally, the data acquisition device provided in this embodiment further includes: a transceiver module.

[0176] Among them, the processing module 51 is also used to determine whether the analysis time is greater than a preset time threshold. If so, the number of times the detection instruction is sent is obtained, and it is determined whether the number of times the detection instruction is sent is greater than the preset number of times; when it is determined to be less than or equal to, the temperature and pressure detection component is used to send the detection instruction to the connected device again; the index data returned by the connected device is received again, and the temperature and pressure detection component is used to perform protocol analysis on the returned index data again; when it is determined to be greater than, it is determined that the connected device is a temperature sensor.

[0177] Optionally, when collecting temperature data based on the temperature sensor, the acquisition module 52 is specifically used to:

[0178] The temperature data is acquired based on the communication connection with the temperature sensor; when it is determined that the temperature data is normal, the temperature data is filtered and the processed temperature data is displayed on the corresponding operation interface.

[0179] Optionally, when collecting temperature data and pressure data based on the temperature and pressure transmitter, the acquisition module 52 is specifically used to:

[0180] The pressure data is acquired based on the communication connection with the temperature and pressure transmitter; when it is determined that the pressure data is normal, the pressure data is filtered, and the temperature data is acquired based on the communication connection with the temperature and pressure transmitter; when it is determined that the temperature data is normal, the temperature data is filtered, and the processed pressure data and the processed temperature data are displayed on the corresponding operation interface.

[0181] Optionally, the processing module 51 is also used to obtain the pressure data again based on the retry timer when it is determined that the pressure data is abnormal; in response to the pressure data obtained again being abnormal within the range allowed by the retry timer, the abnormal pressure data is displayed on the corresponding operation interface and a power-off operation is performed; in response to the pressure data obtained again returning to normal within the range allowed by the retry timer, the retry timer is cleared; the normal pressure data is filtered, and the process of obtaining temperature data is continued.

[0182] Optionally, the processing module 51 is also used to, when it is determined that the temperature data is abnormal, re-acquire the temperature data based on a retry timer; in response to the temperature data re-acquired being always abnormal within the range allowed by the retry timer, display the abnormal temperature data on a corresponding operation interface and perform a power-off operation; in response to the temperature data re-acquired returning to normal within the range allowed by the retry timer, perform a clearing operation on the retry timer; filter the normal temperature data, and continue to display the processed temperature data, or the processed pressure data and the processed temperature data.

[0183] The data acquisition device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be described in detail here.

[0184] Figure 6 The schematic diagram of the water meter device provided for this application. Figure 6 As shown, the water meter device 60 provided in this embodiment includes: a target interface 61, at least one processor 62 and a memory 63. Optionally, the device 60 also includes a communication component. The processor 62, the memory 63 and the communication component are connected via a bus 64.

[0185] In the specific implementation process, the target interface 61 is used to access the temperature sensor and the temperature and pressure transmitter, and at least one processor 62 executes the computer execution instructions stored in the memory 63, so that the at least one processor 62 executes the above method.

[0186] The specific implementation process of the processor 62 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0187] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0188] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.

[0189] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0190] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0191] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.

[0192] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0193] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0194] The division of units is only a logical function division, and there may be other divisions 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 an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

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

[0196] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0197] If the function 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 storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0198] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0199] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A data collection method, characterized in that: The method is applied to a water meter, the water meter includes a target interface, and the water meter executes the data collection method when sensing that the target interface is connected. The method includes: In response to currently entering the power supply state, detecting the connected device based on the target interface; If it is determined that the connected device is a temperature sensor, temperature data is collected based on the temperature sensor; the temperature sensor is a device for detecting temperature indicators; If it is determined that the connected device is a temperature and pressure transmitter, temperature data and pressure data are collected based on the temperature and pressure transmitter; the temperature and pressure transmitter is a device for detecting temperature indicators and pressure indicators.

2. The method according to claim 1, characterized in that The detecting of the connected device based on the target interface includes: A temperature and pressure detection component is used to send a detection instruction to the connected device, and the temperature and pressure detection component is used to detect the index data returned by the temperature and pressure transmitter; Receive the index data returned by the connected device, and use the temperature and pressure detection component to perform protocol analysis on the returned index data; When the protocol analysis is normal, it is determined that the connected device is a temperature and pressure transmitter; When the protocol parsing is abnormal, the parsing time is obtained, and it is determined whether the parsing time is greater than a preset time threshold; if not, it is determined that the connected device is a temperature sensor.

3. The method according to claim 2, characterized in that After determining whether the parsing time is greater than a preset time threshold, the method further includes: If yes, obtain the number of times the detection instruction is sent, and determine whether the number of times the detection instruction is sent is greater than the preset number of times; When it is determined that the value is less than or equal to the value, the temperature and pressure detection component is used again to send a detection instruction to the connected device again; the index data returned by the connected device is received again, and the temperature and pressure detection component is used to perform protocol analysis on the returned index data again; When it is determined that is greater than, it is determined that the connected device is a temperature sensor.

4. The method according to claim 1, characterized in that The collecting of temperature data based on the temperature sensor includes: Acquiring the temperature data based on a communication connection with the temperature sensor; When it is determined that the temperature data is normal, the temperature data is filtered and the processed temperature data is displayed on a corresponding operation interface.

5. The method according to claim 1, characterized in that The method of collecting temperature data and pressure data based on the temperature and pressure transmitter includes: Acquiring the pressure data based on a communication connection with the temperature and pressure transmitter; When it is determined that the pressure data is normal, filtering the pressure data, and acquiring the temperature data based on a communication connection with the temperature and pressure transmitter; When it is determined that the temperature data is normal, the temperature data is filtered, and the processed pressure data and the processed temperature data are displayed on a corresponding operation interface.

6. The method according to claim 5, characterized in that When determining that the pressure data is abnormal, the method further includes: Obtain pressure data again based on a retry count timer; In response to the pressure data acquired again being always abnormal within the range allowed by the retry timer, the abnormal pressure data is displayed on the corresponding operation interface and a power-off operation is performed; In response to the pressure data acquired again returning to normal within the range allowed by the retry timer, the retry timer is cleared; the normal pressure data is filtered, and the process of acquiring temperature data is continued.

7. The method according to claim 4 or 5, characterized in that: When determining that the temperature data is abnormal, the method further includes: Get temperature data again based on the retry count timer; In response to the temperature data acquired again being always abnormal within the range allowed by the retry timer, the abnormal temperature data is displayed on the corresponding operation interface and a power-off operation is performed; In response to the temperature data acquired again returning to normal within the range allowed by the retry timer, the retry timer is cleared; the normal temperature data is filtered, and the process of displaying the processed temperature data, or the processed pressure data and the processed temperature data is continued.

8. A water meter device, characterized in that: include: Memory, processor, target interface; The memory stores computer-executable instructions; the target interface is used to access a temperature sensor or a temperature and pressure transmitter; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.

10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 7 when being executed by a processor.