Low-power consumption method realized based on equipment management framework in embedded real-time operating system (RT-Thread)

文档序号:1419439 发布日期:2020-03-13 浏览:20次 中文

阅读说明:本技术 一种嵌入式实时操作系统(RT-Thread)中基于设备管理框架实现的低功耗方法 (Low-power consumption method realized based on equipment management framework in embedded real-time operating system (RT-Thread) ) 是由 李存皓 蒋行川 谢涛 于 2018-09-05 设计创作,主要内容包括:本发明是一种嵌入式实时操作系统(RT-Thread)中基于设备管理框架实现的低功耗方法属于计算机技术领域。实现了基于RT-Thread设备管理框架的一种低功耗管理策略,在BSP中向软件层提供了简单进入低功耗的接口,实现了简单快速的一步进入低功耗状态的方法,并且进入低功耗之后MCU进入休眠,达到最低功耗控制,MCU从休眠中唤醒后重新启用所有设备,让所有设备进入工作状态。在设备管理框架中设计两个遍历算法,一个遍历算法实现查找设备列表中已经打开的设备,并将这些设备关闭并标记,另一个遍历算法实现查找上一个遍历算法中标记的设备,并将这些设备打开和去标记,这样就可以实现所有设备的低功耗管理。(The invention discloses a low-power consumption method based on an equipment management framework in an embedded real-time operating system (RT-Thread), belonging to the technical field of computers. The method realizes a low-power-consumption management strategy based on an RT-Thread device management framework, provides an interface for a software layer to simply enter a low-power-consumption state in the BSP, realizes a simple and quick method for entering the low-power-consumption state in one step, enables the MCU to enter the sleep state after entering the low power consumption state to achieve the lowest power consumption control, and restarts all devices after the MCU wakes up from the sleep state to enable all the devices to enter the working state. Two traversal algorithms are designed in a device management framework, one traversal algorithm is used for searching for devices which are already opened in a device list, closing and marking the devices, the other traversal algorithm is used for searching for devices which are marked in the previous traversal algorithm, and opening and unmarking the devices, and therefore low-power-consumption management of all the devices can be achieved.)

1. A low power consumption method realized based on a device management framework in an embedded real-time operating system (RT-Thread), which is characterized in that: the RT-Thread-based device management framework is developed for the second time, an interface which is simple to enter low power consumption is provided for a software layer in the BSP, a method for closing all opened devices and a device closing method before recovery are added, and the MCU is matched with dormancy awakening to be packaged into a simple interface for the software layer to use.

2. The low power consumption method of claim 1, wherein: a device driver is made for each device.

3. The low power consumption method of claim 2, wherein: each device driver includes an open interface that includes device power-up and initialization, and a close interface that includes device power-down and re-initialization.

4. The low power consumption method of claim 1, wherein: the RT-Thread based equipment management framework is developed for the second time.

5. The low power consumption method of claim 5, wherein: the RT-Thread-based equipment management framework is developed for the second time, and two traversal algorithms are manufactured.

6. The low power consumption method of claim 6, wherein: the device management manager based on RT-Thread carries out secondary development, and two traversal algorithms are made, wherein the first algorithm is to traverse all the devices which are opened at present, and then close and mark the devices.

7. The low power consumption method of claim 6, wherein: the RT-Thread-based device management housekeeper carries out secondary development and makes two traversal algorithms, wherein the second algorithm is to traverse all current devices and reopen and unmark the marked devices.

8. The low power consumption method of claim 1, wherein: a simple low power control interface is encapsulated.

9. A method of low power consumption according to claims 5, 6, 7, 8, 9, characterized by: and a simple low-power consumption control interface is packaged, a first traversal algorithm is called, then the MCU is controlled to enter the sleep state, and a second traversal algorithm is called during awakening.

10. The low power consumption method of claim 1, wherein: an equipment management framework of RT-Thread is adopted.

2. Field of the invention

The invention belongs to the technical field of computers, and particularly relates to a low-power consumption method based on an equipment management framework in an embedded real-time operating system (RT-Thread)

3. Background of the invention

3.1 background of the invention

With the rapid development of computer technology and the continuous progress of chip manufacturing process, the application of embedded systems is increasingly widespread: from circuit devices such as civil televisions and mobile phones to weapon systems such as military airplanes and tanks, the body shadow of the embedded system is everywhere. In the application development of an embedded system, the RTOS is adopted to support multiple tasks, so that the program development is easier, the maintenance is convenient, and the stability and the reliability of the system can be improved. This has gradually become a development direction for embedded system development.

In the fields of industrial control, military equipment, aerospace, etc., there are severe requirements on the response time of the system, which requires the use of real-time systems. The embedded operating systems we often say are all embedded real-time operating systems. Such as μ C/OS-II, ePOS and Linux, HOPEN OS. The understanding of the embedded real-time operating system should be built on the understanding of the embedded system with the added requirement for response time.

The RTOS is generally divided into a hardware layer, a software layer and an intermediate layer, the intermediate layer is arranged between the hardware layer and the software layer and is also called HAL or BSP, and the intermediate layer separates upper-layer software (application program) of a system from bottom-layer hardware, so that a bottom-layer driver of the system is independent of the upper layer, and upper-layer software developers can develop the system according to an interface provided by the BSP without concerning the specific condition of the bottom-layer hardware. This layer generally contains the initialization of the relevant underlying hardware, input/output operations of data and configuration functions of the hardware devices, i.e. device management is in the middle layer.

LPDs are a problem that many designers must face in the design of embedded systems because embedded systems are widely used in portable and mobile products that are not always sufficiently powered, often by batteries, so that the designers consider every detail to reduce power consumption and thus prolong battery life as much as possible. In fact, considering low power consumption design globally has become an increasingly urgent issue.

3.2 prior art

3.2.1 prior art protocol

The RT-Thread is an open source Internet of things operating system from China, and in the RT-Thread real-time operating system, the RT-Thread provides a set of simple I/O equipment management framework which divides I/O equipment into three layers for processing. As shown in fig. 1.

Before a device can be accessed by an upper layer application, the device needs to be registered in the system and corresponding attributes are added. The registered devices can be searched from the system by the device name in a mode of 'searching device interfaces', so that the device control block (or device handle) is obtained. The function interfaces of the registered device are as follows:

rt_err_t rt_device_register(rt_device_t dev,const char*name,rt_uint8_t flags);

the device is removed from the device system and the unloaded device can no longer be located via the "find device interface". The functional interface of the off-load device is as follows:

rt_err_t rt_device_unregister(rt_device_t dev)

searching for the device according to the specified device name can be completed through the following interfaces:

rt_device_t rt_device_find(const char*name)

initializing the specified equipment can be completed through the following function interfaces:

rt_err_t rt_device_init(rt_device_t dev)

the device is turned on according to the device control block, which can be accomplished through the following function interfaces:

rt_err_t rt_device_open(rt_device_t dev,rt_uint16_t oflags)

the device is shut down according to the device control block, which can be accomplished through the following function interfaces:

rt_err_t rt_device_close(rt_device_t dev)

reading, or obtaining data from, the device may be accomplished through the following functional interface:

rt_size_t rt_device_read(rt_device_t dev,rt_off_t pos,void*buffer,rt_size size)

writing data into the device can be completed through the following function interfaces:

rt_size_t rt_device_write(rt_device_t dev,rt_off_t pos,const void*buffer,rt_size size)

controlling the device according to the device control block can be done by the following function interfaces:

rt_err_t rt_device_control(rt_device_t dev,rt_uint8_t cmd,void*arg)

4. Summary of the invention

The invention realizes a low-power-consumption management strategy based on an RT-Thread device management framework, provides an interface for a software layer to simply enter a low-power-consumption state in a BSP (base station protocol), realizes a method for simply and quickly entering the low-power-consumption state in one step, and after the low power consumption is entered, an MCU (micro control unit) enters a sleep state to achieve the lowest power consumption control, and after the MCU is awakened from the sleep state, all devices are restarted to enable all devices to enter a working state. Firstly, a device management framework provides a driving interface of each device, wherein the driving interface comprises an opening interface, a closing interface, a reading interface, a writing interface and a control interface, the opening interface is used for realizing the power-on and initialization work of the device, the closing interface is used for realizing the lower point and the repeated initialization work of the device, so the power consumption of the device can be controlled by the opening interface and the closing interface, then two traversal algorithms are designed in the device management framework, one traversal algorithm is used for searching the opened devices in a device list and closing and marking the devices, the other traversal algorithm is used for searching the devices marked in the previous traversal algorithm, opening and marking the devices, an interface is packaged at the same time, the interface is used for executing a first traversal algorithm, then an MCU is used for sleeping, and a second traversal algorithm is executed during waking up, so the power consumption management of all the devices can be realized.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于VR的轮胎吊实训系统及方法

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!