Intelligent electric meter based on embedded operating system

文档序号:632246 发布日期:2021-05-11 浏览:8次 中文

阅读说明:本技术 基于嵌入式操作系统的智能电表 (Intelligent electric meter based on embedded operating system ) 是由 王志强 胡启龙 樊琳 田羽 王鑫 杜君 付青琴 刘佳 王于波 庞振江 李延 梁 于 2020-12-25 设计创作,主要内容包括:本发明实施方式涉及智能电表技术领域,特别涉及一种基于嵌入式操作系统的智能电表,所述智能电表中的嵌入式操作系统包括硬件层、启动层和驱动层,还包括应用层和系统层,所述应用层包括若干应用程序,所述系统层包括:应用接口子层,用于提供所述系统层与所述应用程序的接口;设备管理子层,用于向所述应用接口子层提供与驱动设备框架的接口;函数集合子层,用于提供文件操作函数集合,供所述驱动层中的设备向所述驱动设备框架注册;驱动实现子层,用于提供所述驱动设备框架对注册后的设备进行管理;标准库子层,用于提供标准驱动库,所述标准驱动库中的标准驱动用于驱动所述注册后的设备。本发明提供的实施方式便于智能电表的功能开发。(The embodiment of the invention relates to the technical field of intelligent electric meters, in particular to an intelligent electric meter based on an embedded operating system, wherein the embedded operating system in the intelligent electric meter comprises a hardware layer, a starting layer, a driving layer, an application layer and a system layer, the application layer comprises a plurality of application programs, and the system layer comprises: the application interface sublayer is used for providing an interface between the system layer and the application program; the device management sublayer is used for providing an interface with a driving device framework for the application interface sublayer; the function set sub-layer is used for providing a file operation function set for the equipment in the drive layer to register to the drive equipment framework; a drive implementation sublayer, configured to provide the drive device framework to manage the registered device; and the standard library sublayer is used for providing a standard driver library, and standard drivers in the standard driver library are used for driving the registered equipment. The implementation mode provided by the invention is convenient for function development of the intelligent electric meter.)

1. The utility model provides a smart electric meter based on embedded operating system, embedded operating system in the smart electric meter includes hardware layer, start-up layer and driver layer, its characterized in that still includes application layer and system layer, the application layer includes a plurality of application program, the system layer includes:

the application interface sublayer is used for providing an interface between the system layer and the application program;

the device management sublayer is used for providing an interface with a driving device framework for the application interface sublayer;

the function set sub-layer is used for providing a file operation function set for the equipment in the drive layer to register to the drive equipment framework;

a drive implementation sublayer, configured to provide the drive device framework to manage the registered device;

and the standard library sublayer is used for providing a standard driver library, and standard drivers in the standard driver library are used for driving the registered equipment.

2. The smart meter based on the embedded operating system according to claim 1, wherein the embedded operating system is operated in a management module of the smart meter, and the smart meter further comprises a metering module and an expansion module;

the metering module comprises a power metering module and a data storage module;

the expansion module comprises a non-intervention identification module, an ordered charging module and an electric energy quality analysis module.

3. The embedded operating system-based smart meter of claim 2, wherein the applications comprise a system application, a business application and an extension application, and data interaction exists between the applications;

and the business application program and the extended application program carry out data interaction with the system layer through the system application program.

4. The smart meter of claim 3, wherein the applications in the metering module are connected to the system applications through a program interface.

5. The embedded operating system-based smart meter of claim 4, wherein the business application comprises:

the display application program is used for displaying information of the intelligent electric meter;

the data center application program is used for acquiring, storing and transmitting and receiving the data of the intelligent electric meter; and

and the basic service application program is used for realizing the basic service function of the intelligent electric meter.

6. The embedded operating system-based smart meter of claim 3, wherein the system application is configured to implement message passing among the system application, the extended application and the uplink interface, and management and monitoring of the business application.

7. The smart meter according to claim 1, wherein the interface provided by the device management sub-layer comprises: an open function, a close function, a read function, a write function, an input output control function, a monitor function, and a file offset function.

8. The embedded operating system-based smart meter of claim 1, wherein the devices in the driver layer comprise at least one of a UART device, an I2C bus device, an SPI bus device, and a functional peripheral;

the UART equipment, the I2C bus equipment and the SPI bus equipment are registered as standard equipment in the driving equipment framework, and are in butt joint with the function set sub-layer through the driving equipment framework;

and the functional peripheral completes the registration in the drive equipment framework through a corresponding file operation function added in the function set sub-layer.

9. The embedded operating system-based smart meter of claim 1, further comprising an external communication interface.

10. The smart meter of claim 9, wherein the external communication interface supports DL/T698.45 protocol.

Technical Field

The invention relates to the technical field of intelligent electric meters, in particular to an intelligent electric meter based on an embedded operating system.

Background

In recent years, the IR46 "active electric energy meter" standard promulgated by the international legal metering Organization (OIML) has made new demands on the metering technology and performance requirements of electric energy meters, and it is clear that when the management demand changes on the premise of ensuring the safety, the software related to illegal system can be upgraded on line, but the functions related to legal metering are not affected. However, the existing intelligent electric energy meter has limited expandability, single stored data content and format, various functions cannot be flexibly configured, the intelligent electric energy meter does not have a software upgrading function, and the business requirements of future continuous change and expansion of the ubiquitous power internet of things cannot be met. Therefore, advanced ideas of international standards and construction requirements of ubiquitous power internet of things need to be fully considered in the design scheme of a new-generation intelligent electric energy meter, the software upgrading requirements related to the IR46 need to be met besides the basic metering function, and flexible access of user-side intelligent equipment is supported.

The existing intelligent electric energy meter based on the embedded operating system has the advantages that the application layer software is designed into an integrated design, the coupling degree between the software is strong, the logic nesting is complex, the software upgrading is not facilitated, and the development requirement of a newly added service cannot be met. In addition, decoupling design is not realized between the bottom driver and the operating system, so that development and transplantation of manufacturers are not facilitated, and the operating efficiency of hardware resources is reduced.

Disclosure of Invention

In view of the above, the present invention is directed to an embedded operating system-based smart meter, so as to at least partially solve the above problems.

In order to achieve the above object, a first aspect of the present invention provides an intelligent electric meter based on an embedded operating system, where the embedded operating system in the intelligent electric meter includes a hardware layer, a start layer, a driver layer, an application layer and a system layer, the application layer includes a plurality of application programs, and the system layer includes: the application interface sublayer is used for providing an interface between the system layer and the application program; the device management sublayer is used for providing an interface with a driving device framework for the application interface sublayer; the function set sub-layer is used for providing a file operation function set for the equipment in the drive layer to register to the drive equipment framework; a drive implementation sublayer, configured to provide the drive device framework to manage the registered device; and the standard library sublayer is used for providing a standard driver library, and standard drivers in the standard driver library are used for driving the registered equipment.

Preferably, the embedded operating system runs in a management module of the smart electric meter, and the smart electric meter further comprises a metering module and an expansion module; the measurement module provides power measurement module and data storage module, the extension module includes non-intervention identification module, orderly module and the electric energy quality analysis module of charging.

Preferably, the application programs include a system application program, a business application program and an extension application program, and data interaction exists between the application programs; and the business application program and the extended application program carry out data interaction with the system layer through the system application program.

Preferably, the application program in the metering module is connected with the system application program through a program interface.

Preferably, the service application includes: the display application program is used for displaying information of the intelligent electric meter; the data center application program is used for acquiring, storing and transmitting and receiving the data of the intelligent electric meter; and the basic service application program is used for realizing the basic service function of the intelligent electric meter.

Preferably, the system application is further configured to: passing messages between the system application, the extension application and the upstream interface, and managing and monitoring the business application.

Preferably, the interface provided by the device management sublayer includes: an open function, a close function, a read function, a write function, an input output control function, a monitor function, and a file offset function.

Preferably, the devices in the driver layer include at least one of a UART device, an I2C bus device, an SPI bus device, and a functional peripheral; the UART equipment, the I2C bus equipment and the SPI bus equipment are registered as standard equipment in the driving equipment framework, and are in butt joint with the function set sub-layer through the driving equipment framework; and the functional peripheral completes the registration in the drive equipment framework through a corresponding file operation function added in the function set sub-layer.

Preferably, the smart meter further comprises an external communication interface.

Preferably, the external communication interface supports a DL/T698.45 protocol.

The intelligent electric meter based on the embedded operating system has the following beneficial effects:

(1) compared with the existing intelligent electric energy meter software, the application layer software realizes low coupling degree, and is convenient for later software upgrading and new function increasing;

(2) compared with the existing intelligent electric energy meter software, the software and hardware decoupling separation is realized by the driving layer and the system layer, the development and the transplantation of manufacturers are facilitated, the maintenance cost of an operating system is reduced, and the operation efficiency of hardware resources is improved.

Additional features and advantages of the invention will be set forth in the detailed description which follows.

Drawings

The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate an embodiment of the invention and, together with the description, serve to explain the invention and not to limit the invention. In the drawings:

fig. 1 is a schematic structural diagram of a system layer in an intelligent electric meter based on an embedded operating system according to an embodiment of the present invention;

FIG. 2 is a schematic diagram of a system layer implementation according to an embodiment of the present invention;

FIG. 3 is a block diagram of an embedded operating system according to an embodiment of the present invention;

fig. 4 is a schematic diagram of a module in an intelligent electric meter based on an embedded operating system according to an embodiment of the present invention;

fig. 5 is a schematic structural diagram of an application layer in the smart meter based on the embedded operating system according to an embodiment of the present invention.

Detailed Description

The following detailed description of embodiments of the invention refers to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating embodiments of the invention, are given by way of illustration and explanation only, not limitation.

Fig. 1 is a schematic structural diagram of a system layer in an intelligent electric meter based on an embedded operating system according to an embodiment of the present invention. As shown in fig. 1, an embedded operating system of a smart meter includes a hardware layer, a start layer, a driver layer, an application layer and a system layer, where the application layer includes a plurality of application programs, and the system layer includes:

the application interface sublayer is used for providing an interface between the system layer and the application program; the application program of the application layer calls the bottom layer hardware equipment in the intelligent electric meter and the functions thereof through the interface provided by the application interface sublayer;

the device management sublayer is used for providing an interface with a driving device framework for the application interface sublayer; the sub-layer provides a standard interface to the upper layer, and the interface provided by the driver framework to the application layer is a function of several operational functions.

The function set sub-layer is used for providing a file operation function set for the equipment in the drive layer to register to the drive equipment framework; the sub-layer provides the drives implementation sub-layer with a fos set (set of file manipulation functions) for the drives to register with the device.

A drive implementation sublayer, configured to provide the drive device framework to manage the registered device; in this sub-layer, all devices are provided with standard names, and the application layer operates the devices according to the standard names.

And the standard library sublayer is used for providing a standard driver library, and standard drivers in the standard driver library are used for driving the registered equipment. The standard library sublayer stores a standard library provided by a chip manufacturer, and operates peripheral driver related equipment, such as chip registers and the like, by using a standard library interface.

The intelligent electric energy meter designed by the embodiment applies the embedded operating system decoupled from the kernel, wherein a specific structure of a system layer of the embedded operating system is shown in fig. 2. Fig. 2 is a schematic diagram of a system layer according to an embodiment of the invention. The implementation method can reduce research and development and maintenance costs, improve development efficiency and improve the operating efficiency of hardware resources.

In order to explain the positional relationship of the system layer and the like in the smart meter in the present embodiment, it is specifically explained with reference to fig. 3. Fig. 3 is a schematic structural diagram of an embedded operating system according to an embodiment of the present invention, as shown in fig. 3. The intelligent electric energy meter software runs based on a management module hardware platform, and is respectively realized on a hardware layer, a starting layer, a driving layer, a system layer and an application layer according to different running environments and different running authorities. The software design based on the intelligent electric energy meter management module is shown in the figure. Wherein, 1) the hardware layer realizes the hardware running environment of the electric energy meter software; 2) the starting layer realizes hardware initialization and guides the kernel to start; 3) the driving layer comprises a general device driver, a special device driver and an MCU driver, can be compatible with various hardware architectures, provides a uniform interface for the upper part and realizes hardware platform; 4) the system layer realizes the multitask scheduling, the inter-task communication, the memory resource distribution and protection and the like of the embedded operating system; components such as an equipment driving frame and a peripheral interface are realized, and a uniform interface is provided for an application layer; 5) the application layer realizes the operation and management of the electric energy meter service function, and realizes decoupling separation between application layer software.

Fig. 4 is a schematic diagram of modules in an intelligent electric meter based on an embedded operating system according to an embodiment of the present invention, as shown in fig. 4. In an embodiment provided by the present invention, the embedded operating system runs in a management module of the smart meter, and the smart meter further includes a metering module and an expansion module; the measurement module provides power measurement module and data storage module, the extension module includes non-intervention identification module, orderly module and the electric energy quality analysis module of charging. The intelligent electric energy meter integrally adopts a multi-core modularized design, uses a physical separation principle, is provided with a metering module, a management module, an expansion module and the like, and is mutually independent among modules, and the damage of a certain module does not influence the work of other modules. The metering module provides legal data such as electric quantity and a clock, and historical data such as positive and negative active data are stored every minute and are used for electric quantity tracing; the management module is used for undertaking management tasks of the whole table, mainly comprising tasks of fee control, display, external communication, event recording, data freezing, load control and the like, and supporting software upgrading; the expansion module comprises a non-intervention identification module (standard distribution), an ordered charging module and an electric energy quality analysis module.

In an embodiment provided by the present invention, the interface provided by the device management sublayer includes: the method comprises the steps of opening a function open, closing a function close, reading a function read, writing a function write, an input-output control function ioctl, a monitoring function poll and a file offset function lseek. The above arrangement of basic functions enables basic management of devices.

In one embodiment provided by the present invention, the device in the driver layer includes at least one of a UART device, an I2C bus device, an SPI bus device, and a functional peripheral; the UART equipment, the I2C bus equipment and the SPI bus equipment are registered as standard equipment in the driving equipment framework, and are in butt joint with the function set sub-layer through the driving equipment framework; and the functional peripheral completes the registration in the drive equipment framework through a corresponding file operation function added in the function set sub-layer. Specifically, for UART (Universal Asynchronous Receiver Transmitter/Transmitter), it has a corresponding Device framework, and it needs to register as a standard Device first, and then complete the docking of fos by the framework. For the I2C bus and SPI bus devices, like UART, first register as a standard Device, but the bus class Device does not register the fops interface, so the user-mode APP cannot access the bus Device. For functional peripherals such as EEPROM, LCD, ESAM and the like, manufacturers need to realize interfaces needed to be realized in fops and complete equipment registration.

Fig. 5 is a schematic structural diagram of an application layer in the smart meter based on the embedded operating system according to an embodiment of the present invention, as shown in fig. 5. In one embodiment provided by the invention, the application programs comprise a system application program, a business application program and an extension application program, and data interaction exists between the application programs; and the business application program and the extended application program carry out data interaction with the system layer through the system application program. The application layer in the intelligent electric energy meter comprises a system application program, namely the safety reinforcing APP. The safety reinforcement APP is a bridge for data interaction between a physical interface of the intelligent electric energy meter and the business APP; and after the safety reinforcement APP analyzes the protocol data, forwarding the data according to the logic address. Each APP is used as a single process in the intelligent electric energy meter operating system, and the processes are interacted in an inter-process Communication (IPC) mode; the IPC supports four modes of a channel, a shared memory, a message queue and a memory device.

In one embodiment provided by the present invention, the system application is further configured to: the system is responsible for message transmission among an internal App, an uplink interface and an expansion module of the system, and internal App management and monitoring, so that stable and reliable operation of the system is ensured.

In one embodiment provided by the present invention, the service application includes: the display application program is used for displaying information of the intelligent electric meter; the data center application program is used for acquiring, storing and transmitting and receiving the data of the intelligent electric meter; and the basic service application program is used for realizing the basic service function of the intelligent electric meter. As also shown in fig. 5, the service application completes the service function of the electric energy meter, and may be divided into a basic service APP, a data center APP and a display APP, where each APP realizes a corresponding function, interacts in an interprocess communication manner, and simultaneously may also be used for an extension APP to call.

In an embodiment provided by the present invention, the application program in the metering module is connected to the system application program through a program interface. Namely, the metering module in fig. 5 is connected with the security hardened APP in the system application through the program interface. Through this embodiment, the management and the call to smart electric meter bottom hardware are realized through this embedded operating system's application layer to the measurement function in the measurement module.

In an embodiment provided by the present invention, the smart meter further includes an external communication interface, which is used for communication networking and data transmission. The external communication interface may be a wireless interface such as NB-IOT, or a wired interface such as RJ 45.

In one embodiment of the present invention, the external communication interface supports DL/T698.45 protocol. The DL/T698.45 protocol is a communication exchange protocol defined in a national standard electric energy information acquisition and management system, the protocol penetrates through a system main station, an acquisition terminal and an intelligent electric energy meter, the uniformity and the normalization of the communication protocol of the electric energy information acquisition system can be realized, and the reliability of the operation of the system is improved.

The design of the intelligent electric energy meter embedded operating system applied to the decoupling separation of the application and the kernel of the intelligent electric energy meter, which is provided by the above embodiment, can effectively solve the defects that the software coupling degree of the existing intelligent electric energy meter is strong and the software upgrading is not facilitated. In addition, decoupling between bottom hardware and the operating system is realized through equipment registration between the bottom driver and the operating system, development and transplantation of manufacturers are facilitated, and the operating efficiency of hardware resources is improved.

Alternative embodiments of the present invention are described in detail with reference to the drawings, however, the embodiments of the present invention are not limited to the specific details of the embodiments, and various simple modifications may be made to the technical solution of the embodiments of the present invention within the technical idea of the embodiments of the present invention, and these simple modifications all fall within the protective scope of the embodiments of the present invention.

It should be noted that the various features described in the above embodiments may be combined in any suitable manner without departing from the scope of the invention. In order to avoid unnecessary repetition, the embodiments of the present invention will not be described separately for the various possible combinations.

Those skilled in the art will understand that all or part of the steps in the method according to the above embodiments may be implemented by a program, which is stored in a storage medium and includes several instructions to enable a single chip, a chip, or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

In addition, any combination between different embodiments of the present invention is also possible, and the embodiments of the present invention should be considered as disclosed in the embodiments of the present invention as long as the combination does not depart from the spirit of the embodiments of the present invention.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种列车运行能耗计量方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!