Low-power smart gas meter and its hierarchical logic architecture

By using a low-power microprocessor and NB-IoT communication chip in a smart gas meter, combined with a hierarchical logic architecture and FreeRTOS operating system, the complex application design, high energy consumption and tamper-proof problems of smart gas meters are solved. Provides longer life and efficient battery usage and illegal meter removal monitoring.

CN108874561BActive Publication Date: 2024-10-01SHANGHAI FIORENTINI GAS EQUIP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201810612472.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-06-14
Publication Date
2024-10-01
Estimated Expiration
2038-06-14

AI Technical Summary

Technical Problem

Existing smart gas meters are complex in program design and difficult to maintain and manage code. Traditional cellular network communications consume high energy, affect battery life, and lack anti-illegal meter removal and anti-tampering functions.

Method used

It uses a low-power STM32L152VD microprocessor and NB-IoT cellular network communication chip, combined with a layered logic architecture and FreeRTOS operating system, to achieve improved module code coupling, reduced power consumption, illegal meter removal recording and alarm functions.

Benefits of technology

It significantly improves the battery life of smart gas meters, implements monitoring and alarm functions for illegal meter removal, and improves code maintenance and management efficiency through layered design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN108874561B_ABST
    Figure CN108874561B_ABST
Patent Text Reader

Abstract

The present invention provides a low-power smart gas meter and its hierarchical logic architecture, wherein the low-power smart gas meter includes a smart gas meter body, a cover-opening trigger device and a cover body; the cover body is detachably fixed with the smart gas meter body; the smart gas meter body includes a processor, a memory and a communication chip, the memory and the communication chip are connected to the processor; the cover-opening trigger device is connected between the smart gas meter body and the cover body, and connected to the processor. A low-power smart gas meter and its hierarchical logic architecture of the present invention can greatly improve the coupling degree between module codes, and at the same time, it has low power consumption, and can significantly improve the service life of the smart membrane gas meter when using the same amount of batteries; and can realize the illegal meter disassembly record and alarm functions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent gas meters, and in particular to a low-power intelligent gas meter and a hierarchical logic architecture thereof. Background Art

[0002] The programming of the traditional 8 / 16 / 32-bit microprocessors of existing smart gas meters is mostly based on bare metal design. Although it can meet relatively simple applications, it is not conducive to the code design of complex applications and the code maintenance and management of multi-member teams. At the same time, the existing smart gas meters mostly use traditional GSM / GPRS and 4G cellular network communication modules for communication, and the power consumption reaches 2 amperes. Such energy consumption will seriously affect the battery life. In addition, the existing smart gas meters lack the function of preventing illegal meter disassembly and tampering. Summary of the invention

[0003] In view of the deficiencies in the above-mentioned prior art, the present invention provides a low-power intelligent gas meter and a hierarchical logical architecture thereof, which can greatly improve the coupling degree between module codes and at the same time have low power consumption, and can significantly prolong the service life of the intelligent membrane gas meter when using the same amount of batteries; and can realize the illegal meter dismantling record and alarm function.

[0004] In order to achieve the above-mentioned objectives, the present invention provides a low-power consumption smart gas meter, comprising a smart gas meter body, a cover opening trigger device and a cover body; the cover body is detachably fixed to the smart gas meter body; the smart gas meter body comprises a processor, a memory and a communication chip, and the memory and the communication chip are connected to the processor; the cover opening trigger device is connected between the smart gas meter body and the cover body, and is connected to the processor.

[0005] Preferably, the cover opening trigger device is a touch switch.

[0006] Preferably, the communication chip adopts a NB-IoT cellular network communication chip.

[0007] Preferably, the smart gas meter body also includes a photoelectric direct-reading accumulator, at least one control button, a first power supply, a display, a second power supply, a DC switch and a motor valve; the first power supply is electrically connected to the processor, and the control button, the display, the DC switch and the motor valve are electrically connected to the processor; the second power supply is electrically connected to the DC switch, the motor valve and the communication chip.

[0008] Preferably, the processor comprises a 32-bit low-power microprocessor of model STM32L152VD.

[0009] Preferably, the processor is provided with the layered logic architecture, and the layered logic architecture includes a FreeRTOS embedded operating system.

[0010] Preferably, the memory is a serial flash memory.

[0011] A hierarchical logical architecture based on the low-power intelligent gas meter of the present invention comprises an intermediate layer and a business layer, wherein the intermediate layer comprises: an intermediate layer task manager, a first application module and a first driver module; the business layer comprises: a business layer task manager, a second application module and a second driver module;

[0012] The business layer task manager is connected in communication with the middle layer task manager, the first application module is connected in communication with the middle layer task manager and the second application module, the first driver module is connected in communication with the first application module and the second driver module, and the second driver module is connected in communication with the second application module;

[0013] The middle layer is used to uniformly encapsulate the hardware module functions and the basic logic functions of the system;

[0014] The business layer is used to control the corresponding hardware by calling the interface of the middle layer;

[0015] The first driver module and the second driver module are used for multi-level encapsulation of native library functions of the processor.

[0016] Preferably, the middle-layer task manager includes:

[0017] A menu task management module, used to manage the interaction between buttons and menus;

[0018] An event task management module, used to manage interrupt events triggered by onboard resources of the control board with the processor as the core, wherein the interrupt events include key press, clock and wake-up;

[0019] a business layer request task management module, used to process application requests from the business layer; and

[0020] The FreeRTOS embedded operating system is used to provide system scheduling and function interface;

[0021] The first application module includes:

[0022] a middle layer initialization module, used to allocate the FreeRTOS embedded operating system resources according to the middle layer tasks; and

[0023] An intermediate layer application module and a function interface module are used to implement the first peripheral function by module, wherein the first peripheral function includes LCD display menu items, clock alarm management and power supply voltage acquisition.

[0024] Preferably, the business layer task manager includes:

[0025] A communication task module, used to manage and maintain the external communication interface of the diaphragm gas meter;

[0026] A business layer event task module, used to process information communication transmission between modules of the business layer;

[0027] a valve control task module, for processing valve control requests, wherein the valve control requests include: power-off I / O interruption, key I / O interruption and valve control notification of the communication protocol; and

[0028] a middle layer notification task module, used for processing the event notifications given by the middle layer in a shared form, wherein the event notifications include: hourly / daily events, power-off / power-on events, and cover opening / closing events;

[0029] The second application module includes:

[0030] a business layer initialization module, used to allocate the FreeRTOS embedded operating system resources according to the middle layer tasks; and

[0031] A business layer application module and a function interface module are used to implement the second peripheral function by module, and the second peripheral function includes NB-IoT communication, remote control of valves and manual / automatic network reporting.

[0032] The present invention adopts the above technical solution, so it has the following beneficial effects:

[0033] The cooperation of the cover opening trigger device, processor and communication chip makes the cover opening operation immediately trigger the anti-tampering event and notify the processor, which can realize the monitoring of illegal cover opening events by users, and record the event and alarm the maintenance personnel. The use of NB-IoT cellular network communication chip can reduce the power consumption to 300 mA level during data communication. The low-power system design of the firmware can significantly improve the service life of the smart gas meter when using the same amount of batteries. The processor combines the FreeRTOS embedded operating system and uses the structure of code partitioning and hierarchical design to effectively improve the coupling between module codes. The use of hierarchical logic architecture separates the driver and business logic of the gas meter control board, and uses the FreeRTOS embedded operating system to separate the system call and the specific processor, which truly realizes the independence of program logic and bottom layer. The hierarchical structure can effectively avoid directly operating the bottom layer such as interrupt control and memory access in the business logic, achieve interface management for different chip and module combinations, and realize low coupling of code between developers of different roles. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 A schematic diagram of the structure of a low-power intelligent gas meter according to an embodiment of the present invention;

[0035] Figure 2 A schematic diagram of the structure of a touch switch according to an embodiment of the present invention;

[0036] Figure 3 A schematic diagram of the internal structure of a low-power smart gas meter according to an embodiment of the present invention;

[0037] Figure 4 A schematic diagram of the structure of a hierarchical logic architecture according to an embodiment of the present invention;

[0038] Figure 5 A system power-on flow chart of a low-power smart gas meter according to an embodiment of the present invention;

[0039] Figure 6 This is a data transmission flow chart of a low-power smart gas meter according to an embodiment of the present invention. DETAILED DESCRIPTION

[0040] The following is based on the attached Figure 1 to Figure 6 , give the preferred embodiments of the present invention, and describe them in detail so that the functions and features of the present invention can be better understood.

[0041] See also Figure 1 to Figure 4A low-power smart gas meter according to an embodiment of the present invention comprises a smart gas meter body 1, a cover opening trigger device 2 and a cover body 3; the cover body 3 is detachably fixed to the smart gas meter body 1; the smart gas meter body 1 comprises a processor 101, a memory 102 and a communication chip 103, and the memory 102 and the communication chip 103 are connected to the processor 101; the cover opening trigger device 2 is connected between the smart gas meter body 1 and the cover body 3, and is connected to the processor 101.

[0042] The cooperation between the cover opening trigger device 2, the processor 101 and the communication chip 103 ensures that the opening operation of the cover body 3 will immediately trigger an anti-tampering event and notify the processor 101, thereby monitoring illegal cover opening events by users, and recording the event and alerting the maintenance personnel.

[0043] In this embodiment, the cover opening trigger device 2 adopts a touch switch. The touch switch includes a telescopic top rod 21 and four contact pins 22 connected to the telescopic top rod 21. The touch switch is fixed to the gas meter body 1. The telescopic top rod 21 is compressed between the smart gas meter body 1 and the cover body 3 or between the smart gas meter body 1 and the convex column 31 of the cover body 3. When the cover body 3 is opened, the telescopic top rod 21 extends to drive the contact pins 22 to move, disconnect or connect the circuit with the processor 101, and then generate a trigger signal. In other embodiments, the structure of the touch switch is not limited and any existing touch switch can be used.

[0044] The communication chip 103 adopts a NB-IoT cellular network communication chip.

[0045] The use of NB-IoT cellular network communication chips can reduce power consumption during data communication to 300 mA, and the low-power system design of the firmware can significantly increase the service life of the smart gas meter when using the same amount of batteries. In this embodiment, the model of the NB-IoT cellular network communication chip is BC95.

[0046] NB-IoT (Narrowband Internet of Things) adopts international standards and is a low-cost, telecommunications-grade, high-reliability, high-security wide-area Internet of Things technology that can be integrated and evolved with existing cellular networks. It has a wider and deeper coverage, lower cost, and supports massive connections.

[0047] The smart gas meter body 1 also includes a photoelectric direct reading accumulator 14, at least one control button 105, a first power supply 106, a display 107, a second power supply 108, a DC switch 109 and a motor valve 110; the first power supply 106 is electrically connected to the processor 101, and the control button 105, the display 107, the DC switch 109 and the motor valve 110 are electrically connected to the processor 101; the second power supply 108 is electrically connected to the DC switch 109, the motor valve 110 and the communication chip 103.

[0048] The first power supply 106 is used to power the processor 101, and the second power supply 108 is used to power the motor valve 110 and the communication chip 103. In this embodiment, the first power supply 106 uses a 3.6 volt lithium battery; the second power supply 108 uses a 4-cell 1.5 volt dry cell battery. The photoelectric direct reading accumulator 14 is used to obtain the mechanical character wheel reading through photoelectric signal conversion.

[0049] In this embodiment, the display 107 uses a low-power LCD screen to synchronize the gas meter digital wheel value to the display 107 and can prompt the user with status information during the use of the gas meter, such as faults, interference, low battery, etc.

[0050] The processor 101 includes a 32-bit low-power microprocessor of model STM32L152VD. The processor 101 is provided with a hierarchical logic architecture, and the hierarchical logic architecture includes a FreeRTOS embedded operating system 414.

[0051] FreeRTOS embedded operating system 414 is a mini real-time operating system kernel. As a lightweight operating system, its functions include: task management, time management, semaphore, message queue, memory management, recording function, software timer, coroutine, etc., which can basically meet the needs of smaller systems.

[0052] The memory 102 is a serial flash memory, which is a low-power SPI storage device used to store historical records.

[0053] A low-power smart gas meter according to an embodiment of the present invention further includes multiple software function modules, including:

[0054] The metering management module is used to manage the gas meter counts and the digital signals given to the processor 101 in the form of pulse counting or photoelectric coding wheel, and can manage the reed switch or photoelectric direct reading accumulator 14. It can monitor abnormal flow such as excessive flow, too low flow and reading regression during the use of the gas meter.

[0055] The key detection module is used to maintain a user key event and form a human-computer interaction with the display 107 through a short / long key.

[0056] The anti-tampering module is used to monitor illegal opening of the cover by users, record the event and send an alarm to inform maintenance personnel.

[0057] The display module is used to synchronize the counting wheel value to the display 107 and can prompt the user with status information during the use of the gas meter, such as failure, interference, low battery, etc.

[0058] The communication control module is used for software interface definition of network communication functions, including starting the process, pushing and receiving data, data flow processing and protocol analysis, etc.

[0059] The motor valve control module is used to manage the motor valve 110 to implement the operation of opening and closing the valve, and can also monitor valve leakage events.

[0060] The log storage module is used to regularly store the gas meter hourly metering data, daily metering data, monthly metering data, system logs, etc. in an external storage device for query purposes.

[0061] Power supply monitoring module for power management.

[0062] A hierarchical logical architecture of a low-power smart gas meter based on this embodiment of the present invention includes an intermediate layer 4 and a business layer 5. The intermediate layer 4 includes: an intermediate layer task manager 41, a first application module 42 and a first driver module 43; the business layer 5 includes: a business layer task manager 51, a second application module 52 and a second driver module 53;

[0063] The business layer task manager 51 is connected to the middle layer task manager 41 in communication, the first application module 42 is connected to the middle layer task manager 41 and the second application module 52 in communication, the first driver module 43 is connected to the first application module 42 and the second driver module 53 in communication, and the second driver module 53 is connected to the second application module 52 in communication;

[0064] The middle layer 4 is used to unify the encapsulation of hardware module functions and system basic logic functions;

[0065] The business layer 5 is used to control the corresponding hardware by calling the interface of the middle layer 4;

[0066] The first driver module 43 and the second driver module 53 are used for multi-level encapsulation of the native library function of the processor 101, and encapsulate the driver code of the chip manufacturer into a unified interface. By encapsulating the driver layer, it is convenient for system transplantation.

[0067] The middle-layer task manager 41 includes: a menu task management module 411, an event task management module 412, a business layer request task management module 413 and a FreeRTOS embedded operating system 414, wherein the menu task management module 411 is used to manage the interaction between buttons and menus; the event task management module 412 is used to manage interrupt events triggered by the onboard resources of the control board with the processor 101 as the core, and the interrupt events include buttons, clocks and wake-ups; the business layer request task management module 413 is used to process application requests from the business layer 5; the FreeRTOS embedded operating system 414 is used to provide system scheduling and function interfaces;

[0068] The first application module 42 includes: an intermediate layer initialization module 421 and an intermediate layer application module and function interface module 422; wherein the intermediate layer initialization module 421 is used to allocate FreeRTOS embedded operating system 414 resources according to the intermediate layer 4 tasks; the intermediate layer application module and function interface module 422 is used to implement the first peripheral function by module, and the first peripheral function includes LCD display menu items, clock alarm management and power supply voltage acquisition.

[0069] The business layer task manager 51 includes: a communication task module 511, a business layer event task module 512, a valve control task module 513 and an intermediate layer notification task module 514; wherein, the communication task module 511 is used to manage and maintain the external communication interface of the diaphragm gas meter, such as local serial port communication and NB-IoT network communication, such as the semaphore reported on the network, the external memory read and write queue, the valve control queue and the communication protocol processing queue, etc.; the business layer event task module 512 is used to process the information communication transmission between the modules of the business layer 5; the valve control task module 513 is used to process the valve control request, and the valve control request includes: power-off I / O interruption, key I / O interruption and valve control notification of the communication protocol; the intermediate layer notification task module 514 is used to process the event notification given by the intermediate layer 4 in a shared form, and the event notification includes: hour / day event, power-off / power-on event and cover opening / closing event.

[0070] The second application module 52 includes: a business layer initialization module 521 and a business layer application module and function interface module 522, wherein the business layer initialization module 521 is used to allocate FreeRTOS embedded operating system 414 resources according to the middle layer 4 tasks; the business layer application module and function interface module 522 is used to implement the second peripheral function by module, and the second peripheral function includes NB-IoT communication, remote control valve and manual / automatic network reporting.

[0071] In addition, the first driver module 43 includes an intermediate layer driver module 431, an intermediate layer peripheral and I / O hardware abstraction layer module 432, a business layer I / O hardware abstraction layer module 433 and an STM32L1 peripheral library module 434; the second driver module 53 includes a business layer driver module 531 and a business layer peripheral hardware abstraction layer module 532.

[0072] The Hardware Abstraction Layer (HAL) is an interface layer between the operating system kernel and the hardware circuit. Its purpose is to abstract the hardware, hide the hardware interface details of a specific platform, and provide a virtual hardware platform for the operating system, making it hardware-independent and portable on multiple platforms.

[0073] The processor 101 is combined with the FreeRTOS embedded operating system 414 and utilizes the structure of code partitioning and hierarchical design, which can effectively improve the coupling degree between module codes.

[0074] The hierarchical logic architecture of the embodiment of the present invention separates the driving and business logic of the gas meter control board, and uses the FreeRTOS embedded operating system 414 to separate the system call and the specific processor 101, thus truly realizing the independence of the program logic and the bottom layer. The hierarchical structure can effectively avoid directly operating the bottom layer such as interrupt control and memory access in the business logic, achieve interface management for different chip and module combinations, and realize low coupling of codes between developers with different roles.

[0075] See also Figure 3 to Figure 5 , a low-power intelligent gas meter according to an embodiment of the present invention, the system power-on working steps are as follows:

[0076] Step 1: Power on or reset, where the reset may be caused by a watchdog timeout or software reset;

[0077] Step 2: Start the boot and select the loaded code partition, perform hardware initialization, middle layer 4 initialization, business layer 5 initialization, and start the system scheduler of FreeRTOS embedded operating system 414 after completing the initialization of all partition codes;

[0078] Step 3: Run the middle-layer task manager 41, start the clock to trigger the periodic wake-up interrupt, and set the alarm time of the relevant task. If the event generated by the middle layer 4 is shared with the business layer 5, the business layer 5 will execute and process it after receiving the notification;

[0079] Step 4: After no operation, the FreeRTOS embedded operating system 414 enters the idle state and determines whether it needs to enter the low-power stop mode. If the business layer 5 logic is executed and there is no event or message notification in the middle layer 4, it directly enters the stop mode, otherwise it continues to run the middle layer 4 task;

[0080] Step 5: The processor 101 is awakened by a periodic interrupt in the low power stop mode. At this time, the interrupt processing function performs a watchdog feeding operation, that is, clears the watchdog counter. If the watchdog feeding times out, it resets and enters the first step. This cycle repeats.

[0081] See also Figure 3 , Figure 6A low-power smart gas meter according to an embodiment of the present invention can initiate data transmission manually or by the alarm timing of its processor 101. Its events conform to the layered logical architecture of this embodiment. Specifically, the manual or alarm ringing events wake up the processor 101, triggering the driver layer to interrupt and notify the middle layer 4. The middle layer 4 then shares the event through the system call of the FreeRTOS embedded operating system 414 to the business layer 5. The business layer 5 executes the communication task, starts and initializes the NB-IoT cellular network communication chip, searches for the reading information and pushes it to the remote server to complete the data interaction, and then ends the task and releases the system resources of the FreeRTOS embedded operating system 414.

[0082] The present invention is described in detail above in conjunction with the embodiments of the accompanying drawings. A person skilled in the art can make various variations of the present invention according to the above description. Therefore, certain details in the embodiments should not constitute a limitation of the present invention, and the scope of protection of the present invention shall be defined by the scope of the attached claims.

Claims

1. A low-power smart gas meter, characterized in that: The smart gas meter comprises a main body, a cover-opening trigger device, and a cover body; the cover body is detachably fixed to the main body of the smart gas meter; the main body of the smart gas meter comprises a processor, a memory, and a communication chip, the memory and the communication chip being connected to the processor; the cover-opening trigger device is connected between the main body of the smart gas meter and the cover body, and is connected to the processor; The processor is provided with a layered logic architecture, and the layered logic architecture includes a FreeRTOS embedded operating system; The FreeRTOS embedded operating system includes an intermediate layer and a business layer, wherein the intermediate layer includes: an intermediate layer task manager, a first application module and a first driver module; the business layer includes: a business layer task manager, a second application module and a second driver module; The business layer task manager is in communication with the middle layer task manager, the first application module is in communication with the middle layer task manager and the second application module, the first driver module is in communication with the first application module and the second driver module, and the second driver module is in communication with the second application module; The middle layer is used to uniformly encapsulate the hardware module functions and the basic logic functions of the system; The business layer is used to control the corresponding hardware by calling the interface of the middle layer; The first driver module and the second driver module are used for multi-level encapsulation of native library functions of the processor; The middle-layer task manager includes: A menu task management module, used to manage the interaction between buttons and menus; An event task management module, used to manage interrupt events triggered by onboard resources of the control board with the processor as the core, the interrupt events including key press, clock and wake-up; a business layer request task management module, configured to process application requests from the business layer; and The FreeRTOS embedded operating system is used to provide system scheduling and function interfaces; The first application module includes: a middle layer initialization module, configured to allocate the FreeRTOS embedded operating system resources according to middle layer tasks; and An intermediate layer application module and a function interface module, configured to implement a first peripheral function on a module basis, wherein the first peripheral function includes LCD display menu items, clock alarm management, and power supply voltage acquisition; The business layer task manager includes: A communication task module, used to manage and maintain the external communication interface of the diaphragm gas meter; A business layer event task module, used to process information communication transmission between the modules of the business layer; a valve control task module for processing valve control requests, including power-off I / O interrupts, key I / O interrupts, and valve control notifications of communication protocols; and a middle layer notification task module, configured to process event notifications provided by the middle layer in a shared manner, wherein the event notifications include hourly / daily events, power-off / power-on events, and lid opening / closing events; The second application module includes: a business layer initialization module, configured to allocate the FreeRTOS embedded operating system resources according to the middle layer tasks; and A business layer application module and a function interface module are used to implement the second peripheral function by module, wherein the second peripheral function includes NB-IoT communication, remote control valve and manual / automatic network reporting.

2. The low-power smart gas meter according to claim 1, characterized in that: The cover opening trigger device adopts a touch switch.

3. The low-power smart gas meter according to claim 1, characterized in that: The communication chip adopts the NB-IoT cellular network communication chip.

4. The low-power smart gas meter according to claim 3, characterized in that: The smart gas meter body further includes a photoelectric direct reading accumulator, at least one control button, a first power supply, a display, a second power supply, a DC switch and a motor valve; the first power supply is electrically connected to the processor, and the control button, the display, the DC switch and the motor valve are electrically connected to the processor; The second power supply is electrically connected to the DC switch, the motor valve, and the communication chip.

5. The low-power smart gas meter according to claim 4, characterized in that: The processor includes a 32-bit low-power microprocessor of model STM32L152VD.

6. The low-power smart gas meter according to claim 1, characterized in that: The memory is a serial flash memory.