A Method for Multiple Safety Checks of Key Data of an Ultrasonic Water Meter

By using multiple media to save key data in ultrasonic water meters and perform multiple verifications, the problem of data being easily lost or damaged in a single medium is solved, and the security and reliability of data are achieved.

CN114416429BActive Publication Date: 2025-07-22WEIHAI PLOUMETER
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210067544.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-20
Publication Date
2025-07-22
Estimated Expiration
2042-01-20

AI Technical Summary

Technical Problem

The key data of the existing ultrasonic water meter is stored in a single medium, which is easily lost or damaged and cannot be restored to use.

Method used

The key data of the ultrasonic water meter is stored in different media of on-chip Flash Memory, on-chip Information Memory and external EEPROM, and the data integrity and reliability are ensured through multiple checksum verification processes.

Benefits of technology

Improve the security of key data storage, ensure the authenticity and reliability of metrological data, and prevent data loss or corruption.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

The present invention relates to a method for multiple security verification of key data of an ultrasonic water meter, which solves the technical problem that the key data of the existing ultrasonic water meter is stored in a single medium and the data is easily lost or damaged. The method includes the following steps: storing the key data ensuring the normal metering function of the ultrasonic water meter in different media, namely on-chip Flash Memory, on-chip Information Memory, and external EEPROM; the key data includes system parameters and metering data; powering on to load the system parameters and reading the correct system parameters; powering on to load the metering data and reading the metering data; regularly saving the metering data during the operation of the meter; when the program is abnormally interfered, the program is abnormally reset, the current metering data is saved, and the system parameters are reloaded. The present invention can be widely applied to the data storage of ultrasonic water meters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of instrument control, and particularly to a method for multiple security verification of key data of an ultrasonic water meter. Background Art

[0002] The key data of an ultrasonic water meter is divided into two categories: one is system parameters, including data such as meter number, caliber, flow correction parameters, etc.; the other is measurement data, including forward cumulative flow, reverse cumulative flow, PCB power-on time, working time, etc. Currently, the key data of the ultrasonic water meter is stored in a single medium, and when the data is interfered with or damaged, the data cannot be restored for use. Summary of the Invention

[0003] In order to solve the technical problem that the key data of the existing ultrasonic water meter is stored in a single medium and the data is easily lost or damaged, the present invention provides a method for multiple security verification of key data of an ultrasonic water meter with data stored in multiple media.

[0004] The present invention provides a method for multiple security verification of key data of an ultrasonic water meter, including the following steps:

[0005] Step 1: Save the key data ensuring the normal measurement function of the ultrasonic water meter in different media of on-chip Flash Memory, on-chip Information Memory, and external EEPROM; the key data includes system parameters and measurement data;

[0006] Step 2: Power on and load the system parameters, and read the correct system parameters;

[0007] Step 3: Power on and load the measurement data, and read the measurement data;

[0008] Step 4: Regularly save the measurement data during the operation of the instrument;

[0009] Step 5: When the program is abnormally interfered, such as abnormal program reset, read the measurement data in the memory and judge whether it is correct according to its checksum. If it is incorrect, read the measurement data from the on-chip Information Memory or external EEPROM, and reload the system parameters.

[0010] Preferably, in Step 1, the on-chip Flash Memory saves the system parameters, the on-chip Information Memory saves the measurement data, and the external EEPROM saves the measurement data and system parameters; the system parameters include meter number, caliber, flow correction parameters, program version, flow data version, temperature correction, zero correction, starting flow; the measurement data includes forward cumulative flow, reverse cumulative flow, PCB power-on duration, working duration, fault duration, power-on times, reset times, current time.

[0011] Preferably, the step of reading the correct system parameters in Step 2 is as follows:

[0012] Step (1): Read the system parameters saved in the on-chip Flash Memory, calculate the checksum, and check whether the checksum is correct. If it is correct, read the data into the system parameter data structure in the memory; if it is incorrect, proceed to Step (2);

[0013] Step (2): Read the system parameters saved in the external EEPROM, calculate the checksum, and check whether the checksum is correct. If it is correct, read the data into the system parameter data structure in the memory; if it is incorrect, proceed to Step (3);

[0014] Step (3): Read the initial values of the system parameters from the on-chip Flash Memory into the system parameter data structure in the memory.

[0015] Preferably, the step of reading the metering data in Step 3 is as follows:

[0016] Step 1): Read the metering data saved in the on-chip Information Memory and calculate the checksum, and determine whether the data is correct and valid. If it is correct, read the metering data saved in the on-chip Information Memory into the metering data data structure in the memory; if it is incorrect, proceed to Step 2);

[0017] Step 2): Read the metering data saved in the external EEPROM and calculate the checksum, and determine whether the data is correct and valid. If it is correct, read the metering data saved in the external EEPROM into the metering data data structure in the memory; if it is incorrect, proceed to Step 3);

[0018] Step 3): Clear the metering data data structure in the memory.

[0019] Preferably, the specific steps for the instrument to periodically save the metering data in Step 4 are as follows:

[0020] Step A: Calculate the checksum of the metering data in the memory, write the metering data and the checksum into the on-chip Information Memory, read the data written into the on-chip Information Memory and calculate the checksum, and determine whether the checksum is correct. If it is correct, then write the metering data and the checksum into the external EEPROM; if it is incorrect, proceed to Step B;

[0021] Step B: Erase the on-chip Information Memory, recalculate the checksum of the metering data in the memory, then write it into the on-chip Information Memory and make a determination;

[0022] Step C: Repeat operation steps A and B three times.

[0023] Preferably, before the meter saves the measurement data in step 4, the battery voltage is detected. If the chip power supply is normal, read and write operations are performed; otherwise, the data is not saved.

[0024] Preferably, the specific steps for detecting the battery voltage are as follows: Before saving the data, use a power supply voltage monitor to detect that the battery voltage is greater than 2.8V to ensure sufficient power supply for in-chip Flash Memory and external EEPROM during read and write operations; set SVSCTL = 0x80, read and write in the unused external EEPROM space and confirm whether the data is correct, determine whether the data is correct and whether the SVSFG bit of SVSCTL is set. If the SVSFG is set or the data is incorrect, the data is not saved, and the SVSCTL register is manually cleared.

[0025] Preferably, the specific steps of step 5 include:

[0026] Step a: Calculate the checksum of the measurement data in the memory, determine whether the checksum is correct. If the data is correct and valid, proceed to step b; otherwise, proceed to step c.

[0027] Step b: Copy the measurement data to the unused memory; clear the memory used by the program data, and then copy the measurement data saved in the unused memory back to the measurement data data structure in the memory.

[0028] Step c: Read the measurement data saved in the in-chip Information Memory and calculate the checksum to determine whether the data is correct and valid. If it is correct, read the measurement data saved in the in-chip Information Memory into the measurement data data structure in the memory; if it is incorrect, read the measurement data saved in the external EEPROM and calculate the checksum to determine whether the data is correct and valid. If it is correct, read the measurement data saved in the external EEPROM into the measurement data data structure in the memory; if it is incorrect, clear the measurement data data structure in the memory.

[0029] Preferably, the specific steps for reloading the system parameters in step 5 include:

[0030] Step (A): Read the system parameters saved in the in-chip Flash Memory and calculate the checksum to check whether the checksum is correct. If it is correct, read the data into the system parameter data structure in the memory; if it is incorrect, proceed to step (B).

[0031] Step (B): Read the system parameters saved in the external EEPROM and calculate the checksum to check whether the checksum is correct. If it is correct, read the data into the system parameter data structure in the memory; if it is incorrect, proceed to step (C).

[0032] Step (C): Read the default data into the system parameter data structure in memory.

[0033] The beneficial effects of the present invention are as follows:

[0034] Save the key data in different media, namely on-chip Flash Memory, on-chip Information Memory, and external EEPROM, to improve the security of saving key data. At the same time, ensure that the metering data does not decrease, or minimize the decrease of metering data as much as possible, and ensure the authenticity and reliability of the metering data. Specific embodiments

[0035] The following further describes the present invention in conjunction with the accompanying drawings and embodiments, so that those skilled in the technical field to which the present invention pertains can easily implement the present invention.

[0036] Embodiment: The steps of the present invention include:

[0037] Step 1: Save the key data ensuring the normal metering function of the ultrasonic water meter in different media, namely on-chip Flash Memory, on-chip Information Memory, and external EEPROM, to improve the security of saving key data; the key data includes system parameters and metering data. Flash Memory is a flash memory, Information Memory is an information memory, and both have the characteristic of not losing data when powered off; EEPROM is an electrically erasable programmable read-only memory, 2-Wire Serial EEPROM. The system parameters include data such as meter number, caliber, flow correction parameter, program version, flow data version, temperature correction, zero correction, start flow rate, etc.; the metering data includes data such as forward cumulative flow, reverse cumulative flow, PCB power-on time, working time, fault duration, power-on times, reset times, current time (year, month, day, hour, minute, second), etc.

[0038] Step 2: Power on and load the system parameters, and read the correct system parameters.

[0039] Read the checksum of the system parameters saved in the on-chip Flash Memory and check whether its checksum is correct. If it is correct, read the data into the system parameter data structure in memory (RAM); if it is incorrect, read the checksum of the system parameters saved in the external EEPROM and check whether its checksum is correct. If it is correct, read the data into the system parameter data structure in memory (RAM); if it is incorrect, read the initial value of the system parameters in the on-chip Flash Memory into the system parameter data structure in memory (RAM).

[0040] Step 3: Power on and load the metering data, and read the appropriate metering data.

[0041] Read the metering data stored in the on-chip Information Memory and calculate the checksum to determine whether the data is correct and valid. If it is correct, read the metering data stored in the on-chip Information Memory into the metering data data structure in the memory (RAM); if it is incorrect, read the metering data stored in the external EEPROM and calculate the checksum to determine whether the data is correct and valid. If it is correct, read the metering data stored in the external EEPROM into the metering data data structure in the memory (RAM); if it is incorrect, clear the metering data data structure in the memory (RAM).

[0042] Step 4: During operation, the instrument periodically saves the metering data.

[0043] Detect the battery voltage before saving the data to ensure that the chip is powered properly. Judge that its voltage should be greater than 2.8V, otherwise the data will not be saved.

[0044] Detect the battery voltage using the Supply Voltage Supervisor before saving the data to ensure that there is sufficient power supply for the on-chip Flash Memory and external EEPROM during read and write operations. Set SVSCTL = 0x80, read and write in an unused external EEPROM space and confirm whether the data is correct. Judge whether the data is correct and whether the SVSFG bit of SVSCTL is set. If the SVSFG is set or the data is incorrect, the data will not be saved, and manually clear the SVSCTL register.

[0045] Save the metering data, calculate the checksum of the metering data in the memory (RAM), write the metering data and the checksum into the on-chip Information Memory, read the data written into the on-chip Information Memory and calculate the checksum, and judge whether the checksum is correct. If it is correct, then write the metering data and the checksum into the external EEPROM; if it is incorrect, erase the on-chip Information Memory, recalculate the checksum of the metering data in the memory (RAM), then write it into the on-chip Information Memory and judge, and repeat the operation three times.

[0046] The system parameters are saved and written only when the system parameters are changed. The checksum of the system parameters in the computing memory (RAM) is calculated. The system parameters and the checksum are written into the on-chip Flash Memory. The data written in the on-chip Flash Memory is read and the checksum is calculated. It is judged whether the checksum is correct. If it is correct, the system parameters and the checksum are written into the external EEPROM; if it is incorrect, the on-chip Flash Memory is erased, the checksum of the system parameters in the memory (RAM) is recalculated, and then written into the on-chip Flash Memory, and the operation is repeated three times.

[0047] Step 5: When the program is interfered abnormally, the program is reset abnormally, the current measurement data is saved, and the system parameters are reloaded.

[0048] For the protection of the measurement data, the checksum of the measurement data in the memory (RAM) is calculated and compared with the checksum in the measurement data structure. If they are the same, it means that the measurement data has not been interfered and is valid. The measurement data is copied to the unused memory; the memory used by the program data is cleared, and then the measurement data saved in the unused memory is copied back to the measurement data structure in the memory (RAM).

[0049] When the measurement data in the memory (RAM) is invalid, the measurement data saved in the on-chip Information Memory is read and the checksum is calculated to judge whether the data is correct and valid. If it is correct, the measurement data saved in the on-chip Information Memory is read into the measurement data structure in the memory (RAM); if it is incorrect, the measurement data saved in the external EEPROM is read and the checksum is calculated to judge whether the data is correct and valid. If it is correct, the measurement data saved in the external EEPROM is read into the measurement data structure in the memory (RAM); if it is incorrect, the measurement data structure in the memory (RAM) is cleared.

[0050] For the reloading of the system parameters, the system parameters saved in the on-chip Flash Memory are read and the checksum is calculated to check whether the checksum is correct. If it is correct, the data is read into the system parameter data structure in the memory (RAM); if it is incorrect, the system parameters saved in the external EEPROM are read and the checksum is calculated to check whether the checksum is correct. If it is correct, the data is read into the system parameter data structure in the memory (RAM); if it is incorrect, the default data is read into the system parameter data structure in the memory (RAM).

[0051] The above description is only for the preferred embodiments of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modifications, equivalent replacements, improvements, etc. made within the scope defined by the claims of the present invention shall fall within the protection scope of the present invention.

Claims

1. A method for multiple security verification of key data of an ultrasonic water meter, characterized in that It includes the following steps: Step 1: Save the key data ensuring the normal metering function of the ultrasonic water meter in different media of on-chip Flash Memory, on-chip Information Memory, and external EEPROM; the key data includes system parameters and metering data; Step 2: Power on and load the system parameters, and read the correct system parameters; Step 3: Power on and load the metering data, and read the metering data; Step 4: Regularly save the metering data during the operation of the meter. The specific steps are: Step A: Calculate the checksum of the metering data in the memory, write the metering data and the checksum into the on-chip Information Memory, read the written data in the on-chip Information Memory and calculate the checksum, and judge whether the checksum is correct. If it is correct, then write the metering data and the checksum into the external EEPROM; If it is incorrect, go to Step B; Step B: Erase the on-chip Information Memory, recalculate the checksum of the metering data in the memory, then write it into the on-chip Information Memory and judge; Step C: Repeat the operation steps of Step A and Step B three times; Before the meter saves the metering data in Step 4, detect the battery voltage. If the chip power supply is normal, perform read and write operations, otherwise do not save the data. The specific steps for detecting the battery voltage are: Before saving the data, use the power voltage monitor to detect that the battery voltage is greater than 2.8V to ensure sufficient power supply for the on-chip Flash Memory and external EEPROM during read and write operations; Set SVSCTL = 0x80, read and write in the unused external EEPROM space and confirm whether the data is correct. Judge whether the data is correct and whether the SVSFG bit of SVSCTL is set. If the SVSFG is set or the data is incorrect, do not save the data, and manually clear the SVSCTL register; Step 5: When the program is abnormally interfered, read the metering data in the memory and judge whether it is correct according to its checksum. If it is incorrect, read the metering data from the on-chip Information Memory or external EEPROM, and reload the system parameters.

2. The method for multiple safety verification of key data of an ultrasonic water meter according to claim 1, characterized in that, In Step 1, the on-chip Flash Memory saves the system parameters, the on-chip Information Memory saves the metering data, and the external EEPROM saves the metering data and system parameters; the system parameters include the meter number, caliber, flow correction parameter, program version, flow data version, temperature correction, zero correction, starting flow; the metering data includes the forward cumulative flow, reverse cumulative flow, PCB power-on duration, working duration, fault duration, power-on times, reset times, current time.

3. The method for multiple safety verification of key data of an ultrasonic water meter according to claim 1, wherein, The steps for reading the correct system parameters in Step 2 are: Step (1): Read the system parameters saved in the on-chip Flash Memory and calculate the checksum, check whether its checksum is correct. If it is correct, read the data into the system parameter data structure in the memory; if it is incorrect, go to Step (2); Step (2): Read the system parameters saved in the external EEPROM, calculate the checksum, and check whether the checksum is correct. If it is correct, read the data into the system parameter data structure in the memory; if it is incorrect, proceed to step (3). Step (3): Read the initial values of the system parameters from the on-chip Flash Memory into the system parameter data structure in the memory.

4. The ultrasonic water meter key data multiple safety verification method according to claim 1, characterized in that The steps for reading the measurement data in step 3 are as follows: Step 1): Read the measurement data saved in the on-chip Information Memory and calculate the checksum, and determine whether the data is correct and valid. If it is correct, read the measurement data saved in the on-chip Information Memory into the measurement data data structure in the memory; If it is incorrect, proceed to step 2); Step 2): Read the measurement data saved in the external EEPROM and calculate the checksum, and determine whether the data is correct and valid. If it is correct, read the measurement data saved in the external EEPROM into the measurement data data structure in the memory; If it is incorrect, proceed to step 3); Step 3): Clear the measurement data data structure in the memory.

5. The method for multiple safety verification of key data of an ultrasonic water meter according to claim 1, characterized in that, The specific steps of step 5 include: Step a: Calculate the checksum of the measurement data in the memory, and determine whether the checksum is correct. If the correct data is valid, proceed to step b, otherwise proceed to step c; Step b: Copy the measurement data to the unused memory; clear the memory used by the program data, and then copy the measurement data saved in the unused memory back to the measurement data data structure in the memory; Step c: Read the measurement data saved in the on-chip Information Memory and calculate the checksum, and determine whether the data is correct and valid. If it is correct, read the measurement data saved in the on-chip Information Memory into the measurement data data structure in the memory; if it is incorrect, read the measurement data saved in the external EEPROM and calculate the checksum, and determine whether the data is correct and valid. If it is correct, read the measurement data saved in the external EEPROM into the measurement data data structure in the memory; if it is incorrect, clear the measurement data data structure in the memory.

6. The multi - safety verification method for key data of the ultrasonic water meter according to claim 1, characterized in that, The specific steps for reloading the system parameters in step 5 include: Step (A): Read the system parameters saved in the on-chip Flash Memory, calculate the checksum, and check whether the checksum is correct. If it is correct, read the data into the system parameter data structure in the memory; if it is incorrect, proceed to step (B); Step (B): Read the system parameters saved in the external EEPROM, calculate the checksum, and check whether the checksum is correct. If it is correct, read the data into the system parameter data structure in the memory; if it is incorrect, proceed to step (C); Step (C): Read the default data into the system parameter data structure in the memory.

Citation Information

Patent Citations

  • NB module capable of embedding ultrasonic water meter function into NB-IOT modem chip

    CN109520576A

  • Communication equipment starting configuration data backup synchronization method

    CN111124763A

  • Storage system

    CN212112445U