Summary of the invention
It is an object of the invention to provide one and realize the how battery powered method and system of embedded device, can be more
Solve well many battery managements display problem.
According to an aspect of the invention, it is provided one realizes the how battery powered method of embedded device, bag
Include:
Hardware layer module obtains multiple battery attributes information of multiple batteries, and by the plurality of battery attributes information
Send to driving layer module;
Drive layer module according to the plurality of battery attributes information received, generate the multiple of multiple battery respectively and set
Standby file, and send power supply event to battery powered managing and display module;
After battery powered managing and display module receive described power supply event, open device file to be read, and
Obtain battery attributes information therein, in order to update and show the battery status of respective battery.
Preferably, it is utilized respectively multiple electric power detection chips of described hardware layer module, obtains the bag of multiple battery
Containing battery level information and/or battery voltage information and/or multiple battery attributes information of battery temperature information.
Preferably, it is utilized respectively multiple charging management chips of described hardware layer module, multiple batteries are filled
Electricity, and obtain the multiple battery attributes information comprising charging complete information of multiple battery.
Preferably, the software frame straton module of described battery powered managing and display module passes through hardware abstraction layer
After submodule receives power supply event, utilize hardware abstraction layer submodule to call the driving interface driving layer module, obtain
Take the battery attributes information in relevant device file.
Preferably, described software frame straton module is utilized, it is judged that whether current battery charge is less than predetermined electricity
And/or current battery level whether higher than predetermined voltage and/or current battery temperature whether higher than predetermined temperature and/
Or present battery whether charging complete, in order to according to judged result, show corresponding battery status.
Preferably, judge that current battery charge less than predetermined electricity and/or is worked as when described software frame straton module
Front cell voltage has charged higher than predetermined temperature and/or present battery higher than predetermined voltage and/or current battery temperature
Cheng Shi, utilizes the application layer submodule of described battery powered managing and display module, display to comprise battery electric quantity mistake
Low and/or battery overvoltage and/or battery excess temperature and/or the battery status of battery charging complete.
According to a further aspect in the invention, it is provided that one realizes the how battery powered system of embedded device, bag
Include:
Hardware layer module, for obtaining multiple battery attributes information of multiple battery, and belongs to the plurality of battery
Property information send to drive layer module;
Drive layer module, for according to the plurality of battery attributes information received, generating multiple battery respectively
Multiple device files, and send power supply event to battery powered managing and display module;
Battery powered managing and display module, after being used for receiving described power supply event, open equipment literary composition to be read
Part, and obtain battery attributes information therein, in order to update and show the battery status of respective battery.
Preferably, described hardware layer module includes:
Multiple electric power detection chips, comprise battery level information and/or battery for obtain multiple battery respectively
Information of voltage and/or multiple battery attributes information of battery temperature information.
Preferably, described hardware layer module also includes:
Multiple charging management chips, for being charged multiple batteries respectively, and obtain comprising of multiple battery
Multiple battery attributes information of charging complete information.
Preferably, described battery powered managing and display module include:
Hardware abstraction layer submodule, for by calling the driving interface driving layer module, obtains relevant device literary composition
Battery attributes information in part;
Software frame straton module, for receiving power supply event by hardware abstraction layer submodule, and obtains corresponding
Battery attributes information in device file, according to described battery attributes information, it is judged that current battery charge is the lowest
Whether whether it is higher than pre-higher than predetermined voltage and/or current battery temperature in predetermined electricity and/or current battery level
The whether charging complete of fixed temperature and/or present battery;
When described software frame straton module, application layer submodule, for judging that current battery charge is less than predetermined electricity
Amount and/or current battery level higher than predetermined voltage and/or current battery temperature higher than predetermined temperature and/or current
During battery charging complete, display includes that battery electric quantity is too low and/or battery overvoltage and/or battery excess temperature and/or battery
The battery status of charging complete.
Compared with prior art, the beneficial effects of the present invention is:
The present invention is applicable to the battery powered embedded device of polylith, it is possible to meet embedded device management and display
The demand of multiple battery attributes information of polylith battery.
Detailed description of the invention
Below in conjunction with accompanying drawing to a preferred embodiment of the present invention will be described in detail, it will be appreciated that described below
Preferred embodiment be merely to illustrate and explain the present invention, be not intended to limit the present invention.
Fig. 1 be the present invention provide realize the how battery powered method flow diagram of embedded device, as it is shown in figure 1,
Step includes:
Step 101, hardware layer module obtain multiple battery attributes information of multiple batteries, and by the plurality of electricity
Pond attribute information sends to driving layer module.
In described step 101, described hardware layer module is utilized respectively its multiple electric power detection chips, obtains multiple
The multiple batteries comprising battery level information and/or battery voltage information and/or battery temperature information of battery belong to
Property information, and it is utilized respectively its multiple charging management chips, multiple batteries are charged, obtain multiple battery
The multiple battery attributes information comprising charging complete information.
Step 102, driving layer module, according to the plurality of battery attributes information received, generate multiple electricity respectively
Multiple device files in pond, and send power supply event to battery powered managing and display module.
After step 103, battery powered managing and display module receive described power supply event, open to be read setting
Standby file, and obtain battery attributes information therein, for the battery status updating and showing respective battery.
In described step 103, the software frame straton module of described battery powered managing and display module is by hard
After part level of abstraction submodule receives power supply event, hardware abstraction layer submodule is utilized to call the driving driving layer module
Interface, obtains the battery attributes information in relevant device file, and when described software frame straton module judges to work as
Front battery electric quantity is high higher than predetermined voltage and/or current battery temperature less than predetermined electricity and/or current battery level
When predetermined temperature and/or present battery charging complete, utilize described battery powered managing and display module should
Using straton module, display comprises that battery electric quantity is too low and/or battery overvoltage and/or battery excess temperature and/or battery charging
The battery status completed.In short, software architecture straton module is according to described battery attributes information, it is judged that current
Battery whether battery electric quantity is too low and/or battery overvoltage and/or battery excess temperature and/or battery charging complete, according to sentencing
Disconnected result, shows corresponding battery status.
Fig. 2 be the present invention provide realize the how battery powered system architecture diagram of embedded device, such as Fig. 2
Shown in, including hardware layer module, drive layer module, wherein:
Described hardware layer module is used for obtaining multiple battery attributes information of multiple battery, and by the plurality of battery
Attribute information sends to driving layer module.Comprising: believe for obtaining the battery electric quantity that comprises of multiple battery respectively
Multiple electric power detection of multiple battery attributes information of breath and/or battery voltage information and/or battery temperature information
Chip, and for respectively multiple batteries being charged, and obtain multiple battery comprise charging complete information
Multiple charging management chips of multiple battery attributes information.
Described driving layer module is for according to the plurality of battery attributes information received, generating multiple battery respectively
Multiple device files, and send power supply event to battery powered managing and display module.
After described battery powered managing and display module are used for receiving described power supply event, open equipment to be read
File, and obtain battery attributes information therein, for the battery status updating and showing respective battery.Its bag
Include:
Hardware abstraction layer submodule, for by calling the driving interface driving layer module, obtains relevant device literary composition
Battery attributes information in part;
Software frame straton module, for receiving power supply event by hardware abstraction layer submodule, and obtains corresponding
Battery attributes information in device file, according to described battery attributes information, it is judged that current battery charge is the lowest
Whether whether it is higher than pre-higher than predetermined voltage and/or current battery temperature in predetermined electricity and/or current battery level
The whether charging complete of fixed temperature and/or present battery;
When described software frame straton module, application layer submodule, for judging that current battery charge is less than predetermined electricity
Amount and/or current battery level higher than predetermined voltage and/or current battery temperature higher than predetermined temperature and/or current
During battery charging complete, display includes that battery electric quantity is too low and/or battery overvoltage and/or battery excess temperature and/or battery
The battery status of charging complete.
Fig. 3 is many batteries power supply stand composition that the embodiment of the present invention provides, and the present embodiment is by how electric for embedded device
Pond electric power system is divided into five-layer structure according to the difference of function, as it is shown on figure 3, every layer architecture complete independently is special
Fixed function, realizes communication by the interface of definition between level, it is ensured that the closure of every layer architecture function and independence
Property.This five layer architecture is followed successively by from bottom to top:
1) hardware layer
According to the embedded product demand to battery-powered time, polylith battery uses line or circuit to carry out equipment
Power supply, coordinates charging management chip and the electric power detection chip operating system to equipment and upper layer software (applications) to provide battery
Attribute information.
2) layer is driven
Realizing interface according to operating system driving and realize the driving of each battery respectively, battery drives and mainly completes charging valve
The detection of battery charging process of reason chip, the battery electric quantity of electric power detection chip, cell voltage, battery current,
Battery temperature and remaining time etc. battery attributes information acquisition.
3) hardware abstraction layer
By calling the driving interface driving layer system kernel, obtain and to upper layer transfers battery attributes information.
4) software frame layer
This layer receives the battery attributes information of hardware abstraction layer transmission, needs the electricity of display to the transmission of upper strata application layer
Pond attribute information, and according to current many battery status to upper layer transfers battery overvoltage, excess temperature, low electricity or pass
The battery message such as machine.
5) application layer
This layer is mainly used in showing the state of each battery, and receives different battery message rear line prompting and work as
Front electric power system state.
Wherein, described hardware layer constitute hardware layer module, described driving layer constitute drive layer module, described firmly
Part level of abstraction, described software architecture layer, described application layer constitute battery powered managing and display module.
The hierarchical structure of the present embodiment make the realization of many battery power supply systems of complexity be reduced to five the most only
Vertical level, the most beneficially extension of electric power system, it is also beneficial to the product transplanting at different operating system.
Fig. 4 is the Double-battery powered Organization Chart based on Android that the embodiment of the present invention provides, with RFID hands
As a example by holding machine, described hand-held set selects the processor of 1GHz dominant frequency, the DDR3 internal memory of 512MB, has superelevation
Frequently, the big power consumption module such as high frequency and WiFi, the highest power consumption of hand-held set complete machine close to 2A, normal operating power consumption
Close to 1A.In order to be effectively increased the mobile power-on time of equipment, power according to the battery more than five layers of above-mentioned analysis
Level framework, in the android system that hand-held set uses, as shown in Figure 4, realizes each layer function respectively,
Realize Android double-battery electric power system.
1) hardware layer
Hand-held set uses two pieces of batteries to increase the power-on time of equipment, when the voltage of two pieces of batteries is more than the threshold preset
Automatically turn on during threshold voltage, to system power supply, during less than threshold voltage, be automatically switched off power supply.
In addition two pieces of batteries electric power detection chip and charging management chip by TI respectively is to android system
Battery attributes information is provided.
2) layer is driven
Use Power Supply drive pattern to realize two pieces of batteries in android system to drive, according to electricity
The different attribute of pond and charging adapter generates respective device file, inquires about battery attributes information for upper strata and makes
With.
Using the mode of intervalometer in battery drives, timing sends to upper strata with the form of uevent event and disappears
Breath, notifies system update battery information.
3) hardware abstraction layer
Android system predefines JNI layer, drives, for opening, the device file generated in layer, it is thus achieved that electricity
The information such as pond electricity, cell voltage and adapter are the most in place, owing to the JNI layer of Android only achieves
The battery attributes acquisition of information of monoblock battery, it is therefore desirable to realize obtaining of other one piece of battery attributes information at this layer
Take.
4) software frame layer
Software frame layer, for being responsible for receiving the uevent event of driving layer transmission, calls hardware abstraction layer interface
Update battery attributes information, if battery status changes, then send battery message, notice application to upper strata
Layer carries out user's prompting in the way of interface display.
Software frame layer, in addition to transmission message, is also responsible for managing electric power system, by battery overvoltage excess temperature or
The detection that person's electricity is low performs different system operations.
Owing to android system acquiescence is powered with one piece of battery, so to the transmission to upper strata of the battery message and confession
The management of electricity system is required for realizing accordingly.
5) application layer
The battery message display battery information that application layer sends according to software frame layer, and the change to electric power system
Carry out the functions such as interface user's prompting.For hand-held set double-battery electric power system, android system needs
Realize the program of battery 2 attribute display.
In sum, the present invention has following technical effect that
The present invention realizes can not only effectively realizing in framework many batteries function of supplying power at five layers, and this layering
The features such as framework portability and extensibility are also beneficial to the exploitation of embedded device electric power system.
Although above the present invention being described in detail, but the invention is not restricted to this, the art technology
Personnel can carry out various amendment according to the principle of the present invention.Therefore, all amendments made according to the principle of the invention,
All should be understood to fall into protection scope of the present invention.