Counter data self-diagnosis method and device

By calculating the maximum reasonable number and comparing the current flow data bit by bit, the problem of inaccurate measurement of the photoelectric direct reading counter is solved, effective monitoring and evaluation of the counter status is achieved, and the accuracy and reliability of the counter are improved.

CN120232501AInactive Publication Date: 2025-07-01ZHEJIANG CHINT INSTR & METER
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510705445.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-29
Publication Date
2025-07-01
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The photoelectric direct reading counter is inaccurate due to unstable performance of the photoelectric transceiver, bubble interference and ambient light interference, and it is impossible to determine whether it is still applicable to the current instrument.

Method used

By obtaining the current traffic data and the latest data of the counter, calculate the maximum reasonable number, and compare bit by bit based on the preset comparison mechanism until the corresponding digits of the ten digits are completely consistent, perform update result data operations and/or determine whether the self-diagnostic counter is applicable.

Benefits of technology

It realizes effective monitoring and evaluation of counter status, improves counter counting accuracy and reliability, ensures data accuracy and system stability, and reduces faults caused by data errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120232501A_ABST
    Figure CN120232501A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of metering data diagnosis, and discloses a counter data self-diagnosis method and device, and the method comprises the steps: obtaining the current flow data and the latest data of a counter, and calculating a maximum reasonable number based on the current flow data; based on a preset comparison bit comparison mechanism, sequentially comparing the current traffic data with the comparison bit numbers of the maximum reasonable number until the numbers of the ten corresponding bits are completely consistent, and obtaining a comparison result; and executing a result data updating operation and / or judging whether the self-diagnosis counter is applicable or not based on the comparison result. The state of the counter is effectively monitored and evaluated, the counting accuracy of the photoelectric direct-reading counter is improved, and the problem that whether the photoelectric direct-reading counter is still suitable for a current meter or not cannot be judged due to the fact that the metering number of the photoelectric direct-reading counter is inaccurate is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of measurement data diagnosis, and particularly to a method and device for self-diagnosis of counter data. Background Art

[0002] The photoelectric direct-reading counter of a diaphragm gas meter is generally used to convert the reading of the diaphragm gas meter counter into an electrical signal and send it to the main control board of the intelligent diaphragm gas meter, so that the intelligent module can read the reading of the diaphragm gas meter and realize the function of intelligent meter reading.

[0003] With the development of electronic information technology, intelligent remote gas meters are widely used in the gas industry. Many intelligent remote gas meters adopt the above-mentioned photoelectric direct-reading method to collect the readings of gas meters. Due to reasons such as unstable performance of photoelectric transceiver tubes (i.e., light-emitting diodes and receiving diodes), bubble interference, ambient light interference, and technical complexity, some bits of the intelligent remote gas meter cannot be accurately identified within a certain period of time, and the intelligent remote gas meter collects abnormal readings. During the operation of intelligent gas meters, the photoelectric direct-reading counter also has defects and deficiencies, such as bubble interference, cumulative error, and technical complexity. Each round of the counter exists independently. When there are temporary digital errors in a single round or a single digit, it leads to inaccurate measurement of the photoelectric direct-reading counter. In this case, it is impossible to determine whether the photoelectric direct-reading counter is still applicable to the current meter. Summary of the Invention

[0004] In view of this, the present invention provides a method and device for self-diagnosis of counter data to solve the problem that it is impossible to determine whether the photoelectric direct-reading counter is still applicable to the current meter due to inaccurate counting of the photoelectric direct-reading counter.

[0005] In a first aspect, the present invention provides a method for self-diagnosis of counter data, the method comprising: Obtaining current flow data and the latest counter data, and calculating the maximum reasonable number based on the current flow data; Comparing the comparison bit numbers of the current flow data and the maximum reasonable number in turn based on a preset comparison bit comparison mechanism until the numbers of the corresponding bits of the tens place are exactly the same, to obtain a comparison result; Performing an operation of updating result data and / or an operation of determining whether the self-diagnosis counter is applicable based on the comparison result.

[0006] A method for self-diagnosing counter data provided by the present invention can timely detect whether the data exceeds the reasonable range by calculating the maximum reasonable number and comparing the current flow data with it, which helps to ensure the accuracy of counter data and avoid incorrect judgments or decisions caused by abnormal data. Based on the preset comparison bit comparison mechanism, the comparison bit numbers of the current flow data and the maximum reasonable number are compared in sequence until the numbers of the corresponding bits in the tens place are exactly the same. This meticulous comparison method can comprehensively detect the consistency of the data. Once inconsistency is found, it can be processed through subsequent operations, thereby enhancing the stability of the entire system and reducing system failures or anomalies caused by data errors. According to the comparison result, the operation of updating the result data and / or the operation of judging whether the self-diagnosing counter is applicable is executed, realizing the effective monitoring and evaluation of the status of the counter itself, improving the counting accuracy of the optoelectronic direct-reading counter, and solving the problem that the inaccurate measurement number of the optoelectronic direct-reading counter makes it impossible to judge whether the optoelectronic direct-reading counter is still applicable to the current meter. This not only helps to timely detect possible problems of the counter, but also provides a basis for subsequent maintenance and optimization, improving the reliability and service life of the counter. This method does not impose too many restrictions on the specific counter type or application scenario, and has high generality. It can be applied to various different types of counters. Whether it is a civilian optoelectronic counter meter or other similar counter devices, as long as the current flow data and the latest data of the counter can be obtained, this method can be used for data self-diagnosis. Therefore, it has a wide application prospect and strong adaptability.

[0007] In an alternative embodiment, calculating the maximum reasonable number based on the current flow data includes: Obtaining the maximum hourly flow of the meter used in conjunction with the counter; Calculating the sum value of the maximum hourly flow of a preset multiple and the current flow data, and taking the sum value as the maximum reasonable number.

[0008] A method for self-diagnosing counter data provided by the present invention calculates the maximum reasonable number by obtaining the maximum hourly flow of the meter used in conjunction with the counter, which can closely combine the actual operating capacity of the meter and the current flow situation, making the maximum reasonable number more in line with the actual business scenario and providing a more accurate basis for accurately judging the reasonableness of the counter data. Calculating the sum value of the maximum hourly flow of a preset multiple and the current flow data as the maximum reasonable number, this calculation method is relatively simple and direct, does not require complex algorithms or a large amount of computing resources, can obtain the result in a short time, helps to improve the efficiency of data processing, and provides support for the self-diagnosis of counter data in a timely manner.

[0009] In an alternative embodiment, the comparison bit numbers of the current traffic data and the maximum reasonable number are sequentially compared based on a preset comparison bit comparison mechanism until the corresponding bit numbers in the tens place are exactly the same, and the comparison result is obtained, including: Determine the starting value of the comparison bit in the preset comparison bit comparison mechanism; Compare whether the starting bit data of the current traffic data is the same as the starting bit data of the maximum reasonable number according to the starting value of the comparison bit. If they are the same, add a preset number to the starting value of the comparison bit, and compare whether the second bit data of the current traffic data is the same as the second bit data of the maximum reasonable number according to the accumulated comparison bit, and sequentially loop through the comparison until it is determined whether the tens bit data of the current traffic data is the same as the tens bit data of the maximum reasonable number; If the starting bit data of the current traffic data until the tens bit data of the current traffic data are all correspondingly the same as the starting bit data of the maximum reasonable number until the tens bit data of the maximum reasonable number, a comparison result of consistent comparison is obtained; otherwise, a comparison result of inconsistent comparison is obtained.

[0010] A counter data self-diagnosis method provided by the present invention determines the starting value of the comparison bit and sequentially accumulates and compares bit by bit according to a fixed rule, from the starting bit to the tens bit, forming a clear and organized comparison process. This ordered comparison method helps to accurately judge the consistency of two numbers in each digit, avoiding confusion and omission, making the comparison result more reliable. The mechanism of sequential comparison bit by bit has good scalability. If more digits need to be compared, or the comparison range and precision need to be adjusted according to different requirements, only parameters such as the starting value of the comparison bit, the preset number, and the termination bit of the comparison need to be modified accordingly, without the need to make large-scale modifications to the entire comparison mechanism, and it can easily adapt to different counter data formats and precision requirements. During the comparison process, once it is found that the data in a certain digit is inconsistent, it can be immediately determined that there is a difference between the two numbers, and there is no need to continue comparing the subsequent digits. This enables the difference between the current traffic data and the maximum reasonable number to be quickly located, improving the efficiency of data comparison and helping to timely discover possible problems in the counter data. By comparing the current traffic data and the maximum reasonable number bit by bit, the matching situation of the two numbers in each digit can be accurately judged, and thus the comparison result can be accurately obtained.

[0011] In an alternative embodiment, when sequentially comparing the comparison bit numbers of the current traffic data and the maximum reasonable number based on a preset comparison bit comparison mechanism until the corresponding bit numbers in the tens place are exactly the same to obtain the comparison result, it further includes: When the starting bit data of the current traffic data is not the same as the starting bit data of the maximum reasonable number compared according to the starting value of the comparison bit, determine whether the latest data of the counter and the current traffic data meet a preset condition; If the preset condition is satisfied, continue to determine whether the starting bit data of the current traffic data and the starting bit data of the maximum reasonable number are ten-digit data. If it is ten-digit data, execute the step of determining the starting value of the comparison bit in the preset comparison bit comparison mechanism and compare whether the starting bit data of the current traffic data and the starting bit data of the maximum reasonable number are the same according to the starting value of the comparison bit; if it is not ten-digit data, accumulate the comparison times and the starting value of the comparison bit to obtain the combined comparison result corresponding to the accumulated comparison times, the accumulated starting value of the comparison bit, the current traffic data, and the latest data digit of the counter.

[0012] A counter data self-diagnosis method provided by the present invention, when the starting bit data of the current traffic data and the maximum reasonable number are inconsistent, by judging whether the preset condition is satisfied between the latest data of the counter and the current traffic data, different processing methods can be adopted for different situations, so that the algorithm is not limited to simple consistency or inconsistency judgments, can better handle various possible data situations, and improves the processing ability of the algorithm for complex data. When the preset condition is satisfied and it is not ten-digit data, the comparison times and the starting value of the comparison bit are accumulated to obtain a new combined comparison result. This method can dynamically adjust the comparison process according to the actual data situation, avoid unnecessary repeated comparisons, improve the comparison efficiency, and make the entire self-diagnosis process more efficient and accurate. By further judging whether it is ten-digit data and performing corresponding operations according to the result, the data can be analyzed more carefully to ensure that the data comparison at different digits can be reasonably processed, thereby improving the judgment accuracy of whether the self-diagnosis counter is applicable and reducing the possibility of misjudgment.

[0013] In an optional implementation manner, based on the preset comparison bit comparison mechanism, compare the comparison bit digits of the current traffic data and the maximum reasonable number in sequence until whether the corresponding bit digits of the tenth digit are exactly the same to obtain the comparison result, and further include: If the preset condition is not satisfied, then judge whether the latest data of the counter corresponding to the starting value of the comparison bit is the same as the current traffic data. If they are the same, execute the operation of updating the result data based on the comparison result; if they are not the same, find the new comparison bit before the ten-digit data in the latest data of the counter that is equal to the digit of the corresponding bit in the current traffic data to obtain the new comparison bit digit comparison result or the comparison result of not finding it.

[0014] A counter data self-diagnosis method provided by the present invention, when the latest counter data does not meet the preset conditions compared with the current flow data, further determines whether the latest counter data corresponding to the starting value of the comparison bit is consistent with the current flow data. If they are consistent, an operation of updating the result data is performed. This method can flexibly handle different data situations, making the self-diagnosis method more adaptable, better able to cope with various possible data states, improving the generality of the counter data self-diagnosis method. In the case of inconsistency, find a new comparison bit before the tens digit in the latest counter data that is equal to the digit in the corresponding position of the current flow data. This helps to more precisely analyze the data differences, locate the possible problem positions, provide more detailed information for subsequent adjustment or correction of the counter data, so as to more specifically solve the problem of data inconsistency, and improve the accuracy and effectiveness of data diagnosis.

[0015] In an alternative embodiment, performing an operation of updating the result data and / or determining whether the self-diagnosis counter is applicable based on the comparison result includes: When obtaining a comparison result of consistency, update the result data according to the digit of the current flow data corresponding to the starting value of the comparison bit, and obtain a judgment result that the self-diagnosis counter is applicable; When obtaining a comparison result of inconsistency, perform an operation of updating the result data and determining whether the self-diagnosis counter is applicable based on the combined comparison result of the accumulated comparison times, the current flow data corresponding to the accumulated starting value of the comparison bit, and the digit of the latest counter data; or perform an operation of updating the result data based on the comparison result of the new comparison bit digit; or perform an operation of determining whether the self-diagnosis counter is applicable based on the comparison result that has not been found.

[0016] A counter data self-diagnosis method provided by the present invention formulates clear operation processes for different comparison results (consistent comparison and inconsistent comparison) respectively. When the comparison is consistent, the result data is directly updated and the conclusion that the self-diagnosis counter is applicable is obtained; when the comparison is inconsistent, the operation is further refined according to different intermediate comparison results (combined comparison result, new comparison bit digit comparison result, not-found comparison result). This clear logical structure makes the entire self-diagnosis process easy to understand and implement, and also facilitates subsequent maintenance and optimization. For the case of consistent comparison, the result data is directly updated based on the current flow data, and at the same time, it is determined that the self-diagnosis counter is applicable, ensuring the accuracy of the result when the data is completely matched. For the case of inconsistent comparison, by processing different intermediate results, the data differences can be analyzed more deeply, and various factors are comprehensively considered to determine whether the self-diagnosis counter is applicable, avoiding a simple and crude judgment method and improving the accuracy and reliability of the judgment result. When the comparison is consistent, the result data is updated according to the digit of the current flow data corresponding to the starting value of the comparison bit, ensuring that the result data can timely reflect the situation of the current flow data. When the comparison is inconsistent, corresponding update operations are performed according to different intermediate results, so that the result data can be reasonably adjusted according to the actual data differences, making the result data more valuable for reference.

[0017] In an alternative embodiment, based on the combined comparison result of the accumulated comparison times, the current flow data corresponding to the accumulated starting value of the comparison bit, and the digit of the latest data of the counter, perform the operation of updating the result data and the operation of determining whether the self-diagnosis counter is applicable based on the comparison result, including: Determine the comparison times, add a preset number to the comparison times, and at the same time add the accumulated comparison times to the starting value of the comparison bit to obtain a new comparison bit value. Then, determine whether the digit of the current flow data corresponding to the new comparison bit value and the maximum reasonable number is 0. If it is not 0, re-search for the bit whose digit after the new comparison bit value is 0 in the latest data of the counter. If the bit whose digit after the new comparison bit value is 0 is found before the units digit, update the preset number of digits before the new comparison bit value to the result data. If the bit whose digit after the new comparison bit value is 0 is not found before the units digit, keep the current flow data unchanged and perform the operation of determining whether the self-diagnosis counter is applicable based on the usage amount of the metering device.

[0018] A method for self-diagnosis of counter data provided by the present invention determines the number of comparisons and accumulates them. At the same time, it dynamically adjusts the starting value of the comparison bit according to the accumulated number of comparisons to obtain a new comparison bit value, enabling the comparison process to vary flexibly according to the actual situation. This dynamic adjustment mechanism can better adapt to different data characteristics and improve the processing ability of the self-diagnosis method for complex data. After obtaining the new comparison bit value, it is judged whether the digits of the current flow data and the maximum reasonable number corresponding to this bit are 0, and different processing is carried out accordingly. If it is not 0, then a bit with a digit of 0 is searched again in the latest data of the counter. If found, the result data is updated. This processing method for a specific digit (0) can more accurately extract the effective information in the data, provide a more reasonable basis for the update of the result data, and improve the pertinence and effectiveness of data processing. If no bit with a digit of 0 is found after the new comparison bit value before the units digit, the current flow data remains unchanged and a judgment on whether the self-diagnosis counter is applicable is performed based on the usage amount of the metering device. This operation ensures that when the result data cannot be updated in the conventional way, a reasonable judgment can still be made based on the usage amount of the metering device, avoiding incorrect judgments caused by data anomalies, thereby improving the reliability of the self-diagnosis process and the credibility of the data.

[0019] In an alternative embodiment, the operation of updating the result data based on the comparison result of the new comparison bit digit includes: Performing an operation of updating the result data based on the digits of a preset number of bits before the new comparison bit.

[0020] A method for self-diagnosis of counter data provided by the present invention performs an operation of updating the result data based on the digits of a preset number of bits before the new comparison bit, which can update the result data in a targeted manner. By focusing on the digits of specific positions before the new comparison bit, unnecessary changes to the result data are avoided, making the update operation more accurate. Only paying attention to the digits of a preset number of bits before the new comparison bit greatly reduces the scope and workload of data processing compared to processing the entire result data.

[0021] In an alternative embodiment, the operation of judging whether the self-diagnosis counter is applicable based on the comparison result that is not found includes: If the new comparison bit before the tens digit data in the latest data of the counter that is not found is equal to the digit of the corresponding position in the current flow data, the current flow data remains unchanged and a judgment on whether the self-diagnosis counter is applicable is performed based on the usage amount of the metering device.

[0022] A method for self-diagnosing counter data provided by the present invention keeps the current flow data unchanged when a new comparison bit is equal to the digit of the corresponding bit in the current flow data before finding the tens digit data in the latest counter data. This operation avoids randomly changing the current flow data due to data anomalies or mismatches, ensuring the stability and reliability of the data, and making subsequent judgments based on the current flow data and the usage of the metering device more credible. Judging whether the self-diagnosing counter is applicable based on the usage of the metering device makes full use of the relevant data of the metering device. The usage of the metering device is one of the important bases for reflecting the working state of the counter. By combining this information for judgment, the working condition of the counter can be evaluated from another perspective, increasing the dimension and comprehensiveness of the judgment and improving the accuracy of self-diagnosis. By keeping the current flow data unchanged and combining the usage of the metering device for judgment, the self-diagnosis process becomes more rigorous. This judgment method that comprehensively considers multiple factors reduces the possibility of misjudgment caused by a single data factor and enhances the reliability of the judgment on whether the self-diagnosing counter is applicable.

[0023] In a second aspect, the present invention provides a device for self-diagnosing counter data, which includes: A data acquisition and maximum reasonable number calculation module, configured to acquire the current flow data and the latest counter data, and calculate the maximum reasonable number based on the current flow data; A comparison bit digit comparison module, configured to sequentially compare the comparison bit digits of the current flow data and the maximum reasonable number based on a preset comparison bit comparison mechanism until the digits of the corresponding bit in the tens place are exactly the same, and obtain a comparison result; An update operation and self-diagnosis execution module, configured to perform an update result data operation and / or judge whether the self-diagnosing counter is applicable based on the comparison result.

[0024] In a third aspect, the present invention provides a computer device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to execute the counter data self-diagnosis method according to the first aspect or any corresponding embodiment thereof.

[0025] In a fourth aspect, the present invention provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to cause a computer to execute the counter data self-diagnosis method according to the first aspect or any corresponding embodiment thereof.

[0026] In a fifth aspect, the present invention provides a computer program product, including computer instructions, and the computer instructions are used to cause a computer to execute the counter data self-diagnosis method according to the first aspect or any corresponding embodiment thereof. Description of the Drawings

[0027] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0028] Figure 1 is the circuit schematic diagram of the wheel state of the photoelectric direct-reading gas meter according to an embodiment of the present invention; Figure 2 is the schematic flowchart of the counter data self-diagnosis method according to an embodiment of the present invention; Figure 3 is the schematic flowchart of another counter data self-diagnosis method according to an embodiment of the present invention; Figure 4 is the schematic flowchart of yet another counter data self-diagnosis method according to an embodiment of the present invention; Figure 5 is the schematic flowchart of still another counter data self-diagnosis method according to an embodiment of the present invention; Figure 6 is the structural block diagram of the counter data self-diagnosis device according to an embodiment of the present invention; Figure 7 is the schematic diagram of the hardware structure of the computer device according to an embodiment of the present invention. Specific Embodiments

[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.

[0030] As Figure 1 shown, it is the circuit schematic diagram of the wheel state of the photoelectric direct-reading gas meter, where D1, D2, D3, D4, and D5 are light-emitting diodes, and N1 is the corresponding receiving diode. When the corresponding CODEA pin is at a low level and the L0 pin, L1 pin, L2 pin, L3 pin, and L4 pin are at high levels in sequence, the D1, D2, D3, D4, and D5 light-emitting diodes conduct in sequence; when the light-emitting diode conducts, if the corresponding receiving diode is not blocked, then the N1 receiving diode conducts, and the INA pin is at a low level; if the corresponding receiving diode is blocked, then the N1 receiving diode cannot conduct, and the INA pin is at a high level.

[0031] When reading the status of the digit wheel, first set the L0 pin, L1 pin, L2 pin, L3 pin, L4 pin and CODEA pin of the light-emitting diode to low level. At this time, all the light-emitting diodes are not conducting. Then, sequentially set the L0 pin from low level to high level, and at the same time read the status of the INA pin. After each reading, set the corresponding L1 pin, L2 pin, L3 pin, L4 pin from low level to high level, and then receive the status of the next group of INA pins until 5 groups are completed. The generated 5-bit status binary coded data, after decoding, is converted into an optoelectronic number, representing the digit wheel reading of the intelligent remote transmission meter. For example Figure 1 The binary coded data 10111 in

[0032] With the development of electronic information technology, intelligent remote transmission gas meters are widely used in the gas industry. Many intelligent remote transmission gas meters adopt the above-mentioned optoelectronic direct reading method to collect the readings of gas meters. Due to reasons such as unstable performance of optoelectronic transceiver tubes (i.e., light-emitting diodes and receiving diodes), bubble interference, ambient light interference, and technical complexity, some bits of the intelligent remote transmission gas meter cannot be accurately identified for a period of time, resulting in abnormal readings collected by the intelligent remote transmission gas meter. When there is a temporary digital error in a single wheel or a single digit, it causes inaccurate measurement of the optoelectronic direct reading counter. In this case, it is impossible to determine whether the optoelectronic direct reading counter is still applicable to the current meter.

[0033] The embodiment of the present invention provides a counter data self-diagnosis method, which can judge whether the counter is still applicable to the measuring meter through self-diagnosis, achieving the effects of accurate measurement and consistency of the counter.

[0034] According to the embodiment of the present invention, an embodiment of a counter data self-diagnosis method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0035] In this embodiment, a counter data self-diagnosis method is provided, which can be used for measuring meters, such as intelligent gas meters, intelligent remote transmission meters, etc. Figure 2 is a flowchart of the counter data self-diagnosis method according to the embodiment of the present invention, as Figure 2 shown, this process includes the following steps: Step S101, obtain the current flow data and the latest data of the counter, and calculate the maximum reasonable number based on the current flow data.

[0036] Specifically, real-time flow data is obtained through a sensor or data acquisition module connected to a counter. For example, the counter is connected to a smart gas meter. For a gas flow counter used to measure gas flow, the sensor continuously monitors the gas flow rate and converts the flow rate information into a digital signal and transmits it to the data processing unit. After a series of processes (such as filtering, calibration, etc.), the data processing unit obtains the current flow data, stores it in memory in a specific format (such as floating-point form), and waits for subsequent processing.

[0037] Read the latest recorded data of the counter from the storage medium of the counter itself (such as EEPROM, flash memory, etc.). Each time the counter detects a change in flow, it stores the current cumulative flow value.

[0038] For the convenience of calculation, a maximum reasonable number is set, and the maximum reasonable number is calculated based on the current flow data.

[0039] The current flow data, the latest data of the counter, and the maximum reasonable number are all represented in binary data from 0 to 9.

[0040] Step S102, based on a preset comparison bit comparison mechanism, sequentially compare the comparison bit numbers of the current flow data and the maximum reasonable number until the numbers of the corresponding bits in the tens place are exactly the same, and obtain the comparison result.

[0041] Specifically, the preset comparison bit comparison mechanism refers to comparing the comparison bit numbers in the current flow data and the maximum reasonable number bit by bit.

[0042] For example, set the starting value of the comparison bit to 0, which means starting from the leftmost (highest) bit of the data for bit-by-bit comparison. Create a variable n in memory and initialize it to 0. n is used to record the position of the digit currently being compared.

[0043] First comparison: Read the current flow data and the maximum reasonable number from memory. According to the starting value of the comparison bit n = 0, compare whether the starting bit (highest bit) data of the current flow data is the same as the starting bit data of the maximum reasonable number. For example, if the current flow data is 00000.1 and the maximum reasonable number is 00006.1, at this time, compare the highest bit numbers, both are 0, and the two are the same.

[0044] Loop comparison: If they are the same, add a preset number to the starting value n of the comparison bit (usually the preset number is 1, indicating moving to the next bit for comparison). In this example, n changes from 0 to 1. Then, according to the new comparison bit n = 1, compare whether the second bit data of the current flow data is the same as the second bit data of the maximum reasonable number, and so on in a loop. Suppose the current flow data is 12345.6 and the maximum reasonable number is 12349.6. When n = 0, the highest bit 1 is equal; when n = 1, the second highest bit 2 is equal; when n = 2, the third bit 3 is equal; when n = 3, the fourth bit 4 is equal; when n = 4, compare the fifth bit (tens place), 5 and 9 are not equal.

[0045] Result judgment: If the starting bit data of the current flow data until the tens place data of the current flow data are all correspondingly the same as the starting bit data of the maximum reasonable number until the tens place data of the maximum reasonable number, mark the comparison result as consistent; otherwise mark it as inconsistent. For example, if the current flow data is 12345.6 and the maximum reasonable number is 12345.6, and the corresponding digits from the highest bit to the tens place are all the same, then a consistent comparison result is obtained; if the current flow data is 12345.6 and the maximum reasonable number is 12346.6, and the tens place digits are different, then an inconsistent comparison result is obtained. The comparison result is stored in a specific flag variable (such as a boolean variable result) for subsequent operations.

[0046] Step S103, perform an operation to update the result data and / or determine whether the self-diagnostic counter is applicable based on the comparison result.

[0047] When a consistent comparison result is obtained (i.e., result is true), update the result data with the digits of the current flow data corresponding to the starting value of the comparison bit. Suppose the result data is initially XXXXXX and the current flow data is 12345.6. Since the comparison is consistent, update the result data to 1234X.6 (here it is assumed that the result data only focuses on the tens place and one decimal place is retained). The specific implementation method is through memory operations, replacing the characters or values at the corresponding positions in the result data storage area with the values at the corresponding positions of the current flow data. At the same time, obtain the judgment result that the self-diagnostic counter is applicable. A flag variable (such as counter−status) can be set in the system and assigned the "applicable" status to indicate that the self-diagnostic counter is working properly and the data is reasonable.

[0048] When an inconsistent comparison result is obtained (i.e., result is false), a series of complex processing procedures will be entered. First, determine whether the latest data of the counter and the current flow data meet the preset conditions (the preset conditions may include whether the latest data of the counter is within the reasonable fluctuation range of the current flow data, etc., and the specific conditions are set according to the actual application scenario).

[0049] If the preset condition is met, continue to determine whether the starting bit data where the current flow data is inconsistent with the maximum reasonable number is the tens digit data. If it is the tens digit data, re - execute the step of determining the starting value of the comparison bit in the preset comparison bit comparison mechanism (i.e., reset n to 0), and compare whether the starting bit data of the current flow data is consistent with the starting bit data of the maximum reasonable number according to the starting value of the comparison bit; if it is not the tens digit data, accumulate the comparison times (create a variable i in the memory to record the comparison times, with an initial value of 0) and the starting value n of the comparison bit, and obtain the combined comparison result of the current flow data corresponding to the accumulated comparison times i = i + 1 and the accumulated starting value n of the comparison bit n = n + i and the latest data digit of the counter.

[0050] Then, according to this combined comparison result, continue to perform subsequent judgments and operations, such as judging whether the digits of the current flow data and the maximum reasonable number corresponding to the new comparison bit value are 0 and a series of other operations, and finally decide whether to update the result data and judge whether the self - diagnostic counter is applicable.

[0051] The counter data self - diagnosis method provided in this embodiment, by calculating the maximum reasonable number and comparing the current flow data with it, can timely detect whether the data exceeds the reasonable range, which helps to ensure the accuracy of the counter data and avoid wrong judgments or decisions caused by data anomalies. Based on the preset comparison bit comparison mechanism, compare the current flow data with the maximum reasonable number in turn until the digits of the corresponding bits of the tens place are completely consistent. This meticulous comparison method can comprehensively detect the consistency of the data. Once inconsistency is found, it can be processed through subsequent operations, thereby enhancing the stability of the entire system and reducing system failures or anomalies caused by data errors. Perform the operation of updating the result data and / or judging whether the self - diagnostic counter is applicable according to the comparison result, realizing the effective monitoring and evaluation of the counter's own state, improving the counting accuracy of the optoelectronic direct - reading counter, and solving the problem that the optoelectronic direct - reading counter cannot be judged whether it is still applicable to the current meter due to inaccurate measurement numbers.

[0052] In this embodiment, a counter data self - diagnosis method is provided, which can be used for metering instruments, such as intelligent gas meters, intelligent remote - transmission meters, etc. Figure 3 is a flowchart of the counter data self - diagnosis method according to an embodiment of the present invention, as Figure 3 shown, and this process includes the following steps: Step S201, obtain the current flow data and the latest data of the counter, and calculate the maximum reasonable number based on the current flow data.

[0053] Specifically, as Figure 5 shown, the above - mentioned step S201 includes: Step S2011, obtain the maximum hourly flow rate of the metering device used in conjunction with the counter.

[0054] Specifically, the metering device can be an intelligent gas meter, an intelligent remote transmission meter, etc. Obtain the flow rate data of the metering device, screen out the maximum hourly flow rate Qmax data from it, and at the same time read the latest data of the counter.

[0055] Step S2012, calculate the sum value of the maximum hourly flow rate multiplied by a preset multiple and the current flow rate data, and use the sum value as the maximum reasonable number.

[0056] Specifically, the preset multiple in this embodiment is set to 1.5 times. The maximum reasonable number is the value obtained by adding 1.5 times the maximum hourly flow rate Qmax to the current flow rate data.

[0057] Step S202, based on a preset comparison bit comparison mechanism, sequentially compare the comparison bit numbers of the current flow rate data and the maximum reasonable number until the numbers of the corresponding bits in the tens place are exactly the same, and obtain a comparison result.

[0058] Specifically, the above-mentioned step S202 includes: Step S2021, determine the starting value of the comparison bit in the preset comparison bit comparison mechanism; compare whether the starting bit data of the current flow rate data is the same as the starting bit data of the maximum reasonable number according to the starting value of the comparison bit. If they are the same, add a preset number to the starting value of the comparison bit, and compare whether the second bit data of the current flow rate data is the same as the second bit data of the maximum reasonable number according to the accumulated comparison bit, and loop and compare in turn until it is compared whether the tens bit data of the current flow rate data is the same as the tens bit data of the maximum reasonable number; if the starting bit data of the current flow rate data until the tens bit data of the current flow rate data are all the same as the starting bit data of the maximum reasonable number until the tens bit data of the maximum reasonable number, obtain a comparison result of consistent comparison; otherwise, obtain a comparison result of inconsistent comparison.

[0059] Specifically, first set the comparison bit, the number of comparisons, etc. The comparison bit is the current position when reading the counter one by one from left to right bit by bit. The number of comparisons is the number of times when it is temporarily impossible to accurately judge that the comparison of the digit of this bit is completed. Let the comparison bit be represented by n, initially n is equal to 0, and the number of comparisons be represented by i, initially i is equal to 0.

[0060] Add 1 to the comparison bit n as the starting value of the comparison bit. Compare the digit of this bit of the current flow rate data and the maximum reasonable number according to the comparison bit n. If they are the same, compare the comparison bit numbers of the current flow rate data and the maximum reasonable number according to this logic in a loop until the tens digits are all exactly the same, and obtain a comparison result of consistent comparison; otherwise, obtain a comparison result of inconsistent comparison.

[0061] For example, the comparison bit is initially 0, 0 plus 1 equals 1. The current flow data is: 00000.1, and the maximum reasonable number is: 00006.1. The first comparison bit from left to right of both numbers is 0, and the comparison is consistent. The number at this comparison bit in the result data is directly updated according to the comparison bit number 0 of the current data. At this time, the result data is 0XXXX.X. Compare the comparison bit data of the current data and the maximum reasonable number in a loop according to this logic until the ten-digit data are all exactly the same. Update the result data according to the comparison result of consistent comparison. The final result data is: 0000X.X.

[0062] Step S2022, when the starting bit data of the current flow data is inconsistent with the starting bit data of the maximum reasonable number when comparing according to the starting value of the comparison bit, determine whether the latest data of the counter satisfies a preset condition with the current flow data; if the preset condition is satisfied, continue to determine whether the starting bit data of the current flow data and the starting bit data of the maximum reasonable number are ten-digit data. If they are ten-digit data, execute the step of determining the starting value of the comparison bit in the preset comparison bit comparison mechanism and comparing whether the starting bit data of the current flow data is consistent with the starting bit data of the maximum reasonable number according to the starting value of the comparison bit; if they are not ten-digit data, accumulate the comparison times and the starting value of the comparison bit to obtain the combined comparison result of the accumulated comparison times, the starting value of the accumulated comparison bit corresponding current flow data, and the latest data of the counter.

[0063] Specifically, in this embodiment, the preset condition is whether the number of the latest data of the counter satisfies the remainder of (the number of the current flow data + 1) modulo 10.

[0064] If the current flow data and the maximum reasonable number are inconsistent after comparing the digits at the comparison bit n, then compare whether the number of the latest data of the counter at the comparison bit n is the remainder of (the number of the current flow data + 1) modulo 10. If it is, determine whether this bit is the tens place. If it holds again, return to step S2021; if it is not the tens place, increment the comparison times i (i.e., i = i + 1, i = 1), and move the comparison bit to the position of the comparison bit plus i bits (i.e., the comparison bit n = n + i, n = 2), that is, the comparison bit is the new value after adding i. Then determine whether the new comparison bit number is the number 0. If not, find the bit that is 0 after the comparison bit again. If a 0 is found before reaching the units place, update the digits from the i bits before the latest comparison bit to the latest comparison bit into the result data, that is, obtain the combined comparison result of the accumulated comparison times, the starting value of the accumulated comparison bit corresponding current flow data, and the latest data of the counter.

[0065] For example, taking a civilian photoelectric counter as an example, the civilian photoelectric counter is a mechanical counter with 5 integer digits and 3 decimal digits. The comparison bit of the mechanical counter in the civilian photoelectric counter table mainly compares the first 4 digits of the 5 integer digits. The current flow data (09999.1) and the maximum reasonable number (10005.1) compare the digits at this bit according to the comparison bit n = 1. If the comparison is inconsistent (0 is not equal to 1), then compare whether the latest data of the counter (17008.8) at the comparison bit n = 1 is the remainder of taking the modulus of 10 after adding 1 to the digit of the current data (09999.1) (it is 0 + 1 remainder 10 which is equal to 1). Determine whether this bit is the tens place (it is not the tens place, but the highest digit of the civilian counter, the ten-thousands place). If it is not the tens place, then increment the comparison count i by 1 (i = 0, i + 1 = 1), and move the comparison bit to the next i-th bit of the comparison bit, that is, the comparison bit is the new value after adding i (n = n + i, n = 2). Then determine whether the new comparison bit digit is the digit 0 (the n-th digit of 17008.8 is 7 at this time). If it is not, then find the bit that is 0 after re-finding the comparison bit (i = 1, i + 1 = 2, n = n + i = 1 + 2 = 3, the 3rd digit of 17008.8 is 0, that is, the hundreds place is 0). From this, it can be known that if a 0 is found before reaching the units place, then update the digits from the i-th bit before the latest comparison bit to the digits in the latest comparison bit to the result data.

[0066] Step S2023, if the preset condition is not met, then determine whether the latest data of the counter corresponding to the starting value of the comparison bit is consistent with the current flow data. If they are consistent, then perform the operation of updating the result data based on the comparison result; if they are inconsistent, then find the new comparison bit before the tens digit data in the latest data of the counter that is equal to the digit in the corresponding position of the current flow data, and obtain the comparison result of the new comparison bit digit or the comparison result of not finding it.

[0067] Specifically, according to the comparison bit n = 1, compare whether the digit of the latest data of the counter is the remainder of taking the modulus of 10 after adding 1 to the digit of the current flow data. If it is not, then compare the digit at this bit according to the comparison bit n, that is, compare whether the digit of the latest data of the counter is equal to the digit of the current data. If it is, update the digits from the j-th bit before the latest comparison bit to the digits in the latest comparison bit to the result data; if it is not, then determine whether the latest comparison bit where the digit of the latest data is equal to the digit of the current data is found before reaching the tens place, that is, obtain the comparison result of the new comparison bit digit or the comparison result of not finding it.

[0068] Step S203, perform the operation of updating the result data based on the comparison result and / or determine the operation of whether the self-diagnosis counter is applicable. For details, please refer to Figure 2 Step S103 of the embodiment shown, which will not be elaborated here.

[0069] The counter data self-diagnosis method provided in this embodiment determines the starting value of the comparison bit and accumulates it successively according to fixed rules for bit-by-bit comparison. From the starting bit to the tenth bit, a clear and organized comparison process is formed. This ordered comparison method helps to accurately judge the consistency of two numbers in each digit, avoiding confusion and omission, and making the comparison result more reliable. The mechanism of bit-by-bit comparison has good scalability. When the starting bit data of the current flow data and the maximum reasonable number is inconsistent, by judging whether the latest data of the counter and the current flow data meet the preset conditions, different processing methods can be adopted for different situations, so that the algorithm is not limited to simple consistency or inconsistency judgment, and can better handle various possible data situations, improving the algorithm's processing ability for complex data. When the latest data of the counter and the current flow data do not meet the preset conditions, further judge whether the latest data of the counter corresponding to the starting value of the comparison bit is consistent with the current flow data. If they are consistent, perform the operation of updating the result data. This way can flexibly process according to different data situations, making the self-diagnosis method more adaptable and better able to handle various possible data states.

[0070] In this embodiment, a counter data self-diagnosis method is provided, which can be used in metering devices, such as smart gas meters, smart remote transmission meters, etc. Figure 4 It is a flowchart of the counter data self-diagnosis method according to an embodiment of the present invention, as Figure 4 shown. The process includes the following steps: Step S301, obtain the current flow data and the latest data of the counter, and calculate the maximum reasonable number based on the current flow data. For details, please refer to Figure 3 step S201 of the embodiment shown here, which will not be elaborated here.

[0071] Step S302, compare the comparison bit numbers of the current flow data and the maximum reasonable number successively based on the preset comparison bit comparison mechanism until the numbers of the corresponding bits of the tenth bit are exactly the same, and obtain the comparison result. For details, please refer to Figure 3 step S202 of the embodiment shown here, which will not be elaborated here.

[0072] Step S303, perform the operation of updating the result data and / or judge whether the self-diagnosis counter is applicable based on the comparison result.

[0073] Specifically, as Figure 5 shown, the above step S303 includes: Step S3031, when obtaining a comparison result of consistent comparison, update the result data according to the number of the current flow data corresponding to the starting value of the comparison bit, and obtain the judgment result that the self-diagnosis counter is applicable.

[0074] Specifically, as described in step S2021, the current flow data is: 00000.1, and the maximum reasonable number is: 00006.1. The first comparison bit from left to right of both numbers is 0, which is consistent. The digit of this comparison bit in the result data is directly updated according to the comparison bit digit 0 of the current flow data. At this time, the result data is: 0XXXX.X. Compare the comparison bit data of the current flow data and the maximum reasonable number in this logic loop until the ten-digit data are all exactly the same. Then the self-diagnosis counter is still applicable. At this time, the result data is: 0000X.X.

[0075] Step S3032, when obtaining a comparison result of inconsistent comparison, perform an operation of updating the result data and determining whether the self-diagnosis counter is applicable based on the combined comparison result of the accumulated comparison times, the current flow data corresponding to the accumulated starting value of the comparison bit, and the latest data digit of the counter; or perform an operation of updating the result data based on the comparison result of the new comparison bit digit; or perform an operation of determining whether the self-diagnosis counter is applicable based on the comparison result that has not been found.

[0076] In some alternative embodiments, the above step S3032 includes: Step a1, determine the comparison times, add a preset number to the comparison times, and at the same time add the accumulated comparison times to the starting value of the comparison bit to obtain a new comparison bit value. Then determine whether the digits of the current flow data and the maximum reasonable number corresponding to the new comparison bit value are 0. If they are not 0, then re-locate the bit whose digit after the new comparison bit value is 0 in the latest data of the counter. If a bit whose digit after the new comparison bit value is 0 is found before the units digit, then update the preset number of digits before the new comparison bit value to the result data. If no bit whose digit after the new comparison bit value is 0 is found before the units digit, then keep the current flow data unchanged and perform an operation of determining whether the self-diagnosis counter is applicable based on the usage amount of the metering device.

[0077] For example, taking a civilian photoelectric counter as an example, the civilian photoelectric counter is a mechanical counter with 5 integer digits and 3 decimal digits. The comparison bit of the mechanical counter of the civilian photoelectric counter table mainly compares the first 4 digits among the 5 integer digits. The current flow data (09999.1) and the maximum reasonable number (10005.1) compare the digit at this bit according to the comparison bit n = 1. If the comparison is inconsistent (0 is not equal to 1), then compare whether the latest data of the counter (17008.8) at the comparison bit n = 1 is the remainder of taking the modulus of 10 after adding 1 to the digit of the current data (09999.1) (0 + 1 remainder 10 is equal to 1). Determine whether this bit is the tens place (it is not the tens place, but the highest place value of the ten-thousands place of the civilian counter). If it is not the tens place, then increment the comparison count i by 1 (i = 0, i + 1 = 1), and move the comparison bit to the next i-th bit of the comparison bit, that is, the comparison bit is the new value after adding i (n = n + i, n = 2). Then determine whether the digit at the new comparison bit is the digit 0 (the n-th digit of 17008.8 is 7 at this time). If it is not, then find the bit where the digit is 0 again after re-finding the comparison bit (i = 1, i + 1 = 2, n = n + i = 1 + 2 = 3, the 3rd digit of 17008.8 is 0, that is, the hundreds place is 0). From this, it can be known that if a digit 0 is found before reaching the units place, then update the digits from the i-th bit before the latest comparison bit to the digit at the latest comparison bit to the result data. At this time, the result data is 100XX.X, as Figure 5 shown. If it has not reached the tens place yet, then the next comparison bits are all 0 (10005.1 and 17008.8), and then update the result data to 1000X.X.

[0078] If a bit with a digit 0 after the new comparison bit value is not found before the units place, then keep the current flow data unchanged and perform an operation to determine whether the self-diagnostic counter is applicable based on the usage amount of the metering device. For example, estimate the number of times of the latest data of the counter corresponding to using 10 cubic meters of gas from the average daily gas consumption in the previous ten days of the metering device. Query whether there is at least 1 day within this number of times that is the remainder of taking the modulus of 10 after adding 1 to the digit in the tens place of the current flow data, and whether the digit in the tens place remains unchanged for 10 consecutive times after this number of times. If the query is successful, then the self-diagnostic counter is still applicable; otherwise, the self-diagnostic counter is no longer applicable. Keep the current flow data unchanged during the query until the self-diagnostic counter is still applicable and then end.

[0079] Step a2, perform an operation to update the result data based on the digits of the preset number of bits before the new comparison bit.

[0080] Specifically, compare according to the comparison bit n. Whether the latest data digit is the remainder of (the current data digit + 1) modulo 10. If not, compare the digit at this bit according to the comparison bit n. Whether the latest data digit is equal to the current data digit. If so, update the digits from the j digits before the latest comparison bit to the digits in the latest comparison bit to the result data; if not, determine that if the latest comparison bit where the latest data digit is equal to the current data digit is found before reaching the tens place, update the digits from the j digits before the latest comparison bit to the digits in the latest comparison bit to the result data.

[0081] Step a3, if the new comparison bit before the tens digit in the latest data of the search counter is not equal to the digit at the corresponding bit in the current flow data, keep the current flow data unchanged and perform an operation to determine whether the self-diagnostic counter is applicable based on the usage amount of the metering device.

[0082] Specifically, if the new comparison bit before the tens digit in the latest data of the search counter is not equal to the digit at the corresponding bit in the current flow data, estimate the number of times of the latest data of the counter corresponding to using 10 cubic meters of gas from the average daily gas consumption in the previous ten days of this metering device. Query whether there is at least 1 day within this number of times that is the remainder of (the tens digit of the current flow data + 1) modulo 10, and whether the tens digit remains unchanged for 10 consecutive times after this number of times. If the query is successful, the self-diagnostic counter is still applicable; otherwise, the self-diagnostic counter is no longer applicable. Keep the current flow data unchanged during the query until the self-diagnostic counter is still applicable and then end.

[0083] The counter data self-diagnosis method provided in this embodiment formulates clear operation processes for different comparison results (matching and non-matching). When the comparison is matching, directly update the result data and draw the conclusion that the self-diagnostic counter is applicable; when the comparison is non-matching, further refine the operation according to different intermediate comparison results (combined comparison result, new comparison bit digit comparison result, non-found comparison result). This clear logical structure makes the entire self-diagnosis process easy to understand and implement, and also facilitates subsequent maintenance and optimization. For the case of matching, directly update the result data based on the current flow data, and at the same time determine that the self-diagnostic counter is applicable, ensuring the accuracy of the result when the data is completely matched. For the case of non-matching, by processing different intermediate results, it is possible to analyze data differences more deeply and comprehensively consider various factors to determine whether the self-diagnostic counter is applicable, avoiding a simple and crude judgment method and improving the accuracy and reliability of the judgment result. When the comparison is matching, update the result data according to the digit in the current flow data corresponding to the starting value of the comparison bit, ensuring that the result data can timely reflect the situation of the current flow data. When the comparison is non-matching, perform corresponding update operations according to different intermediate results, enabling the result data to be reasonably adjusted according to the actual data differences and making the result data more valuable for reference.

[0084] As one or more specific application embodiments of the embodiments of the present invention, in combination with Figure 5 The self-diagnosis of counter data provided by the present invention will be further described in detail. The specific process is as follows: Step 1) First, obtain the maximum reasonable number calculated from the current data, read the latest data of the counter, read the comparison bit n equal to 0, the comparison times i equal to 0, and j equal to 0. The maximum reasonable number is the value obtained by adding 1.5 times the maximum hourly flow Qmax to the current data. The comparison bit is the current position when reading the counter bit by bit from left to right. The comparison times is the number of times the comparison is completed when it is temporarily impossible to accurately judge the digit of this bit.

[0085] 2) Add 1 to the comparison bit n as the starting value of the comparison bit. Compare the current flow data and the maximum reasonable number for the digit of this bit according to the comparison bit n. If they are the same, loop and compare the current flow data and the maximum reasonable number for the comparison bit digits according to this logic until the ten digits are completely the same, and obtain a comparison result of consistent comparison. Otherwise, obtain a comparison result of inconsistent comparison.

[0086] For example, the initial comparison bit is 0, 0 + 1 = 1. The current flow data is: 00000.1, and the maximum reasonable number is: 00006.1. The first comparison bit from left to right of the two numbers is 0, and the comparison is consistent. The digit of this comparison bit in the result data is directly updated according to the comparison bit digit 0 of the current data. At this time, the result data is 0XXXX.X. Loop and compare the comparison bit data of the current data and the maximum reasonable number according to this logic until the ten data are completely the same, and update the result data according to the comparison result of consistent comparison. The final result data is: 0000X.X.

[0087] 3) If the current flow data and the maximum reasonable number are inconsistent after comparing the digit of this bit according to the comparison bit n, then compare whether the digit of the latest data of the counter is the remainder of (the digit of the current flow data + 1) modulo 10 according to the comparison bit n. If it is, then judge whether this bit is the tens place. If it holds again, return to step S2021; if it is not the tens place, then add 1 to the comparison times i (that is, i = i + 1, i = 1), and move the comparison bit to the position of the comparison bit plus i bits (that is, the comparison bit n = n + i, n = 2), that is, the comparison bit is the new value after adding i. Then judge whether the new comparison bit digit is the digit 0. If not, find the bit with the digit 0 after the comparison bit again. If the digit 0 is found before reaching the units place, update the digits from the i bits before the latest comparison bit to the latest comparison bit in the result data. If the comparison bit with the digit 0 is not found before reaching the units place, execute step 5).

[0088] For example, taking a civilian photoelectric counter as an example, the civilian photoelectric counter is a mechanical counter with 5 integer digits and 3 decimal digits. The comparison bit of the mechanical counter in the civilian photoelectric counter table mainly compares the first 4 digits of the 5 integer digits. The current flow data (09999.1) and the maximum reasonable number (10005.1) compare the digit at this position according to the comparison bit n = 1. If the comparison is inconsistent (0 is not equal to 1), then compare whether the latest data of the counter (17008.8) at the comparison bit n = 1 is the remainder of (the current data (09999.1) digit + 1) modulo 10 (0 + 1 modulo 10 is equal to 1). Determine whether this bit is the tens place (it is not the tens place, but the highest place value of the civilian counter, the ten-thousands place). If it is not the tens place, then increment the comparison count i by 1 (i = 0, i + 1 = 1), and move the comparison bit to the next i-th bit of the comparison bit, that is, the comparison bit is the new value after adding i (n = n + i, n = 2). Then determine whether the new comparison bit digit is the digit 0 (the n-th digit of 17008.8 is 7 at this time). If it is not, then find the bit that is 0 after re-finding the comparison bit (i = 1, i + 1 = 2, n = n + i = 1 + 2 = 3, the 3rd digit of 17008.8 is 0, that is, the hundreds place is 0). If it is found before reaching the units place, update the digits from the i-th bit before the latest comparison bit to the digits in the latest comparison bit to the result data (100 in the maximum reasonable number 10005.1 is updated to the result data, and at this time the result data is 100XX.X). Then according to Figure 5 the process of Figure 5 , it has not reached the tens place yet, and the next comparison bits are all 0 (10005.1 and 17008.8). Therefore, the result data is 1000X.X.

[0089] 4) According to the comparison bit n = 1, compare whether the digit of the latest data of the counter is the remainder of (the current flow data digit + 1) modulo 10. If it is not, then compare the digit at this position according to the comparison bit n, that is, compare whether the digit of the latest data of the counter is equal to the current data digit. If it is, update the digits from the j-th bit before the latest comparison bit to the digits in the latest comparison bit to the result data; if it is not, then determine whether the latest comparison bit where the latest data digit is equal to the current data digit is found before reaching the tens place. If the latest comparison bit where the latest data digit is equal to the current data digit is not found before reaching the tens place, then execute step 5).

[0090] 5) Estimate the number of times of the latest data of the counter corresponding to using 10 cubic meters of gas from the average daily gas consumption in the previous ten days of this meter. Query whether there is at least 1 day within this number of times that is the remainder of (the tens digit of the current flow data + 1) modulo 10, and whether the tens digit remains unchanged for 10 consecutive times after this number of times. If the query is successful, the self-diagnostic counter is still applicable; otherwise, the self-diagnostic counter is no longer applicable. Keep the current flow data unchanged during the query until the self-diagnostic counter is still applicable and then end.

[0091] Throughout the process, a diaphragm gas meter with a nominal flow rate of 2.5 m³ / h is taken as an example, and other flow specifications can be inferred by analogy: Example 1: When the current data of the optoelectronic direct-reading counter is 00000.1, the maximum reasonable number is 00006.1, the latest reading value is 00001.0, the self-diagnostic counter during operation is still applicable, and the result data is 0000X.X.

[0092] Example 2: When the current data of the optoelectronic direct-reading counter is 00009.1, the maximum reasonable number is 00015.1, the latest reading value is 00008.8, the self-diagnostic counter during operation is still applicable, and the result data is 0000X.X.

[0093] Example 3: When the current data of the optoelectronic direct-reading counter is 00009.1, the maximum reasonable number is 00015.1, the latest reading value is 00018.8, the self-diagnostic counter during operation is still applicable, and the result data is 0001X.X.

[0094] Example 4: When the current data of the optoelectronic direct-reading counter is 00099.1, the maximum reasonable number is 00105.1, the latest reading value is 00108.8, the self-diagnostic counter during operation is still applicable, and the result data is 0010X.X.

[0095] Example 5: When the current data of the optoelectronic direct-reading counter is 00099.1, the maximum reasonable number is 00105.1, the latest reading value is 00178.8, the applicability of the self-diagnostic counter during operation is to be determined, and the result data is 00??X.X.

[0096] Example 6: When the current data of the optoelectronic direct-reading counter is 00999.1, the maximum reasonable number is 01005.1, the latest reading value is 01708.8, the self-diagnostic counter during operation is still applicable, and the result data is 0100X.X.

[0097] Example 7: When the current data of the optoelectronic direct-reading counter is 00999.1, the maximum reasonable number is 01005.1, the latest reading value is 01778.8, the applicability of the self-diagnostic counter during operation is to be determined, and the result data is 0???X.X.

[0098] Example 8: When the current data of the optoelectronic direct-reading counter is 09999.1, the maximum reasonable number is 10005.1, the latest reading value is 17008.8, the self-diagnostic counter during operation is still applicable, and the result data is 1000X.X.

[0099] Example 9: When the current data of the optoelectronic direct-reading counter is 09999.1, the maximum reasonable number is 10005.1, the latest reading value is 17778.8, the applicability of the self-diagnostic counter during operation is to be determined, and the result data is????X.X.

[0100] Example 10: When the current data of the current optoelectronic direct-reading counter is 00009.1, the maximum reasonable number is 00015.1, the latest value read is 00078.8, the applicability of the self-diagnostic counter during operation is to be determined, and the result data is 000?X.X.

[0101] Example 11: When the current data of the current optoelectronic direct-reading counter is 00099.1, the maximum reasonable number is 00105.1, the latest value read is 00708.8, the self-diagnostic counter during operation is still applicable, and the result data is 0010X.X.

[0102] Example 12: When the current data of the current optoelectronic direct-reading counter is 00099.1, the maximum reasonable number is 00105.1, the latest value read is 00778.8, the applicability of the self-diagnostic counter during operation is to be determined, and the result data is 00??X.X.

[0103] Example 13: When the current data of the current optoelectronic direct-reading counter is 00999.1, the maximum reasonable number is 01005.1, the latest value read is 07008.8, the self-diagnostic counter during operation is still applicable, and the result data is 0100X.X.

[0104] Example 14: When the current data of the current optoelectronic direct-reading counter is 00999.1, the maximum reasonable number is 01005.1, the latest value read is 07778.8, the applicability of the self-diagnostic counter during operation is to be determined, and the result data is 0???X.X.

[0105] Example 15: When the current data of the current optoelectronic direct-reading counter is 09999.1, the maximum reasonable number is 10005.1, the latest value read is 70008.8, the self-diagnostic counter during operation is still applicable, and the result data is 1000X.X.

[0106] Example 16: When the current data of the current optoelectronic direct-reading counter is 09999.1, the maximum reasonable number is 10005.1, the latest value read is 77778.8, the applicability of the self-diagnostic counter during operation is to be determined, and the result data is????X.X.

[0107] 17. In Examples 5, 7, 9, 10, 12, 14, and 16, the self-diagnostic results are all to be determined. At this time, through these seven examples, estimate the effective number of times of reading the latest data corresponding to 10 cubic meters of gas based on the average value of the first ten days' data of the meter. Since the data is read once per hour, check whether there is at least 1 time within this number of times that is the remainder of the current data's tens digit plus 0 or 1 or 2 modulo 10, and whether the tens digit remains unchanged for 10 consecutive times after this number of times. If so, it is determined that the self-diagnostic counter is still applicable.

[0108] 18. As in Example 16, within the valid number of times, if it is confirmed that the tens digit of the latest data continuously remains 9, the result data is 0999X.X; if it is confirmed that the tens digit of the latest data continuously remains 0, the result data is 1000X.X; if it is confirmed that the tens digit of the latest data continuously remains 1, the result data is 1001X.X; 19. And so on for Examples 5, 7, 9, 10, 12, and 14. If it is determined that the self-diagnosis counter is still applicable, the possible values for these 6 examples are respectively: 0009X.X, 0010X.X, 0011X.X; 0099X.X, 0100X.X, 0101X.X; 0999X.X, 1000X.X, 1001X.X; 0000X.X, 0001X.X, 0002X.X; 0009X.X, 0010X.X, 0011X.X; 0099X.X, 0100X.X, 0101X.X.

[0109] 20. When the query determination exceeds the valid number of times, the self-diagnosis counter is no longer applicable.

[0110] The counter data self-diagnosis method provided in this embodiment is a solution that is still applicable when the 5 + 3 civilian optoelectronic counter reads data directly once per hour. Applying the method of the present invention realizes whether the counter and the metering instrument are still matched and applicable in the mode of the 5 + 3 civilian optoelectronic counter reading data directly once per hour. Such a counter is usually affected by light interference, dust interference, etc., resulting in errors in the binary data of encoding and decoding from 0 to 9. When there are encoding errors such as interference, there is a maximum reasonable number range in the scenario where the 5 + 3 civilian optoelectronic counter reads data directly once per hour. In this way, the first four digits of the 5 + 3 civilian optoelectronic counter are much larger than the reasonable number. Therefore, by judging not to update and not easily update when not moving, the encoding errors caused by light interference and dust interference can be filtered out. The 5th digit is the tens digit, which is around the maximum reasonable number range in this application mode. Let the 4th digit of the 5 + 3 civilian optoelectronic counter be within a reasonable range, that is, when the tens digit is updated to the next mechanical digit. At this time, if there is light interference and dust interference, it can be eliminated with the rotation of the mechanical word wheel and the influence of gravity, etc. When it rotates to this number in the next circle, it is highly unlikely to have this problem. And for the 5th to 8th digits of the 5 + 3 civilian optoelectronic counter, they are the decimal digits to the units digit. The decimal digits are usually insensitive in the application mode per hour. Together with the units digit, using 3 numbers, namely the current flow data, the maximum reasonable number, and the latest reading of the counter, combined with the method of the present invention, a relatively high-precision result data can be given.

[0111] In this embodiment, a counter data self-diagnosis device is further provided. This device is used to implement the above-mentioned embodiments and preferred implementation manners, and those that have been described will not be repeated. As used hereinafter, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0112] This embodiment provides a counter data self-diagnosis device, as Figure 6 shown, including: A data acquisition and maximum reasonable number calculation module 601, which is used to acquire the current flow data and the latest counter data, and calculate the maximum reasonable number based on the current flow data.

[0113] A comparison digit comparison module 602, which is used to sequentially compare the comparison digits of the current flow data and the maximum reasonable number based on a preset comparison digit comparison mechanism until the digits in the corresponding positions of the tens place are exactly the same, and obtain a comparison result.

[0114] An update operation and self-diagnosis execution module 603, which is used to perform an operation of updating the result data and / or determine whether the self-diagnosis counter is applicable based on the comparison result.

[0115] In some alternative implementation manners, the data acquisition and maximum reasonable number calculation module 601 includes: A maximum hourly flow acquisition unit, which is used to acquire the maximum hourly flow of the metering instrument used in conjunction with the counter.

[0116] A maximum reasonable number calculation unit, which is used to calculate the sum value of the maximum hourly flow multiplied by a preset multiple and the current flow data, and use the sum value as the maximum reasonable number.

[0117] In some alternative implementation manners, the comparison digit comparison module 602 includes: A first comparison digit comparison unit, which is used to determine the starting value of the comparison digit in the preset comparison digit comparison mechanism; compare whether the starting digit data of the current flow data is the same as the starting digit data of the maximum reasonable number according to the starting value of the comparison digit. If they are the same, the starting value of the comparison digit is incremented by a preset number, and the second digit data of the current flow data is compared with the second digit data of the maximum reasonable number according to the incremented comparison digit, and so on in a loop until it is compared whether the tenth digit data of the current flow data is the same as the tenth digit data of the maximum reasonable number; if the starting digit data of the current flow data until the tenth digit data of the current flow data are all the same as the starting digit data of the maximum reasonable number until the tenth digit data of the maximum reasonable number, a comparison result of consistent comparison is obtained; otherwise, a comparison result of inconsistent comparison is obtained.

[0118] The second comparison bit comparison unit is used to determine whether a preset condition is satisfied between the latest data of the counter and the current traffic data when the starting bit data of the current traffic data is inconsistent with the starting bit data of the maximum reasonable number according to the starting value of the comparison bit; if the preset condition is satisfied, it continues to determine whether the starting bit data of the current traffic data and the starting bit data of the maximum reasonable number are ten-digit data. If it is ten-digit data, it executes the step of determining the starting value of the comparison bit in the preset comparison bit comparison mechanism and comparing whether the starting bit data of the current traffic data is consistent with the starting bit data of the maximum reasonable number according to the starting value of the comparison bit; if it is not ten-digit data, it accumulates the comparison times and the starting value of the comparison bit to obtain the combined comparison result of the accumulated comparison times, the current traffic data corresponding to the accumulated starting value of the comparison bit, and the latest data digit of the counter.

[0119] The third comparison bit comparison unit is used to, when the preset condition is not satisfied, determine whether the latest data of the counter corresponding to the starting value of the comparison bit is consistent with the current traffic data. If they are consistent, it executes the update result data operation based on the comparison result; if they are inconsistent, it finds the new comparison bit before the ten-digit data in the latest data of the counter that is equal to the digit of the corresponding bit in the current traffic data to obtain the new comparison bit digit comparison result or the comparison result of not finding it.

[0120] In some alternative embodiments, the update operation and self-diagnosis execution module 603 includes: The first update operation and self-diagnosis execution unit is used to, when obtaining a comparison result of consistent comparison, update the result data according to the digit of the current traffic data corresponding to the starting value of the comparison bit, and obtain the judgment result applicable to the self-diagnosis counter.

[0121] The second update operation and self-diagnosis execution unit is used to, when obtaining a comparison result of inconsistent comparison, execute the update result data operation based on the comparison result and the operation of judging whether the self-diagnosis counter is applicable based on the combined comparison result of the accumulated comparison times, the current traffic data corresponding to the accumulated starting value of the comparison bit, and the latest data digit of the counter; or execute the update result data operation based on the new comparison bit digit comparison result; or execute the operation of judging whether the self-diagnosis counter is applicable based on the comparison result of not finding it.

[0122] In some alternative embodiments, the second update operation and self-diagnosis execution unit includes: An update operation and self-diagnosis execution subunit is used to determine the number of comparisons, add a preset number to the number of comparisons, and at the same time add the accumulated number of comparisons to the starting value of the comparison bit to obtain a new comparison bit value, and determine whether the current flow data corresponding to the new comparison bit value and the number of the maximum reasonable number are 0. If they are not 0, then search for the bit whose number after the new comparison bit value is 0 in the latest data of the counter again. If the bit whose number after the new comparison bit value is 0 is found before the units digit, then update the preset number of digits before the new comparison bit value to the result data. If the bit whose number after the new comparison bit value is 0 is not found before the units digit, then keep the current flow data unchanged and execute the operation of judging whether the self-diagnosis counter is applicable based on the usage amount of the metering device.

[0123] An update result data subunit is used to execute an update result data operation based on the number of digits before the new comparison bit.

[0124] A self-diagnosis execution subunit is used to, if the new comparison bit before the tens digit data in the latest data of the counter is not equal to the number of the corresponding digit in the current flow data, then keep the current flow data unchanged and execute the operation of judging whether the self-diagnosis counter is applicable based on the usage amount of the metering device.

[0125] The further function descriptions of the above-mentioned various modules and units are the same as those in the corresponding embodiments above, and will not be elaborated here.

[0126] The counter data self-diagnosis device in this embodiment is presented in the form of functional units. Here, the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and a memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0127] The embodiment of the present invention further provides a computer device having the above-mentioned Figure 6 counter data self-diagnosis device shown.

[0128] Please refer to Figure 7 , Figure 7 which is a schematic structural diagram of a computer device provided by an alternative embodiment of the present invention. As Figure 7As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Each component communicates with each other using different buses and can be installed on a common motherboard or in other ways as needed. The processor can process instructions executed within the computer device, including instructions stored in the memory or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some alternative embodiments, if needed, multiple processors and / or multiple buses can be used with multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (such as an array of servers, a set of blade servers, or a multi-processor system). Figure 7 Take one processor 10 as an example in Figure 7 .

[0129] The processor 10 can be a central processing unit, a network processor, or a combination thereof. Among them, the processor 10 can further include a hardware chip. The above hardware chip can be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The above programmable logic device can be a complex programmable logic device, a field programmable gate array, a generic array logic, or any combination thereof.

[0130] Among them, the memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiments.

[0131] The memory 20 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the computer device. In addition, the memory 20 can include a high-speed random access memory and can also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some alternative embodiments, the memory 20 can optionally include a memory remotely set relative to the processor 10, and these remote memories can be connected to the computer device through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0132] The memory 20 can include a volatile memory, such as a random access memory; the memory can also include a non-volatile memory, such as a flash memory, a hard disk, or a solid-state drive; the memory 20 can also include a combination of the above types of memories.

[0133] The computer device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30, and the output device 40 may be connected by a bus or other means. Figure 7 Taking the connection by bus as an example.

[0134] The input device 30 can receive input digital or character information, and generate key signal inputs related to the user settings and function controls of the computer device, such as a touch screen, a keypad, a mouse, a trackpad, a touchpad, a pointing stick, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED), and a haptic feedback device (e.g., a vibration motor), etc. The above display device includes but is not limited to a liquid crystal display, a light-emitting diode, a display, and a plasma display. In some alternative embodiments, the display device may be a touch screen.

[0135] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or be implemented as computer code that can be recorded on a storage medium, or be implemented as computer code that is originally stored in a remote storage medium or a non-transitory machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored as such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid-state drive, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.

[0136] A part of the present invention can be applied as a computer program product, such as computer program instructions. When executed by a computer, through the operation of the computer, the methods and / or technical solutions according to the present invention can be invoked or provided. Those skilled in the art should be able to understand that the forms of existence of computer program instructions in a computer-readable medium include but are not limited to source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include but are not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Herein, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible by the computer.

[0137] Although embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations fall within the scope defined by the appended claims.

Claims

1. A method for self-diagnosis of counter data, characterized in that, The method includes: Obtaining the current traffic data and the latest data of the counter, and calculating the maximum reasonable number based on the current traffic data; Comparing the current traffic data with the comparison bit numbers of the maximum reasonable number in sequence based on a preset comparison bit comparison mechanism until the numbers of the corresponding bits in the tens place are exactly the same, to obtain a comparison result; Performing an operation to update the result data and / or determining whether the self-diagnostic counter is applicable based on the comparison result.

2. The method according to claim 1, characterized in that, Calculating the maximum reasonable number based on the current traffic data includes: Obtaining the maximum hourly flow of the metering device used in conjunction with the counter; Calculating the sum of the maximum hourly flow of a preset multiple and the current traffic data, and using the sum as the maximum reasonable number.

3. The method according to claim 1, wherein The step of comparing the current traffic data with the comparison bit numbers of the maximum reasonable number in sequence based on a preset comparison bit comparison mechanism until the numbers of the corresponding bits in the tens place are exactly the same, to obtain a comparison result, includes: Determining the starting value of the comparison bit in the preset comparison bit comparison mechanism; Comparing whether the starting bit data of the current traffic data is the same as the starting bit data of the maximum reasonable number according to the starting value of the comparison bit. If they are the same, the starting value of the comparison bit is incremented by a preset number, and the second bit data of the current traffic data is compared with the second bit data of the maximum reasonable number according to the incremented comparison bit, and the comparison is cycled in sequence until it is compared whether the tens bit data of the current traffic data is the same as the tens bit data of the maximum reasonable number; If the starting bit data of the current traffic data until the tens bit data of the current traffic data are all corresponding and the same as the starting bit data of the maximum reasonable number until the tens bit data of the maximum reasonable number, a comparison result of consistent comparison is obtained; otherwise, a comparison result of inconsistent comparison is obtained.

4. The method according to claim 3, wherein The step of comparing the current traffic data with the comparison bit numbers of the maximum reasonable number in sequence based on a preset comparison bit comparison mechanism until the numbers of the corresponding bits in the tens place are exactly the same, to obtain a comparison result, further includes: When the starting bit data of the current traffic data is not the same as the starting bit data of the maximum reasonable number compared according to the starting value of the comparison bit, determining whether a preset condition is satisfied between the latest data of the counter and the current traffic data; If the preset condition is satisfied, continue to determine whether the starting bit data of the current traffic data and the starting bit data of the maximum reasonable number are the tens bit data. If they are the tens bit data, perform the step of determining the starting value of the comparison bit in the preset comparison bit comparison mechanism and comparing whether the starting bit data of the current traffic data is the same as the starting bit data of the maximum reasonable number according to the starting value of the comparison bit; if they are not the tens bit data, increment the comparison times and the starting value of the comparison bit to obtain a combined comparison result of the incremented comparison times, the incremented starting value of the comparison bit, the corresponding current traffic data, and the latest data of the counter.

5. The method according to claim 4, wherein The step of comparing the current traffic data with the comparison bit numbers of the maximum reasonable number in sequence based on a preset comparison bit comparison mechanism until the numbers of the corresponding bits in the tens place are exactly the same, to obtain a comparison result, further includes: When the preset conditions are not met, it is determined whether the latest data of the counter corresponding to the starting value of the comparison bit is consistent with the current flow data. If they are consistent, an operation of updating the result data is performed based on the comparison result; if they are inconsistent, a new comparison bit equal to the digit in the corresponding position of the current flow data is searched for in the latest data of the counter before the tens digit, and a new comparison result of the comparison bit digits or a comparison result of not found is obtained.

6. The method according to claim 5, characterized in that, The operation of performing the update result data operation based on the comparison result and / or determining whether the self-diagnostic counter is applicable includes: When a comparison result of consistent comparison is obtained, the result data is updated according to the digit of the current flow data corresponding to the starting value of the comparison bit, and a judgment result that the self-diagnostic counter is applicable is obtained; When a comparison result of inconsistent comparison is obtained, an operation of performing the update result data operation based on the comparison result and determining whether the self-diagnostic counter is applicable is performed based on the combined comparison result of the accumulated comparison times, the current flow data corresponding to the accumulated starting value of the comparison bit, and the digits of the latest data of the counter; or an operation of updating the result data is performed based on the new comparison result of the comparison bit digits; or an operation of determining whether the self-diagnostic counter is applicable is performed based on the comparison result of not found.

7. The method according to claim 6, wherein The operation of performing the update result data operation based on the comparison result and determining whether the self-diagnostic counter is applicable based on the combined comparison result of the accumulated comparison times, the current flow data corresponding to the accumulated starting value of the comparison bit, and the digits of the latest data of the counter includes: Determine the number of comparisons, add a preset number to the number of comparisons, and at the same time add the accumulated number of comparisons to the starting value of the comparison bit to obtain a new comparison bit value. Then judge whether the digits of the current flow data corresponding to the new comparison bit value and the maximum reasonable number are 0. If they are not 0, search for a bit with a digit of 0 after the new comparison bit value in the latest data of the counter again. If a bit with a digit of 0 after the new comparison bit value is found before the units digit, update the preset number of digits before the new comparison bit value to the result data. If a bit with a digit of 0 after the new comparison bit value is not found before the units digit, keep the current flow data unchanged and perform an operation of determining whether the self-diagnostic counter is applicable based on the usage amount of the metering device.

8. The method according to claim 6, wherein The operation of performing the update result data operation based on the new comparison result of the comparison bit digits includes: Performing an operation of updating the result data based on the digits of the preset number of digits before the new comparison bit.

9. The method according to claim 6, wherein The operation of performing the judgment on whether the self-diagnostic counter is applicable based on the comparison result of not found includes: If a new comparison bit equal to the digit in the corresponding position of the current flow data is not found in the latest data of the counter before the tens digit, keep the current flow data unchanged and perform an operation of determining whether the self-diagnostic counter is applicable based on the usage amount of the metering device.

10. A counter data self-diagnosis device, characterized in that, The device includes: A data acquisition and maximum reasonable number calculation module, configured to acquire the current flow data and the latest data of the counter, and calculate the maximum reasonable number based on the current flow data; A comparison bit digit comparison module, configured to sequentially compare the comparison bit digits of the current flow data and the maximum reasonable number based on a preset comparison bit comparison mechanism until the digits of the corresponding positions of the tens digit are exactly the same, and obtain a comparison result; An update operation and self-diagnosis execution module, configured to perform an update result data operation based on the comparison result and / or determine whether a self-diagnosis counter is applicable for an operation.

Citation Information

Patent Citations

  • Self-diagnosis and correction method of direct-reading mechanical counter with pulse input

    CN108844602A

  • Direct reading method of photoelectric direct reading counter based on low-bit character wheel carry counting

    CN114707626A

  • Photoelectric direct-reading water meter error self-checking method and system and storage medium

    CN118583255A

  • Abnormality diagnosis method and device of basic input and output system, medium and product

    CN119847808A