Meter end parameter storage method and device of gas meter and gas meter
By identifying and allocating the storage address and type of gas meter parameters and adopting a fixed address and cyclic storage method, the problem of chaotic storage of gas meter parameters is solved and the service life of the storage chip is improved.
Patent Information
- Application Number
- CN202510722748.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-09-05
AI Technical Summary
The meter-side parameter storage of existing gas meters is frequently chaotic, causing the storage chip to reach its storage life prematurely and become unable to effectively store parameters.
By processing the parameter storage instructions of the gas meter, the type of the parameter to be stored is identified, and the corresponding storage address and storage unit are determined based on the parameter type. Fixed address storage and circular storage are used to allocate different storage spaces for different types of parameters to prevent chaotic storage of parameters.
It achieves safe and accurate storage of various meter parameters, extends the service life of the storage chip, and avoids storage failure caused by frequent storage.
Smart Images

Figure CN120596022A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of gas meter equipment, and in particular to a method and device for storing meter-end parameters of a gas meter, and a gas meter. Background Art
[0002] With the increasing availability of gas supplies and the demand for intelligent management, gas meters are becoming increasingly versatile, placing higher demands on meter-side parameter storage methods. Currently, most gas meter parameters are stored in flash or EEPROM memory, which has a limited number of storage cycles. Frequent storage can cause the memory chip to reach its end of life prematurely, resulting in failure of subsequent parameter storage. Most smart gas meters have an upgrade function, and the program before and after the upgrade may require additional storage parameters. In this case, scalability of parameter storage is crucial, requiring the addition of new parameters without changing the original parameters. Existing storage methods result in chaotic storage and consume memory chips at an excessively high rate. Summary of the Invention
[0003] The present invention provides a method, device and gas meter for storing meter-end parameters of a gas meter, so as to solve the technical problem in the prior art that frequent and chaotic storage of meter-end parameters of a gas meter causes a storage chip to reach its storage life prematurely, resulting in the inability to store meter-end parameters.
[0004] According to one aspect of the present invention, a method for storing meter-side parameters of a gas meter is provided, which is applied to the gas meter and comprises:
[0005] Processing a gas meter parameter storage instruction of the gas meter, and determining a parameter to be stored corresponding to the gas meter parameter storage instruction;
[0006] Determining the parameter storage address based on the parameter type corresponding to the parameter to be stored;
[0007] The storage unit corresponding to the parameter to be stored is determined by the parameter storage address, and the parameter to be stored is stored in the storage unit.
[0008] According to another aspect of the present invention, a meter-side parameter storage device for a gas meter is provided, which is deployed at the gas meter and includes:
[0009] an instruction processing module, configured to process a gas meter parameter storage instruction of the gas meter and determine a parameter to be stored corresponding to the gas meter parameter storage instruction;
[0010] A storage address identification module, configured to determine the parameter storage address based on the parameter type corresponding to the parameter to be stored;
[0011] The parameter storage module is used to determine the storage unit corresponding to the parameter to be stored according to the parameter storage address, and store the parameter to be stored in the storage unit.
[0012] According to another aspect of the present invention, a gas meter is provided, comprising:
[0013] at least one processor; and
[0014] a memory communicatively connected to the at least one processor; wherein,
[0015] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the meter-end parameter storage method of the gas meter described in any embodiment of the present invention.
[0016] The technical solution of the embodiment of the present invention determines the parameters to be stored corresponding to the gas meter parameter storage instruction by processing the gas meter parameter storage instruction of the gas meter, and can respond to the instructions of the meter-end program of the gas meter to identify the meter-end parameters that need to be stored, thereby preventing the meter-end parameters from being frequently stored; determines the parameter storage address based on the parameter type corresponding to the parameter to be stored, and prevents the chaotic storage of meter-end parameters by dividing different types of parameters into different storage spaces for storage; determines the storage unit corresponding to the parameter to be stored through the parameter storage address, and stores the parameter to be stored in the storage unit, thereby realizing safe and accurate storage of various types of meter-end parameters, solving the technical problem that the frequent and chaotic storage of the meter-end parameters of the gas meter causes the storage chip to reach its storage life prematurely, resulting in the inability to store the meter-end parameters, and achieves the beneficial effect of increasing the service life of the storage chip.
[0017] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 A flow chart of a method for storing meter-side parameters of a gas meter is provided in an embodiment of the present invention;
[0020] Figure 2A flow chart of another gas meter parameter storage method provided by an embodiment of the present invention;
[0021] Figure 3 An example diagram of a parameter storage structure for fixed address storage provided by an embodiment of the present invention;
[0022] Figure 4 A schematic structural diagram of a fixed-length storage unit provided in an embodiment of the present invention;
[0023] Figure 5 A flow chart of another gas meter parameter storage method provided by an embodiment of the present invention;
[0024] Figure 6 A schematic diagram of a structure of a cyclic storage parameter storage provided by an embodiment of the present invention;
[0025] Figure 7 A flow chart of another gas meter parameter storage method provided by an embodiment of the present invention;
[0026] Figure 8 The present invention discloses a schematic diagram of a parameter storage structure of a gas meter;
[0027] Figure 9 A schematic structural diagram of a meter-end parameter storage device for a gas meter provided in an embodiment of the present invention;
[0028] Figure 10 FIG. 1 is a schematic structural diagram of a gas meter 10 that can be used to implement an embodiment of the present invention. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0030] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0031] Figure 1 The present invention provides a flow chart of a method for storing meter-side parameters of a gas meter. This embodiment is applicable to situations where a gas meter needs to store and update various types of meter-side parameters. The method can be executed by a meter-side parameter storage device of a gas meter. The meter-side parameter storage device of the gas meter can be implemented in the form of hardware and / or software. The meter-side parameter storage device of the gas meter can be configured in the gas meter. Figure 1 As shown, the method includes:
[0032] S110: Process the gas meter parameter storage instruction of the gas meter, and determine the parameters to be stored corresponding to the gas meter parameter storage instruction.
[0033] The gas meter parameter storage instruction may be an instruction to store the meter-side parameters during the operation of the gas meter. It should be noted that the gas meter parameter storage instruction can indicate the parameters to be stored, and the gas meter can determine the parameters to be stored based on the gas meter parameter storage instruction.
[0034] The parameters to be stored may be meter-end parameters that need to be stored in the gas meter.
[0035] Optionally, the meter parameters of the gas meter can be divided into four parameter types: operating parameters, setting parameters, fixed parameters and real-time parameters;
[0036] Optionally, the operating parameters may be fixed parameters generated during the operation of the gas meter. When the operating parameters need to be stored at specific times or when the parameters change during the operation of the gas meter, a gas meter parameter storage instruction corresponding to the operating parameters is generated. For example, the operating parameters may be the monthly cumulative gas usage amount settled at dawn each day.
[0037] Optionally, the setting parameters can be used to set parameters for the gas meter; by setting new setting parameters in the gas meter, when the setting parameters need to be stored, a gas meter parameter storage instruction corresponding to the operating parameter is generated. For example, the setting parameters can be used to set the gas meter to record and display the gas volume used in the previous day, and the gas volume used in the previous day needs to be stored.
[0038] Optionally, the fixed parameters may be parameters that are burned into the gas meter and remain unchanged.
[0039] Optionally, the real-time parameters may be parameters that need to be stored in the gas meter in real time, such as real-time recording of the accumulated gas volume and accumulated amount in the gas meter. The accumulated gas volume and accumulated amount need to be stored in real time, thereby generating a gas meter parameter storage instruction.
[0040] Specifically, when the meter-side parameters of the gas meter need to be stored, the gas meter generates a gas meter parameter storage instruction corresponding to the meter-side parameters, processes the gas meter parameter storage instruction, and determines the parameters to be stored corresponding to the gas meter parameter storage instruction.
[0041] S120: Determine the parameter storage address based on the parameter type corresponding to the parameter to be stored.
[0042] The parameter type may be a type of the parameter to be stored in the table-side parameter, and the parameter type may be at least one of an operating parameter, a setting parameter, a fixed parameter, and a real-time parameter.
[0043] Optionally, in the storage space of the gas meter, corresponding storage spaces are set for four types of meter-end parameters respectively, each type of meter-end parameter corresponds to a separate storage space, and at least one storage unit is set in the storage space, and each storage unit stores the data of a meter-end parameter.
[0044] Optionally, identify the parameter type corresponding to the parameter to be stored, and then determine the storage space corresponding to the parameter to be stored, determine the storage unit of the parameter to be stored in the storage space corresponding to the parameter to be stored, and use the parameter storage address of the storage unit as the parameter storage address of the parameter to be stored.
[0045] Specifically, the parameter storage address is determined based on the parameter type corresponding to the parameter to be stored.
[0046] S130: Determine a storage unit corresponding to the parameter to be stored according to the parameter storage address, and store the parameter to be stored in the storage unit.
[0047] Specifically, after obtaining the parameter storage address of the parameter to be stored, the storage unit corresponding to the parameter storage address is accessed, and the parameter to be stored is stored in the storage unit, thereby completing the gas meter parameter storage instruction.
[0048] The technical solution of the embodiment of the present invention determines the parameters to be stored corresponding to the gas meter parameter storage instruction by processing the gas meter parameter storage instruction of the gas meter, and can respond to the instructions of the meter-end program of the gas meter to identify the meter-end parameters that need to be stored, thereby preventing the meter-end parameters from being frequently stored; determines the parameter storage address based on the parameter type corresponding to the parameter to be stored, and prevents the chaotic storage of meter-end parameters by dividing different types of parameters into different storage spaces for storage; determines the storage unit corresponding to the parameter to be stored through the parameter storage address, and stores the parameter to be stored in the storage unit, thereby realizing safe and accurate storage of various types of meter-end parameters, solving the technical problem that the frequent and chaotic storage of the meter-end parameters of the gas meter causes the storage chip to reach its storage life prematurely, resulting in the inability to store the meter-end parameters, and achieves the beneficial effect of increasing the service life of the storage chip.
[0049] Figure 2 This is a flowchart of another method for storing gas meter parameters provided by an embodiment of the present invention. The relationship between this embodiment and the above embodiment is that it specifically describes a specific method for storing parameters to be stored when the parameters to be stored are operating parameters, setting parameters or fixed parameters, such as Figure 2 As shown, the method includes:
[0050] S210: Process the gas meter parameter storage instruction of the gas meter, and determine the parameters to be stored corresponding to the gas meter parameter storage instruction.
[0051] S220: If the parameter type is an operating parameter, a setting parameter, or a fixed parameter, determine a storage address of the fixed parameter according to the parameter to be stored.
[0052] Optionally, if the parameter type of the parameter to be stored is an operating parameter, a setting parameter or a fixed parameter, the storage method of the operating parameter, the setting parameter or the fixed parameter is a fixed address storage method, and then the fixed parameter storage address of the parameter to be stored is identified through the parameter to be stored.
[0053] Optionally, in the present invention, the fixed address storage method divides the storage space of operating parameters, setting parameters or fixed parameters into a main storage area and a backup storage area. The main storage area is composed of multiple storage units of fixed length, and the backup storage area is also composed of multiple storage units of fixed length. In the main storage area and the backup storage area corresponding to one parameter type, the length of the storage unit is exactly the same; in the main storage area corresponding to different parameter types, the length of the storage unit can be the same or different; the present invention supports separate setting and adjustment of storage units of different parameter types to meet the storage requirements of each parameter type.
[0054] During the storage process, a parameter to be stored is stored in the main storage area and the backup storage area respectively. When reading the operating parameters, setting parameters or fixed parameters, as long as there is a valid parameter in the main storage area and the backup storage area, the parameter storage is considered valid.
[0055] Optionally, in the fixed address storage mode, each parameter type is bound to a fixed parameter structure, and the parameter structure of each parameter of this parameter type is exactly the same when stored. Based on the parameter structure of the operating parameters, setting parameters or fixed parameters, parameter reserved space and parameter check value space are added to form the most basic storage unit. The length of the storage unit in the storage space is fixed, that is, the fixed storage length. This makes the three types of parameters, operating parameters, setting parameters or fixed parameters, not stored according to the actual parameter structure length of the parameters, but by adding parameter reserved space and parameter check value space, the length of all parameters in the storage space is fixed to the same fixed storage length.
[0056] Optionally, the parameter check value is a CRC (Cyclic Redundancy Check) value. The parameter check value is calculated based on the actual parameters stored in the storage unit and is fixedly stored in a separate space set for the parameter check value in the storage unit.
[0057] For example, Figure 3 This is an example diagram of a parameter storage structure for fixed address storage provided by an embodiment of the present invention. Figure 3 As shown in the figure: the storage space corresponding to the operating parameters, setting parameters or fixed parameters is divided into two storage areas, namely the main storage area and the backup storage area. The main storage area and the backup storage area are respectively set with fixed-length parameters 1, parameter 2, parameter 3, parameter 4, parameter 5 and parameter 6; taking parameter 1 as an example, the same parameter 1 is stored in the main storage area and the backup storage area respectively, and the parameter used space of the two parameters 1 has exactly the same length in the fixed-length parameter space of parameter 1, and the parameter reserved space and the parameter check value (CRC) space are also exactly the same.
[0058] Figure 4 A structural diagram of a fixed-length storage unit provided by an embodiment of the present invention; Figure 4 As shown, in a fixed-length storage unit, it is composed of parameter used space, parameter reserved space and parameter check value storage space when storing parameters.
[0059] Optionally, in another optional embodiment of the present invention, determining the parameter storage address according to the parameter to be stored includes:
[0060] The corresponding primary storage area and backup storage area are determined based on the parameter type of the parameter to be stored; and the parameter storage address is determined according to the parameter to be stored and a preset fixed storage length.
[0061] The fixed parameter storage address determines the main storage address and the backup storage address. The main storage address may be the storage address of the storage unit of the parameter to be stored in the main storage area; the backup storage address may be the storage address of the storage unit of the parameter to be stored in the backup storage area.
[0062] Specifically, when determining the parameters to be stored, the main storage area and the backup storage area corresponding to the parameter type are determined based on the parameter type corresponding to the parameter to be stored, and then the preset fixed storage lengths of the storage units in the main storage area and the backup storage area are obtained. Based on the preset fixed storage lengths, address offset calculations are performed in the main storage area and the backup storage area respectively to obtain the main storage addresses of the free storage units in the main storage area and the backup storage addresses of the free storage units in the backup storage addresses.
[0063] S230: Add parameter reserved space for the parameter to be stored based on the fixed storage length of the storage unit to determine the target storage parameter, and calculate the parameter check value corresponding to the parameter to be stored.
[0064] Among them, the target storage parameter is composed of the parameter to be stored and the parameter reserved space; it should be noted that, since the length of the storage unit is a fixed storage length, the storage space of the parameter check value is subtracted from the fixed storage length, which is the storage space that can be used for the parameter to be stored. Then, on the basis of the fixed storage length, the storage space of the parameter check value and the length of the parameter to be stored are removed to obtain the parameter reserved space corresponding to the parameter to be stored. On the basis of the parameter to be stored, the parameter reserved space is added to obtain the target storage parameter.
[0065] Optionally, during storage, it is also necessary to calculate a parameter check value corresponding to the parameter to be stored, and the parameter check value is obtained by performing a cyclic redundancy check calculation on the parameter to be stored.
[0066] Specifically, a parameter reserved space is added for the parameter to be stored based on the fixed storage length of the storage unit to determine the target storage parameter, and a parameter check value corresponding to the parameter to be stored is calculated.
[0067] S240 , access the storage unit corresponding to the primary storage address and the storage unit corresponding to the backup storage address respectively.
[0068] Optionally, after calculating the target storage parameter and the parameter check value of the parameter to be stored, the storage unit corresponding to the primary storage address in the primary storage area and the storage unit corresponding to the backup storage address corresponding to the backup storage address in the backup storage area are accessed respectively.
[0069] S250: Store the target storage parameter and the parameter check value in a storage unit corresponding to the primary storage address and a storage unit corresponding to the backup storage address, respectively.
[0070] Specifically, in the storage unit corresponding to the main storage address entering the main storage area, the target storage parameters and the parameter check value are stored in the storage unit corresponding to the main storage address; in the storage unit corresponding to the backup storage address entering the backup storage area, the target storage parameters and the parameter check value are stored in the storage unit corresponding to the backup storage address.
[0071] The technical solution of the embodiment of the present invention determines the parameters to be stored corresponding to the gas meter parameter storage instruction by processing the gas meter parameter storage instruction of the gas meter, and can respond to the instructions of the meter-end program of the gas meter to identify the meter-end parameters that need to be stored, thereby preventing the meter-end parameters from being frequently stored; determines the parameter storage address based on the parameter type corresponding to the parameter to be stored, and prevents the chaotic storage of meter-end parameters by dividing different types of parameters into different storage spaces for storage; determines the storage unit corresponding to the parameter to be stored through the parameter storage address, and stores the parameter to be stored in the storage unit, thereby realizing safe and accurate storage of various types of meter-end parameters, solving the technical problem that the frequent and chaotic storage of the meter-end parameters of the gas meter causes the storage chip to reach its storage life prematurely, resulting in the inability to store the meter-end parameters, and achieves the beneficial effect of increasing the service life of the storage chip.
[0072] Figure 5 This is a flow chart of another method for storing gas meter parameters provided by an embodiment of the present invention. The relationship between this embodiment and the above embodiment is that it specifically describes a specific method for storing parameters to be stored when the parameters to be stored are real-time parameters, such as Figure 5 As shown, the method includes:
[0073] S510: Process the gas meter parameter storage instruction of the gas meter, and determine the parameters to be stored corresponding to the gas meter parameter storage instruction.
[0074] S520: If the parameter type is a real-time parameter, determine an index value of the parameter to be stored, and determine a storage address of the random parameter according to the index value.
[0075] Optionally, for parameters to be stored whose parameter type is real-time parameters, the storage method adopted by the present invention is through circular storage. In the circular storage space corresponding to the circular storage, the random parameter storage address of different parameters to be stored is variable. In order to ensure that the parameters stored in the circular storage are correctly stored in sequence, a space for storing the random parameter storage address index is set to store the index value. The index value is used to determine the latest random parameter storage address during the circular storage.
[0076] Optionally, when setting the storage space for the index value, a circular storage method is also used to store the index value. Each time a real-time parameter is stored, the latest index value is first found, and a random parameter storage address is determined based on the index value. After the index value is updated to the next address, the real-time parameter is stored in the random parameter storage address. For example, in the storage space for the index value, the default value is 0xFF, and the latest position 0x55 indicates that a valid real-time parameter exists for that index value.
[0077] Figure 6 A schematic diagram of a structure of a cyclic storage parameter storage provided by an embodiment of the present invention. Figure 6 As shown: It consists of an index value space and a random parameter storage address area. The index value of the index value space is 0x55, indicating that the random parameter storage address corresponding to the index value stores the parameter. The index value of the index value space is 0xFF, indicating that the random parameter storage address corresponding to the index value has no parameter. The latest index value of 0x55 indicates the random parameter storage address that stores the latest real-time parameters. The storage unit corresponding to the index value 0x55 in the random parameter storage address area stores the real-time parameters, and the storage unit corresponding to the index value 0xFF is an unused space.
[0078] Specifically, if the parameter type is a real-time parameter, the index value of the parameter to be stored is determined, and the random parameter storage address is determined according to the index value.
[0079] Optionally, in another optional embodiment of the present invention, determining the index value of the parameter to be stored and determining the random parameter storage address by the index value includes:
[0080] An index search is performed in a preset index value space by a binary search method to determine the index value; and the random parameter storage address is calculated based on the index value.
[0081] Specifically, the index value space is a storage space for storing index values in sequence, and each index value is sorted in sequence. A pointer pointing to the start of the index is set in the index value space, and then a circular calculation is performed to obtain the latest index value in the index value space. The random storage address corresponding to the latest index value is calculated based on the address offset between the index value and the circular storage space.
[0082] S530: Access the storage unit corresponding to the random parameter storage address, and store the parameter to be stored in the storage unit corresponding to the random parameter storage address.
[0083] Optionally, the storage structure of the storage unit corresponding to the random parameter storage address and the storage unit corresponding to the main storage address are the same. The storage unit corresponding to the random parameter storage address includes the actual stored real-time parameters, reserved storage space and parameter check value. During storage, based on the fixed storage length of the storage unit, the storage space of the parameter check value and the length of the parameter to be stored are removed to obtain the parameter reserved space corresponding to the parameter to be stored. Based on the parameter to be stored, the parameter reserved space is added to obtain the target storage parameter, and the parameter check value corresponding to the parameter to be stored is calculated. The parameter check value is obtained by performing a cyclic redundancy check calculation on the parameter to be stored, and the storage unit corresponding to the random parameter storage address is accessed. The target storage parameter and the parameter check value are stored in the storage unit corresponding to the random parameter storage address, and the index value is updated to the next address of the index value space.
[0084] The technical solution of the embodiment of the present invention determines the parameters to be stored corresponding to the gas meter parameter storage instruction by processing the gas meter parameter storage instruction of the gas meter, and can respond to the instructions of the meter-end program of the gas meter to identify the meter-end parameters that need to be stored, thereby preventing the meter-end parameters from being frequently stored; determines the parameter storage address based on the parameter type corresponding to the parameter to be stored, and prevents the chaotic storage of meter-end parameters by dividing different types of parameters into different storage spaces for storage; determines the storage unit corresponding to the parameter to be stored through the parameter storage address, and stores the parameter to be stored in the storage unit, thereby realizing safe and accurate storage of various types of meter-end parameters, solving the technical problem that the frequent and chaotic storage of the meter-end parameters of the gas meter causes the storage chip to reach its storage life prematurely, resulting in the inability to store the meter-end parameters, and achieves the beneficial effect of increasing the service life of the storage chip.
[0085] Figure 7 This is a flow chart of another method for storing meter-end parameters of a gas meter provided by an embodiment of the present invention. The relationship between this embodiment and the above embodiment is that it specifically describes a specific method for reading meter-end parameters when the meter-end parameters of the gas meter are restarted, such as Figure 7 As shown, the method includes:
[0086] S710: Receive a meter-side program startup instruction from a gas meter, and determine at least one target parameter corresponding to the meter-side program startup instruction.
[0087] Among them, the meter-end program startup instruction can be an instruction for starting the meter-end program of the gas meter; it should be noted that, in the present invention, the gas meter is usually running continuously. After the meter-end program of the gas meter is remotely upgraded or the user actively restarts the gas meter, the meter-end program of the gas meter is restarted, and then after the gas meter is restarted, a meter-end program startup instruction is generated to read the parameters of various parameter types of the gas meter.
[0088] Optionally, in the present invention, default meter-side parameters to be loaded are set for the meter-side program startup instruction, and upon recognizing the meter-side program startup instruction, target parameters to be loaded by the meter-side program startup instruction are identified. The target parameters may be the default meter-side parameters to be loaded when the gas meter is started.
[0089] Specifically, a meter-side program start instruction of the gas meter is received, and at least one target parameter corresponding to the meter-side program start instruction is determined.
[0090] S720. For each target parameter, identify the parameter reading address corresponding to the target parameter based on the parameter type corresponding to the target parameter, access the target storage unit based on the parameter reading address of each target parameter, and obtain the parameter corresponding to the table-side program startup instruction.
[0091] Among them, the parameter reading address can be the storage address where the gas meter stores various meter-end parameters; it should be noted that since the parameter types of the target parameters are operating parameters, setting parameters, real-time generation and fixed parameters, the parameter reading addresses are the main storage address and random parameter storage address respectively.
[0092] Optionally, when reading a target parameter, for the target parameter, a storage space for storing the parameter type is determined based on the parameter type of the target parameter, and then the storage address of the target parameter is obtained, that is, the parameter reading address is obtained.
[0093] The parameters to be loaded may be target parameters read from the storage space of the gas meter.
[0094] Optionally, in another optional embodiment of the present invention, identifying the parameter reading address corresponding to the target parameter based on the parameter type corresponding to the target parameter, accessing the target storage unit based on the parameter reading address of each target parameter, and obtaining the parameter corresponding to the table-side program startup instruction includes:
[0095] If the parameter type is an operating parameter, determining a primary storage area corresponding to the operating parameter;
[0096] Determining the parameter reading address based on the target parameter and a preset fixed storage length;
[0097] Accessing the storage unit based on the target parameter address, and reading the actual storage parameters, the reserved parameter space, and the actual storage check value in the storage unit;
[0098] Calculating a current check value of the actual stored parameter;
[0099] If the current check value of the actual stored parameter is different from the stored check value, determining a backup parameter address in the backup storage area based on the target parameter and a preset fixed storage length;
[0100] Accessing the storage unit based on the backup parameter address, and reading the backup storage parameters, the reserved parameter space, and the backup storage check value in the storage unit;
[0101] Calculating a current check value of the backup storage parameter;
[0102] If the current check value of the backup storage parameter is different from the backup storage check value, a default parameter corresponding to the target parameter is loaded, and the default parameter is written into the storage unit of the main storage area and the storage unit of the backup storage area.
[0103] The actual storage parameter may be a parameter actually stored in the storage unit; and the actual storage check value may be a value stored in the storage space corresponding to the parameter check value in the storage unit.
[0104] The current check value may be a parameter check value obtained by real-time calculation based on the actual storage parameters in the storage unit.
[0105] The backup storage verification value may be a parameter verification value stored in a storage unit of the backup storage area; and the backup storage parameter may be an actual storage parameter stored in a storage unit of the backup storage area.
[0106] Optionally, for a target parameter, when it is identified that the parameter type of the target parameter is an operating parameter, the storage space corresponding to the operating parameter is accessed, the main storage area corresponding to the operating parameter is determined, the offset address of the target parameter relative to the first storage unit is calculated based on the parameter name of the target parameter and the fixed storage length of the storage unit, and then the storage unit of the target parameter is determined to obtain the parameter reading address; the storage unit corresponding to the parameter reading address is accessed, the actual storage parameters, reserved parameter space and actual storage check value stored in the storage unit are read, the parameter check is performed based on the actual storage parameters stored in the storage unit, and the current check value corresponding to the actual storage parameter is calculated. If the current check value is the same as the actual storage check value, it is considered that the check has passed, and the actual storage parameter corresponding to the target parameter is read as the parameter to be loaded.
[0107] Optionally, if the current check value is different from the actual storage check value, it is considered that there is an error in the stored operating parameters, and the backup storage area corresponding to the operating parameters is read, and the offset address of the target parameters relative to the first storage unit is calculated based on the target parameters and the fixed storage length of the storage unit, the storage unit of the target parameter in the backup storage area is determined, the storage unit is accessed, the backup storage parameters, reserved parameter space and backup storage check value stored in the storage unit are read, parameter verification is performed based on the backup storage parameters stored in the storage unit, and the current check value corresponding to the backup storage parameters is calculated. If the current check value is the same as the backup storage check value, it is considered that the verification has passed, the backup storage parameters are read as the parameters to be loaded, and the backup storage parameters are stored in the storage unit in the main storage area.
[0108] Optionally, if the current check value is the same as the backup storage check value, the default parameter corresponding to the target parameter is used as the parameter to be loaded, and the default parameter is stored in the storage unit of the main storage area and the storage unit of the backup storage area respectively. The default parameter can be a default parameter fixed in the gas meter.
[0109] Optionally, for a target parameter, when it is identified that the parameter type of the target parameter is a setting parameter or a fixed parameter, the reading process of the setting parameter and the fixed parameter is consistent with the operating parameter, and the present invention will not explain it again.
[0110] Optionally, for a target parameter, when the parameter type of the target parameter is identified as a real-time parameter, an index search is performed in the index value space through binary search to obtain the latest index value in the index value space, and the random storage address corresponding to the latest index value is calculated based on the address offset between the index value and the loop storage space, and the storage unit corresponding to the random storage address is accessed and read in the storage unit. The actual storage parameters, reserved parameter space and actual storage check value stored in the storage unit are read, and parameter verification is performed based on the actual storage parameters stored in the storage unit. The current check value corresponding to the actual storage parameter is calculated. If the current check value is the same as the actual storage check value, it is considered that the verification has passed, and the actual storage parameter corresponding to the target parameter is read as the parameter to be loaded.
[0111] Optionally, if the current check value is different from the actual stored check value, the check is considered to have failed, and the parameters corresponding to the target parameters are read from the operating parameters as the parameters to be loaded. It should be noted that real-time parameters are parameters that need to be saved in real time in the operating parameters. The operating parameters are stored once at a fixed time or when a specific parameter changes. The real-time parameters at that time are stored in the fixed storage unit corresponding to the operating parameters. When an error occurs in reading the real-time parameters, the fixed storage unit corresponding to the parameter type is read from the operating parameters to obtain the parameters of the fixed storage unit as the real-time parameters. For example, the operating parameter can be the remaining amount of the gas meter. During the operation of the gas meter, the remaining amount is calculated in real time and stored in the storage unit corresponding to the real-time parameter. At 0:00 every day, the remaining amount at 0:00 every day is stored as the operating parameter in the fixed storage unit. When the remaining amount is read at 12:00 the next day, if it is found that the real-time remaining amount at 12:00 cannot be read, the remaining amount at 0:00 on the same day in the fixed storage unit is read as the real-time remaining amount at the current 12:00.
[0112] Figure 8 The present invention discloses a schematic diagram of a gas meter parameter storage structure. Figure 8 As shown: The gas meter divides the overall storage space into four parts, and sets corresponding storage space for four types of meter-side parameters respectively. Each type of meter-side parameter corresponds to a separate storage space. At least one storage unit is set in the storage space, and an index value space is set for the real-time parameter, so that each type of parameter is stored in a different storage space without affecting each other during storage.
[0113] S730: Load each of the parameters to be loaded to start the meter-side program of the gas meter.
[0114] Specifically, the meter-side program of the gas meter loads each parameter to be loaded, thereby starting the meter-side program of the gas meter.
[0115] Optionally, if a storage unit requires new parameters, the corresponding storage unit is determined based on the new parameters, the storage unit is accessed, the new unit is added to the reserved parameter space, and the parameter check value is updated to complete the parameter update. This upgrade does not affect the original parameters and does not require the creation of new storage space.
[0116] The embodiment of the present invention solves the technical problem that frequent and chaotic storage of meter-end parameters of a gas meter causes the storage chip to reach its storage life prematurely, resulting in the inability to store meter-end parameters, and achieves the beneficial effect of increasing the service life of the storage chip.
[0117] Figure 9 The present invention provides a schematic diagram of the structure of a gas meter end parameter storage device. Figure 9As shown, the device includes: an instruction processing module 910, a storage address identification module 920 and a parameter storage module 930; wherein,
[0118] An instruction processing module 910 is configured to process a gas meter parameter storage instruction of the gas meter and determine parameters to be stored corresponding to the gas meter parameter storage instruction;
[0119] A storage address identification module 920 is configured to determine the parameter storage address based on the parameter type corresponding to the parameter to be stored;
[0120] The parameter storage module 930 is configured to determine the storage unit corresponding to the parameter to be stored according to the parameter storage address, and store the parameter to be stored in the storage unit.
[0121] The technical solution of the embodiment of the present invention determines the parameters to be stored corresponding to the gas meter parameter storage instruction by processing the gas meter parameter storage instruction of the gas meter, and can respond to the instructions of the meter-end program of the gas meter to identify the meter-end parameters that need to be stored, thereby preventing the meter-end parameters from being frequently stored; determines the parameter storage address based on the parameter type corresponding to the parameter to be stored, and prevents the chaotic storage of meter-end parameters by dividing different types of parameters into different storage spaces for storage; determines the storage unit corresponding to the parameter to be stored through the parameter storage address, and stores the parameter to be stored in the storage unit, thereby realizing safe and accurate storage of various types of meter-end parameters, solving the technical problem that the frequent and chaotic storage of the meter-end parameters of the gas meter causes the storage chip to reach its storage life prematurely, resulting in the inability to store the meter-end parameters, and achieves the beneficial effect of increasing the service life of the storage chip.
[0122] Optionally, the storage address identification module 920 is specifically configured to:
[0123] If the parameter type is an operating parameter, a setting parameter or a fixed parameter, determining the fixed parameter storage address according to the parameter to be stored;
[0124] If the parameter type is a real-time parameter, an index value of the parameter to be stored is determined, and the random parameter storage address is determined according to the index value.
[0125] Optionally, the storage address identification module 920 is further configured to:
[0126] Determining a corresponding primary storage area and a backup storage area based on the parameter type of the parameter to be stored;
[0127] The parameter storage address is determined according to the parameters to be stored and a preset fixed storage length; wherein the fixed parameter storage address determines a primary storage address and a backup storage address.
[0128] Optionally, the parameter storage module 930 is specifically configured to:
[0129] Determine a target storage parameter by adding a parameter reserved space for the parameter to be stored based on a fixed storage length of the storage unit, and calculate a parameter check value corresponding to the parameter to be stored;
[0130] Accessing the storage unit corresponding to the primary storage address and accessing the storage unit corresponding to the backup storage address respectively;
[0131] The target storage parameter and the parameter check value are stored in a storage unit corresponding to the primary storage address and a storage unit corresponding to the backup storage address, respectively.
[0132] Optionally, the storage address identification module 920 is further configured to:
[0133] Performing index retrieval in a preset index value space by a binary search method to determine the index value;
[0134] The random parameter storage address is calculated based on the index value.
[0135] Optionally, the parameter storage module 930 is further configured to:
[0136] Access the storage unit corresponding to the random parameter storage address, and store the parameter to be stored in the storage unit corresponding to the random parameter storage address.
[0137] Optionally, the system further includes a program restart module, a parameter reading module and a parameter loading module; wherein,
[0138] The program restart module is configured to receive a meter-side program start instruction from the gas meter and determine at least one target parameter corresponding to the meter-side program start instruction;
[0139] The parameter reading module is configured to identify, for each target parameter, a parameter reading address corresponding to the target parameter based on a parameter type corresponding to the target parameter, access a target storage unit based on the parameter reading address of each target parameter, and obtain a parameter to be loaded corresponding to the table-side program startup instruction;
[0140] The parameter loading module is used to load each of the parameters to be loaded to start the meter-end program of the gas meter.
[0141] Optionally, the parameter reading module is specifically used to:
[0142] If the parameter type is an operating parameter, determining a primary storage area corresponding to the operating parameter;
[0143] Determining the parameter reading address based on the target parameter and a preset fixed storage length;
[0144] Accessing the storage unit based on the target parameter address, and reading the actual storage parameters, the reserved parameter space, and the actual storage check value in the storage unit;
[0145] Calculating a current check value of the actual stored parameter;
[0146] If the current check value of the actual stored parameter is different from the stored check value, determining a backup parameter address in the backup storage area based on the target parameter and a preset fixed storage length;
[0147] Accessing the storage unit based on the backup parameter address, and reading the backup storage parameters, the reserved parameter space, and the backup storage check value in the backup storage unit;
[0148] Calculating a current check value of the backup storage parameter;
[0149] If the current check value of the backup storage parameter is different from the backup storage check value, a default parameter corresponding to the target parameter is loaded, and the default parameter is written into the main storage unit and the backup storage unit.
[0150] The meter-end parameter storage device of the gas meter provided in the embodiment of the present invention can execute the meter-end parameter storage method of the gas meter provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0151] Figure 10 The components, their connections and relationships, and their functions shown herein are merely examples and are not intended to limit implementation of the invention described and / or claimed herein.
[0152] like Figure 10 As shown, the gas meter 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 and a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores a computer program executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from the storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the gas meter 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0153] Multiple components in the gas meter 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard and mouse; an output unit 17, such as various types of displays and speakers; a storage unit 18, such as a magnetic disk and optical disk; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the gas meter 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0154] The processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors that run machine learning model algorithms, a digital signal processor (DSP), and any other suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the gas meter parameter storage method.
[0155] In some embodiments, the gas meter's meter-side parameter storage method can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the gas meter 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the gas meter's meter-side parameter storage method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the gas meter's meter-side parameter storage method in any other appropriate manner (e.g., via firmware).
[0156] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0157] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0158] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0159] To provide interaction with a user, the systems and techniques described herein can be implemented on a gas meter having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the gas meter. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0160] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0161] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0162] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.
[0163] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A method for storing meter-end parameters of a gas meter, characterized in that: Applicable to gas meters; including: Processing a gas meter parameter storage instruction of the gas meter, and determining a parameter to be stored corresponding to the gas meter parameter storage instruction; Determine a parameter storage address based on a parameter type corresponding to the parameter to be stored; The storage unit corresponding to the parameter to be stored is determined by the parameter storage address, and the parameter to be stored is stored in the storage unit.
2. The method according to claim 1, characterized in that The determining the parameter storage method based on the parameter type corresponding to the parameter to be stored includes: If the parameter type is an operating parameter, a setting parameter or a fixed parameter, determining the fixed parameter storage address according to the parameter to be stored; If the parameter type is a real-time parameter, an index value of the parameter to be stored is determined, and a random parameter storage address is determined according to the index value.
3. The method according to claim 2, characterized in that The determining the parameter storage address according to the parameters to be stored includes: Determining a corresponding primary storage area and a backup storage area based on the parameter type of the parameter to be stored; The parameter storage address is determined according to the parameters to be stored and a preset fixed storage length; wherein the fixed parameter storage address determines a primary storage address and a backup storage address.
4. The method according to claim 3, characterized in that The step of determining a storage unit corresponding to the parameter to be stored by using the parameter storage address, and storing the parameter to be stored in the storage unit, comprises: Determine a target storage parameter by adding a parameter reserved space for the parameter to be stored based on a fixed storage length of the storage unit, and calculate a parameter check value corresponding to the parameter to be stored; Accessing the storage unit corresponding to the primary storage address and accessing the storage unit corresponding to the backup storage address respectively; The target storage parameter and the parameter check value are stored in a storage unit corresponding to the primary storage address and a storage unit corresponding to the backup storage address, respectively.
5. The method according to claim 2, characterized in that Determining the index value of the parameter to be stored, and determining the random parameter storage address according to the index value, includes: Performing index retrieval in a preset index value space by a binary search method to determine the index value; The random parameter storage address is calculated based on the index value.
6. The method according to claim 5, characterized in that The step of determining a storage unit corresponding to the parameter to be stored by using the parameter storage address, and storing the parameter to be stored in the storage unit, comprises: Access the storage unit corresponding to the random parameter storage address, and store the parameter to be stored in the storage unit corresponding to the random parameter storage address.
7. The method according to claim 1, characterized in that Also includes: receiving a meter-side program start instruction from a gas meter, and determining at least one target parameter corresponding to the meter-side program start instruction; For each of the target parameters, identifying a parameter reading address corresponding to the target parameter based on a parameter type corresponding to the target parameter, accessing a target storage unit based on the parameter reading address of each of the target parameters, and obtaining a parameter to be loaded corresponding to the table-side program startup instruction; Each of the parameters to be loaded is loaded to start the meter-end program of the gas meter.
8. The method according to claim 7, characterized in that The step of identifying a parameter reading address corresponding to the target parameter based on a parameter type corresponding to the target parameter, accessing a target storage unit based on the parameter reading address of each target parameter, and obtaining a parameter corresponding to the table-side program startup instruction includes: If the parameter type is an operating parameter, determining a primary storage area corresponding to the operating parameter; Determining the parameter reading address based on the target parameter and a preset fixed storage length; Accessing the storage unit based on the target parameter address, and reading the actual storage parameters, the reserved parameter space, and the actual storage check value in the storage unit; Calculating a current check value of the actual stored parameter; If the current check value of the actual stored parameter is different from the stored check value, determining a backup parameter address in a backup storage area based on the target parameter and a preset fixed storage length; Accessing the storage unit based on the backup parameter address, and reading the backup storage parameters, the reserved parameter space, and the backup storage check value in the storage unit; Calculating a current check value of the backup storage parameter; If the current check value of the backup storage parameter is different from the backup storage check value, a default parameter corresponding to the target parameter is loaded, and the default parameter is written into the storage unit of the main storage area and the storage unit of the backup storage area.
9. A gas meter end parameter storage device, characterized in that: Deployed on gas meters; including: an instruction processing module, configured to process a gas meter parameter storage instruction of the gas meter and determine a parameter to be stored corresponding to the gas meter parameter storage instruction; A storage address identification module, configured to determine the parameter storage address based on the parameter type corresponding to the parameter to be stored; The parameter storage module is used to determine the storage unit corresponding to the parameter to be stored according to the parameter storage address, and store the parameter to be stored in the storage unit.
10. A gas meter, characterized in that: The gas meter comprises: at least one processor; and A memory chip in communication with the at least one processor; wherein, The memory chip stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the meter-end parameter storage method for a gas meter according to any one of claims 1 to 8.
Citation Information
Patent Citations
Data storage method, electronic equipment and storage medium
CN111966287A
Intelligent gas meter applying balanced life storage method and data storage method
CN112525278A
Data classified storage method and device based on dual-core intelligent electric meter
CN112684987A
Storage management method, storage device and storage medium
CN115525208A
Metering online monitoring module parameter management method, device, equipment and medium
CN117310596A