CN103049069B - End cell process for temperature indication and device and terminal - Google Patents
End cell process for temperature indication and device and terminal Download PDFInfo
- Publication number
- CN103049069B CN103049069B CN201210487289.5A CN201210487289A CN103049069B CN 103049069 B CN103049069 B CN 103049069B CN 201210487289 A CN201210487289 A CN 201210487289A CN 103049069 B CN103049069 B CN 103049069B
- Authority
- CN
- China
- Prior art keywords
- file
- battery temperature
- temperature data
- terminal
- battery
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 75
- 230000008569 process Effects 0.000 title abstract description 12
- 238000000605 extraction Methods 0.000 claims abstract description 13
- 230000006870 function Effects 0.000 claims description 43
- 238000012544 monitoring process Methods 0.000 claims description 23
- 230000008859 change Effects 0.000 claims description 8
- 238000006243 chemical reaction Methods 0.000 claims description 4
- 238000010586 diagram Methods 0.000 description 6
- 238000012806 monitoring device Methods 0.000 description 6
- 230000009286 beneficial effect Effects 0.000 description 4
- 230000008901 benefit Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000004590 computer program Methods 0.000 description 2
- 238000004880 explosion Methods 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000017525 heat dissipation Effects 0.000 description 1
- 238000003780 insertion Methods 0.000 description 1
- 230000037431 insertion Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000013021 overheating Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 239000000725 suspension Substances 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Secondary Cells (AREA)
- Telephone Function (AREA)
- Charge And Discharge Circuits For Batteries Or The Like (AREA)
Abstract
The embodiment of the invention discloses a kind of end cell process for temperature indication and device, and a kind of terminal.Wherein, end cell temperature indicating device comprises: path analysis module, is suitable for the file path of the battery temperature data place file that temperature sensor senses in analysing terminal battery arrives; Wherein, battery temperature data be system in advance call driver notice operating system be written to data in file; Temperature read module, is suitable for the file content that file reading path is corresponding; First extraction module, is suitable for extracting battery temperature data from file content; Display module, is suitable for showing battery temperature data in the user interface of terminal.The embodiment of the present invention can read battery temperature data timely and accurately, reduce the impact on terminal capabilities, and after the battery temperature data getting terminal, this battery temperature data can be presented in the user interface of terminal, thus described battery temperature data can be shown more intuitively.
Description
Technical Field
The embodiment of the invention relates to the technical field of terminals, in particular to a terminal battery temperature display method and device and a terminal.
Background
With the rise of mobile internet, more and more users select intelligent mobile terminals. The current intelligent mobile terminal is developed rapidly, the performance is stronger and stronger, the screen size is larger and larger, and the equipment size is thinner and thinner, and a battery with larger capacity is generally equipped for supporting the stronger performance and the larger screen.
Since the battery generates heat during use, the thin size of the terminal body is disadvantageous for heat dissipation, resulting in an increase in the temperature of the battery. Especially, when a user plays a mobile phone game, the situation is more prominent, the performance of the terminal is affected by the temperature rise, and even in an extreme case, overheating can occur to cause explosion.
In view of the above circumstances, there has not been proposed a method for effectively solving the above problems.
Disclosure of Invention
In view of the above problems, the present invention has been made to provide a terminal battery temperature display method and apparatus and a terminal that overcome or at least partially solve the above problems.
According to an aspect of the present invention, there is provided a terminal battery temperature display method, including:
analyzing a file path of a file where battery temperature data sensed by a temperature sensor in a terminal battery is located; the battery temperature data is data which is written into a file by a system calling a driver in advance to inform an operating system;
reading the file content corresponding to the file path;
extracting the battery temperature data from the file content;
and displaying the battery temperature data on a user interface of the terminal.
In the embodiment of the invention, the file path of the file in which the battery temperature sensed by the temperature sensor data is located comprises a plurality of file paths,
the reading of the file content corresponding to the file path includes:
reading corresponding file contents from the plurality of file paths in sequence, wherein the reading in sequence is traversing reading according to a preset sequence;
and when the file contents are read from any one file path in sequence, stopping reading the file contents corresponding to the next file path.
In the embodiment of the present invention, when reading the file content from any one file path in sequence, stopping reading the file content corresponding to the next file path includes:
when the file content corresponding to any one file path is read successfully, judging whether the file content corresponding to any one file path is empty content;
and when the file content is not empty, stopping reading the file content corresponding to the next file path.
In the embodiment of the present invention, reading the file content corresponding to the file path further includes:
and when the file contents corresponding to any one file path are read in sequence, and the file contents corresponding to the next file path are read continuously when the file contents corresponding to any one file path fail to be read or the file contents corresponding to any one file path are empty contents.
In the embodiment of the present invention, sequentially reading corresponding file contents from the plurality of file paths includes:
calling information to read a ReadInfo function, and sequentially transmitting the multiple file paths serving as parameters to the ReadInfo function;
and receiving a return value of the ReadInfo function, wherein the return value is the file content corresponding to the file path.
In the embodiment of the invention, in the android operating system, the multiple file paths include a file path/sys/class/hwmon/hwmon 0/device/temp1_ input, a file path/sys/class/power _ supply/byte/temp, and a file path/sys/class/power _ supply/byte/temp.
In the embodiment of the present invention, the terminal battery temperature monitoring method further includes:
monitoring a broadcast event sent by a terminal operating system when the state of the battery is detected to be changed;
additional data of the broadcast event is read and battery temperature data is extracted from the additional data.
In the embodiment of the present invention, the changing of the state of the battery includes:
the charging is started, the charging is finished, or the electric quantity variation of the battery reaches a preset threshold value.
In the embodiment of the present invention, the terminal battery temperature monitoring method further includes:
comparing the extracted battery temperature data with a preset temperature range;
when the battery temperature data is within the temperature range, determining the battery temperature data within the temperature range as the battery temperature data of the terminal;
and when the battery temperature data exceeds the temperature range, converting the battery temperature data into temperature data within the temperature range, and taking the converted battery temperature data as the battery temperature data of the terminal.
In the embodiment of the invention, the user interface is any one of the following:
desktop plug-ins, desktop floating windows, and browser plug-ins.
According to another aspect of the present invention, there is provided a terminal battery temperature display device including:
the path analysis module is suitable for analyzing a file path of a file where battery temperature data sensed by a temperature sensor in the terminal battery is located; the battery temperature data is data which is written into a file by a system calling a driver in advance to inform an operating system;
the temperature reading module is suitable for reading the file content corresponding to the file path;
a first extraction module adapted to extract the battery temperature data from the file content;
and the display module is suitable for displaying the battery temperature data on a user interface of the terminal.
In the embodiment of the invention, the file path of the file in which the battery temperature data sensed by the temperature sensor is located comprises a plurality of file paths,
the temperature reading module sequentially reads corresponding file contents from the plurality of file paths, and stops reading the file contents corresponding to the next file path when the file contents are read from any one file path during sequential reading, wherein the sequential reading is traversing reading according to a preset sequence.
In an embodiment of the present invention, the temperature reading module includes:
the judging submodule is suitable for judging whether the file content corresponding to any file path is empty content or not when the file content corresponding to any file path is read successfully;
and the reading stopping sub-module is suitable for stopping reading the file content corresponding to the next file path when the judging sub-unit judges that the file content is not the empty content.
In the embodiment of the present invention, the temperature reading module further includes:
and the continuous reading sub-module is suitable for continuously reading the file content corresponding to the next file path when the file content corresponding to any one file path fails to be read or the file content corresponding to any one file path is empty content during sequential reading.
In an embodiment of the present invention, the temperature reading module includes:
the calling submodule is suitable for calling information to read the ReadInfo function, and the plurality of file paths are sequentially used as parameters to be transmitted to the ReadInfo function;
and the receiving submodule is suitable for receiving a return value of the ReadInfo function, and the return value is the file content corresponding to the file path.
In the embodiment of the invention, in the android operating system, the multiple file paths include a file path/sys/class/hwmon/hwmon 0/device/temp1_ input, a file path/sys/class/power _ supply/byte/temp, and a file path/sys/class/power _ supply/byte/temp.
In the embodiment of the present invention, the terminal battery temperature monitoring apparatus further includes:
and the second extraction module is suitable for monitoring a broadcast event sent by a terminal operating system when the state of the battery is detected to be changed, reading additional data of the broadcast event and extracting battery temperature data from the additional data.
In the embodiment of the present invention, the changing of the state of the battery includes:
the charging is started, the charging is finished, or the electric quantity variation of the battery reaches a preset threshold value.
In the embodiment of the present invention, the terminal battery temperature monitoring apparatus further includes:
the comparison module is suitable for comparing the extracted battery temperature data with a preset temperature range;
the determining module is used for determining that the battery temperature data within the temperature range is the battery temperature data of the terminal when the comparison result of the comparing module is that the battery temperature data is within the temperature range;
and the conversion module is suitable for converting the battery temperature data into the temperature within the temperature range when the comparison result of the comparison module indicates that the battery temperature data exceeds the temperature range, and taking the converted battery temperature data as the battery temperature data of the terminal.
In the embodiment of the invention, the user interface is any one of the following:
desktop plug-ins, desktop floating windows, and browser plug-ins.
According to another aspect of the present invention, there is provided a terminal including: CPU, battery, temperature sensor, memory, and terminal battery temperature display device as described.
According to the terminal battery temperature display method and device provided by the embodiment of the invention, the file path of the file where the battery temperature data sensed by the temperature sensor in the terminal battery is located can be analyzed, and the file content corresponding to the file path is read, wherein the file paths are obtained by analyzing the bottom layer source code of the system and correspond to the file where the temperature sensor data is located, so that the battery temperature data of the terminal can be directly extracted from the file content. Therefore, the problem that the performance of the terminal is affected due to the fact that the current battery temperature data cannot be obtained and the battery temperature is too high is solved, and the beneficial effects that the battery temperature data can be timely and accurately read and the effect on the performance of the terminal is reduced are achieved.
Secondly, after the battery temperature data of the terminal is acquired, the battery temperature data can be displayed on a user interface of the terminal, so that the battery temperature data can be displayed to a user more intuitively.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 shows a flow chart of a terminal battery temperature monitoring method according to an embodiment of the invention;
FIG. 2 is a flow chart illustrating a method for monitoring terminal battery temperature according to an embodiment of the present invention;
FIG. 3 is a block diagram of a terminal battery temperature monitoring device according to an embodiment of the present invention;
FIG. 4 is a flow chart illustrating a terminal battery temperature display method according to an embodiment of the present invention;
FIG. 5 illustrates an interface diagram of a battery temperature display according to an embodiment of the present invention; and
fig. 6 is a block diagram illustrating a structure of a terminal battery temperature display device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Embodiments of the invention are operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known computing systems, environments, and/or configurations that may be suitable for use with the computer system/server include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set top boxes, programmable consumer electronics, network pcs, minicomputer systems, mainframe computer systems, distributed cloud computing environments that include any of the above systems, and the like.
The computer system/server may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer system/server may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.
Referring to fig. 1, a flowchart of a terminal battery temperature monitoring method provided in an embodiment of the present invention is shown, where the method specifically includes:
and step 100, analyzing a file path of a file where battery temperature data sensed by a temperature sensor in a terminal battery is located.
And the battery temperature data is data which is written into a file by a system calling a driver in advance to inform an operating system.
With the development of the internet, more and more users select the intelligent mobile terminal, the current intelligent mobile terminal develops rapidly, and a battery with larger capacity is generally equipped for the terminal in order to support stronger performance and a larger screen. The battery generates heat during use, and if the temperature of the battery is too high, the performance of the terminal is affected.
Therefore, the embodiment of the invention provides a terminal battery temperature monitoring method, which can directly obtain battery temperature data by reading data of a temperature sensor inside a terminal. Some temperature sensors are installed in the terminal, the temperature sensors can monitor the temperature data of the internal equipment of the terminal in real time, specific temperature data can be obtained from the temperature sensors through equipment drivers realized by manufacturers, then a driver program is called by the system in advance to inform the operating system, and the temperature data are written into corresponding files by the operating system.
In the embodiment of the invention, the bottom layer source code of the terminal system can be analyzed to find out the file in which the temperature sensor data in the terminal battery is stored and what the file path is, and after the file path is found out, the file content under the file path can be processed subsequently.
And 102, reading the file content corresponding to the file path.
In step 100, a file path of a file where battery temperature data sensed by a temperature sensor in a terminal battery is located is analyzed, and since the file in the file path is determined by analyzing the terminal and stores the battery temperature data, after the file path is obtained, file content corresponding to the file path can be read.
The file content includes battery temperature data and may also include some other information, which is not limited in this embodiment of the present invention.
Step 104, extracting the battery temperature data from the file content.
And reading the file content corresponding to the file path, namely directly extracting the battery temperature data from the file content.
If the current battery temperature is too high, some action may be taken to lower the battery temperature (e.g., if a game is currently being played, the current game may be stopped).
The specific procedures of the above steps will be described in detail in the following examples.
The terminal battery temperature monitoring method provided by the embodiment of the invention can analyze the file path of the file where the battery temperature data sensed by the temperature sensor in the terminal battery is located, and read the file content corresponding to the file path, wherein the file paths are the file paths of the file where the corresponding temperature sensor data is located, which are obtained by analyzing the system bottom source code, so that the battery temperature data of the terminal can be directly extracted from the file content. Therefore, the problem that the performance of the terminal is affected due to the fact that the current battery temperature data cannot be obtained and the battery temperature is too high is solved, the battery temperature data can be timely and accurately read, and the effect on the performance of the terminal is reduced.
The following describes a method for monitoring the temperature of a terminal battery according to an embodiment of the present invention in detail.
Referring to fig. 2, a flow chart of a terminal battery temperature monitoring method according to an embodiment of the present invention is shown, which may include:
step 200, analyzing a file path of a file where battery temperature data sensed by a temperature sensor in a terminal battery is located.
According to the description related to the first embodiment, in the embodiment of the present invention, the path of the file storing the temperature sensor data in the terminal battery may be determined by analyzing the bottom layer source code of the terminal system, and after the file path is found, the file content under the file path may be processed subsequently.
For a specific analysis process, a person skilled in the art may perform corresponding processing according to actual situations, and the embodiment of the present invention is not discussed in detail herein.
And the battery temperature data is data which is written into a file by a system calling a driver in advance to inform an operating system.
Considering that manufacturers of each terminal may be different, and the operating systems of different terminals of the manufacturers write the temperature data into different files at different positions, paths of the files for storing the battery temperature data may also be different, so that the terminals produced by different manufacturers may be analyzed respectively to obtain which paths of the files for storing the battery temperature data are for different terminals.
Therefore, in the embodiment of the present invention, the file path of the file in which the battery temperature data sensed by the temperature sensor is located may include a plurality of file paths.
Step 202, reading the file content corresponding to the file path.
After the paths of the files for storing the battery temperature data in the terminal are determined, the file contents corresponding to the file paths can be read by the system because the battery temperature data of the terminal are stored in the file contents under the file paths.
In the embodiment of the invention, a timer can be set, and the timer can be used for informing the system of directly reading the file content under the file path at regular time. The time interval for reading is not limited by the embodiments of the present invention.
As can be known from the related description of step 200, the file path of the file where the temperature sensor data is located in the embodiment of the present invention may include multiple file paths, and therefore, step 202 may specifically include:
substep 2021, reading the corresponding file contents from the plurality of file paths in sequence.
In the embodiment of the invention, the files storing the battery temperature data may be different for the terminals of different manufacturers, so that a plurality of different file paths can be obtained through analysis, and for a certain terminal, the battery temperature data can be stored in the file corresponding to one of the file paths. Therefore, when reading the corresponding file content from the plurality of file paths, the embodiments of the present invention may sequentially read the plurality of file paths in a traversal manner according to a preset sequence until the corresponding file content is read from one of the file paths.
For example, the possibility that the battery temperature data is included in the file content under each file path for the current terminal may be analyzed first, then the plurality of file paths are sorted according to the size of the possibility, and finally the sorted file paths are read sequentially.
Of course, other characteristics of the file path may also be used for sorting, and the embodiment of the present invention is not limited thereto.
In the embodiment of the invention, the corresponding file contents can be read from the plurality of file paths through an information reading function (ReadInfo function).
This sub-step 2021 may comprise:
a1, calling the ReadInfo function, and sequentially transmitting the plurality of file paths as parameters to the ReadInfo function.
a2, receiving a return value of the ReadInfo function, wherein the return value is the file content corresponding to the file path.
The readlnfo function is an information reading function of the operating system, and for a specific process of reading file contents through the system function, a person skilled in the art performs corresponding processing according to actual conditions, and the embodiment of the present invention is not discussed in detail here.
In the sub-step 2022, when the file content is read from any file path, the reading of the file content corresponding to the next file path is stopped.
Paths of files storing the battery temperature data of different terminals can be different, and the possible file paths are used as file paths of files where the battery temperature data sensed by the temperature sensors are located after analysis. When a terminal is processed, if the file content is read from one of the file paths, the file in the file path is the file for storing the battery temperature data in the terminal, and at this time, the file content may not be read from other paths.
In an embodiment of the present invention, the sub-step 2022 may include:
b1, when the file content corresponding to any file path is successfully read, judging whether the file content corresponding to any file path is empty content.
b2, when the file content is not empty, stopping reading the file content corresponding to the next file path.
In the substep 2023, when reading in sequence, when the file content corresponding to any file path fails to be read or the file content corresponding to any file path is empty, the file content corresponding to the next file path is continuously read.
In the following, by taking the android system as an example, through analysis, in the android operating system, a path of a file for storing battery temperature data may include the following:
(1)/sys/class/hwmon/hwmon0/device/temp1_input
(2)/sys/class/power_supply/battery/temp
(3)/sys/class/power_supply/battery/batt_temp
for different manufacturers, the operating system of the terminal writes the temperature data into different files at different positions, but through analysis, the temperature data is stored in a file corresponding to one of the three file paths. Therefore, in the embodiment of the present invention, the three file paths may be sequentially transferred to the readlnfo function at regular intervals, and then the return value of the readlnfo function is received (for example, the file path may be transferred to the readlnfo function at regular intervals by a luzhou teacher) until the corresponding file content is read from one of the file paths. The specific process can comprise the following steps:
step 1, transferring the file path/sys/class/hwmon/hwmon 0/device/temp1_ input as a parameter to the ReadInfo function.
If the ReadInfo function successfully acquires the file content under the file path, executing the step 2; if the file content acquisition fails, step 4 is performed.
And 2, judging whether the file content is empty or not.
If the file content is not empty, executing step 3; and if the file content is empty, executing the step 4.
And step 3, receiving a return value of the ReadInfo function, wherein the return value is the file content corresponding to the file path/sys/class/hwmon/hwmon 0/device/temp1_ input.
And 4, transferring the file path/sys/class/power _ supply/pattern/temp as a parameter to the ReadInfo function.
And if the ReadInfo function successfully acquires the file content under the file path, executing step 5, and if the file content acquisition fails, executing step 7.
And 5, judging whether the file content is empty or not.
If the file content is not empty, executing step 6; if the file content is empty, step 7 is performed.
And 6, receiving a return value of the ReadInfo function, wherein the return value is the file content corresponding to the file path/sys/class/power _ supply/basic/temp.
And 7, transmitting the file path/sys/class/power _ supply/basic/batt _ temp as a parameter to the ReadInfo function.
And if the ReadInfo function successfully acquires the file content under the file path and the file content is not empty, executing the step 8.
And 8, receiving a return value of the ReadInfo function, wherein the return value is the file content corresponding to the file path/sys/class/power _ supply/basic/batt _ temp.
Since the three file paths can be known as the paths of the files capable of storing the battery temperature data through the above description, in the embodiment of the present invention, the corresponding file content can be read in at least one of the file paths. Therefore, in the above process, if the corresponding file content is not read under the file path/sys/class/hwmon/hwmon 0/device/temp1_ input and the file path/sys/class/power _ supply/battery/temp, the corresponding file path may be read under the file path/sys/class/power _ supply/battery _ temp.
It should be noted that, in the embodiment of the present invention, the reading order of the three file paths is not limited. The three file paths are for an android operating system, but the embodiment of the present invention is not limited to the three file paths, for example, other file paths may be for other operating systems, and the embodiment of the present invention will not be discussed in detail here.
Step 204, extracting the battery temperature data from the file content.
After the corresponding file path is read in step 202, since the battery temperature data is stored in the file content under the file path, the battery temperature data may be extracted from the read file content in this step.
In the embodiment of the invention, the battery temperature data of the terminal can be acquired in real time through the steps 200 to 204, so that the acquisition of the battery temperature data is more timely.
On the other hand, through analysis, when the battery state of the terminal changes, the terminal operating system sends out a broadcast event, and the additional data of the broadcast event contains the battery temperature data information of the terminal. Therefore, the embodiment of the invention further provides a method for acquiring the battery temperature data through the broadcast event.
Specifically, the method for monitoring the battery temperature according to the embodiment of the present invention may further include:
and step 206, when the state of the battery is detected to be changed, monitoring a broadcast event sent by the terminal operating system.
In the embodiment of the present invention, the change of the state of the battery may include the following situations:
the charging may be initiated (e.g., detecting insertion of a charger), completed (e.g., detecting removal of a charger), or the amount of change in the charge of the battery may reach a predetermined threshold (e.g., the amount of change in the charge of the battery may reach 1% or some other value).
Of course, the change of the battery state according to the embodiment of the present invention is not limited to the above-mentioned several cases, and may also include other cases, which is not limited in this respect.
Step 208, additional data of the broadcast event is read and battery temperature data is extracted from the additional data.
The broadcast event sent by the operating system includes additional data, the additional data includes battery temperature data of the terminal, the battery temperature data may also be battery temperature data obtained by the method for reading corresponding file content in the preset file path, and for a specific process, the embodiment of the present invention is not discussed in detail herein.
After the terminal operating system sends out the broadcast event, the additional data of the broadcast event can be read, and the battery temperature data in the additional data can be extracted from the read additional data.
It should be noted that the above steps 206-208 are processes for reading the broadcast event of the operating system to obtain the battery temperature data. However, the terminal operating system only sends the broadcast event when detecting that the state of the battery changes, that is, if the method for reading the broadcast event is used, the corresponding battery temperature data can be obtained only when the state of the battery changes, and the corresponding battery temperature data cannot be obtained even if the battery temperature data changes at other times. Therefore, the method of obtaining battery temperature data by reading broadcast events has the problem that the battery temperature data is not updated timely.
Therefore, in order to solve the problem, the embodiment of the present invention provides a method for acquiring battery temperature data by reading, in real time, file content corresponding to a file path of a file in which the battery temperature data sensed by the temperature sensor is located in steps 200 to 204. The method comprises the steps of firstly determining paths of files possibly storing battery temperature data in a terminal, and then reading the file contents in the file paths in real time, so that the method is not limited by the battery state, and can acquire the corresponding battery temperature data even if the battery state is not changed. Therefore, compared with the method for acquiring the battery temperature data by reading the broadcast event, the method for reading the corresponding file content in the preset file path is not limited by external conditions (state change of the battery), so that the battery temperature data can be updated more timely.
Because some terminals have particularity, the unit of the battery temperature data acquired by the terminals may not be the same, and therefore, in order to unify the value range of the acquired temperature, the embodiment of the invention can set the battery temperature data to be in the unit of the temperature.
In the embodiment of the present invention, a temperature range may be preset, and when the acquired battery temperature data is within the preset temperature range, the temperature is determined to be the battery temperature data of the terminal.
Therefore, the method for monitoring the battery temperature data according to the embodiment of the present invention may further include the following steps:
step 210, comparing the extracted battery temperature data with a preset temperature range.
And 212, when the battery temperature data is in the temperature range, determining that the battery temperature data in the temperature range is the battery temperature data of the terminal.
In the embodiment of the invention, the temperature range can be set to be 15-60 ℃, and if the extracted battery temperature data is in the temperature range, the temperature can be used as the battery temperature data of the terminal.
And 214, when the battery temperature data exceeds the temperature range, converting the battery temperature data into the temperature within the temperature range, and using the converted battery temperature data as the battery temperature data of the terminal.
If the extracted battery temperature data exceeds the temperature range, the embodiment of the invention can further process the extracted temperature to make the extracted temperature within the normal temperature range.
For example, if the extracted battery temperature data is 300 (which may not be in units), embodiments of the present invention may divide the value by a fixed value (e.g., by 10). If the value divided by the fixed value is not within the temperature range, the obtained value is continuously divided by the fixed value until the obtained value is within the temperature range, and finally the battery temperature data within the temperature range is determined as the battery temperature data of the terminal.
It should be noted that the above temperature ranges are only used for examples, and the specific values are not limited in the embodiments of the present invention.
The terminal battery temperature monitoring method provided by the embodiment of the invention can analyze the file path of the file where the battery temperature data sensed by the temperature sensor in the terminal battery is located, regularly read the file content from the file path, extract the battery temperature data from the file path, and acquire the battery temperature data through the broadcast event sent by the system, so that the battery temperature data of the terminal can be acquired more timely and accurately, the problem that the performance of the terminal is influenced by overhigh battery temperature due to the fact that the current battery temperature data cannot be acquired is solved, the beneficial effects that the battery temperature data can be read timely and accurately, and the influence on the performance of the terminal is reduced are achieved.
It should be noted that the foregoing method embodiments are described as a series of acts or combinations for simplicity in explanation, but it should be understood by those skilled in the art that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 3, a block diagram of a terminal battery temperature monitoring apparatus according to a third embodiment of the present invention is shown, where the apparatus may include: a path analysis module 300, a temperature reading module 302, a first extraction module 304, a second extraction module 306, a comparison module 308, a determination module 310, a conversion module 312.
Wherein,
the path analysis module 300 is adapted to analyze a file path of a file where battery temperature data sensed by a temperature sensor in a terminal battery is located;
and the battery temperature data is data which is written into a file by a system calling a driver in advance to inform an operating system.
The temperature reading module 302 is adapted to read file contents corresponding to the file path;
in the embodiment of the invention, the terminal battery temperature monitoring device can also comprise a timer, and the timer can inform a system of directly reading the file content under the file path at regular time.
Since manufacturers of terminals may be different, paths of files for storing battery temperature data may also be different, and thus, in the embodiment of the present invention, a file path of a file in which battery temperature data sensed by a temperature sensor in a terminal battery is located may include a plurality of file paths.
For example, in an android operating system, the plurality of file paths may include a file path/sys/class/hwmon/hwmon 0/device/temp1_ input, a file path/sys/class/power _ supply/byte/temp, and a file path/sys/class/power _ supply/byte/temp.
Specifically, the temperature reading module 302 sequentially reads corresponding file contents from the plurality of file paths, and when reading the file contents from any one file path in sequence, stops reading the file contents corresponding to the next file path.
Wherein, the sequential reading is traversal reading according to a preset sequence.
The temperature reading module 302 may include:
the calling submodule is suitable for calling a ReadInfo function, and the multiple file paths are sequentially used as parameters to be transmitted to the ReadInfo function;
the receiving submodule is suitable for receiving a return value of the ReadInfo function, and the return value is file content corresponding to the file path;
the judging submodule is suitable for judging whether the file content corresponding to any file path is empty content or not when the file content corresponding to any file path is read successfully;
the reading stopping submodule is suitable for stopping reading the file content corresponding to the next file path when the judging subunit judges that the file content is not the empty content;
and the continuous reading sub-module is suitable for continuously reading the file content corresponding to the next file path when the file content corresponding to any one file path fails to be read or the file content corresponding to any one file path is empty content during sequential reading.
A first extraction module 304 adapted to extract the battery temperature data from the file content;
a second extraction module 306, adapted to monitor a broadcast event sent by a terminal operating system when detecting that a state of the battery changes, read additional data of the broadcast event, and extract battery temperature data from the additional data;
the change of the state of the battery comprises the following conditions:
the charging is started, the charging is finished, or the electric quantity variation of the battery reaches a preset threshold value.
Of course, other situations may be included, and the embodiment of the present invention is not limited thereto.
Because some terminals have particularity, in order to unify the value range of the acquired temperature, in the embodiment of the invention, the temperature range can be preset, and when the acquired battery temperature data is within the preset temperature range, the temperature is determined to be the battery temperature data of the terminal.
Therefore, the apparatus according to the embodiment of the present invention may further include:
a comparison module 308 adapted to compare the extracted battery temperature data with a preset temperature range;
a determining module 310, adapted to determine the battery temperature data within the temperature range as the battery temperature data of the terminal when the comparison result of the comparing module is that the battery temperature data is within the temperature range;
a converting module 312, adapted to convert the battery temperature data into a temperature within the temperature range when the comparison result of the comparing module indicates that the battery temperature data exceeds the temperature range, and use the converted battery temperature data as the battery temperature data of the terminal.
As for the above-mentioned terminal battery temperature monitoring device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant points can be referred to the partial description of the method embodiment shown in fig. 1 and fig. 2.
The terminal battery temperature monitoring device provided by the embodiment of the invention can more timely and accurately obtain the battery temperature data of the terminal, thereby solving the problem that the performance of the terminal is influenced by overhigh battery temperature because the current battery temperature data cannot be obtained, and obtaining the beneficial effects that the battery temperature data can be timely and accurately read, and the influence on the performance of the terminal is reduced.
Based on the embodiment of the terminal battery temperature monitoring device, the embodiment of the invention also provides a terminal comprising the CPU, the battery, the temperature sensor, the memory and the terminal battery temperature monitoring device. The terminal can analyze file paths of files where battery temperature data sensed by a temperature sensor in a terminal battery are located, and read file contents corresponding to the file paths, wherein the file paths are obtained by analyzing a system bottom source code and correspond to the files where the temperature sensor data are located, so that the battery temperature data of the terminal can be directly extracted from the file contents. Therefore, the problem that the performance of the terminal is affected due to the fact that the current battery temperature data cannot be obtained and the battery temperature is too high is solved, and the beneficial effects that the battery temperature data can be timely and accurately read and the effect on the performance of the terminal is reduced are achieved.
The battery generates heat during use, causing a rise in the temperature of the battery, which affects the performance of the terminal and may even overheat in extreme cases, causing explosion. Therefore, in order not to affect the performance of the terminal during the use of the terminal, if the battery temperature is too high, the currently executing program may be temporarily stopped to lower the battery temperature.
Therefore, in the embodiment of the present invention, a method for displaying a terminal battery temperature is provided, which may further display the battery temperature data on a user interface of the terminal after obtaining the battery temperature data of the terminal, so as to display the battery temperature data to a user more intuitively.
As shown in fig. 4, which is a flowchart of a terminal battery temperature display method according to an embodiment of the present invention, the method includes:
and step 400, analyzing a file path of a file where battery temperature data sensed by a temperature sensor in the terminal battery is located.
And the battery temperature data is data which is written into a file by a system calling a driver in advance to inform an operating system.
Step 402, reading the file content corresponding to the file path.
Step 404, extracting the battery temperature data from the file content.
For the specific processes from step 400 to step 404, reference may be made to partial descriptions of the method embodiments shown in fig. 1 and fig. 2, and the embodiments of the present invention will not be discussed in detail here.
And 406, displaying the battery temperature data on a user interface of the terminal.
Wherein the user interface is any one of the following:
desktop plug-ins, desktop floating windows and browser plug-ins.
For example, the embodiment of the present invention may display the battery temperature data through a desktop plug-in widget.
The widget is originally a plug-in tool from apple computer, konfabubulator, and is now extended to the windows system, and the software can put its functional blocks, namely the widget, on the desktop of the terminal. For example, the following steps: the clock widget is used for displaying the current time on the desktop; the weather widget can display the weather forecast of the customized region; the cpu widget can display the occupation ratio of the cpu; also desktop search widgets, stock widgets, etc.
Specifically, the embodiment of the present invention may display the battery temperature data through the widget, where the battery temperature data may include the battery temperature data and a current temperature state (e.g., normal, too high, etc.).
Referring to fig. 5, an interface diagram of a battery temperature display according to an embodiment of the present invention is shown, and as can be seen from fig. 5, the current battery temperature data is 29 °, and the state is normal.
Of course, some other information related to the battery temperature data (for example, how much the current battery temperature is higher than the normal temperature) may also be displayed on the user interface (for example, the desktop) of the terminal in the embodiment of the present invention, which is not limited in this respect.
In addition, the battery temperature data can be displayed through the desktop suspension window.
Software on the terminal can generate corresponding floating windows on a screen of the terminal, and the floating windows have the functions of prompting a user of the running state of a main program when the window of the main program is minimized, and quickly opening the window of the main program by clicking the small windows. For example, a 360-degree mobile phone security guard provides a floating window which can be displayed on a terminal screen, and the floating window displays system resource information such as memory occupied amount used by the terminal.
In the embodiment of the invention, the battery temperature data can be displayed through the desktop floating window, the floating window can comprise a preset inlet for displaying the battery temperature detection result, the request of the user side can be received in real time (for example, an operation button is arranged in the floating window, and the request can be triggered when the user side clicks the button), and the real-time measurement result of the temperature data can be displayed after the request of the user side is received.
Of course, the temperature data may also be displayed in other manners, which is not limited in this embodiment of the present invention.
Corresponding to the method for displaying the terminal battery temperature described in the above embodiment, the embodiment of the present invention further provides a terminal battery temperature display apparatus.
Fig. 6 is a block diagram illustrating a terminal battery temperature display device according to an embodiment of the present invention, where the device may include:
the path analysis module 600 is adapted to analyze a file path of a file where battery temperature data sensed by a temperature sensor in a terminal battery is located;
and the battery temperature data is data which is written into a file by a system calling a driver in advance to inform an operating system.
A temperature reading module 602, adapted to read a file content corresponding to the file path;
a first extraction module 604 adapted to extract the battery temperature data from the file content.
A display module 606 adapted to display the battery temperature data on a user interface of the terminal.
Wherein the user interface is any one of the following:
desktop plug-ins, desktop floating windows and browser plug-ins.
For specific descriptions of the path analysis module 600, the temperature reading module 602, and the first extraction module 604, reference may be made to the related description of the above-mentioned terminal battery temperature data monitoring apparatus embodiment, and the embodiment of the present invention is not discussed in detail herein.
The method and the device for displaying the battery temperature data of the terminal provided by the embodiment can further display the battery temperature data on the user interface of the terminal after acquiring the battery temperature data of the terminal, so that a user can more intuitively know the battery temperature data and perform corresponding operation on the terminal according to the current battery temperature data condition, for example, if the current battery temperature is too high, the battery temperature can be reduced by suspending some application programs, and the influence on the terminal performance is reduced.
Based on the embodiment of the terminal battery temperature display device, the embodiment of the invention also provides a terminal comprising the CPU, the battery, the temperature sensor, the memory and the terminal battery temperature display device. The terminal can display the battery temperature data on a user interface of the terminal after acquiring the battery temperature data of the terminal, so that a user can know the battery temperature data more intuitively.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As is readily imaginable to the person skilled in the art: any combination of the above embodiments is possible, and thus any combination between the above embodiments is an embodiment of the present application, but the present disclosure is not necessarily detailed herein for reasons of space.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It will be appreciated by those skilled in the art that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in a battery temperature display device according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
Disclosed herein is a1, a terminal battery temperature display method, comprising: analyzing a file path of a file where battery temperature data sensed by a temperature sensor in a terminal battery is located; the battery temperature data is data which is written into a file by a system calling a driver in advance to inform an operating system; reading the file content corresponding to the file path; extracting the battery temperature data from the file content; and displaying the battery temperature data on a user interface of the terminal. A2, according to the method in A1, the file path of the file where the battery temperature sensed by the temperature sensor data is located includes multiple file paths, and the reading of the file content corresponding to the file paths includes: reading corresponding file contents from the plurality of file paths in sequence, wherein the reading in sequence is traversing reading according to a preset sequence; and when the file contents are read from any one file path in sequence, stopping reading the file contents corresponding to the next file path. A3, according to the method in A2, when reading the file contents from any file path in sequence, stopping reading the file contents corresponding to the next file path, including: when the file content corresponding to any one file path is read successfully, judging whether the file content corresponding to any one file path is empty content; and when the file content is not empty, stopping reading the file content corresponding to the next file path. A4, according to the method in A3, the reading the file content corresponding to the file path further includes: and when the file contents corresponding to any one file path are read in sequence, and the file contents corresponding to the next file path are read continuously when the file contents corresponding to any one file path fail to be read or the file contents corresponding to any one file path are empty contents. A5, according to the method of A2, the sequentially reading the corresponding file contents from the multiple file paths includes: calling information to read a ReadInfo function, and sequentially transmitting the multiple file paths serving as parameters to the ReadInfo function; and receiving a return value of the ReadInfo function, wherein the return value is the file content corresponding to the file path. A6, according to the method of A2, in the android operating system, the file paths include file path/sys/class/hwmon/hwmon 0/device/temp1_ input, file path/sys/class/power _ supply/basic/temp and file path/sys/class/power _ supply/basic _ temp. A7, the method of A1, further comprising: monitoring a broadcast event sent by a terminal operating system when the state of the battery is detected to be changed; additional data of the broadcast event is read and battery temperature data is extracted from the additional data. A8, the method of A7, wherein the changing the state of the battery comprises: the charging is started, the charging is finished, or the electric quantity variation of the battery reaches a preset threshold value. A9, the method of A1 or A7, further comprising: comparing the extracted battery temperature data with a preset temperature range; when the battery temperature data is within the temperature range, determining the battery temperature data within the temperature range as the battery temperature data of the terminal; and when the battery temperature data exceeds the temperature range, converting the battery temperature data into temperature data within the temperature range, and taking the converted battery temperature data as the battery temperature data of the terminal. A10, the method of any one of A1 to A9, the user interface being any one of: desktop plug-ins, desktop floating windows, and browser plug-ins.
Disclosed herein is B11, a terminal battery temperature display device, comprising: the path analysis module is suitable for analyzing a file path of a file where battery temperature data sensed by a temperature sensor in the terminal battery is located; the battery temperature data is data which is written into a file by a system calling a driver in advance to inform an operating system; the temperature reading module is suitable for reading the file content corresponding to the file path; a first extraction module adapted to extract the battery temperature data from the file content. And the display module is suitable for displaying the battery temperature data on a user interface of the terminal. B12, according to the device of B11, the file path of the file where the battery temperature data sensed by the temperature sensor is located includes a plurality of file paths, the temperature reading module sequentially reads corresponding file contents from the plurality of file paths, and when the file contents are sequentially read, the reading of the file contents corresponding to the next file path is stopped when the file contents are read from any one file path, wherein the sequential reading is traversing reading according to a preset sequence. B13, the device according to B12, the temperature reading module comprising: the judging submodule is suitable for judging whether the file content corresponding to any file path is empty content or not when the file content corresponding to any file path is read successfully; and the reading stopping sub-module is suitable for stopping reading the file content corresponding to the next file path when the judging sub-unit judges that the file content is not the empty content. B14, the device according to B13, the temperature reading module further comprising: and the continuous reading sub-module is suitable for continuously reading the file content corresponding to the next file path when the file content corresponding to any one file path fails to be read or the file content corresponding to any one file path is empty content during sequential reading. B15, the device according to B12, the temperature reading module comprising: the calling submodule is suitable for calling information to read the ReadInfo function, and the plurality of file paths are sequentially used as parameters to be transmitted to the ReadInfo function; and the receiving submodule is suitable for receiving a return value of the ReadInfo function, and the return value is the file content corresponding to the file path. B16, the device according to the B12, wherein in an android operating system, the file paths include file path/sys/class/hwmon/hwmon 0/device/temp1_ input, file path/sys/class/power _ supply/basic/temp and file path/sys/class/power _ supply/basic _ temp. B17, the apparatus according to B11, further comprising: and the second extraction module is suitable for monitoring a broadcast event sent by a terminal operating system when the state of the battery is detected to be changed, reading additional data of the broadcast event and extracting battery temperature data from the additional data. B18, the device according to B17, the state change of the battery comprises: the charging is started, the charging is finished, or the electric quantity variation of the battery reaches a preset threshold value. B19, the apparatus according to B11 or B17, further comprising: the comparison module is suitable for comparing the extracted battery temperature data with a preset temperature range; the determining module is used for determining that the battery temperature data within the temperature range is the battery temperature data of the terminal when the comparison result of the comparing module is that the battery temperature data is within the temperature range; and the conversion module is suitable for converting the battery temperature data into the temperature within the temperature range when the comparison result of the comparison module indicates that the battery temperature data exceeds the temperature range, and taking the converted battery temperature data as the battery temperature data of the terminal. B20, the apparatus according to any one of B11 to B20, the user interface being any one of: desktop plug-ins, desktop floating windows, and browser plug-ins.
Disclosed herein is C21, a terminal, comprising: CPU, battery, temperature sensor, memory, and terminal battery temperature display device as described in any of the above B11-B20.
Claims (18)
1. A terminal battery temperature display method comprises the following steps:
analyzing a bottom source code of a terminal system, and determining a file path of a file where battery temperature data sensed by a temperature sensor in a terminal battery is located; the battery temperature data is data which is written into a file by a system calling a driver in advance to inform an operating system, and the file path of the file in which the battery temperature data sensed by the temperature sensor is located comprises a plurality of file paths;
reading corresponding file contents from the plurality of file paths in sequence, wherein the reading is traversing reading according to a preset sequence; when reading the file contents in sequence, stopping reading the file contents corresponding to the next file path when reading the file contents from any file path;
extracting the battery temperature data from the file content;
and displaying the battery temperature data on a user interface of the terminal.
2. The method according to claim 1, wherein when reading the file contents from any one file path in sequence, stopping reading the file contents corresponding to the next file path, comprises:
when the file content corresponding to any one file path is read successfully, judging whether the file content corresponding to any one file path is empty content;
and when the file content corresponding to any one file path is not empty, stopping reading the file content corresponding to the next file path.
3. The method of claim 2, further comprising:
and when the file contents corresponding to any one file path are read in sequence, and the file contents corresponding to the next file path are read continuously when the file contents corresponding to any one file path fail to be read or the file contents corresponding to any one file path are empty contents.
4. The method of claim 1, wherein said sequentially reading corresponding file contents from said plurality of file paths comprises:
calling information to read a ReadInfo function, and sequentially transmitting the multiple file paths serving as parameters to the ReadInfo function;
and receiving a return value of the ReadInfo function, wherein the return value is the file content corresponding to the file path.
5. The method of claim 1, wherein the plurality of file paths comprise a file path/sys/class/hwmon/hwmon 0/device/temp1input, a file path/sys/class/power _ supply/base/temp, and a file path/sys/class/power _ supply/base/temp in an android operating system.
6. The method of claim 1, further comprising:
monitoring a broadcast event sent by a terminal operating system when the state of the battery is detected to be changed;
additional data of the broadcast event is read and battery temperature data is extracted from the additional data.
7. The method of claim 6, the changing the state of the battery comprising:
the charging is started, the charging is finished, or the electric quantity variation of the battery reaches a preset threshold value.
8. The method of claim 1 or 6, further comprising:
comparing the extracted battery temperature data with a preset temperature range;
when the battery temperature data is within the temperature range, determining the battery temperature data within the temperature range as the battery temperature data of the terminal;
and when the battery temperature data exceeds the temperature range, converting the battery temperature data into temperature data within the temperature range, and taking the converted battery temperature data as the battery temperature data of the terminal.
9. The method of any of claims 1 to 7, the user interface being any of:
desktop plug-ins, desktop floating windows, and browser plug-ins.
10. A terminal battery temperature display device comprising:
the path analysis module is suitable for analyzing a bottom source code of the terminal system and determining a file path of a file where battery temperature data sensed by a temperature sensor in a terminal battery is located; the battery temperature data is data which is written into a file by a system calling a driver in advance to inform an operating system, and the file path of the file in which the battery temperature data sensed by the temperature sensor is located comprises a plurality of file paths;
the temperature reading module is suitable for reading the file content corresponding to the file path; the temperature reading module sequentially reads corresponding file contents from the plurality of file paths, and stops reading the file contents corresponding to the next file path when the file contents are read from any one file path during sequential reading, wherein the sequential reading is traversing reading according to a preset sequence;
a first extraction module adapted to extract the battery temperature data from the file content;
and the display module is suitable for displaying the battery temperature data on a user interface of the terminal.
11. The apparatus of claim 10, the temperature reading module comprising:
the judging submodule is suitable for judging whether the file content corresponding to any file path is empty content or not when the file content corresponding to any file path is read successfully;
and the reading stopping sub-module is suitable for stopping reading the file content corresponding to the next file path when the judging sub-module judges that the file content corresponding to any one file path is not the empty content.
12. The apparatus of claim 11, the temperature reading module further comprising:
and the continuous reading sub-module is suitable for continuously reading the file content corresponding to the next file path when the file content corresponding to any one file path fails to be read or the file content corresponding to any one file path is empty content during sequential reading.
13. The apparatus of claim 10, the temperature reading module comprising:
the calling submodule is suitable for calling information to read the ReadInfo function, and the plurality of file paths are sequentially used as parameters to be transmitted to the ReadInfo function;
and the receiving submodule is suitable for receiving a return value of the ReadInfo function, and the return value is the file content corresponding to the file path.
14. The apparatus of claim 10, wherein the plurality of file paths comprise a file path/sys/class/hwmon/hwmon 0/device/temp1input, a file path/sys/class/power _ supply/basic/temp, and a file path/sys/class/power _ supply/basic/temp in an android operating system.
15. The apparatus of claim 10, further comprising:
and the second extraction module is suitable for monitoring a broadcast event sent by a terminal operating system when the state of the battery is detected to be changed, reading additional data of the broadcast event and extracting battery temperature data from the additional data.
16. The apparatus of claim 15, the change in the state of the battery comprising:
the charging is started, the charging is finished, or the electric quantity variation of the battery reaches a preset threshold value.
17. The apparatus of claim 10 or 15, further comprising:
the comparison module is suitable for comparing the extracted battery temperature data with a preset temperature range;
the determining module is used for determining that the battery temperature data in the temperature range are the battery temperature data of the terminal when the comparison result of the comparing module is that the battery temperature data are in the temperature range;
and the conversion module is suitable for converting the battery temperature data into the temperature within the temperature range when the comparison result of the comparison module indicates that the battery temperature data exceeds the temperature range, and taking the converted battery temperature data as the battery temperature data of the terminal.
18. A terminal, comprising: a CPU, a battery, a temperature sensor, a memory, and a terminal battery temperature display device according to any one of claims 10 to 17.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210487289.5A CN103049069B (en) | 2012-11-26 | 2012-11-26 | End cell process for temperature indication and device and terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210487289.5A CN103049069B (en) | 2012-11-26 | 2012-11-26 | End cell process for temperature indication and device and terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103049069A CN103049069A (en) | 2013-04-17 |
CN103049069B true CN103049069B (en) | 2016-03-30 |
Family
ID=48061739
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210487289.5A Active CN103049069B (en) | 2012-11-26 | 2012-11-26 | End cell process for temperature indication and device and terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103049069B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103257320B (en) * | 2013-05-08 | 2019-04-02 | 百度在线网络技术(北京)有限公司 | The electric quantity environment construction method and apparatus of mobile terminal |
CN103487138A (en) * | 2013-09-29 | 2014-01-01 | 上海斐讯数据通信技术有限公司 | Mobile terminal having ultraviolet ray real-time detection function based on cloud service and method of mobile terminal |
CN105472099A (en) * | 2014-08-13 | 2016-04-06 | 中兴通讯股份有限公司 | Temperature processing method and temperature processing device |
JP6656284B2 (en) * | 2018-03-22 | 2020-03-04 | 本田技研工業株式会社 | Vehicle battery temperature display |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN201403119Y (en) * | 2008-12-12 | 2010-02-10 | 康佳集团股份有限公司 | Cell phone with temperature monitoring function |
CN101695084A (en) * | 2009-09-29 | 2010-04-14 | 深圳华为通信技术有限公司 | Method and device for prompting |
CN101984644A (en) * | 2010-10-28 | 2011-03-09 | 浙江大学 | Android operating system mobile phone-based temperature alarm method |
CN102694913A (en) * | 2012-05-14 | 2012-09-26 | 广东欧珀移动通信有限公司 | Implementing method for carrying out alarming on abnormal temperature inside mobile phone |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8230121B2 (en) * | 2009-01-05 | 2012-07-24 | Sierra Wireless, Inc. | Method and apparatus for identifying a device handle in a computer system |
US20110046832A1 (en) * | 2009-02-17 | 2011-02-24 | Vehicules Nemo Inc. | Electronic Assistance System and Method |
CN202411012U (en) * | 2011-12-05 | 2012-09-05 | 哈尔滨智木科技有限公司 | Battery separation equipment with temperature monitor |
-
2012
- 2012-11-26 CN CN201210487289.5A patent/CN103049069B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN201403119Y (en) * | 2008-12-12 | 2010-02-10 | 康佳集团股份有限公司 | Cell phone with temperature monitoring function |
CN101695084A (en) * | 2009-09-29 | 2010-04-14 | 深圳华为通信技术有限公司 | Method and device for prompting |
CN101984644A (en) * | 2010-10-28 | 2011-03-09 | 浙江大学 | Android operating system mobile phone-based temperature alarm method |
CN102694913A (en) * | 2012-05-14 | 2012-09-26 | 广东欧珀移动通信有限公司 | Implementing method for carrying out alarming on abnormal temperature inside mobile phone |
Also Published As
Publication number | Publication date |
---|---|
CN103049069A (en) | 2013-04-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107193750B (en) | Script recording method and device | |
US20150054655A1 (en) | Usage Data for Marine Electronics Device | |
EP3062567B1 (en) | Electronic device and method for managing power in electronic device | |
KR102273371B1 (en) | Method for controlling and an electronic device thereof | |
CN103049069B (en) | End cell process for temperature indication and device and terminal | |
CN112214260A (en) | Loading method and device of terminal application APP | |
US9823945B2 (en) | Method and apparatus for managing application program | |
CN104520815A (en) | Method, device and equipment for task scheduling | |
CN104932963B (en) | The method and device of management terminal | |
CN105988805B (en) | Application program management method and mobile terminal | |
CN107798064B (en) | Page processing method, electronic device and computer readable storage medium | |
CN109614608A (en) | Electronic device, text information detection method and storage medium | |
EP3276487B1 (en) | Method of detecting similar applications and electronic device adapted to the same | |
US11422916B2 (en) | Usage amount monitoring method and monitoring unit of electronic control unit for vehicle | |
CN103019907B (en) | A kind of end cell temperature monitoring method and device and terminal | |
EP3021250B1 (en) | Electronic device and method for suggesting response manual in occurrence of denial | |
CN111147549B (en) | Terminal desktop content sharing method, device, equipment and storage medium | |
CN103559228B (en) | The loading method and device of Shipping Options Page in browser | |
CN113342451A (en) | Book prompt information display method, computing equipment and computer storage medium | |
CN107231647B (en) | Network detecting method, network detection device and intelligent terminal | |
CN106909486B (en) | Method, device and system for processing business exception | |
CN109032911B (en) | Frame rate detection method and device for mobile device and electronic device | |
KR102340251B1 (en) | Method for managing data and an electronic device thereof | |
CN106446158B (en) | Application data sharing method, sharing device and terminal | |
CN110889116A (en) | Advertisement blocking method and device and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20220728 Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015 Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd. Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park) Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd. Patentee before: Qizhi software (Beijing) Co.,Ltd. |