[go: up one dir, main page]

CN104167801A - A method for displaying the status of mobile power supply, mobile terminal and mobile power supply - Google Patents

A method for displaying the status of mobile power supply, mobile terminal and mobile power supply Download PDF

Info

Publication number
CN104167801A
CN104167801A CN201410443292.6A CN201410443292A CN104167801A CN 104167801 A CN104167801 A CN 104167801A CN 201410443292 A CN201410443292 A CN 201410443292A CN 104167801 A CN104167801 A CN 104167801A
Authority
CN
China
Prior art keywords
power supply
current
mobile terminal
mobile
mobile power
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.)
Pending
Application number
CN201410443292.6A
Other languages
Chinese (zh)
Inventor
廖福椿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201410443292.6A priority Critical patent/CN104167801A/en
Publication of CN104167801A publication Critical patent/CN104167801A/en
Pending legal-status Critical Current

Links

Landscapes

  • Telephone Function (AREA)

Abstract

The invention is suitable for the field of mobile equipment, and provides a method for displaying the state of a mobile power supply, a mobile terminal and the mobile power supply, wherein the method comprises the following steps: the mobile terminal is connected with the mobile power supply through a USB (universal serial bus) line; the mobile terminal sends a command for acquiring the state information to the mobile power supply through the D +/D-of the USB line; the mobile power supply acquires the state information of the mobile power supply according to the instruction, and sends the state information to the mobile terminal through the D +/D-of the USB cable; the mobile terminal stores the state information into a preset node; the mobile terminal reads the state information from the node; and the mobile terminal displays the state information. According to the invention, a user can know the specific state information of the mobile power supply, such as the current electric quantity or the current temperature of the mobile power supply, and the user can judge whether the mobile power supply needs to be charged in advance or used when the temperature of the mobile power supply is reduced to be not too hot according to the specific state information.

Description

一种显示移动电源的状态的方法、移动终端及移动电源A method for displaying the status of mobile power supply, mobile terminal and mobile power supply

技术领域technical field

本发明属于移动设备领域,尤其涉及一种显示移动电源的状态的方法、移动终端及移动电源。The invention belongs to the field of mobile equipment, and in particular relates to a method for displaying the status of a mobile power supply, a mobile terminal and a mobile power supply.

背景技术Background technique

随着智能终端的功能越来越强大,耗电逐渐成为了困扰用户的一个难题。一天一充或者二充都是常见的。为了避免智能终端突然没电,大部分用户为智能终端配备了移动电源。As the functions of smart terminals become more and more powerful, power consumption has gradually become a difficult problem for users. One or two charges a day are common. In order to prevent the smart terminal from suddenly running out of power, most users equip the smart terminal with a mobile power supply.

移动电源由于成本及便携性的原因,没有LCD,用户只能通过指示灯了解移动电源的状态。但指示灯表示的是一个很宽泛的东西,比如电量20%和电量80%时,指示灯的指示情况可能是一样的。有的移动电源安装有几个指示灯,粗略地显示移动电源的当前电量,但用户很难理解各个指示灯的指示含义,所以不能够清楚地知道移动电源剩余多少电,要不要提前充满,以致带移动电源外出后,有时候用了一会,发现移动电源没电了,这是一件很郁闷的事情。Due to the cost and portability of the mobile power supply, there is no LCD, and the user can only know the status of the mobile power supply through the indicator light. But what the indicator light represents is a very broad thing. For example, when the power is 20% and the power is 80%, the indication of the light may be the same. Some mobile power supplies are equipped with several indicator lights, which roughly show the current power of the mobile power supply, but it is difficult for users to understand the meaning of each indicator light, so they cannot clearly know how much power is left in the mobile power supply, whether to charge it in advance, so that After going out with a mobile power supply, sometimes after using it for a while, it is very frustrating to find that the mobile power supply is out of power.

另外,移动电源发热时,用户也不知道其具体温度多少,需不需要“凉快”一下。In addition, when the mobile power supply heats up, the user does not know the specific temperature, whether it needs to be "cooled".

发明内容Contents of the invention

本发明实施例提供了一种显示移动电源的状态的方法、移动终端及移动电源,旨在解决现有技术,用户在使用移动电源的过程中,无法清楚地知道移动电源的状态,比如,移动电源的当前电量或者当前温度的问题。Embodiments of the present invention provide a method for displaying the state of a mobile power supply, a mobile terminal, and a mobile power supply, aiming to solve the problem in the prior art that users cannot clearly know the state of the mobile power supply during use of the mobile power supply, for example, mobile The current power level of the power supply or the current temperature problem.

一方面,提供一种显示移动电源的状态的方法,所述方法包括:In one aspect, a method for displaying a state of a mobile power supply is provided, the method comprising:

移动终端与移动电源通过USB线建立连接;The mobile terminal is connected to the mobile power supply through a USB cable;

移动终端通过USB线的D+/D-发送获取状态信息的指令至移动电源;The mobile terminal sends an instruction to obtain status information to the mobile power supply through the D+/D- of the USB cable;

移动电源根据所述指令获取移动电源的状态信息,并将所述状态信息通过USB线的D+/D-发送至移动终端;The mobile power supply obtains the state information of the mobile power supply according to the instruction, and sends the state information to the mobile terminal through the D+/D- of the USB line;

移动终端将所述状态信息存储至预设的节点中;The mobile terminal stores the state information in a preset node;

移动终端从所述节点中读取所述状态信息;The mobile terminal reads the status information from the node;

移动终端显示所述状态信息。The mobile terminal displays the status information.

进一步地,所述状态信息包括移动电源的当前电量、当前温度、当前电压、当前电流中的任意一种。Further, the state information includes any one of the current battery capacity, current temperature, current voltage, and current current of the mobile power supply.

进一步地,在移动终端的预设目录下,移动终端为每一种类型的状态信息创建一个对应的节点,不同种类的状态信息存储至不同的节点中。Further, under the preset directory of the mobile terminal, the mobile terminal creates a corresponding node for each type of state information, and different types of state information are stored in different nodes.

另一方面,提供一种移动终端,所述移动终端包括:In another aspect, a mobile terminal is provided, and the mobile terminal includes:

连接建立单元,用于与移动电源通过USB线建立连接;The connection establishment unit is used to establish a connection with the mobile power supply through a USB cable;

指令发送单元,用于通过USB线的D+/D-发送获取状态信息的指令至移动电源;The command sending unit is used to send the command to obtain the status information to the mobile power supply through the D+/D- of the USB line;

状态信息接收单元,用于通过USB线的D+/D-接收移动电源发送的状态信息;The state information receiving unit is used to receive the state information sent by the mobile power supply through the D+/D- of the USB line;

状态信息存储单元,用于将所述状态信息存储至预设的节点中;a state information storage unit, configured to store the state information in a preset node;

状态信息读取单元,用于从所述节点中读取所述状态信息;a state information reading unit, configured to read the state information from the node;

状态信息显示单元,用于显示所述状态信息。The status information display unit is used to display the status information.

进一步地,所述状态信息包括移动电源的当前电量、当前温度、当前电压、当前电流中的任意一种。Further, the state information includes any one of the current battery capacity, current temperature, current voltage, and current current of the mobile power supply.

进一步地,所述移动终端还包括:Further, the mobile terminal also includes:

节点创建单元,用于在移动终端的预设目录下,为每一种类型的状态信息创建一个对应的节点,不同种类的状态信息存储至不同的节点中。The node creation unit is used to create a corresponding node for each type of state information in the preset directory of the mobile terminal, and store different types of state information in different nodes.

又一方面,提供一种移动电源,所述移动电源包括:In yet another aspect, a mobile power supply is provided, the mobile power supply comprising:

连接建立单元,用于与移动终端通过USB线建立连接;A connection establishment unit, configured to establish a connection with the mobile terminal via a USB cable;

指令接收单元,用于通过USB线的D+/D-接收移动终端发送的获取状态信息的指令;The instruction receiving unit is used to receive the instruction for acquiring state information sent by the mobile terminal through the D+/D- of the USB line;

状态信息获取单元,用于根据所述指令获取移动电源的状态信息;A status information acquisition unit, configured to acquire status information of the mobile power supply according to the instruction;

状态信息发送单元,用于通过USB线的D+/D-发送所述状态信息至移动终端。The state information sending unit is used to send the state information to the mobile terminal through the D+/D- of the USB line.

进一步地,所述状态信息包括移动电源的当前电量、当前温度、当前电压、当前电流中的任意一种。Further, the state information includes any one of the current battery capacity, current temperature, current voltage, and current current of the mobile power supply.

进一步地,所述状态信息获取单元包括:Further, the state information acquisition unit includes:

ADC采样模块,用于通过ADC采样得到移动电源的当前温度、当前电压、当前电流;The ADC sampling module is used to obtain the current temperature, current voltage, and current current of the mobile power supply through ADC sampling;

开路电压计算模块,用于根据当前电压和当前电流计算开路电压;The open circuit voltage calculation module is used to calculate the open circuit voltage according to the current voltage and the current current;

电量计算模块,用于根据所述开路电压和所述当前温度查找温度、电量和开路电压之间的关系表得到移动电源的当前电量。The power calculation module is used to search the relationship table between temperature, power and open circuit voltage according to the open circuit voltage and the current temperature to obtain the current power of the mobile power supply.

在本发明实施例,移动电源接收到移动终端发送的获取状态信息的指令后,可以将获取到的相应状态信息发送给移动终端,并在移动终端上显示给用户,用户可以知道移动电源的具体状态信息,比如,移动电源的当前电量或者当前温度,用户可以根据这些具体状态信息来判断是否需要给移动电源提前充电或者等移动电源的温度降到不太热的时候再行使用。In the embodiment of the present invention, after the mobile power supply receives the instruction to obtain status information sent by the mobile terminal, it can send the obtained corresponding status information to the mobile terminal, and display it to the user on the mobile terminal, so that the user can know the specific status information of the mobile power supply. Status information, such as the current power level or current temperature of the mobile power supply, the user can judge whether to charge the mobile power bank in advance or use it when the temperature of the mobile power bank is not too hot according to these specific status information.

附图说明Description of drawings

图1是本发明实施例一提供的显示移动电源的状态的方法的实现流程图;Fig. 1 is an implementation flow chart of a method for displaying the state of a mobile power supply provided by Embodiment 1 of the present invention;

图2是本发明实施例一提供的温度-电量-开路电压OCV电压的关系表示意图;Fig. 2 is a schematic diagram of the relationship table of temperature-electricity-open-circuit voltage OCV voltage provided by Embodiment 1 of the present invention;

图3是本发明实施例二提供的移动终端的结构框图;FIG. 3 is a structural block diagram of a mobile terminal provided in Embodiment 2 of the present invention;

图4是本发明实施例三提供的移动电源的结构框图。Fig. 4 is a structural block diagram of a mobile power supply provided by Embodiment 3 of the present invention.

具体实施方式Detailed ways

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

在本发明实施例中,移动终端与移动电源通过USB线建立连接,移动终端通过USB线的D+/D-发送获取状态信息的指令至移动电源,移动电源根据所述指令获取移动电源的状态信息,并将所述状态信息发送至移动终端,移动终端先将所述状态信息存储至预设的节点中,再从所述节点中读取所述状态信息,最后显示所述状态信息。In the embodiment of the present invention, the mobile terminal is connected to the mobile power supply through a USB cable, and the mobile terminal sends an instruction to obtain status information to the mobile power supply through the D+/D- of the USB cable, and the mobile power supply obtains the status information of the mobile power supply according to the instruction , and send the state information to the mobile terminal, the mobile terminal first stores the state information in a preset node, then reads the state information from the node, and finally displays the state information.

以下结合具体实施例对本发明的实现进行详细描述:The realization of the present invention is described in detail below in conjunction with specific embodiment:

实施例一Embodiment one

图1示出了本发明实施例一提供的显示移动电源的状态的方法的实现流程,详述如下:Figure 1 shows the implementation process of the method for displaying the state of the mobile power supply provided by Embodiment 1 of the present invention, which is described in detail as follows:

在步骤S101中,移动终端与移动电源通过USB线建立连接。In step S101, the mobile terminal is connected to the mobile power supply through a USB cable.

在本发明实施例中,显示移动电源的状态信息的智能终端是移动终端。In the embodiment of the present invention, the smart terminal displaying the status information of the mobile power supply is a mobile terminal.

移动电源通过USB线给移动终端充电,USB线上有4个信号,vbus提供电流,gnd接地,D+/D-是空闲的。The mobile power supply charges the mobile terminal through the USB line. There are 4 signals on the USB line, vbus provides current, gnd is grounded, and D+/D- are idle.

在步骤S102中,移动终端通过USB线的D+/D-发送获取状态信息的指令至移动电源。In step S102, the mobile terminal sends an instruction to obtain status information to the mobile power supply through D+/D- of the USB cable.

在本发明实施例中,移动终端和移动电源之间通过USB线建立连接后,两者之间可以通过USB线的空闲的D+/D-进行通信。In the embodiment of the present invention, after the connection between the mobile terminal and the mobile power supply is established through the USB cable, the two can communicate through the idle D+/D- of the USB cable.

其中,移动终端可以D+/D-发送获取状态信息的指令至移动电源,获取到的状态信息可以是移动电源的当前电量、当前温度、当前电压、当前电流中的任意一种。Wherein, the mobile terminal can D+/D- send an instruction to obtain status information to the mobile power supply, and the obtained status information can be any one of the current power, current temperature, current voltage, and current current of the mobile power supply.

具体的,该获取状态信息的指令是一条预先设计的指令,每一种类型的状态信息对应不同的指令。Specifically, the instruction for acquiring status information is a pre-designed instruction, and each type of status information corresponds to a different instruction.

其中,获取移动电源的当前电量信息的指令,可以定义为0x51,获取移动电源的当前温度信息的指令,可以定义为0x52。定义好的指令,以二进制的形式通过USB线的D+/D-发送至移动电源。具体定义为何种指令,可以根据移动电源和移动终端之间的约定来自行定义,在此不做限制。Wherein, the instruction for obtaining the current power information of the mobile power supply may be defined as 0x51, and the instruction for obtaining the current temperature information of the mobile power supply may be defined as 0x52. The defined instructions are sent to the mobile power supply in binary form through the D+/D- of the USB cable. What kind of instruction is specifically defined can be defined according to the agreement between the mobile power supply and the mobile terminal, and there is no limitation here.

其中,移动终端上安装有一个应用“获取移动电源的状态.apk”。该apk界面上包括“获取移动电源的电量信息”、“获取启动电源的温度信息”等选项或者按钮,通过选中或者点击该apk界面上的相应选项或者按钮,移动终端自动生成相应的指令并发送该指令至移动电源。比如,用户选中“获取移动电源的电量信息”,则移动终端生成并发送0x51至移动电源,请求获取移动电源的电量信息。Wherein, an application "obtaining the status of mobile power supply.apk" is installed on the mobile terminal. The apk interface includes options or buttons such as "get the power information of the mobile power supply" and "get the temperature information of the starting power supply". By selecting or clicking the corresponding options or buttons on the apk interface, the mobile terminal will automatically generate the corresponding command and send it This instruction goes to the mobile power supply. For example, if the user selects "obtain the power information of the mobile power supply", the mobile terminal generates and sends 0x51 to the power bank, requesting to obtain the power information of the mobile power supply.

在步骤S103中,移动电源根据所述指令获取移动电源的状态信息,并通过USB线的D+/D-将所述状态信息发送至移动终端。In step S103, the mobile power source acquires state information of the mobile power source according to the instruction, and sends the state information to the mobile terminal through D+/D− of the USB cable.

在本发明实施例中,移动电源通过USB线的D+/D-接收到移动终端发送的指令后,根据所述指令获取相应的状态。比如,若接收到的指令是0x51,则获取移动电源的当前电量,并通过USB线的D+/D-发送获取到的当前电量至移动终端。In the embodiment of the present invention, after the mobile power supply receives the instruction sent by the mobile terminal through the D+/D- of the USB line, it acquires the corresponding state according to the instruction. For example, if the received command is 0x51, then obtain the current power of the mobile power supply, and send the obtained current power to the mobile terminal through D+/D- of the USB cable.

其中,移动电源接收到0x51后,将电量信息通过USB线的D+/D-以二进制形式返回给移动终端。比如获取到的当前电量是60%,则返回00111100至移动终端。由于电量的范围是0~100,返回的数据长度是8个bit即可。Wherein, after receiving 0x51, the mobile power supply returns the power information to the mobile terminal in binary form through the D+/D- of the USB cable. For example, if the obtained current power is 60%, then return 00111100 to the mobile terminal. Since the power range is 0 to 100, the length of the returned data is only 8 bits.

在步骤S104中,移动终端将所述状态信息存储至预设的节点中。In step S104, the mobile terminal stores the status information in a preset node.

在本发明实施例中,移动终端通过USB线的D+/D-接收到移动电源发送的电量信息后,将所述电量信息存入预设的节点/sys/class/power_supply/battery/power_bank_cap中。In the embodiment of the present invention, after receiving the power information sent by the mobile power supply through D+/D- of the USB cable, the mobile terminal stores the power information into the preset node /sys/class/power_supply/battery/power_bank_cap.

其中,移动终端上安装有一个应用“获取移动电源的状态.apk”。通过该apk可以在移动终端的预设目录/sys/class/power_supply/battery/下创建若干个节点,为每一种类型的状态信息创建一个对应的节点,不同种类的状态信息存储至不同的节点中。比如,在预设目录/sys/class/power_supply/battery/下创建两个节点:power_bank_cap和power_bank_temp。其中,power_bank_cap节点用于存储接收到的电量信息,power_bank_temp用于存储接收到的温度信息。Wherein, an application "obtaining the status of mobile power supply.apk" is installed on the mobile terminal. Through this apk, several nodes can be created under the default directory /sys/class/power_supply/battery/ of the mobile terminal, and a corresponding node can be created for each type of status information, and different types of status information can be stored in different nodes middle. For example, create two nodes under the default directory /sys/class/power_supply/battery/: power_bank_cap and power_bank_temp. Among them, the power_bank_cap node is used to store the received power information, and power_bank_temp is used to store the received temperature information.

若接收到的状态信息是电量信息,则移动终端将接收到的电量信息存储至/sys/class/power_supply/battery/power_bank_cap节点中;若接收到的状态信息是温度信息,则移动终端将接收到的温度信息存储至/sys/class/power_supply/battery/power_bank_temp节点中If the received status information is power information, the mobile terminal will store the received power information in the /sys/class/power_supply/battery/power_bank_cap node; if the received status information is temperature information, the mobile terminal will receive The temperature information is stored in the /sys/class/power_supply/battery/power_bank_temp node

在步骤S105中,移动终端从所述节点中读取所述状态信息。In step S105, the mobile terminal reads the state information from the node.

在本发明实施例中,由于移动终端采用的安卓Android系统分为底层和上层,移动电源只能和底层通信,所以底层将接收到的状态信息存入相应的节点供上层获取,底层接收到状态信息后,告知上层已经接收到移动电源发送的状态信息,上层读取相应的节点中存储的数据,并将读取到的数据在界面中显示出来。In the embodiment of the present invention, since the Android system adopted by the mobile terminal is divided into the bottom layer and the upper layer, the mobile power supply can only communicate with the bottom layer, so the bottom layer stores the received status information into the corresponding node for the upper layer to obtain, and the bottom layer receives the status information After receiving the information, inform the upper layer that the status information sent by the mobile power supply has been received, the upper layer reads the data stored in the corresponding node, and displays the read data on the interface.

在步骤S106中,移动终端显示所述状态信息。In step S106, the mobile terminal displays the status information.

在本发明实施例中,移动终端显示读取到的状态信息至移动终端的界面上,以供用户查看。In the embodiment of the present invention, the mobile terminal displays the read status information on the interface of the mobile terminal for the user to view.

另外,需要说明的是,需要获取哪种状态信息是根据用户的需要来选择的。若前面提到的,获取到的状态信息是电量信息,则用户还可以选择让移动电源发送温度信息或者电压信息或者电源信息至移动终端。In addition, it should be noted that which state information needs to be obtained is selected according to the needs of the user. If as mentioned above, the obtained state information is power information, the user can also choose to let the mobile power supply send temperature information or voltage information or power supply information to the mobile terminal.

其中,移动终端获取完电量信息后,可以通过USB线的D+/D-再发送0x52至移动电源,要求移动电源告知其温度,移动电源通过USB线的D+/D-接收到0x52后,将当前温度通过USB线的D+/D-以二进制形式发送给移动终端,由于温度的范围是-40~100度,范围较宽,用8bit表示不够用,可以连续发送多次,每次一个byte。移动终端接收到温度信息后,将几个byte一起解析出来,在界面上显示。移动电源的其它信息,如电压、电流等亦可通过步骤102至步骤106显示给用户。Among them, after the mobile terminal obtains the power information, it can send 0x52 to the mobile power supply through the D+/D- of the USB line, and ask the mobile power supply to inform its temperature. After the mobile power supply receives 0x52 through the D+/D- of the USB line, the current The temperature is sent to the mobile terminal in binary form through the D+/D- of the USB cable. Since the temperature range is -40 to 100 degrees, which is a wide range, 8bit is not enough, and it can be sent multiple times continuously, one byte at a time. After receiving the temperature information, the mobile terminal parses several bytes together and displays it on the interface. Other information of the mobile power supply, such as voltage and current, can also be displayed to the user through steps 102 to 106 .

另外,需要说明的是,通过ADC采样可以得到移动电源的当前温度、当前电压、当前电流;根据当前电压和当前电流计算开路电压后,根据所述开路电压和所述当前温度查找温度、电量和开路电压之间的关系表得到移动电源的当前电量。In addition, it should be noted that the current temperature, current voltage, and current current of the mobile power supply can be obtained through ADC sampling; after the open circuit voltage is calculated according to the current voltage and current current, the temperature, power and The relationship table between the open circuit voltage obtains the current power of the mobile power supply.

具体的,可以将通过ADC采样得到电压、电流、温度分别记为Vbat、Ibat和Temp。移动电源的电池经过硬件测试均会得到一张温度-电量-开路电压OCV电压的关系表,如图2所示,该表中,横轴表示各个电量下的电压值,纵轴表示不同的温度,比如25摄氏度、电量为90%时,电池OCV电压是4082mV。移动电源的电芯内阻和从电池触点到ADC采样点的阻抗是已知的,记为R。通过电压、电流计算OCV:Specifically, the voltage, current, and temperature obtained through ADC sampling may be recorded as Vbat, Ibat, and Temp, respectively. The battery of the mobile power supply will get a temperature-power-open circuit voltage OCV voltage relationship table after hardware testing, as shown in Figure 2. In this table, the horizontal axis represents the voltage value under each power level, and the vertical axis represents different temperatures. For example, when the battery is 90% charged at 25 degrees Celsius, the battery OCV voltage is 4082mV. The internal resistance of the battery cell of the mobile power supply and the impedance from the battery contact to the ADC sampling point are known, denoted as R. Calculate OCV by voltage and current:

OCV=Vbat+Ibat*ROCV=Vbat+Ibat*R

在OCV和温度已知时,查询图2所示的关系表可得到电量。When OCV and temperature are known, query the relationship table shown in Figure 2 to get the power.

另外,还需要说明的是,移动电源也可以主动发送状态信息至移动终端。只不过,在移动电源主动发送状态信息之前,先要给移动终端发送一条指令,通过该指令通知移动终端接下来接收到的状态信息为哪一种状态信息,比如是,电量信息还是温度信息。移动终端根据该指令将接收到的状态信息存入相应的节点中,再读取、显示给用户。具体执行过程与步骤S102至步骤S106类似,在此不再赘述。In addition, it should be noted that the mobile power supply can also actively send status information to the mobile terminal. However, before the mobile power supply actively sends status information, it must first send an instruction to the mobile terminal, through which the mobile terminal is notified which status information the next received status information is, for example, power information or temperature information. The mobile terminal stores the received state information in the corresponding node according to the instruction, and then reads and displays it to the user. The specific execution process is similar to step S102 to step S106, and will not be repeated here.

本实施例,移动终端和移动电源之间通过USB线的D+/D-进行通信,移动终端通过D+/D-发送获取状态信息的指令至移动电源,移动电源根据该指令获取相应的状态信息并发送所述状态信息至移动终端,移动终端侧接收到所述状态信息后,存储、读取并显示给用户。使得用户可以根据自己的需要获取移动电源的相应状态信息,极大的提升了使用体验。并且,移动终端和移动电源之间不需要转接头,也不需要外加任何装置,移动电源通过USB线插到移动终端的USB接口上后,两者即可进行状态信息的创术,节省了成本,增大了用户使用的便利性。还有,USB线的D+/D-本质上是GPIO口,GPIO口可以随意输出高低电平,因此,移动终端和移动电源之间通信格式和协议可以根据研发人员的需求来自定义,加快的研发速度,节省了研发成本。In this embodiment, the mobile terminal and the mobile power supply communicate through the D+/D- of the USB cable, and the mobile terminal sends an instruction to obtain state information to the mobile power supply through D+/D-, and the mobile power supply obtains the corresponding state information according to the instruction and The status information is sent to the mobile terminal, and the mobile terminal side stores, reads and displays the status information to the user after receiving the status information. The user can obtain the corresponding status information of the mobile power supply according to his needs, which greatly improves the user experience. Moreover, there is no need for an adapter or any additional device between the mobile terminal and the mobile power supply. After the mobile power supply is plugged into the USB interface of the mobile terminal through a USB cable, the two can create status information, which saves costs. , increasing user convenience. In addition, the D+/D- of the USB cable is essentially a GPIO port, and the GPIO port can output high and low levels at will. Therefore, the communication format and protocol between the mobile terminal and the mobile power supply can be customized according to the needs of the R&D personnel, speeding up R&D speed, saving R&D costs.

本领域普通技术人员可以理解实现上述各实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,相应的程序可以存储于一计算机可读取存储介质中,所述的存储介质,如ROM/RAM、磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps in the methods of the above-mentioned embodiments can be completed by instructing related hardware through a program, and the corresponding program can be stored in a computer-readable storage medium. Media, such as ROM/RAM, magnetic disk or optical disk, etc.

实施例二Embodiment two

图3示出了本发明实施例二提供的移动终端的具体结构框图,为了便于说明,仅示出了与本发明实施例相关的部分。该移动终端3包括:连接建立单元31、指令发送单元32、状态信息接收单元33、状态信息存储单元34、状态信息读取单元35和状态信息显示单元36。FIG. 3 shows a specific structural block diagram of a mobile terminal provided by Embodiment 2 of the present invention. For convenience of description, only parts related to the embodiment of the present invention are shown. The mobile terminal 3 includes: a connection establishment unit 31 , an instruction sending unit 32 , a status information receiving unit 33 , a status information storage unit 34 , a status information reading unit 35 and a status information display unit 36 .

其中,连接建立单元31,用于与移动电源通过USB线建立连接;Wherein, the connection establishment unit 31 is used to establish a connection with the mobile power supply through a USB cable;

指令发送单元32,用于通过USB线的D+/D-发送获取状态信息的指令至移动电源;The instruction sending unit 32 is used to send an instruction to obtain status information to the mobile power supply through the D+/D- of the USB line;

状态信息接收单元33,用于通过USB线的D+/D-接收移动电源发送的状态信息;The state information receiving unit 33 is used to receive the state information sent by the mobile power supply through the D+/D- of the USB line;

状态信息存储单元34,用于将所述状态信息存储至预设的节点中;A state information storage unit 34, configured to store the state information into a preset node;

状态信息读取单元35,用于从所述节点中读取所述状态信息;A state information reading unit 35, configured to read the state information from the node;

状态信息显示单元36,用于显示所述状态信息。The state information display unit 36 is configured to display the state information.

具体的,所述状态信息包括移动电源的当前电量、当前温度、当前电压、当前电流中的任意一种。Specifically, the state information includes any one of the current battery capacity, current temperature, current voltage, and current current of the mobile power supply.

进一步地,所述移动终端3还包括:Further, the mobile terminal 3 also includes:

节点创建单元,用于在移动终端的预设目录下,为每一种类型的状态信息创建一个对应的节点,不同种类的状态信息存储至不同的节点中。The node creation unit is used to create a corresponding node for each type of state information in the preset directory of the mobile terminal, and store different types of state information in different nodes.

本发明实施例提供的移动终端可以应用在前述对应的方法实施例一中,详情参见上述实施例一的描述,在此不再赘述。The mobile terminal provided by the embodiment of the present invention can be applied in the foregoing first corresponding method embodiment. For details, refer to the description of the foregoing first embodiment, which will not be repeated here.

实施例三Embodiment three

图4示出了本发明实施例二提供的移动电源的具体结构框图,为了便于说明,仅示出了与本发明实施例相关的部分。该移动电源4包括:连接建立单元41、指令接收单元42、状态信息获取单元43和状态信息发送单元44。FIG. 4 shows a specific structural block diagram of the mobile power supply provided by Embodiment 2 of the present invention. For convenience of description, only the parts related to the embodiment of the present invention are shown. The mobile power supply 4 includes: a connection establishing unit 41 , an instruction receiving unit 42 , a status information acquiring unit 43 and a status information sending unit 44 .

其中,连接建立单元41,用于与移动终端通过USB线建立连接;Wherein, the connection establishment unit 41 is used to establish a connection with the mobile terminal through a USB cable;

指令接收单元42,用于通过USB线的D+/D-接收移动终端发送的获取状态信息的指令;The instruction receiving unit 42 is used to receive the instruction for acquiring state information sent by the mobile terminal through the D+/D- of the USB line;

状态信息获取单元43,用于根据所述指令获取移动电源的状态信息;A status information acquisition unit 43, configured to acquire status information of the mobile power supply according to the instruction;

状态信息发送单元44,用于通过USB线的D+/D-发送所述状态信息至移动终端。The state information sending unit 44 is configured to send the state information to the mobile terminal through D+/D- of the USB line.

具体的,所述状态信息包括移动电源的当前电量、当前温度、当前电压、当前电流中的任意一种。Specifically, the state information includes any one of the current battery capacity, current temperature, current voltage, and current current of the mobile power supply.

具体的,所述状态信息获取单元43包括:Specifically, the state information acquisition unit 43 includes:

ADC采样模块,用于通过ADC采样得到移动电源的当前温度、当前电压、当前电流;The ADC sampling module is used to obtain the current temperature, current voltage, and current current of the mobile power supply through ADC sampling;

开路电压计算模块,用于根据当前电压和当前电流计算开路电压;The open circuit voltage calculation module is used to calculate the open circuit voltage according to the current voltage and the current current;

电量计算模块,用于根据所述开路电压和所述当前温度查找温度、电量和开路电压之间的关系表得到移动电源的当前电量。The power calculation module is used to search the relationship table between temperature, power and open circuit voltage according to the open circuit voltage and the current temperature to obtain the current power of the mobile power supply.

本发明实施例提供的移动电源可以应用在前述对应的方法实施例一中,详情参见上述实施例一的描述,在此不再赘述。The mobile power supply provided by the embodiment of the present invention can be applied in the aforementioned first corresponding method embodiment. For details, refer to the description of the aforementioned first embodiment, which will not be repeated here.

值得注意的是,上述系统实施例中,所包括的各个单元只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,各功能单元的具体名称也只是为了便于相互区分,并不用于限制本发明的保护范围。It is worth noting that in the above system embodiments, the units included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit It is only for the convenience of distinguishing each other, and is not used to limit the protection scope of the present invention.

以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention should be included in the protection of the present invention. within range.

Claims (9)

1.一种显示移动电源的状态的方法,其特征在于,所述方法包括:1. A method for displaying the state of a mobile power supply, characterized in that the method comprises: 移动终端与移动电源通过USB线建立连接;The mobile terminal is connected to the mobile power supply through a USB cable; 移动终端通过USB线的D+/D-发送获取状态信息的指令至移动电源;The mobile terminal sends an instruction to obtain status information to the mobile power supply through the D+/D- of the USB cable; 移动电源根据所述指令获取移动电源的状态信息,并将所述状态信息通过USB线的D+/D-发送至移动终端;The mobile power supply obtains the state information of the mobile power supply according to the instruction, and sends the state information to the mobile terminal through the D+/D- of the USB line; 移动终端将所述状态信息存储至预设的节点中;The mobile terminal stores the state information in a preset node; 移动终端从所述节点中读取所述状态信息;The mobile terminal reads the status information from the node; 移动终端显示所述状态信息。The mobile terminal displays the status information. 2.如权利要求1所述的方法,其特征在于,所述状态信息包括移动电源的当前电量、当前温度、当前电压、当前电流中的任意一种。2 . The method according to claim 1 , wherein the status information includes any one of the current battery capacity, current temperature, current voltage, and current current of the mobile power supply. 3.如权利要求2所述的方法,其特征在于,在移动终端的预设目录下,移动终端为每一种类型的状态信息创建一个对应的节点,不同种类的状态信息存储至不同的节点中。3. The method according to claim 2, wherein, under the preset directory of the mobile terminal, the mobile terminal creates a corresponding node for each type of status information, and different types of status information are stored in different nodes middle. 4.一种移动终端,特征在于,所述移动终端包括:4. A mobile terminal, characterized in that the mobile terminal comprises: 连接建立单元,用于与移动电源通过USB线建立连接;The connection establishment unit is used to establish a connection with the mobile power supply through a USB cable; 指令发送单元,用于通过USB线的D+/D-发送获取状态信息的指令至移动电源;The command sending unit is used to send the command to obtain the status information to the mobile power supply through the D+/D- of the USB cable; 状态信息接收单元,用于通过USB线的D+/D-接收移动电源发送的状态信息;The state information receiving unit is used to receive the state information sent by the mobile power supply through the D+/D- of the USB line; 状态信息存储单元,用于将所述状态信息存储至预设的节点中;a state information storage unit, configured to store the state information in a preset node; 状态信息读取单元,用于从所述节点中读取所述状态信息;a state information reading unit, configured to read the state information from the node; 状态信息显示单元,用于显示所述状态信息。The status information display unit is used to display the status information. 5.如权利要求4所述的移动终端,其特征在于,所述状态信息包括移动电源的当前电量、当前温度、当前电压、当前电流中的任意一种。5 . The mobile terminal according to claim 4 , wherein the status information includes any one of the current power, current temperature, current voltage and current current of the mobile power supply. 6.如权利要求5所述的移动终端,其特征在于,所述移动终端还包括:6. The mobile terminal according to claim 5, further comprising: 节点创建单元,用于在移动终端的预设目录下,为每一种类型的状态信息创建一个对应的节点,不同种类的状态信息存储至不同的节点中。The node creation unit is used to create a corresponding node for each type of state information in the preset directory of the mobile terminal, and store different types of state information in different nodes. 7.一种移动电源,其特征在于,所述移动电源包括:7. A mobile power supply, characterized in that the mobile power supply comprises: 连接建立单元,用于与移动终端通过USB线建立连接;A connection establishment unit, configured to establish a connection with the mobile terminal via a USB cable; 指令接收单元,用于通过USB线的D+/D-接收移动终端发送的获取状态信息的指令;The instruction receiving unit is used to receive the instruction for acquiring state information sent by the mobile terminal through the D+/D- of the USB line; 状态信息获取单元,用于根据所述指令获取移动电源的状态信息;A status information acquisition unit, configured to acquire status information of the mobile power supply according to the instruction; 状态信息发送单元,用于通过USB线的D+/D-发送所述状态信息至移动终端。The state information sending unit is used to send the state information to the mobile terminal through the D+/D- of the USB line. 8.如权利要求7所述的移动电源,其特征在于,所述状态信息包括移动电源的当前电量、当前温度、当前电压、当前电流中的任意一种。8 . The mobile power supply according to claim 7 , wherein the status information includes any one of the current power, current temperature, current voltage and current current of the mobile power supply. 9.如权利要求8所述的移动电源,其特征在于,所述状态信息获取单元包括:9. The mobile power supply according to claim 8, wherein the state information acquisition unit comprises: ADC采样模块,用于通过ADC采样得到移动电源的当前温度、当前电压、当前电流;The ADC sampling module is used to obtain the current temperature, current voltage, and current current of the mobile power supply through ADC sampling; 开路电压计算模块,用于根据当前电压和当前电流计算开路电压;The open circuit voltage calculation module is used to calculate the open circuit voltage according to the current voltage and the current current; 电量计算模块,用于根据所述开路电压和所述当前温度查找温度、电量和开路电压之间的关系表得到移动电源的当前电量。The power calculation module is used to search the relationship table between temperature, power and open circuit voltage according to the open circuit voltage and the current temperature to obtain the current power of the mobile power supply.
CN201410443292.6A 2014-08-29 2014-08-29 A method for displaying the status of mobile power supply, mobile terminal and mobile power supply Pending CN104167801A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410443292.6A CN104167801A (en) 2014-08-29 2014-08-29 A method for displaying the status of mobile power supply, mobile terminal and mobile power supply

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410443292.6A CN104167801A (en) 2014-08-29 2014-08-29 A method for displaying the status of mobile power supply, mobile terminal and mobile power supply

Publications (1)

Publication Number Publication Date
CN104167801A true CN104167801A (en) 2014-11-26

Family

ID=51911506

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410443292.6A Pending CN104167801A (en) 2014-08-29 2014-08-29 A method for displaying the status of mobile power supply, mobile terminal and mobile power supply

Country Status (1)

Country Link
CN (1) CN104167801A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104600786A (en) * 2014-12-27 2015-05-06 小米科技有限责任公司 Mobile power and power information display method
CN105811543A (en) * 2016-05-27 2016-07-27 维沃移动通信有限公司 Electric quantity display method of mobile power source, mobile terminal and mobile power source
CN106410921A (en) * 2016-11-29 2017-02-15 珠海市魅族科技有限公司 Charge monitoring method and charging monitoring device
CN108988405A (en) * 2017-05-31 2018-12-11 维沃移动通信有限公司 A kind of charging method and mobile terminal
CN113036872A (en) * 2021-03-23 2021-06-25 张成君 Charging device capable of displaying electric quantity percentage

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20030052769A (en) * 2001-12-21 2003-06-27 엘지전자 주식회사 Apparatus and method for charge of using usb of mobile communication terminal
CN101153894A (en) * 2006-09-26 2008-04-02 鸿富锦精密工业(深圳)有限公司 Electricity quantity detecting method, electricity quantity detecting system and electronic equipment using the same method
CN101362427A (en) * 2008-09-09 2009-02-11 宁波拜特测控技术有限公司 Cell management system of electric automobile
JP2013080392A (en) * 2011-10-04 2013-05-02 Olympus Imaging Corp Usb charging for portable device
CN103106167A (en) * 2013-01-22 2013-05-15 矽力杰半导体技术(杭州)有限公司 Universal Serial Bus (USB) equipment and control method thereof
CN103178565A (en) * 2011-12-23 2013-06-26 比亚迪股份有限公司 Mobile power source and mobile terminal using same
CN103413986A (en) * 2013-08-27 2013-11-27 贝壳网际(北京)安全技术有限公司 Method and device for automatically stopping charging after full charge of mobile terminal
CN203536986U (en) * 2013-07-29 2014-04-09 深圳市恒盛利科技有限公司 Mobile power supply with replaceable charging battery cores

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20030052769A (en) * 2001-12-21 2003-06-27 엘지전자 주식회사 Apparatus and method for charge of using usb of mobile communication terminal
CN101153894A (en) * 2006-09-26 2008-04-02 鸿富锦精密工业(深圳)有限公司 Electricity quantity detecting method, electricity quantity detecting system and electronic equipment using the same method
CN101362427A (en) * 2008-09-09 2009-02-11 宁波拜特测控技术有限公司 Cell management system of electric automobile
JP2013080392A (en) * 2011-10-04 2013-05-02 Olympus Imaging Corp Usb charging for portable device
CN103178565A (en) * 2011-12-23 2013-06-26 比亚迪股份有限公司 Mobile power source and mobile terminal using same
CN103106167A (en) * 2013-01-22 2013-05-15 矽力杰半导体技术(杭州)有限公司 Universal Serial Bus (USB) equipment and control method thereof
CN203536986U (en) * 2013-07-29 2014-04-09 深圳市恒盛利科技有限公司 Mobile power supply with replaceable charging battery cores
CN103413986A (en) * 2013-08-27 2013-11-27 贝壳网际(北京)安全技术有限公司 Method and device for automatically stopping charging after full charge of mobile terminal

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104600786A (en) * 2014-12-27 2015-05-06 小米科技有限责任公司 Mobile power and power information display method
CN105811543A (en) * 2016-05-27 2016-07-27 维沃移动通信有限公司 Electric quantity display method of mobile power source, mobile terminal and mobile power source
CN106410921A (en) * 2016-11-29 2017-02-15 珠海市魅族科技有限公司 Charge monitoring method and charging monitoring device
CN108988405A (en) * 2017-05-31 2018-12-11 维沃移动通信有限公司 A kind of charging method and mobile terminal
CN113036872A (en) * 2021-03-23 2021-06-25 张成君 Charging device capable of displaying electric quantity percentage

Similar Documents

Publication Publication Date Title
US20210367434A1 (en) Method and apparatus for charging a battery
CN103744821B (en) Method and device for realizing USB OTG (Universal Serial Bus On-The-Go) function of mobile terminal
ES2730761T3 (en) Mobile terminal, power supply adapter and method of updating them
CN104167801A (en) A method for displaying the status of mobile power supply, mobile terminal and mobile power supply
CN105934865B (en) Method and device for controlling charging and electronic equipment
CN106571657B (en) Terminal, converter, and connection conversion system and method
US20150270733A1 (en) Device to device charging via usb type-c interfaces
CN110851387B (en) Interface function configuration method and electronic equipment
CN104135053A (en) Electric quantity sharing method and device
US20180062218A1 (en) Electronic device, control method therefor and non-transitory computer-readable storage medium
CN107453428B (en) A kind of method of automatic identification apple and Android device
CN106787011A (en) Charge remaining time display methods, device and terminal device
CN105068959A (en) A charging method and device for a terminal and a terminal with a data exchange function
CN104636296A (en) Serial communication over communication control pin
WO2018090174A1 (en) Charging method and related device
CN106207294A (en) A kind of charging method and device
CN107516919A (en) A charging method and charger
CN105652743B (en) The method and device of Interface Controller
CN108599530A (en) A power supply mode converter and a power supply mode conversion method
CN113241835B (en) Charging module, electronic equipment and charging control method
JP7444903B2 (en) Charging policy setting method and device
CN104035902B (en) A kind of method and communication system for accessing data
CN116315185B (en) Electronic device and battery management method
CN111293748A (en) Method and device for monitoring electric quantity data
CN104300628A (en) Portable power source displaying information of portable power source through intelligent device and method thereof

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20141126

RJ01 Rejection of invention patent application after publication