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
- successfully
- 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
The invention discloses a current setting method of a mobile terminal, which comprises the following steps: after the mobile terminal is connected with the upper computer, whether the mobile terminal successfully downloads the firmware is judged; if the mobile terminal does not successfully download the firmware, setting the charging current provided by the upper computer to the mobile terminal as a first current value; if the mobile terminal has successfully downloaded the firmware, setting the charging current provided by the upper computer to the mobile terminal as a first current value or a second current value according to a preset judgment strategy; the first current value is larger than the second current value, and through the mode, the method and the device can ensure that the firmware burning of the mobile terminal is smoothly carried out in the development and test stage.
Description
Technical Field
The present invention relates to the field of electronic devices, and in particular, to a mobile terminal, a current setting method thereof, and a computer-readable storage medium.
Background
Mobile terminals such as smart phones are becoming necessities in life of people, functions of the mobile terminals are becoming diversified, and the mobile terminals generally need to be developed and tested before leaving factories.
At present, in a development test stage, charging current from an upper computer is often insufficient to complete firmware downloading, and in order to avoid inconvenience caused by the manner, in the development test process, the simulation of the in-place situation of the battery is downloaded in a production line downloading mode. In the development process, the download can be successfully carried out only by simulating that the battery is in place and needing an external program control power supply to supply power, so great inconvenience is brought to the development and debugging work.
Disclosure of Invention
The embodiment of the invention provides a mobile terminal, a current setting method thereof and a computer readable storage medium, which can ensure that firmware burning of the mobile terminal is smoothly carried out in a development and test stage.
The embodiment of the invention adopts a technical scheme that: there is provided a current setting method of a mobile terminal, the method including: after the mobile terminal is connected with the upper computer, whether the mobile terminal successfully downloads the firmware is judged; if the mobile terminal does not successfully download the firmware, setting the charging current provided by the upper computer to the mobile terminal as a first current value; if the mobile terminal has successfully downloaded the firmware, setting the charging current provided by the upper computer to the mobile terminal as a first current value or a second current value according to a preset judgment strategy; the first current value is greater than the second current value.
The embodiment of the invention adopts another technical scheme that: there is provided a mobile terminal including: the judging module is used for judging whether the mobile terminal successfully downloads the firmware after the mobile terminal is connected with the upper computer; the setting module is used for setting the charging current provided by the upper computer to the mobile terminal as a first current value when the mobile terminal does not successfully download the firmware, and setting the charging current provided by the upper computer to the mobile terminal as the first current value or a second current value according to a preset judgment strategy when the mobile terminal successfully downloads the firmware; wherein the first current value is greater than the second current value.
The embodiment of the invention adopts another technical scheme that: there is provided a mobile terminal comprising a processor and a memory coupled to the processor for storing a computer program, the processor being adapted to invoke the computer program to perform the above method.
The embodiment of the invention adopts another technical scheme that: there is provided a computer-readable storage medium storing a computer program executable to implement the above method.
The invention has the beneficial effects that: the embodiment of the invention judges whether the mobile terminal successfully downloads the firmware after being connected with the upper computer; if the mobile terminal does not successfully download the firmware, setting the charging current provided by the upper computer to the mobile terminal as a first current value; if the mobile terminal has successfully downloaded the firmware, setting the charging current provided by the upper computer to the mobile terminal as a first current value or a second current value according to a preset judgment strategy; the first current value is larger than the second current value, so that the mobile terminal can be ensured to burn firmware smoothly in a development and test stage.
Drawings
Fig. 1 is a flowchart illustrating a first embodiment of a current setting method of a mobile terminal according to the present invention;
fig. 2 is a flowchart illustrating a current setting method of a mobile terminal according to a second embodiment of the present invention;
fig. 3 is a flowchart illustrating a current setting method of a mobile terminal according to a third embodiment of the present invention;
fig. 4 is a flowchart illustrating a fourth embodiment of a current setting method of a mobile terminal according to the present invention;
FIG. 5 is a block diagram of a mobile terminal according to an embodiment of the present invention;
fig. 6 is a schematic hardware configuration diagram of a second embodiment of the mobile terminal of the present invention;
fig. 7 is a schematic hardware configuration diagram of a mobile terminal according to a second embodiment of the present invention.
Detailed Description
The technical solution 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 is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first", "second", and the like in the present invention are used for distinguishing different objects, not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
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 invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The power management chip of the mobile terminal such as the smart phone can integrate a battery in-place detection function, after the mobile terminal is connected with the charging device, when the battery is detected to be in place, the power management chip controls the charging device to be a first current value of the charging current of the mobile terminal, and when the battery is detected not to be in place, the power management chip controls the charging device to be a second current value of the charging current of the mobile terminal, wherein the first current value is larger than the second current value.
The mobile terminal comprises a terminal main body and a battery, wherein the battery is in place, namely the battery is connected with the terminal main body, and the battery is not in place, namely the battery is not connected with the terminal main body.
Through the mode, the mobile terminal can be charged by the charging equipment with smaller current when the battery is not in place, and the mobile terminal is charged by larger current when the battery is in place, so that the safety of a user when the mobile terminal is used can be ensured.
In a development and test stage of the mobile terminal, for example, when a main board of the mobile terminal is tested, a battery of the mobile terminal cannot be connected with a terminal main body, that is, the battery is usually in an out-of-place state, however, a power management chip on the main board still can detect whether the battery is in place, so that the power management chip can detect that the battery is out of place in the development and test stage, when a firmware is downloaded by a main board connected with an upper computer, a charging current for supplying power to the main board by the upper computer is set to be a second current value, and the relatively small second current value is insufficient for the main board to complete firmware downloading from the upper computer, which generally causes downloading failure and brings great inconvenience to development and test work.
The embodiment of the invention judges whether the mobile terminal successfully downloads the firmware after being connected with the upper computer; when the mobile terminal does not successfully download the firmware, the charging current provided by the upper computer to the mobile terminal is set to be the first current value, so that the smooth burning of the firmware in the development and test stage of the mobile terminal can be ensured.
According to the embodiment of the invention, when the mobile terminal does not successfully download the firmware, the charging current provided by the upper computer to the mobile terminal is set to be the first current value or the second current value according to the preset judgment strategy, so that the use safety of the mobile terminal can be ensured.
See in particular the detailed description in the examples below.
Referring to fig. 1, fig. 1 is a flowchart illustrating a current setting method of a mobile terminal according to a first embodiment of the present invention. In this embodiment, the current setting method of the mobile terminal may include the steps of:
step 11: and connecting the upper computer.
In step 11, the host computer may be a PC (personal computer). And a main board of the mobile terminal is in power supply connection and communication connection with the upper computer. Specifically, the connection may be performed through a USB (Universal Serial Bus) interface. After the power management chip is connected with the upper computer, hardware electrification and software initialization can be carried out on the power management chip.
During connection, on one hand, the PC end can supply power for a mainboard of the mobile terminal through a VBUS pin of the USB interface, and on the other hand, the PC end can communicate with the mainboard through a data line positive electrode pin D + and a data line negative electrode pin D-of the USB interface in the subsequent downloading process.
Step 12: and judging whether the mobile terminal has successfully downloaded the firmware.
In step 12, as mentioned above, the mobile terminal establishes a connection with the upper computer and triggers execution of the step of determining whether the mobile terminal has successfully downloaded the firmware.
Judging whether the mobile terminal has downloaded the firmware successfully may be: reading a state value of a zone bit in a 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 does not successfully download the firmware.
The step of judging whether the mobile terminal has successfully downloaded the firmware may further be: judging whether the used memory space of a memory of the mobile terminal is equal to a preset memory space or not; if the used memory space of the memory of the mobile terminal is equal to the preset memory space, the mobile terminal has successfully downloaded the firmware; and if the used memory space of the memory of the mobile terminal is less than the preset memory space, the mobile terminal does not successfully download the firmware.
The step of judging whether the mobile terminal has successfully downloaded the firmware may further be: judging whether the hash value of the data stored in the memory of the mobile terminal is equal to a preset hash value or not; if the hash value of the data stored in the memory of the mobile terminal is equal to the preset hash value, the mobile terminal has successfully downloaded the firmware; and 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 does not successfully download the firmware.
See the description below for details.
It should be understood that the above-mentioned methods of determining may be combined to determine whether the mobile terminal has successfully downloaded the firmware, for example, when it is determined that the storage amount of the memory is equal to the preset storage amount and the hash value of the data stored in the memory is equal to the preset hash value, a determination result that the mobile terminal has successfully downloaded the firmware is generated.
In step 12, if the mobile terminal does not download the firmware successfully, step 13 is executed: and setting the charging current provided by the upper computer to the mobile terminal as a first current value.
In step 13, optionally, the setting of the charging current provided by the upper computer to the mobile terminal as the first current value may specifically be: and judging whether the battery of the mobile terminal is in place or not, and setting the charging current as a first current value when the battery is judged to be in place or not.
Optionally, determining whether the battery is in place may include: judging the state value of a battery state bit pin of a power management chip of the mobile terminal; if the state value is the third state value, the battery is in place; and if the state value is the fourth state value, the battery is not in place.
For example, a pull-down resistor is connected to a status bit detection pin of the power management chip, i.e., the status bit detection pin is grounded through the pull-down resistor.
When the battery is in place, the state bit pin of the battery is connected with the state bit detection pin, and the state value of the state bit detection pin is pulled down to a low level at the moment, namely, if the detected state value is the low level, the battery is in place.
When the battery is not in place, the state bit pin of the battery is suspended, and the state value of the state bit detection pin is at a high level at the moment, namely if the state value is detected to be at the high level, the battery is not in place.
The above is merely an example, and in other embodiments, the design of the hardware circuit may be changed to indicate that the battery is not in place when a low level is detected and to indicate that the battery is in place when a high level is detected.
As mentioned above, when it is determined that the mobile terminal has not successfully downloaded the firmware, the charging current provided to the mobile terminal by the upper computer is set to the first current value no matter whether the status bit detection pin of the power management chip detects the high level or the low level. In step 12, if the mobile terminal has successfully downloaded the firmware, step 14 is executed: and setting the charging current provided by the upper computer to the mobile terminal as a first current value or a second current value according to a preset judgment strategy, wherein the first current value is larger than the second current value.
In step 14, setting the charging current provided by the upper computer to the mobile terminal as the first current value or the second current value according to the preset judgment policy may specifically be: judging whether a battery of the mobile terminal is in place; when the battery is judged to be in place, setting the charging current as a first current value; and when the battery is judged not to be in place, setting the charging current to be a second current value.
As mentioned earlier, when it is determined that the mobile terminal successfully downloads the firmware, a preset determination policy 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 charging current of the mobile terminal as the upper computer is set to be a first current value, and when the state bit detection pin of the power management chip detects a high level (the battery is not in place), the charging current of the mobile terminal as the upper computer is set to be a second current value.
Referring to fig. 2, fig. 2 is a flowchart illustrating a current setting method of a mobile terminal according to a second embodiment of the present invention.
In this embodiment, the determining whether the mobile terminal has successfully downloaded the firmware may be: reading a state value of a zone bit in a 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 does not successfully download the firmware.
In this embodiment, if the mobile terminal does not successfully download the firmware, the step of setting the charging current provided by the upper computer to the mobile terminal to the first current value may further include: triggering the mobile terminal to download the firmware from the upper computer; replacing the flag bit in the register of the mobile terminal from the second state value to the first state value after successful download
In this embodiment, the current setting method of the mobile terminal may include the steps of:
step 21: and is connected with an upper computer.
In step 21, the upper computer may be a PC (personal computer). And a main board of the mobile terminal is in power supply connection and communication connection with the upper computer. Specifically, the connection may be performed through a USB (Universal serial bus) interface. After the power management chip is connected with the upper computer, hardware electrification and software initialization can be carried out on the power management chip.
During connection, on one hand, the PC end can supply power for a mainboard of the mobile terminal through a VBUS pin of the USB interface, and on the other hand, the PC end can communicate with the mainboard through a data line positive electrode pin D + and a data line negative electrode pin D-of the USB interface in the subsequent downloading process.
Step 22: and reading the state value of the zone bit in the register of the mobile terminal.
In step 22, the status value of the flag bit in the register in the power management chip of the mobile terminal is read. For example, the state value may be a first state value or a second state value, the first state value may be "1", and the second state value may be "0".
In step 22, if the read status value is the second status value, a determination result that the mobile terminal did not successfully download the firmware is output, that is, step 23 is executed: and setting the charging current provided by the upper computer to the mobile terminal as a first current value.
In step 23, how to set the charging current provided by the upper computer to the mobile terminal to the first current value is specifically referred to the description of the above embodiment, and is not described herein again.
Step 24: and triggering the mobile terminal to download the firmware from the upper computer.
In step 24, for example, the hardware associated with the firmware download is powered on and software initialized. For example, the USB communication function is initialized, the memory is initialized and powered on, and the DDR (Double Data Rate synchronous dynamic random access memory), that is, the memory is initialized and powered on, so that the initialization of the USB communication function, the storage function of the memory, and the like required in the downloading process is completed, and the mobile terminal downloads the firmware to the memory through the USB communication.
Step 25: and replacing the flag bit in the register of the mobile terminal from the second state value to the first state value after the downloading is successful.
In step 25, the flag bit in the register of the mobile terminal may be set from 0 to 1 after the download is successful. Or after the firmware of the mobile terminal is downloaded, and all hardware of the mobile terminal is powered on and initialized, the flag bit is set to 1 from 0.
In step 22, if the read status value is the first status value, a determination result that the mobile terminal has successfully downloaded the firmware is output, that is, step 26 is executed: and setting the charging current provided by the upper computer to the mobile terminal as a first current value or a second current value according to a preset judgment strategy, wherein the first current value is larger than the second current value.
In step 26, how to set the charging current provided by the upper computer to the mobile terminal as the first current value or the second current value according to the preset judgment policy may refer to the description of the above embodiment, and details are not repeated here.
Referring to fig. 3, fig. 3 is a flowchart illustrating a current setting method of a mobile terminal according to a third embodiment of the present invention.
In this embodiment, the determining whether the mobile terminal has successfully downloaded the firmware may be: and judging whether the used memory space of the memory of the mobile terminal is equal to the preset memory space. If the used memory space of the memory of the mobile terminal is equal to the preset memory space, the mobile terminal has successfully downloaded the firmware; and if the used memory space of the memory of the mobile terminal is not equal to the preset memory space, the mobile terminal does not successfully download the firmware.
In this embodiment, the current setting method of the mobile terminal may include the steps of:
step 31: and is connected with an upper computer.
In step 31, the host computer may be a PC (personal computer). And a main board of the mobile terminal is in power supply connection and communication connection with the upper computer. Specifically, the connection may be performed through a USB (Universal Serial Bus) interface. After the host computer is connected, hardware electrification and software initialization can be carried out on the power management chip and the memory.
During connection, on one hand, the PC end can supply power for a mainboard of the mobile terminal through a VBUS pin of the USB interface, and on the other hand, the PC end can communicate with the mainboard through a data line positive electrode pin D + and a data line negative electrode pin D-of the USB interface in the subsequent downloading process.
Step 32: and judging whether the used memory space of the memory of the mobile terminal is equal to the preset memory space.
In step 32, the used memory space of the memory of the mobile terminal is read, and it is determined whether the used memory space is equal to a preset memory space, where the preset memory space is a memory space occupied by the firmware, and if the used memory space is equal to the preset memory space, it indicates that the firmware has been successfully written into the memory, and if the used memory space is not equal to the preset memory space, it indicates that the firmware has not been successfully written into the memory, or the written data is not the firmware of the mobile. For example, if the size of the firmware of the mobile terminal is 1.85Mb, the preset storage amount will be set to 1.85Mb in advance, and then it is determined whether the used storage amount of the memory is equal to 1.85Mb after the mobile terminal establishes a connection with the upper computer.
In step 32, if the used storage amount of the memory of the mobile terminal is not equal to the preset storage amount, outputting a determination result that the mobile terminal has not successfully downloaded the firmware, that is, executing step 33: and setting the charging current provided by the upper computer to the mobile terminal as a first current value.
In step 33, how to set the charging current provided by the upper computer to the mobile terminal to the first current value is specifically described in the above embodiments, and details are not repeated here.
Step 34: and triggering the mobile terminal to download the firmware from the upper computer.
In step 34, for example, the hardware associated with the firmware download is powered on and software initialized. For example, the USB communication function is initialized, the memory is initialized and powered on, and the DDR (Double Data Rate synchronous dynamic random access memory), that is, the memory is initialized and powered on, so that the initialization of the USB communication function, the storage function of the memory, and the like required in the downloading process is completed, and the mobile terminal downloads the firmware to the memory through the USB communication.
In step 32, if the used memory amount of the memory of the mobile terminal is equal to the preset memory amount, outputting a determination result that the mobile terminal has successfully downloaded the firmware, that is, executing step 35: and setting the charging current provided by the upper computer to the mobile terminal as a first current value or a second current value according to a preset judgment strategy, wherein the first current value is larger than the second current value.
In step 35, how to set the charging current provided by the upper computer to the mobile terminal as the first current value or the second current value according to the preset determination policy may refer to the description of the above embodiment, and details are not repeated here.
Referring to fig. 4, fig. 4 is a flowchart illustrating a current setting method of a mobile terminal according to a fourth embodiment of the present invention.
In this embodiment, the determining 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 a preset hash value or not; if the hash value of the data stored in the memory of the mobile terminal is equal to the preset hash value, the mobile terminal has successfully downloaded the firmware; and 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 does not successfully download the firmware.
In this embodiment, the current setting method of the mobile terminal may include the steps of:
step 41: and is connected with an upper computer.
In step 41, the host computer may be a PC (personal computer). And a main board of the mobile terminal is in power supply connection and communication connection with the upper computer. Specifically, the connection may be performed through a USB (Universal Serial Bus) interface. After the host computer is connected, hardware electrification and software initialization can be carried out on the power management chip and the memory.
During connection, on one hand, the PC end can supply power for a mainboard of the mobile terminal through a VBUS pin of the USB interface, and on the other hand, the PC end can communicate with the mainboard through a data line positive electrode pin D + and a data line negative electrode pin D-of the USB interface in the subsequent downloading process.
Step 42: and judging whether the hash value of the data stored in the memory of the mobile terminal is equal to a preset hash value or not.
In step 42, the hash value is a unique and extremely compact representation of a piece of data. The same data has the same hash value, and different data has different hash values. For example, the hash value of the firmware to be burned for the mobile terminal is
“E8C636D0C0486378BF61E6A3000D0FB7”
A preset hash value may be set to this value. After the mobile terminal is connected with the upper computer, whether the hash value of the data stored in the memory is equal to the hash value is judged, if yes, the memory is indicated to be successfully burnt with the firmware, and otherwise, the burning is not successful.
In step 42, if the hash value of the data stored in the memory of the mobile terminal is not equal to the preset hash value, outputting a determination result that the mobile terminal has not successfully downloaded the firmware, that is, performing step 43: and setting the charging current provided by the upper computer to the mobile terminal as a first current value.
In step 43, how to set the charging current provided by the upper computer to the mobile terminal as the first current value according to the preset determination policy is specifically referred to the description of the above embodiment, and is not described herein again.
Step 44: and triggering the mobile terminal to download the firmware from the upper computer.
In step 44, for example, the hardware associated with the firmware download is powered on and software initialized. For example, the USB communication function is initialized, the memory is initialized and powered on, and the DDR (Double Data Rate synchronous dynamic random access memory), that is, the memory is initialized and powered on, so that the initialization of the USB communication function, the storage function of the memory, and the like required in the downloading process is completed, and the mobile terminal downloads the firmware to the memory through the USB communication.
In step 42, if the hash value of the data stored in the memory of the mobile terminal is equal to the preset hash value, outputting a determination result that the mobile terminal has successfully downloaded the firmware, that is, executing step 45: and setting the charging current provided by the upper computer to the mobile terminal as a first current value or a second current value according to a preset judgment strategy, wherein the first current value is larger than the second current value.
In step 45, how to set the charging current provided by the upper computer to the mobile terminal as the first current value or the second current value according to the preset judgment policy may refer to the description of the above embodiment, and details are not repeated here.
Alternatively, in any of the above embodiments, the first current value may be 500mA, and the second current value may be 100 mA.
Referring to fig. 5, fig. 5 is a block diagram of a mobile terminal according to the present invention. In this embodiment, the mobile terminal 50 may include the following modules:
the judging module 51 is configured to judge whether the mobile terminal 50 has successfully downloaded the firmware after the mobile terminal 50 is connected to the upper computer.
The setting module 52 is configured to set a charging current provided to the mobile terminal by the upper computer to a first current value when the mobile terminal 50 does not successfully download the firmware, and set the charging current provided to the mobile terminal by the upper computer to the first current value or a second current value according to a preset judgment policy when the mobile terminal 50 has successfully downloaded the firmware; wherein the first current value is greater than the second current value.
The specific description of the steps executed by each module may refer to the related description in any one of the above method embodiments, and is not repeated here.
Referring to fig. 6, fig. 6 is a schematic hardware structure diagram of a mobile terminal according to a first embodiment of the present invention. In this embodiment, the mobile terminal 60 may include a processor 61 and a memory 62 connected to the processor 61.
The memory 62 may be used to store a computer program and the processor 61 may be used to invoke the computer program to perform the method of any of the embodiments described above.
The processor 61 may specifically be a power management chip as described above. In other embodiments, the processor may also be another processor, which is not limited in this embodiment of the present invention.
Referring 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 mobile terminal 900 includes an RF circuit 910, a memory 920, an input unit 930, a display unit 940, a sensor 950, an audio circuit 960, a wifi module 970, a processor 980, a power supply 990, and the like. Wherein the RF circuit 910, the memory 920, the input unit 930, the display unit 940, the sensor 950, the audio circuit 960, and the wifi module 970 are respectively connected with the processor 980; the power supply 990 is used to supply power to the entire mobile terminal 900.
Specifically, the RF circuit 910 is used for transmitting and receiving signals; the memory 920 is used for storing data instruction information; the input unit 930 is used for inputting information, and may specifically include a touch panel 931 and other input devices 932 such as operation keys; the display unit 940 may include a display panel 941; the sensor 950 includes an optical sensor, a distance sensor, a temperature sensor, an infrared sensor, a laser sensor, etc. for detecting a user approach signal, a distance signal, a temperature of the mobile terminal 900, etc.; a speaker 961 and a microphone 962 are connected to the processor 980 through the audio circuit 960 for emitting and receiving sound signals; the wifi module 970 is then used for receiving and transmitting wifi signals.
The processor 980 is further configured to set a charging current provided by the upper computer to the mobile terminal to a first current value when the mobile terminal 900 does not successfully download the firmware, and set the charging current provided by the upper computer to the mobile terminal to the first current value or a second current value according to a preset judgment policy when the mobile terminal 900 has successfully downloaded the firmware; wherein the first current value is greater than the second current value.
The specific content executed by each device may refer to the description in any one of the above embodiments, and is not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed method and apparatus can be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
Embodiments of the present invention also provide a computer-readable storage medium for storing a computer program, which can be executed by a processor to implement the method provided in the above embodiments. It is understood that the method executed by the computer program stored in the readable storage medium in this embodiment is similar to the method provided in the foregoing embodiments, and the principle and steps thereof are the same, and are not described herein again.
The storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, which can store program codes.
The mobile terminal in any of the above embodiments of the present invention may be a smart phone, a wearable smart device, a tablet computer, a palm computer, a digital PDA, or other mobile terminals.
The charging current provided by the upper computer to the mobile terminal is set to be the first current value before the mobile terminal downloads the firmware from the upper computer; after downloading the firmware, setting the charging current provided by the upper computer to the mobile terminal as a first current value or a second current value according to a preset judgment strategy; the first current value is larger than the second current value, so that the mobile terminal can be ensured to burn firmware smoothly in a development and test stage.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes performed by the present specification and drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (9)
1. A current setting method of a mobile terminal, the method comprising:
after the mobile terminal is connected with the upper computer, whether the mobile terminal successfully downloads the firmware is judged;
if the mobile terminal does not successfully download the firmware, setting the charging current provided by the upper computer to the mobile terminal as a first current value;
if the mobile terminal has successfully downloaded the firmware, setting the charging current provided by the upper computer to the mobile terminal as a first current value or a second current value according to a preset judgment strategy;
wherein the first current value is greater than the second current value;
the step of setting the charging current provided by the upper computer to the mobile terminal to be a first current value includes: judging whether a battery of the mobile terminal is in place or not, and setting the charging current as the first current value when the battery is judged to be in place or not;
the step of setting the charging current provided by the upper computer to the mobile terminal as a first current value or a second current value according to a preset judgment strategy comprises the following steps:
judging whether a battery of the mobile terminal is in place;
when the battery is judged to be in position, setting the charging current to be the first current value;
and when the battery is judged not to be positioned, setting the charging current to be the second current value.
2. The method of claim 1,
the judging whether the mobile terminal has downloaded the firmware successfully comprises:
reading a state value of a zone bit in a register of the mobile terminal;
if the state value is a first state value, the mobile terminal has successfully downloaded the firmware;
and if the state value is the second state value, the mobile terminal does not successfully download the firmware.
3. The method according to claim 2, wherein after the charging current provided to the mobile terminal by the upper computer is set to the first current value if the mobile terminal does not successfully download the firmware, the method further comprises:
triggering the mobile terminal to download the firmware from the upper computer;
and replacing the flag bit in the register of the mobile terminal from the second state value to the first state value after the downloading is successful.
4. The method of claim 1,
the judging whether the mobile terminal has downloaded the firmware successfully comprises:
judging whether the used memory space of the memory of the mobile terminal is equal to a preset memory space or not;
if the used memory space of the memory of the mobile terminal is equal to the preset memory space, the mobile terminal has successfully downloaded the firmware;
and if the used memory space of the memory of the mobile terminal is not equal to the preset memory space, the mobile terminal does not successfully download the firmware.
5. The method of claim 1,
the judging whether the mobile terminal has downloaded the firmware successfully comprises:
judging whether the hash value of the data stored in the memory of the mobile terminal is equal to a preset hash value or not;
if the hash value of the data stored in the memory of the mobile terminal is equal to the preset hash value, the mobile terminal has successfully downloaded the firmware;
and 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 does not successfully download the firmware.
6. The method of claim 1,
the judging whether the battery of the mobile terminal is in place comprises:
judging the state value of a battery state bit pin of a power management chip of the mobile terminal;
if the state value is a third state value, the battery is in place;
and if the state value is a fourth state value, the battery is not in place.
7. A mobile terminal, characterized in that the mobile terminal comprises:
the judging module is used for judging whether the mobile terminal successfully downloads the firmware after the mobile terminal is connected with the upper computer;
the setting module is used for setting the charging current provided by the upper computer to the mobile terminal as a first current value when the mobile terminal does not successfully download the firmware, and setting the charging current provided by the upper computer to the mobile terminal as the first current value or a second current value according to a preset judgment strategy when the mobile terminal successfully downloads the firmware;
wherein the first current value is greater than the second current value; the setting of the charging current provided by the upper computer to the mobile terminal to the first current value includes: judging whether a battery of the mobile terminal is in place or not, and setting the charging current as the first current value when the battery is judged to be in place or not;
the setting of the charging current provided by the upper computer to the mobile terminal as the first current value or the second current value according to the preset judgment strategy comprises: judging whether a battery of the mobile terminal is in place; when the battery is judged to be in position, setting the charging current to be the first current value; and when the battery is judged not to be positioned, setting the charging current to be the second current value.
8. A mobile terminal, characterized in that the mobile terminal comprises a processor and a memory connected to the processor, the memory being adapted to store a computer program, the processor being adapted to invoke the computer program to perform the method of any of claims 1-6.
9. A computer-readable storage medium for storing a computer program executable to implement the method of any one of claims 1 to 6.
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 | |
CN111239617B (en) | Control method and device for charge and discharge test, storage medium and system | |
WO2009091193A2 (en) | Mobile terminal for supporting uart communication and usb communication using single connector and operating method for same | |
CN106649010B (en) | terminal equipment test method and terminal equipment | |
CN108920397B (en) | Device identification method and device, storage medium and electronic device | |
CN108132401A (en) | Charge abnormal detection method, device, storage medium and mobile terminal | |
CN108681514B (en) | Device detection method and device, storage medium and electronic device | |
JP2001184146A (en) | Portable electronic equipment provided with common serial bus connector | |
EP3771987A1 (en) | Electronic device for preventing damage of usb device and operating method thereof | |
CN106877103B (en) | A kind of method that realizing circuit switching and adapter | |
CN112817896A (en) | Type-C interface protection circuit, method and device, storage medium and electronic equipment | |
CN105991415A (en) | Message pushing method and mobile terminal | |
CN106292989A (en) | A kind of information processing method and electronic equipment | |
CN107608923B (en) | Test processing method and related product | |
CN110767946B (en) | Method and device for controlling discharging of mobile terminal and mobile terminal | |
CN107451067B (en) | Processing method for downloading test and related product | |
CN107589819B (en) | Mobile terminal, current setting method thereof, and computer-readable storage medium | |
CN103682863A (en) | Voice reminding charging data wire and charging method of charging data wire | |
CN110556884B (en) | Charging management method, device, medium and electronic equipment applying method | |
CN109104481B (en) | File integrity detection method, file integrity detection device and terminal equipment | |
CN107589820B (en) | Mobile terminal, current setting method thereof, and computer-readable storage medium | |
CN105893875B (en) | Method for preventing the maloperation of the intelligent electronic device external world and its device | |
CN108156306B (en) | Unlocking method and related product | |
CN107577567B (en) | Mainboard test circuit and related product | |
CN111045742A (en) | Card changing method and device 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 | ||
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. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |