CN107589819B - Mobile terminal, current setting method thereof, and computer-readable storage medium - Google Patents
Mobile terminal, current setting method thereof, and computer-readable storage medium Download PDFInfo
- Publication number
- CN107589819B CN107589819B CN201710816730.2A CN201710816730A CN107589819B CN 107589819 B CN107589819 B CN 107589819B CN 201710816730 A CN201710816730 A CN 201710816730A CN 107589819 B CN107589819 B CN 107589819B
- Authority
- CN
- China
- Prior art keywords
- mobile terminal
- firmware
- current value
- value
- 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
Images
Landscapes
- Telephone Function (AREA)
- Charge And Discharge Circuits For Batteries Or The Like (AREA)
Abstract
Description
技术领域technical field
本发明涉及电子设备领域,特别是涉及一种移动终端及其电流设置方法、计算机可读存储介质。The present invention relates to the field of electronic equipment, and in particular, to a mobile terminal, a current setting method thereof, and a computer-readable storage medium.
背景技术Background technique
智能手机等移动终端日渐成为人们生活中的必需品,其功能也越来越多元化,移动终端通常在出厂前需要经过开发测试阶段。Mobile terminals such as smartphones are increasingly becoming necessities in people's lives, and their functions are becoming more and more diversified. Mobile terminals usually need to go through a development and testing stage before leaving the factory.
而目前在开发测试阶段,来自上位机的充电电流往往不足以完成固件下载,目前在开发测试的过程中为了规避这种方式带来的不便,都是在产线下载的模式中进行模拟电池在位的情形进行下载。由于开发的过程中必须通过模拟电池在位且需要外加程控电源进行供电才能成功下载,给开发调试工作带来了很大的不便。At present, in the development and testing stage, the charging current from the host computer is often not enough to complete the firmware download. At present, in the process of development and testing, in order to avoid the inconvenience caused by this method, the battery is simulated in the production line download mode. bit situation to download. In the process of development, it is necessary to simulate the battery in place and need an external program-controlled power supply to supply power to successfully download, which brings great inconvenience to the development and debugging work.
发明内容SUMMARY OF THE INVENTION
本发明实施例提供一种移动终端及其电流设置方法、计算机可读存储介质,能够保证移动终端在开发测试阶段烧录固件的顺利进行。The embodiments of the present invention provide a mobile terminal, a current setting method thereof, and a computer-readable storage medium, which can ensure the smooth progress of firmware programming of the mobile terminal in the development and testing stage.
本发明实施例采用的一个技术方案是:提供一种移动终端的电流设置方法,该方法包括:在连接上位机后判断移动终端是否已经下载固件成功;若移动终端未成功下载固件,则将上位机提供给移动终端的充电电流设置为第一电流值;若移动终端已经成功下载固件,则根据预设判断策略将上位机提供给移动终端的充电电流设置为第一电流值或者第二电流值;第一电流值大于第二电流值。A technical solution adopted in the embodiment of the present invention is to provide a current setting method for a mobile terminal, the method comprising: after connecting to a host computer, judging whether the mobile terminal has successfully downloaded firmware; if the mobile terminal fails to download the firmware successfully, the host computer The charging current provided by the host computer to the mobile terminal is set to the first current value; if the mobile terminal has successfully downloaded the firmware, the charging current provided by the host computer to the mobile terminal is set to the first current value or the second current value according to the preset judgment strategy ; The first current value is greater than the second current value.
本发明实施例采用的另一个技术方案是:提供一种移动终端,该移动终端包括:判断模块,用于在移动终端连接上位机后判断移动终端是否已经下载固件成功;设置模块,用于在移动终端未成功下载固件时将上位机提供给移动终端的充电电流设置为第一电流值,且用于在移动终端已经成功下载固件时根据预设判断策略将上位机提供给移动终端的充电电流设置为第一电流值或者第二电流值;其中,第一电流值大于第二电流值。Another technical solution adopted in the embodiment of the present invention is to provide a mobile terminal, the mobile terminal includes: a judgment module for judging whether the mobile terminal has successfully downloaded firmware after the mobile terminal is connected to a host computer; a setting module for When the mobile terminal fails to download the firmware, the charging current provided by the host computer to the mobile terminal is set as the first current value, and is used to provide the charging current to the mobile terminal from the host computer according to the preset judgment strategy when the mobile terminal has successfully downloaded the firmware Set to the first current value or the second current value; wherein, the first current value is greater than the second current value.
本发明实施例采用的又一个技术方案是:提供一种移动终端,该移动终端包括处理器和与处理器连接的存储器,存储器用于存储计算机程序,处理器用于调用计算机程序以执行上述方法。Another technical solution adopted by the embodiments of the present invention is to provide a mobile terminal, the mobile terminal includes a processor and a memory connected to the processor, the memory is used for storing a computer program, and the processor is used for calling the computer program to execute the above method.
本发明实施例采用的又一个技术方案是:提供一种计算机可读存储介质,该可读存储介质存储有计算机程序,计算机程序能够被执行以实现上述方法。Another technical solution adopted by the embodiments of the present invention is to provide a computer-readable storage medium, where a computer program is stored in the readable storage medium, and the computer program can be executed to implement the above method.
本发明的有益效果是:本发明实施例通过在连接上位机后判断移动终端是否已经下载固件成功;若移动终端未成功下载固件,则将上位机提供给移动终端的充电电流设置为第一电流值;若移动终端已经成功下载固件,则根据预设判断策略将上位机提供给移动终端的充电电流设置为第一电流值或者第二电流值;第一电流值大于第二电流值,能够保证移动终端在开发测试阶段烧录固件的顺利进行。The beneficial effects of the present invention are: the embodiment of the present invention determines whether the mobile terminal has successfully downloaded the firmware after being connected to the host computer; if the mobile terminal fails to download the firmware successfully, the charging current provided by the host computer to the mobile terminal is set to the first current If the mobile terminal has successfully downloaded the firmware, the charging current provided by the host computer to the mobile terminal is set to the first current value or the second current value according to the preset judgment strategy; the first current value is greater than the second current value, which can ensure The firmware programming of the mobile terminal in the development and testing stage was carried out smoothly.
附图说明Description of drawings
图1是本发明移动终端的电流设置方法的第一实施例的流程示意图;1 is a schematic flowchart of a first embodiment of a current setting method for a mobile terminal of the present invention;
图2是本发明移动终端的电流设置方法的第二实施例的流程示意图;2 is a schematic flowchart of a second embodiment of a current setting method for a mobile terminal of the present invention;
图3是本发明移动终端的电流设置方法的第三实施例的流程示意图;3 is a schematic flowchart of a third embodiment of a current setting method for a mobile terminal of the present invention;
图4是本发明移动终端的电流设置方法的第四实施例的流程示意图;4 is a schematic flowchart of a fourth embodiment of a current setting method for a mobile terminal of the present invention;
图5是本发明实施例移动终端的模块示意图;5 is a schematic diagram of a module of a mobile terminal according to an embodiment of the present invention;
图6是本发明移动终端第二实施例的硬件结构示意图;6 is a schematic diagram of the hardware structure of the second embodiment of the mobile terminal of the present invention;
图7是本发明移动终端第二实施例的硬件结构示意图。FIG. 7 is a schematic diagram of a hardware structure of a second embodiment of a mobile terminal of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。可以理解的是,此处所描述的具体实施例仅用于解释本发明,而非对本发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本发明相关的部分而非全部结构。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention. In addition, it should be noted that, for the convenience of description, the drawings only show some but not all structures related to the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
本发明中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second" and the like in the present invention are used to distinguish different objects, rather than to describe a specific order. Furthermore, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes unlisted steps or units, or optionally also includes For other steps or units inherent to these processes, methods, products or devices.
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本发明的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference herein to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor a separate or alternative embodiment that is mutually exclusive of other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
智能手机等移动终端的电源管理芯片中可以集成电池在位检测功能,在移动终端连接充电设备后,检测到电池在位时,电源管理芯片控制充电设备为移动终端的充电电流为第一电流值,在检测到电池不在位时,电源管理芯片控制充电设备为移动终端的充电电流为第二电流值,其中,第一电流值大于第二电流值。The power management chip of a mobile terminal such as a smart phone can integrate the battery presence detection function. After the mobile terminal is connected to the charging device and detects that the battery is in place, the power management chip controls the charging device to charge the mobile terminal to the first current value. , when it is detected that the battery is not in place, the power management chip controls the charging current of the charging device for the mobile terminal to be a second current value, where the first current value is greater than the second current value.
其中,移动终端包括终端主体和电池,电池在位是指电池与终端主体连接,电池不在为是指电池不与终端主体连接。Wherein, the mobile terminal includes a terminal body and a battery, the presence of the battery means that the battery is connected to the body of the terminal, and the absence of the battery means that the battery is not connected to the body of the terminal.
通过上述方式,可以保证电池不在位时充电设备以较小的电流对进行移动终端进行充电,电池在位时,以较大的电流对移动终端进行充电,进而能够保证用户使用移动终端时的安全性。Through the above method, it can be ensured that the charging device charges the mobile terminal with a small current when the battery is not in place, and charges the mobile terminal with a relatively large current when the battery is in place, thereby ensuring the safety of the user when using the mobile terminal. sex.
在移动终端的开发测试阶段,例如对移动终端的主板的进行测试时,其电池无法与终端主体进行连接,也就是说,电池通常是处于不在位的状态,然而主板上的电源管理芯片依然会对电池是否在位进行检测,那么电源管理芯片在此开发测试阶段会检测到电池不在位,在主板连接上位机进行固件下载时,会将上位机为主板供电的充电电流设置为第二电流值,而该相对较小的第二电流值不足以供主板完成从上位机的固件下载,通常导致下载失败,给开发测试工作带来了很大的不便。In the development and testing stage of the mobile terminal, for example, when testing the mainboard of the mobile terminal, the battery of the mobile terminal cannot be connected to the main body of the terminal, that is to say, the battery is usually not in place, but the power management chip on the mainboard will still Detect whether the battery is in place, then the power management chip will detect that the battery is not in place at this stage of development and testing. When the motherboard is connected to the host computer for firmware download, the charging current that the host computer supplies to the motherboard will be set to the second current value. , and the relatively small second current value is not enough for the motherboard to complete the firmware download from the host computer, which usually leads to a download failure, which brings great inconvenience to the development and testing work.
本发明实施例通过在连接上位机后判断移动终端是否已经下载固件成功;在移动终端未成功下载固件时将上位机提供给移动终端的充电电流设置为第一电流值,能够保证移动终端在开发测试阶段烧录固件的顺利进行。The embodiment of the present invention determines whether the mobile terminal has successfully downloaded the firmware after being connected to the host computer; when the mobile terminal fails to download the firmware successfully, the charging current provided by the host computer to the mobile terminal is set to the first current value, which can ensure that the mobile terminal is developing During the test phase, the firmware burning went smoothly.
本发明实施例通过在移动终端未成功下载固件时根据预设判断策略将上位机提供给移动终端的充电电流设置为第一电流值或者第二电流值,能够保证移动终端使用的安全性。The embodiment of the present invention can ensure the safety of the mobile terminal by setting the charging current provided by the host computer to the mobile terminal to the first current value or the second current value according to a preset judgment strategy when the mobile terminal fails to download firmware successfully.
具体参见下文各实施例中的详细说明。For details, please refer to the detailed descriptions in the following embodiments.
请参阅图1,图1是本发明移动终端的电流设置方法第一实施例的流程示意图。在本实施例中,移动终端的电流设置方法可以包括以下步骤:Please refer to FIG. 1. FIG. 1 is a schematic flowchart of a first embodiment of a current setting method for a mobile terminal according to the present invention. In this embodiment, the current setting method of the mobile terminal may include the following steps:
步骤11:连接上位机。Step 11: Connect to the host computer.
在步骤11中,上位机可以为PC(personal computer,个人电脑)端。移动终端的主板与上位机建立供电连接和通信连接。具体可以通过USB(Universal Serial Bus,通用串行总线)接口进行连接。连接上位机之后可以为电源管理芯片进行硬件上电和软件初始化。In step 11, the host computer may be a PC (personal computer, personal computer) end. The main board of the mobile terminal establishes a power supply connection and a communication connection with the upper computer. Specifically, the connection may be performed through a USB (Universal Serial Bus, Universal Serial Bus) interface. After connecting to the host computer, hardware power-on and software initialization can be performed for the power management chip.
连接时,一方面PC端可以通过USB接口的VBUS引脚为移动终端的主板供电,另一方面,PC端可以在后续的下载过程中通过USB接口的数据线正极引脚D+和数据线负极引脚D-与主板进行通信。When connecting, on the one hand, the PC side can supply power to the main board of the mobile terminal through the VBUS pin of the USB interface; Pin D - to communicate with the motherboard.
步骤12:判断移动终端是否已经下载固件成功。Step 12: Determine whether the mobile terminal has successfully downloaded the firmware.
在步骤12中,承前所述,移动终端与上位机建立连接并触发执行判断移动终端是否已经下载固件成功的步骤。In
判断移动终端是否已经下载固件成功可以为:读取移动终端的寄存器中的标志位的状态值;若状态值为第一状态值,则移动终端已经成功下载固件;若状态值为第二状态值,则移动终端未成功下载固件。Determining whether the mobile terminal has successfully downloaded the firmware may be: reading the state value of the flag bit in the register of the mobile terminal; if the state value is the first state value, the mobile terminal has successfully downloaded the firmware; if the state value is the second state value , the mobile terminal fails to download the firmware.
判断移动终端是否已经下载固件成功还可以为:判断移动终端的存储器的已使用的存储量是否等于预设存储量;若移动终端的存储器的已使用的存储量等于预设存储量,则移动终端已经成功下载固件;若移动终端的存储器的已使用的存储量小于预设存储量,则移动终端未成功下载固件。Determining whether the mobile terminal has successfully downloaded the firmware may also be: judging whether the used storage capacity of the memory of the mobile terminal is equal to the preset storage capacity; if the used storage capacity of the memory of the mobile terminal is equal to the preset storage capacity, then the mobile terminal The firmware has been successfully downloaded; if the used storage amount of the memory of the mobile terminal is less than the preset storage amount, the mobile terminal has not successfully downloaded the firmware.
判断移动终端是否已经下载固件成功还可以为:判断移动终端的存储器中存储的数据的哈希值是否与预设的哈希值相等;若移动终端的存储器中存储的数据的哈希值与预设的哈希值相等,则移动终端已经成功下载固件;若移动终端的存储器中存储的数据的哈希值与预设的哈希值不相等,则移动终端未成功下载固件。Judging whether the mobile terminal has successfully downloaded the firmware can also be: judging whether the hash value of the data stored in the memory of the mobile terminal is equal to the preset hash value; if the hash value of the data stored in the memory of the mobile terminal is equal to the preset hash value; If the set hash values are equal, the mobile terminal has successfully downloaded the firmware; if the hash value of the data stored in the memory of the mobile terminal is not equal to the preset hash value, the mobile terminal has not successfully downloaded the firmware.
具体请参见下文的描述。For details, please refer to the description below.
应理解,上述判断的方法可以相互结合来判断移动终端是否已经下载固件成功,例如,在判断到存储器的存储量和预设存储量相等且存储器存储的数据的哈希值和预设的哈希值相等时,才产生移动终端已经成功下载固件的判断结果。It should be understood that the above-mentioned judgment methods can be combined with each other to judge whether the mobile terminal has successfully downloaded the firmware. When the values are equal, a judgment result that the mobile terminal has successfully downloaded the firmware is generated.
在步骤12中,若移动终端未成功下载固件,则执行步骤13:将上位机提供给移动终端的充电电流设置为第一电流值。In
在步骤13中,可选地,将上位机提供给移动终端的充电电流设置为第一电流值具体可以为:判断移动终端的电池是否在位,在判断到电池在位或者不在位时,均将该充电电流设置为第一电流值。In
可选地,判断电池是否在位可以包括:判断移动终端的电源管理芯片的电池状态位引脚的状态值;若状态值为第三状态值则电池在位;若状态值为第四状态值则电池不在位。Optionally, judging whether the battery is in place may include: judging the state value of the battery status bit pin of the power management chip of the mobile terminal; if the state value is the third state value, the battery is in place; if the state value is the fourth state value The battery is not in place.
例如,电源管理芯片的状态位检测引脚连接有下拉电阻,即该状态位检测引脚通过该下拉电阻接地。For example, the status bit detection pin of the power management chip is connected with a pull-down resistor, that is, the status bit detection pin is grounded through the pull-down resistor.
当电池在位时,电池的状态位引脚与该状态位检测引脚连接,此时状态位检测引脚的状态值被拉低至低电平,即若检测到状态值为低电平表明电池在位。When the battery is in place, the status bit pin of the battery is connected to the status bit detection pin. At this time, the status value of the status bit detection pin is pulled down to a low level, that is, if the detected status value is a low level, it indicates The battery is in place.
当电池不在位时,电池的状态位引脚悬空,此时状态位检测引脚的状态值为高电平,即若检测到状态值为高电平表明电池不在位。When the battery is not in place, the status bit pin of the battery is floating, and the status value of the status bit detection pin is high at this time, that is, if the detected state value is high, it means that the battery is not in position.
以上仅为一种示例,在其他实施例中,可以通过改变硬件电路的设计,从而在检测到低电平时表明电池不在位,高电平时表明电池在位。The above is just an example. In other embodiments, the design of the hardware circuit can be changed to indicate that the battery is not present when a low level is detected, and that the battery is present when a high level is detected.
承前所述,在判断到移动终端未成功下载固件时,无论该电源管理芯片的状态位检测引脚检测到高电平或者低电平,均将上位机提供给移动终端的充电电流设置为第一电流值。在步骤12中,若移动终端已经成功下载固件,则执行步骤14:根据预设判断策略将上位机提供给移动终端的充电电流设置为第一电流值或者第二电流值,其中,第一电流值大于第二电流值。As mentioned above, when it is judged that the mobile terminal has not successfully downloaded the firmware, regardless of whether the status bit detection pin of the power management chip detects a high level or a low level, the charging current provided by the host computer to the mobile terminal is set to the first level. a current value. In
在步骤14中,根据预设判断策略将上位机提供给移动终端的充电电流设置为第一电流值或者第二电流值具体可以为:判断移动终端的电池是否在位;在判断到电池在位时,将充电电流设置为第一电流值;在判断到电池不在位时,将充电电流设置为第二电流值。In
承前所述,在判断到移动终端成功下载固件时,采用预设判断策略,即,在电源管理芯片的状态位检测引脚检测到低电平(电池在位)时,将上位机为移动终端的充电电流设置为第一电流值,在电源管理芯片的状态位检测引脚检测到高电平(电池不在位)时,将上位机为移动终端的充电电流设置为第二电流值。As mentioned above, when it is judged that the mobile terminal has successfully downloaded the firmware, a preset judgment strategy is adopted, that is, when the state bit detection pin of the power management chip detects a low level (the battery is in place), the host computer is set as the mobile terminal. The charging current of the mobile terminal is set to the first current value. When the status bit detection pin of the power management chip detects a high level (the battery is not in position), the charging current of the host computer for the mobile terminal is set to the second current value.
请参阅图2,图2是本发明移动终端的电流设置方法的第二实施例的流程示意图。Please refer to FIG. 2 , which is a schematic flowchart of a second embodiment of a current setting method for a mobile terminal according to the present invention.
在本实施例中,判断移动终端是否已经下载固件成功可以为:读取移动终端的寄存器中的标志位的状态值;若状态值为第一状态值,则移动终端已经成功下载固件;若状态值为第二状态值,则移动终端未成功下载固件。In this embodiment, judging whether the mobile terminal has successfully downloaded the firmware may be: reading the state value of the flag bit in the register of the mobile terminal; if the state value is the first state value, the mobile terminal has successfully downloaded the firmware; if the state value is the first state value, the mobile terminal has successfully downloaded the firmware; If the value is the second state value, the mobile terminal fails to download the firmware successfully.
在本实施例中,在若移动终端未成功下载固件,则将上位机提供给移动终端的充电电流设置为第一电流值的步骤之后还可以包括:触发移动终端从上位机下载固件;在下载成功后将移动终端的寄存器中的标志位从第二状态值置换为第一状态值In this embodiment, if the mobile terminal fails to download the firmware, the step of setting the charging current provided by the host computer to the mobile terminal to the first current value may further include: triggering the mobile terminal to download the firmware from the host computer; After success, replace the flag bit in the register of the mobile terminal from the second state value to the first state value
在本实施例中,移动终端的电流设置方法可以包括以下步骤:In this embodiment, the current setting method of the mobile terminal may include the following steps:
步骤21:与上位机连接。Step 21: Connect with the host computer.
在步骤21中,上位机可以为PC(personal computer,个人电脑)端。移动终端的主板与上位机建立供电连接和通信连接。具体可以通过USB(Universal Serial Bus,通用串行总线)接口进行连接。连接上位机之后可以为电源管理芯片进行硬件上电和软件初始化。In
连接时,一方面PC端可以通过USB接口的VBUS引脚为移动终端的主板供电,另一方面,PC端可以在后续的下载过程中通过USB接口的数据线正极引脚D+和数据线负极引脚D-与主板进行通信。When connecting, on the one hand, the PC side can supply power to the main board of the mobile terminal through the VBUS pin of the USB interface; Pin D - to communicate with the motherboard.
步骤22:读取移动终端的寄存器中的标志位的状态值。Step 22: Read the state value of the flag bit in the register of the mobile terminal.
在步骤22中,读取移动终端的电源管理芯片中寄存器中的标志位的状态值。例如该状态值可以为第一状态值或者第二状态值,第一状态值可以为“1”,第二状态值可以为“0”。In
在步骤22中,若读取的状态值为第二状态值,则输出移动终端未成功下载固件的判断结果,即执行步骤23:将上位机提供给移动终端的充电电流设置为第一电流值。In
在步骤23中,如何将上位机提供给移动终端的充电电流设置为第一电流值,具体请参见上文实施例的描述,此处不再赘述。In step 23, how to set the charging current provided by the host computer to the mobile terminal to the first current value, please refer to the description of the above embodiment for details, and details are not repeated here.
步骤24:触发移动终端从上位机下载固件。Step 24: Trigger the mobile terminal to download firmware from the host computer.
在步骤24中,例如,先对固件下载相关的硬件进行上电和软件初始化。例如,USB通信功能初始化,存储器初始化和上电,DDR(Double Data Rate双倍速率同步动态随机存储器),即内存初始化和上电,从而使得下载过程中所需的USB通信功能,存储器的存储功能等初始化完成,从而移动终端通过USB通信将固件下载至存储器。In
步骤25:在下载成功后将移动终端的寄存器中的标志位从第二状态值置换为第一状态值。Step 25: Replace the flag bit in the register of the mobile terminal from the second state value to the first state value after the download is successful.
在步骤25中,可以在下载成功后将移动终端的寄存器中的标志位从0置为1。或者,在移动终端固件下载完成后,且移动终端的所有硬件均完成上电和初始化之后将标志位从0置为1。In
在步骤22中,若读取的状态值为第一状态值,则输出移动终端已成功下载固件的判断结果,即执行步骤26:根据预设判断策略将上位机提供给移动终端的充电电流设置为第一电流值或者第二电流值,其中,第一电流值大于第二电流值。In
在步骤26中,具体如何根据预设判断策略将上位机提供给移动终端的充电电流设置为第一电流值或者第二电流值可以参见上文实施例的描述,此处不再赘述。In
请参阅图3,图3是本发明移动终端的电流设置方法的第三实施例的流程示意图。Please refer to FIG. 3 , which is a schematic flowchart of a third embodiment of a current setting method for a mobile terminal according to the present invention.
在本实施例中,判断移动终端是否已经下载固件成功可以为:判断移动终端的存储器的已使用的存储量是否等于预设存储量。若移动终端的存储器的已使用的存储量等于预设存储量,则移动终端已经成功下载固件;若移动终端的存储器的已使用的存储量不等于预设存储量,则移动终端未成功下载固件。In this embodiment, judging whether the mobile terminal has successfully downloaded the firmware may be: judging whether the used storage amount of the memory of the mobile terminal is equal to the preset storage amount. If the used memory of the mobile terminal's memory is equal to the preset memory, the mobile terminal has successfully downloaded the firmware; if the used memory of the mobile terminal's memory is not equal to the preset memory, the mobile terminal has not successfully downloaded the firmware .
在本实施例中,移动终端的电流设置方法可以包括以下步骤:In this embodiment, the current setting method of the mobile terminal may include the following steps:
步骤31:与上位机连接。Step 31: Connect with the host computer.
在步骤31中,上位机可以为PC(personal computer,个人电脑)端。移动终端的主板与上位机建立供电连接和通信连接。具体可以通过USB(Universal Serial Bus,通用串行总线)接口进行连接。连接上位机之后可以为电源管理芯片和存储器进行硬件上电和软件初始化。In
连接时,一方面PC端可以通过USB接口的VBUS引脚为移动终端的主板供电,另一方面,PC端可以在后续的下载过程中通过USB接口的数据线正极引脚D+和数据线负极引脚D-与主板进行通信。When connecting, on the one hand, the PC side can supply power to the main board of the mobile terminal through the VBUS pin of the USB interface; Pin D - to communicate with the motherboard.
步骤32:判断移动终端的存储器的已使用的存储量是否等于预设存储量。Step 32: Determine whether the used storage amount of the memory of the mobile terminal is equal to the preset storage amount.
在步骤32中,读取移动终端的存储器的已使用的存储量,判断该已使用的存储量是否等于预设存储量,预设的存储量为固件需占用的存储量,若相等这说明固件已经成功写入存储器,若不相等则说明固件未写入成功,或者写入的数据不是移动终端的固件。例如,移动终端的固件的大小为1.85Mb,那么将预先将该预设存储量设置为1.85Mb,然后在移动终端与上位机建立连接之后判断存储器的已使用存储量是否等于1.85Mb。In
在步骤32中,若移动终端的存储器的已使用的存储量不等于预设存储量,则输出移动终端未成功下载固件的判断结果,即执行步骤33:将上位机提供给移动终端的充电电流设置为第一电流值。In
在步骤33中,如何将上位机提供给移动终端的充电电流设置为第一电流值,具体请参见上文实施例的描述,此处不再赘述。In
步骤34:触发移动终端从上位机下载固件。Step 34: Trigger the mobile terminal to download firmware from the host computer.
在步骤34中,例如,先对固件下载相关的硬件进行上电和软件初始化。例如,USB通信功能初始化,存储器初始化和上电,DDR(Double Data Rate双倍速率同步动态随机存储器),即内存初始化和上电,从而使得下载过程中所需的USB通信功能,存储器的存储功能等初始化完成,从而移动终端通过USB通信将固件下载至存储器。In
在步骤32中,若移动终端的存储器的已使用的存储量等于预设存储量,则输出移动终端已经成功下载固件的判断结果,即执行步骤35:根据预设判断策略将上位机提供给移动终端的充电电流设置为第一电流值或者第二电流值,其中,第一电流值大于第二电流值。In
在步骤35中,具体如何根据预设判断策略将上位机提供给移动终端的充电电流设置为第一电流值或者第二电流值可以参见上文实施例的描述,此处不再赘述。In
请参阅图4,图4是本发明移动终端的电流设置方法的第四实施例的流程示意图。Please refer to FIG. 4 , which is a schematic flowchart of a fourth embodiment of a current setting method for a mobile terminal according to the present invention.
在本实施例中,判断移动终端是否已经下载固件成功可以为:判断移动终端的存储器中存储的数据的哈希值是否与预设的哈希值相等;若移动终端的存储器中存储的数据的哈希值与预设的哈希值相等,则移动终端已经成功下载固件;若移动终端的存储器中存储的数据的哈希值与预设的哈希值不相等,则移动终端未成功下载固件。In this embodiment, judging whether the mobile terminal has successfully downloaded the firmware may be: judging whether the hash value of the data stored in the memory of the mobile terminal is equal to the preset hash value; If the hash value is equal to the preset hash value, the mobile terminal has successfully downloaded the firmware; if the hash value of the data stored in the memory of the mobile terminal is not equal to the preset hash value, the mobile terminal has not successfully downloaded the firmware .
在本实施例中,移动终端的电流设置方法可以包括以下步骤:In this embodiment, the current setting method of the mobile terminal may include the following steps:
步骤41:与上位机连接。Step 41: Connect with the host computer.
在步骤41中,上位机可以为PC(personal computer,个人电脑)端。移动终端的主板与上位机建立供电连接和通信连接。具体可以通过USB(Universal Serial Bus,通用串行总线)接口进行连接。连接上位机之后可以为电源管理芯片和存储器进行硬件上电和软件初始化。In
连接时,一方面PC端可以通过USB接口的VBUS引脚为移动终端的主板供电,另一方面,PC端可以在后续的下载过程中通过USB接口的数据线正极引脚D+和数据线负极引脚D-与主板进行通信。When connecting, on the one hand, the PC side can supply power to the main board of the mobile terminal through the VBUS pin of the USB interface; Pin D - to communicate with the motherboard.
步骤42:判断移动终端的存储器中存储的数据的哈希值是否与预设的哈希值相等。Step 42: Determine whether the hash value of the data stored in the memory of the mobile terminal is equal to the preset hash value.
在步骤42中,哈希值是一段数据唯一且极其紧凑的数值表示形式。相同的数据具有相同的哈希值,不同的数据具有不同的哈希值。例如,移动终端需要烧录的固件哈希值是In
“E8C636D0C0486378BF61E6A3000D0FB7”"E8C636D0C0486378BF61E6A3000D0FB7"
那么可以将预设的哈希值设置为该值。在移动终端与上位机建立连接之后判断存储器中存储的数据的哈希值是否与该值相等,若相等则表明存储器已经成功的烧录了固件,反之,则未烧录成功。Then the preset hash value can be set to this value. After the mobile terminal establishes a connection with the host computer, it is determined whether the hash value of the data stored in the memory is equal to the value. If it is equal, it means that the memory has successfully burned the firmware, otherwise, it has not been successfully burned.
在步骤42中,若移动终端的存储器中存储的数据的哈希值与预设的哈希值不相等,则输出移动终端未成功下载固件的判断结果,即执行步骤43:将上位机提供给移动终端的充电电流设置为第一电流值。In
在步骤43中,如何根据预设判断策略将上位机提供给移动终端的充电电流设置为第一电流值,具体请参见上文实施例的描述,此处不再赘述。In
步骤44:触发移动终端从上位机下载固件。Step 44: Trigger the mobile terminal to download firmware from the host computer.
在步骤44中,例如,先对固件下载相关的硬件进行上电和软件初始化。例如,USB通信功能初始化,存储器初始化和上电,DDR(Double Data Rate双倍速率同步动态随机存储器),即内存初始化和上电,从而使得下载过程中所需的USB通信功能,存储器的存储功能等初始化完成,从而移动终端通过USB通信将固件下载至存储器。In
在步骤42中,若移动终端的存储器中存储的数据的哈希值与预设的哈希值相等,则输出移动终端已经成功下载固件的判断结果,即执行步骤45:根据预设判断策略将上位机提供给移动终端的充电电流设置为第一电流值或者第二电流值,其中,第一电流值大于第二电流值。In
在步骤45中,具体如何根据预设判断策略将上位机提供给移动终端的充电电流设置为第一电流值或者第二电流值可以参见上文实施例的描述,此处不再赘述。In
可选地,在上述任意一实施例中,第一电流值的可以为500mA,第二电流值可以为100mA。Optionally, in any of the foregoing embodiments, the first current value may be 500 mA, and the second current value may be 100 mA.
请参阅图5,图5是本发明移动终端的模块示意图。在本实施例中,移动终端50可以包括以下模块:Please refer to FIG. 5 , which is a schematic diagram of a module of the mobile terminal of the present invention. In this embodiment, the
判断模块51,用于在移动终端50连接上位机后判断移动终端50是否已经下载固件成功。The
设置模块52,用于在移动终端50未成功下载固件时将与上位机提供给移动终端的充电电流设置为第一电流值,且用于在移动终端50已经成功下载固件时根据预设判断策略将上位机提供给移动终端的充电电流设置为第一电流值或者第二电流值;其中,第一电流值大于第二电流值.The
上述各个模块执行的步骤的具体说明可以参见上文任意一方法实施例中的相关描述,此处不再赘述。For the specific description of the steps performed by each of the foregoing modules, reference may be made to the relevant description in any one of the above method embodiments, and details are not repeated here.
请参阅图6,图6是本发明移动终端第一实施例的硬件结构示意图。在本实施例中,移动终端60可以包括处理器61和与处理器61连接的存储器62。Please refer to FIG. 6. FIG. 6 is a schematic diagram of a hardware structure of a mobile terminal according to a first embodiment of the present invention. In this embodiment, the
存储器62可用于存储计算机程序,处理器61可用于调用计算机程序以执行上述任意一实施例的方法。The
处理器61具体可以是前文所述的电源管理芯片。在其他实施例中,也可以是其他的处理器,本发明实施例对此不做限定。The
请参阅图7,图7是本发明移动终端第二实施例的硬件结构示意图。在本实施例中,该移动终端900包括RF电路910、存储器920、输入单元930、显示单元940、传感器950、音频电路960、wifi模块970、处理器980以及电源990等。其中,RF电路910、存储器920、输入单元930、显示单元940、传感器950、音频电路960以及wifi模块970分别与处理器980连接;电源990用于为整个移动终端900提供电能。Please refer to FIG. 7 . FIG. 7 is a schematic diagram of a hardware structure of a mobile terminal according to a second embodiment of the present invention. In this embodiment, the
具体而言,RF电路910用于收发信号;存储器920用于存储数据指令信息;输入单元930用于输入信息,具体可以包括触控面板931以及操作按键等其他输入设备932;显示单元940则可以包括显示面板941等;传感器950包括光传感器、距离传感器、温度传感器、红外传感器、激光传感器等,用于检测用户接近信号、距离信号、移动终端900的温度等;扬声器961以及传声器(或者麦克风)962通过音频电路960与处理器980连接,用于接发声音信号;wifi模块970则用于接收和发射wifi信号。Specifically, the
处理器980还用于在移动终端900连接上位机后判断移动终端900是否已经下载固件成功。The
处理器980还用于在移动终端900未成功下载固件时将上位机提供给移动终端的充电电流设置为第一电流值,且用于在移动终端900已经成功下载固件时根据预设判断策略将上位机提供给移动终端的充电电流设置为第一电流值或者第二电流值;其中,第一电流值大于第二电流值.The
上述各个器件执行的具体内容可以参见上文任意一实施例中的描述,此处不再赘述。For the specific content executed by each of the foregoing devices, reference may be made to the description in any of the foregoing embodiments, and details are not repeated here.
在本发明所提供的几个实施方式中,应该理解到,所揭露的方法以及设备,可以通过其它的方式实现。例如,以上所描述的设备实施方式仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。In the several embodiments provided by the present invention, it should be understood that the disclosed method and device may be implemented in other manners. For example, the device implementations described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other divisions. For example, multiple units or components may be Incorporation may either be integrated into another system, or some features may be omitted, or not implemented.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施方式方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this implementation manner.
另外,在本发明各个实施方式中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
本发明实施例还提供一种计算机可读存储介质,该计算机可读存储介质用于存储计算机程序,该计算机程序能够被处理器执行以实现上述实施例中提供的方法。可以理解的,在本实施例中的可读存储介质存储的计算机程序,所用来执行的方法与上述实施例提供的方法类似,其原理和步骤相同,这里不再赘述。Embodiments of the present invention further provide a computer-readable storage medium, where the computer-readable storage medium is used to store a computer program, and the computer program can be executed by a processor to implement the methods provided in the foregoing embodiments. It can be understood that the method used to execute the computer program stored in the readable storage medium in this embodiment is similar to the method provided in the foregoing embodiment, and the principles and steps are the same, and are not repeated here.
其中,该存储介质可以为U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。Wherein, the storage medium can be various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk, or an optical disk. .
本发明上述任意一实施中的移动终端可以为智能手机、可穿戴式智能设备、平板电脑、掌上电脑、数字PDA或者其他移动终端。The mobile terminal in any of the above implementations of the present invention may be a smart phone, a wearable smart device, a tablet computer, a palmtop computer, a digital PDA, or other mobile terminals.
本发明实施例通过在移动终端从上位机下载固件之前将上位机提供给移动终端的充电电流设置为第一电流值;在下载固件完成后根据预设判断策略将上位机提供给移动终端的充电电流设置为第一电流值或者第二电流值;其中,第一电流值大于第二电流值,能够保证移动终端在开发测试阶段烧录固件的顺利进行。In the embodiment of the present invention, the charging current provided by the host computer to the mobile terminal is set to the first current value before the mobile terminal downloads the firmware from the host computer; after the firmware is downloaded, the charging current provided by the host computer to the mobile terminal according to the preset judgment strategy The current is set to the first current value or the second current value; wherein, the first current value is greater than the second current value, which can ensure the smooth progress of firmware programming of the mobile terminal in the development and testing stage.
以上所述仅为本发明的实施方式,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above description is only an embodiment of the present invention, and is not intended to limit the scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the description and drawings of the present invention, or directly or indirectly applied to other related technologies Fields are similarly included in the scope of patent protection of the present invention.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710816730.2A CN107589819B (en) | 2017-09-11 | 2017-09-11 | Mobile terminal, current setting method thereof, and computer-readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710816730.2A CN107589819B (en) | 2017-09-11 | 2017-09-11 | Mobile terminal, current setting method thereof, and computer-readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107589819A CN107589819A (en) | 2018-01-16 |
CN107589819B true CN107589819B (en) | 2020-03-10 |
Family
ID=61051531
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710816730.2A Active CN107589819B (en) | 2017-09-11 | 2017-09-11 | Mobile terminal, current setting method thereof, and computer-readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107589819B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103545882A (en) * | 2013-10-11 | 2014-01-29 | 华为技术有限公司 | Battery in-situ test method and device and battery charge system |
CN104167789A (en) * | 2014-08-12 | 2014-11-26 | Tcl通讯(宁波)有限公司 | Method and system for setting charging current in USB data transmission of mobile terminal |
CN104810890A (en) * | 2015-04-30 | 2015-07-29 | 努比亚技术有限公司 | Charging control method and device |
CN105281387A (en) * | 2014-07-17 | 2016-01-27 | 中兴通讯股份有限公司 | Charging method and device |
CN106991064A (en) * | 2017-03-22 | 2017-07-28 | 惠州Tcl移动通信有限公司 | A kind of automatic start brush machine method and system based on mobile terminal |
-
2017
- 2017-09-11 CN CN201710816730.2A patent/CN107589819B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103545882A (en) * | 2013-10-11 | 2014-01-29 | 华为技术有限公司 | Battery in-situ test method and device and battery charge system |
CN105281387A (en) * | 2014-07-17 | 2016-01-27 | 中兴通讯股份有限公司 | Charging method and device |
CN104167789A (en) * | 2014-08-12 | 2014-11-26 | Tcl通讯(宁波)有限公司 | Method and system for setting charging current in USB data transmission of mobile terminal |
CN104810890A (en) * | 2015-04-30 | 2015-07-29 | 努比亚技术有限公司 | Charging control method and device |
CN106991064A (en) * | 2017-03-22 | 2017-07-28 | 惠州Tcl移动通信有限公司 | A kind of automatic start brush machine method and system based on mobile terminal |
Also Published As
Publication number | Publication date |
---|---|
CN107589819A (en) | 2018-01-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI590041B (en) | Methods and apparatuses to wake computer systems from sleep states | |
US11340676B2 (en) | Method of identifying external electronic device based on power information and electronic device and storage medium for supporting same | |
CN108920397B (en) | Device identification method and device, storage medium and electronic device | |
JP5864785B2 (en) | Computer device and method for switching work mode of universal serial bus connector | |
CN106786960B (en) | Charging control method, device and terminal | |
CN108681514B (en) | Device detection method and device, storage medium and electronic device | |
CN108268389A (en) | The insertion detection method and mobile terminal of a kind of equipment | |
US20200150976A1 (en) | Electronic device and method for transceiving control signal | |
US11269588B2 (en) | Electronic device for outputting audio through USB port and method thereof | |
CN106292989A (en) | A kind of information processing method and electronic equipment | |
US11086538B2 (en) | Method and electronic device for initializing storage | |
CN105183673B (en) | The method and device of external storage hot plug is supported in recovery mode | |
CN108664430B (en) | Equipment identification method and device, storage medium and electronic equipment | |
CN107608923A (en) | Test processing methods and related products | |
CN107589819B (en) | Mobile terminal, current setting method thereof, and computer-readable storage medium | |
CN107451067B (en) | Download test processing methods and related products | |
US8566575B2 (en) | Computer apparatus and method for charging portable electronic device using the computer apparatus | |
WO2020113469A1 (en) | Power on self test method, power on self test device and mobile terminal | |
CN107589820B (en) | Mobile terminal, current setting method thereof, and computer-readable storage medium | |
CN105354066A (en) | OTA (over the air) downloading method and device and intelligent terminal | |
CN107069844A (en) | Charging method, device and terminal | |
CN102411419B (en) | Computer device and charging method for portable electronic device | |
CN106292977B (en) | Adapter identification method and terminal | |
CN116865407B (en) | Charging method and terminal equipment | |
CN112701759B (en) | Control method of terminal equipment, storage medium and terminal equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Applicant after: OPPO Guangdong Mobile Communications Co., Ltd. Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Applicant before: Guangdong Opel Mobile Communications Co., Ltd. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |