CN114138377B - Electronic device, control method thereof, and storage medium - Google Patents

Electronic device, control method thereof, and storage medium Download PDF

Info

Publication number
CN114138377B
CN114138377B CN202210116916.8A CN202210116916A CN114138377B CN 114138377 B CN114138377 B CN 114138377B CN 202210116916 A CN202210116916 A CN 202210116916A CN 114138377 B CN114138377 B CN 114138377B
Authority
CN
China
Prior art keywords
cable
cable detection
electronic device
interface
detection function
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
Application number
CN202210116916.8A
Other languages
Chinese (zh)
Other versions
CN114138377A (en
Inventor
黄停
李岩
朱辰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202210116916.8A priority Critical patent/CN114138377B/en
Publication of CN114138377A publication Critical patent/CN114138377A/en
Application granted granted Critical
Publication of CN114138377B publication Critical patent/CN114138377B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R27/00Arrangements for measuring resistance, reactance, impedance, or electric characteristics derived therefrom
    • G01R27/02Measuring real or complex resistance, reactance, impedance, or other two-pole characteristics derived therefrom, e.g. time constant
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72406User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by software upgrading or downloading

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the application provides electronic equipment, a control method thereof and a storage medium, relates to the technical field of electronic equipment control, and can reduce the probability of false triggering entering a flashing interface due to corrosion of a cable. An electronic device control method, an interface of an electronic device being adapted to connect a cable, the method comprising: responding to a starting instruction to enter a starting process, and starting a cable detection function or keeping the cable detection function in a started state after the starting process is finished; responding to a shutdown instruction to enter a shutdown process, and closing the cable detection function in the shutdown process; in the starting-up process, if the cable detection function is started, the resistance value of a cable detection pin on an interface of the electronic equipment is obtained, and if the resistance value of the cable detection pin meets the flashing condition, the flashing mode is entered.

Description

Electronic device, control method thereof, and storage medium
Technical Field
The present disclosure relates to the field of electronic device control technologies, and in particular, to an electronic device, a control method thereof, and a storage medium.
Background
Electronic equipment such as a mobile phone and the like need to burn and write a new version system on a machine refreshing interface, the existing mode of entering the machine refreshing interface can be triggered by machine disassembling, and the machine disassembling is troublesome. Therefore, in order to enter the flashing interface more conveniently and conveniently without influencing the normal use of a user, the other mode of entering the flashing interface is to detect the cable connected with the interface on the mobile phone, so that the entering of the flashing interface is realized by identifying the flashing cable. However, in some scenarios, the user does not wish to enter the brush interface, but may false trigger entry into the brush interface due to corrosion of the non-brush cable.
Disclosure of Invention
An electronic device, a control method thereof and a storage medium can reduce the probability of false triggering and entering a machine refreshing interface caused by corrosion of a cable, and meanwhile, the electronic device is ensured to have the function of entering the machine refreshing interface without disassembling the machine.
In a first aspect, an electronic device control method is provided, where an interface of an electronic device is adapted to connect a cable, the method including: responding to a starting instruction to enter a starting process, and starting a cable detection function or keeping the cable detection function in a started state after the starting process is finished; responding to a shutdown instruction to enter a shutdown process, and closing the cable detection function in the shutdown process; in the starting-up process, if the cable detection function is started, the resistance value of a cable detection pin on an interface of the electronic equipment is obtained, and if the resistance value of the cable detection pin meets the flashing condition, the flashing mode is entered. Starting a cable detection function in a starting-up process so that the electronic equipment can enter a flashing interface through a flashing cable if a user wants to enter the flashing interface after the electronic equipment is abnormally shut down; and closing the cable detection function in the shutdown process so that even if the non-flashing cable connected with the electronic equipment is corroded in the process of normally using the electronic equipment by a user, the non-flashing cable cannot be triggered to enter a flashing interface by mistake in the normal shutdown and startup processes. The probability of mistakenly triggering to enter the flashing interface is reduced, and meanwhile, the electronic equipment is guaranteed to have the function of entering the flashing interface without being dismounted.
In one possible embodiment, the power-on instruction includes an instruction generated in response to a power key press in the power-off state. That is to say, in the normal use process of the electronic device during the shutdown and startup, even if the used ordinary cable is corroded to meet the flashing condition, the ordinary cable cannot be mistakenly triggered to enter the flashing interface.
In one possible embodiment, the power-on command includes a forced restart key command.
In one possible embodiment, the forced restart key instruction is an instruction generated in response to the combination of forced restart keys being continuously pressed for a preset time period, the preset time period being greater than 20 seconds. The hidden forced restart mode is used as a trigger mode for entering the flashing interface in cooperation with the flashing line, so that the probability of false triggering by a user can be reduced, and an entrance for entering the flashing interface is reserved.
In a possible implementation manner, if the resistance value of the cable detection pin does not satisfy the power-on condition, the power-on process is continuously executed.
In one possible embodiment, in the boot process, if the cable detection function is not turned on, the boot process is continued.
In a possible embodiment, after the process of activating the cable detection function or maintaining the cable detection function in an activated state, the method further includes: when the interface is connected with a cable, if the cable detection function is started, the resistance value of the cable detection pin on the interface is obtained, and if the resistance value of the cable detection pin meets the quick-charging condition, the quick-charging mode is entered. On the premise of reducing false triggering and entering a machine refreshing interface, normal quick charging cable identification can still be ensured.
In one possible embodiment, the cable detection pins are two configuration channel CC pins.
In one possible embodiment, the step of detecting that the resistance value of the cable detection pin meets the brushing condition includes: one of the two CC pins has a resistance value of A, the other CC pin has a resistance value of B, and A is larger than B.
In one possible embodiment, a =56K, B = 22K; or a =56K and B = 10K.
In a possible embodiment, after the process of activating the cable detection function or maintaining the cable detection function in an activated state, the method further includes: when the interface is connected with a cable, if the cable detection function is started, the resistance value of the cable detection pin on the interface is obtained, and if the resistance values of the two CC pins are A, the quick charging mode is entered. On the premise of reducing false triggering and entering a machine refreshing interface, normal quick charging cable identification can still be ensured.
In a second aspect, an electronic device is provided, an interface of the electronic device is suitable for connecting a cable, and the electronic device includes: the starting control module is used for responding to a starting instruction to enter a starting process, starting a cable detection function after the starting process is finished, or keeping the cable detection function in a started state; the shutdown control module is used for responding to a shutdown instruction to enter a shutdown process, and closing the cable detection function in the shutdown process; and the cable detection module is used for acquiring the resistance value of a cable detection pin on the interface of the electronic equipment if the cable detection function is started in the starting process, and entering a flashing mode if the resistance value of the cable detection pin meets the flashing condition.
In one possible embodiment, the power-on command includes a forced restart key command.
In a possible implementation manner, the cable detection module is further configured to, after the process of starting the cable detection function or maintaining the cable detection function in a started state, obtain a resistance value of a cable detection pin on the interface when the interface is connected to the cable, and enter the fast charging mode if the resistance value of the cable detection pin satisfies the fast charging condition.
In a third aspect, an electronic device is provided, an interface of the electronic device is adapted to connect a cable, the electronic device includes a processor and a memory, the memory is used for storing instructions, and the instructions are executed by the electronic device to realize the electronic device control method.
In a fourth aspect, there is provided a computer-readable storage medium having stored therein a computer program which, when run on a computer, causes the computer to execute the electronic device control method described above.
Drawings
FIG. 1 is a schematic diagram of a connection between a mobile phone and a computer in the related art;
FIG. 2 is a schematic diagram of a mobile phone connected to a charger according to the related art;
fig. 3 is a block diagram of an electronic device according to an embodiment of the present application;
fig. 4 is a schematic flowchart of a control method of an electronic device according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a cycle of an electronic device at different stages according to an embodiment of the present application;
FIG. 6 is a schematic diagram of another cycle of an electronic device at different stages according to an embodiment of the present application;
fig. 7 is a flowchart illustrating another electronic device control method according to an embodiment of the present application.
Detailed Description
The terminology used in the description of the embodiments section of the present application is for the purpose of describing particular embodiments of the present application only and is not intended to be limiting of the present application.
Prior to describing the embodiments of the present application, a description will be given of a related art and problems of the related art related to the embodiments of the present application. As shown in fig. 1, in the related art, the cellular phone 10 includes an interface that can be connected to a cable 20, so that the cellular phone 10 can be connected to an external device through the interface and the cable 20. The external device is, for example, a computer 30, and as shown in fig. 2, the external device may be a charger 40. The cable 20 may include three types, which are a normal cable, a flash cord and a quick charging cord, and the mobile phone 10 may determine the type of the connected cable through detecting the pins on the interface, so as to perform a corresponding function according to the type of the cable.
For example, when a mobile phone is started, a flashing cable detection is performed; after the mobile phone is started, if the mobile phone is plugged with a cable or a new cable is plugged in the mobile phone, the quick charging cable detection can be carried out.
The brush cable detection includes: detecting resistance values of two Configuration Channel (CC) pins on an interface, determining whether the type of the cable is a flashing cable according to a condition met by the resistance values of the two CC pins, and if the resistance values of the two CC pins are respectively 56K +22K or 56K +10K, determining that the cable is the flashing cable. If the mobile phone is started, the fact that the mobile phone is plugged in the flashing cable is judged, and the fact that the user is using the mobile phone and is connected to the computer through the flashing cable to prepare flashing is indicated, and therefore the mobile phone enters a flashing mode. If the mobile phone is judged to be plugged with a non-flashing cable, the flashing mode cannot be entered, and the mobile phone can be started normally to enter a system interface.
Fill cable detection soon includes: and detecting the resistance values of the two CC pins on the interface, and determining whether the cable type is a quick charging cable according to the condition met by the resistance values of the two CC pins. If the two CC pins are both 56k, the quick charging cable is judged, which indicates that the user is using the mobile phone and is connected to the quick charging charger through the quick charging cable, so that the mobile phone can enter a quick charging mode through handshaking with the quick charging charger to realize quick charging of the mobile phone. If the mobile phone is not the fast charging cable, the user is connected to the charger or the computer through the non-fast charging cable (a common cable or a flashing cable) by using the mobile phone. At this time, the mobile phone performs the related charging process based on other configuration policies. For example, the mobile phone may perform handshake communication with the connected external device through the cable, and determine a corresponding charging mode (a normal charging mode or a computer charging mode) based on a further result of the handshake communication, so as to enable the mobile phone to perform charging with the external device based on the corresponding mode.
However, in some scenarios, a user may mistakenly trigger the mobile phone to enter the flashing interface, for example, when the mobile phone is powered off due to low battery, the user may plug a common cable to charge the mobile phone and start the mobile phone at the same time. In this case, the detection of the flashing cable is performed, and for a normal common cable, the resistance value of one corresponding CC pin is 56k, and the other CC pin is floating, so that the normal common cable cannot be identified as the flashing cable. However, if the common cable is corroded, and the resistance values of the two CC pins become 56K +22K or 56K +10K, the common cable is mistakenly identified as a flashing cable, and the common cable is mistakenly triggered to enter a flashing interface in the process of starting the mobile phone. That is, when a user uses the mobile phone to plug in a corroded non-flashing cable to start the mobile phone, the user may mistakenly trigger the mobile phone to enter the flashing interface. In addition, the functions of brushing machine cable detection and quick charging cable detection cannot be directly closed, and if the functions of brushing machine cable detection and quick charging cable detection are directly closed, the machine cannot be disassembled to enter a brushing machine interface, and the quick charging cable cannot be identified. In order to solve the above problems, the following describes technical solutions provided in the embodiments of the present application.
First, an electronic device according to an embodiment of the present application will be described, and fig. 3 shows a schematic configuration diagram of the electronic device 100. The electronic device 100 may be an electronic product such as a mobile phone, a tablet computer, a watch, and a bracelet, for example, and the electronic device 100 will be described below by taking a mobile phone as an example. The electronic device 100 may include a processor 110, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charge management module 140, a power management module 141, a battery 142, buttons 190, and the like.
It is to be understood that the illustrated structure of the embodiment of the present invention does not specifically limit the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a controller, and the like. The different processing units may be separate devices or may be integrated into one or more processors.
The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 110, thereby increasing the efficiency of the system.
In some embodiments, processor 110 may include one or more interfaces. The interface may include a Universal Serial Bus (USB) interface or the like. The interface 130 of the electronic device is adapted to connect a cable.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to charge the electronic device 100 by connecting a charger through a cable, and may also be used to transmit data between the electronic device 100 and a peripheral device. And the earphone can also be used for connecting an earphone and playing audio through the earphone. The interface may also be used to connect other electronic devices, such as AR devices and the like.
The USB Type C interface includes two CC pins, when USB Type C interface connection cable, can judge the Type of cable according to the resistance value that detects on the CC pin.
It should be understood that the connection relationship between the modules according to the embodiment of the present invention is only illustrative and is not limited to the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The charging management module 140 is configured to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger via the USB interface 130. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 to power the processor 110, the internal memory 121, and the like. The power management module 141 may also be used to monitor parameters such as battery capacity, battery cycle count, battery state of health (leakage, impedance), etc. In other embodiments, the power management module 141 may be disposed in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be disposed in the same device.
The internal memory 121 may be used to store computer-executable program code, which includes instructions. The internal memory 121 may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, and the like. The storage data area may store data (such as audio data, phone book, etc.) created during use of the electronic device 100, and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
The keys 190 include a power-on key, a volume key, and the like. The keys 190 may be mechanical keys. Or may be touch keys. The electronic apparatus 100 may receive a key input, and generate a key signal input related to user setting and function control of the electronic apparatus 100.
As shown in fig. 4, an embodiment of the present application provides an electronic device control method, where an electronic device 100 includes an interface, the interface of the electronic device 100 is suitable for connecting a cable, and the interface is, for example, the USB interface 130 described above, and the method includes:
step 101, responding to a starting instruction to enter a starting process;
the power-on command is, for example, a command generated in response to a power key. For example, after the electronic device is powered off, the user may press a power key to power on the electronic device, thereby entering a power-on procedure. In the boot process, system services are started, and some initialization operations are performed.
After the boot process is completed, step 102 is executed to turn on the cable detection function, which will be described below, or keep the cable detection function in a turned-on state. When the starting-up process is finished, if the cable detection function is in a closed state, the cable detection function is started; and when the starting-up process is finished, if the cable detection function is in the started state, keeping the cable detection function in the started state. After the cable detection function is turned on, shutdown may be caused by two conditions, one is normal shutdown, that is, step 103 is executed, and the other is abnormal shutdown. The normal shutdown refers to shutdown of the electronic device after a shutdown process, in the shutdown process, system services are normally shut down, and after the shutdown process is finished, the electronic device is shut down. The abnormal shutdown refers to the shutdown of the electronic device without a shutdown process. In the abnormal shutdown process, the shutdown process is not entered, and shutdown may be performed due to direct power failure caused by system abnormality of the electronic device. After the electronic device is powered off, if a user presses a power key, a power-on instruction is generated, so that step 101 is executed; or the system of the electronic device is abnormal and the electronic device is directly restarted after power failure, and at this time, a starting instruction is generated so as to execute the step 101; or forced power-down restart due to a forced restart instruction generated by a user operation, the step 101 is also executed.
Step 103, responding to a shutdown instruction to enter a shutdown process, and in the shutdown process, closing the cable detection function;
the shutdown instruction is, for example, an instruction generated by pressing a power key for a long time, or a shutdown instruction generated by other normal shutdown ways such as timed shutdown. In the embodiment of the present application, in the shutdown process, the cable detection function is also turned off in addition to the system service being turned off, and the cable detection function is in a turned-off state before the cable detection function is turned on next time. After the shutdown process is completed, the electronic device is shut down until a power-on command is generated by, for example, pressing a power key, and then step 101 is executed.
In the boot process, step 201 is executed to determine whether the cable detection function is turned on, if so, i.e., if the cable detection function is turned on, step 202 is executed, otherwise, i.e., if the cable detection function is turned off, steps 202 and 203 are not executed, but the boot process is continuously and normally executed until the boot process is ended;
step 202, obtaining a resistance value of a cable detection pin on an interface of the electronic equipment;
step 203, determining whether the resistance value of the cable detection pin meets the flashing condition, if so, executing step 204, entering the flashing mode, if not, continuing to normally execute the startup process until the startup process is finished, and after the startup process is finished, executing step 102.
The following describes the control method of the electronic device through several specific scenarios:
in a first scenario, as shown in fig. 5, after the electronic device finishes the boot process, the cable detection function is turned on in step 102, or the cable detection function is kept turned on, and the electronic device enters a normal use process. In the normal use process of the electronic equipment, if the electronic equipment is abnormally shut down, the shutdown mode cannot enter a shutdown process. After abnormal shutdown, a user hopes to enter a flashing interface for flashing, the interface of the electronic equipment is connected to a computer through a flashing cable, and then the power key is pressed to start the electronic equipment. The electronic device is powered on and enters a power-on process, in which the cable detection function is kept in a power-off state, that is, the cable detection function is turned on, and in step 201, it is determined that the cable detection function is turned on. Since the cable is a flush cable, it is determined in step 203 that the resistance value of the cable detection pin satisfies the flush condition, step 204 is executed, and the flush mode is entered. That is, in the case of abnormal shutdown of the electronic device, if the user wishes to perform a flush, the user can still conveniently enter the flush interface.
In a second scenario, after the boot process of the electronic device is completed, the cable detection function is turned on in step 102, or the cable detection function is kept in a turned-on state, and a normal use process is performed. In the normal use process of the electronic equipment, the interface of the electronic equipment is connected with a common cable for charging, and at the moment, the electronic equipment is abnormally shut down, and the shutdown mode cannot enter a shutdown flow. After abnormal shutdown, the user presses the power key to start up the electronic device, and enters a startup process, and in step 201, it is determined that the cable detection function is turned on. Since the cable is a normal cable, it is determined in step 203 that the resistance value of the cable detection pin does not satisfy the condition of power-on, and thus the electronic device is normally powered on. That is, in the case of abnormal shutdown of the electronic device, if the user does not wish to perform a flush, the electronic device can still be normally started using the non-flush cable. It should be noted that, the scenario one and the scenario two belong to scenarios that the user rarely encounters, and the electronic device may be abnormally shut down only when a serious system abnormality occurs. Therefore, in the embodiment of the application, the possibility of false triggering into the brushing interface due to corrosion of the cable is low.
Scenario three, in one possible implementation, the power-on instruction includes an instruction generated in response to a power key press in the power-off state. As shown in fig. 6, the electronic device is triggered to automatically shut down by a low power level, so as to enter a shutdown procedure, i.e., execute step 103, or the user normally controls the electronic device to shut down, so as to enter the shutdown procedure, i.e., execute step 103. In step 103, the cable detection function is turned off. After the electronic device is powered off, the user connects the interface of the electronic device to the charger through the common cable for charging, and controls the electronic device to be powered on by pressing the power key, that is, step 101 is executed. In step 201, it is determined that the cable detection function is turned off, so that the cable detection functions of steps 202 and 203 are not performed, but the power-on process is normally performed, and step 102 is performed after the power-on process is ended. Because the cable detection cannot be carried out in the starting-up process, even if the common cable is corroded, the common cable cannot be mistakenly triggered to enter a flashing interface due to the misjudgment of the cable in the scene. That is to say, in the normal use process of the electronic device during the shutdown and startup, even if the used ordinary cable is corroded to meet the flashing condition, the ordinary cable cannot be mistakenly triggered to enter the flashing interface.
According to the control method of the electronic equipment, the cable detection function is started in the starting-up process, so that the electronic equipment can enter a flashing interface through a flashing cable if a user wants to enter the flashing interface after the electronic equipment is abnormally shut down; and closing the cable detection function in the shutdown process so that even if a non-flashing cable connected with the electronic equipment is corroded in the process of normally using the electronic equipment by a user, the non-flashing cable cannot be mistakenly triggered to enter a flashing interface in the normal shutdown and startup processes. The probability of mistakenly triggering to enter the flashing interface is reduced, and meanwhile, the electronic equipment is guaranteed to have the function of entering the flashing interface without being dismounted.
In one possible embodiment, the power-on command includes a forced restart key command. The forced restart key instruction may be an instruction generated in response to a continuous pressing of the forced restart key combination for a preset time period, the preset time period being greater than 20 seconds. For example, the forced restart key instruction is an instruction generated in response to the power key and the volume down key being pressed simultaneously for up to 30 seconds. It is to be understood that the forced restart key instruction may also be an instruction generated in response to another key or a combination of keys, which is not limited in this embodiment of the present application. Since the forced restart process includes an abnormal shutdown and starting of the electronic device, step 103 is not executed, that is, the cable detection function is not turned off, so that the forced restart may be utilized to enable a user to enter a flashing interface after the electronic device is started. Two specific scenarios involving forced restarts are described below:
in a fourth scenario, after the boot process of the electronic device is completed, the cable detection function is turned on in step 102, or the cable detection function is kept in an turned-on state. At the moment, a user wants to enter a flashing interface for flashing, one end of a flashing cable is connected to an interface of the electronic equipment, the other end of the flashing cable is connected to the computer, and at the moment, the user presses a power key and a volume down key simultaneously for 30 seconds to enable the electronic equipment to be restarted forcibly, namely a starting instruction is generated. Namely, step 101 is executed, in the process of forced restart, the shutdown process is not entered, but the process belongs to abnormal shutdown, and the startup process is directly entered after power failure shutdown. Since step 103 is not performed, it is determined that the cable detection function is turned on in step 201 of the power-on process, and since the cable is a power-on cable, it is determined that the resistance value of the cable detection pin satisfies the power-on condition in step 203, step 204 is executed, and the power-on mode is entered. That is, in a scene that a user wishes to perform a flashing operation, the flashing interface can still be conveniently accessed.
In a fifth scenario, after the boot process of the electronic device is completed, the cable detection function is turned on in step 102, or the cable detection function is kept in an turned-on state. At the moment, the interface of the electronic equipment is connected with a common cable for charging, the system of the electronic equipment has problems, and a user hopes to simultaneously press a power key and a volume down key for 30 seconds, so that the electronic equipment is forcibly restarted, and a starting instruction is generated. Namely, step 101 is executed, and in the process of forced restart, the shutdown process is not entered, but the shutdown process is an abnormal shutdown process, and the startup process is directly entered. Since step 103 is not performed, it is determined that the cable detection function is turned on in step 201 of the power-on process, and since the cable is a normal cable, it is determined that the resistance value of the cable detection pin does not satisfy the power-on condition in step 203, so that the electronic device is normally powered on. That is, in the case where the non-swipe cable is used, the electronic device can be normally started.
It should be noted that the scene four and the scene five belong to scenes that the user rarely encounters. The forced restart function is not usually used by the user during normal use of the electronic device. Only when the electronic device is completely stuck, forced restart is required. Or when the user needs to write a new version system to the electronic device, the user needs to enter a machine refreshing interface by matching with a machine refreshing line through forced restart. The entry triggered by the forced restart function is also hidden, and generally cannot be triggered by the user by mistake. For example, a forced restart may only be triggered if the power key and volume down key are pressed simultaneously for 30 seconds. In addition, it should be noted that when the power key and the volume down key are pressed simultaneously for 8 seconds and 30 seconds, normal restart may be triggered, and the normal restart may first go through a shutdown process and then start the mobile phone, so the process does not belong to forced restart. Therefore, in the embodiment of the application, the possibility of false triggering into the brushing interface due to corrosion of the cable is low.
In a possible embodiment, as shown in fig. 7, after the process of turning on the cable detection function or keeping the cable detection function in the turned-on state in step 102, the method further includes: when the interface is connected to the cable, step 301 is performed. In step 301, a resistance value of a cable detection pin on an interface is obtained, then step 302 is executed, in step 302, it is determined whether the resistance value of the cable detection pin meets a fast charging condition, if so, that is, if the resistance value of the cable detection pin meets the fast charging condition, it is indicated that a cable currently connected to the interface is a fast charging cable, step 303 is executed, a fast charging mode is entered, in the fast charging mode, an electronic device is charged through the fast charging cable based on a fast charging protocol, and if not, that is, if the resistance value of the cable detection pin does not meet the fast charging condition, the fast charging mode is not entered, but a corresponding flow is executed based on a non-fast charging cable. For example, if it is determined in step 302 that the cable is a non-fast charging cable, the electronic device may handshake with the connected external device through the non-fast charging cable, and determine a charging module supported by the external device based on a process of the handshake communication, and perform charging in a corresponding charging mode. That is, in fact, the cable detection function is used to detect whether the cable is a quick-charging cable, in addition to detecting whether the cable is a brusher cable. Therefore, in the embodiment of the application, the cable detection function is started after the boot process is finished, so that it is ensured that the electronic device can be normally charged based on the fast charging protocol through the fast charging cable after the boot process is finished. That is to say, this application embodiment still can guarantee normal quick charge cable discernment under the prerequisite that reduces the false triggering and gets into the interface of refreshing machine. Several scenarios involving fast-fill cable detection are described below.
In a sixth scenario, after the start-up process of the electronic device is completed, in step 102, the cable detection function is turned on, or the cable detection function is kept in a turned-on state, and a normal use process is performed. In the normal use process of the electronic device, the user connects the interface of the electronic device to the fast charging charger through the fast charging cable, and then step 302 and step 302 are performed. In step 302, it is determined that the resistance value of the cable detection pin satisfies the fast charging condition, so step 303 is performed, and the fast charging module is entered based on the handshake communication with the fast charging charger to implement the fast charging of the electronic device.
And a seventh scene, connecting the interface of the electronic equipment with the quick charging charger through the quick charging cable by the user, and then starting the electronic equipment. Step 101 is entered, the electronic device responds to the boot instruction and enters a boot process. In the starting-up process, no matter whether the cable detection function is started or not, the electronic equipment is plugged with the quick charging cable, so that the flash mode cannot be entered. After the power-on process is finished, the cable detection function is turned on in step 102, or the cable detection function is kept in a turned-on state, and then, since the interface is connected with the cable, steps 301 and 302 are performed. In step 302, it is determined that the resistance value of the cable detection pin satisfies the fast charging condition, so step 303 is performed, and the fast charging module is entered based on the handshake communication with the fast charging charger to implement the fast charging of the electronic device.
In a possible implementation manner, the cable detection pin is two configuration channel CC pins, that is, the structure connector in the embodiment of the present application is a USB Type C interface. The USB Type C interface includes a ground terminal pin, a power supply pin, a differential pair pin, a CC pin, and the like. In the embodiment of the present application, two CC pins are used as cable detection pins for cable detection, and it is understood that in other possible implementations, other types of interfaces may be used, or other pins may be used as cable detection pins.
In one possible implementation, the step of enabling the resistance value of the cable detection pin to satisfy the brushing condition comprises the following steps: one of the two CC pins has a resistance value of A, the other CC pin has a resistance value of B, and A is larger than B.
In one possible embodiment, a =56K, B = 22K; or a =56K and B = 10K. That is, in step 203, if one of the two CC pins is 56K and the other is 22K, or one of the two CC pins is 56K and the other is 10K, it is determined that the cable is a flush cable, and step 204 is executed to enter a flush mode. If the two CC pins do not satisfy one of 56K, the other is 22K, neither satisfy one of 56K, the other is 10K, then the boot process is continued. For a normal cable, one of the two CC pins is 56K, and the other is floating, but if the pin of the normal cable is corroded, one of the two CC pins of the corroded normal cable may be 56K, and the other is 22K or 10K. In this case, if it is determined in step 201 that the cable detection function is turned off, step 202 and step 203 are not executed, and thus the possibility of entering the flashing interface in such a scenario can be circumvented. The possibility that a corroded common cable is mistakenly judged as a flashing cable under the scene is avoided, and therefore the probability that the corroded common cable enters a flashing interface due to the mistaken judgment is reduced.
In a possible embodiment, after the process of turning on the cable detection function or keeping the cable detection function in a turned-on state in step 102, the method further includes: when the interface is connected with the cable, the resistance value of the cable detection pin on the interface is obtained. And if the resistance values of the two CC pins are A, entering a fast charging mode. That is, in step 302, determining whether the resistance value of the cable detection pin satisfies the fast charging condition refers to determining whether the resistance values of the two CC pins are both 56K, and if yes, performing step 303 and entering the fast charging mode.
An embodiment of the present application further provides an electronic device, where an interface of the electronic device is suitable for connecting a cable, and the electronic device includes: the starting control module is used for responding to a starting instruction to enter a starting process, starting a cable detection function after the starting process is finished, or keeping the cable detection function in a started state; the shutdown control module is used for responding to a shutdown instruction to enter a shutdown process, and closing the cable detection function in the shutdown process; and the cable detection module is used for acquiring the resistance value of a cable detection pin on the interface of the electronic equipment if the cable detection function is started in the starting process, and entering a flashing mode if the resistance value of the cable detection pin meets the flashing condition. The electronic device may apply the electronic device control method in any of the embodiments, and the specific process and principle thereof are not described herein again.
In one possible embodiment, the power-on instruction includes an instruction generated in response to a power key press in the power-off state.
In one possible embodiment, the power-on command includes a forced restart key command.
In one possible embodiment, the forced restart key instruction is an instruction generated in response to the combination of forced restart keys being continuously pressed for a preset time period, the preset time period being greater than 20 seconds.
In a possible implementation manner, the cable detection module is further configured to continue to execute the boot process if the resistance value of the cable detection pin does not satisfy the boot condition.
In a possible embodiment, the cable detection module is further configured to, in the boot process, continue to execute the boot process if the cable detection function is not turned on.
In a possible implementation manner, the cable detection module is further configured to, after the process of starting the cable detection function or maintaining the cable detection function in the started state, obtain a resistance value of a cable detection pin on the interface when the interface is connected to the cable, and enter the fast charging mode if the resistance value of the cable detection pin satisfies the fast charging condition.
In one possible embodiment, the cable detection pins are two configuration channel CC pins.
In one possible embodiment, the step of detecting that the resistance value of the cable detection pin meets the brushing condition includes: one of the two CC pins has a resistance value of A, the other CC pin has a resistance value of B, and A is larger than B.
In one possible embodiment, a =56K, B = 22K; or a =56K and B = 10K.
In a possible implementation manner, the cable detection module is further configured to, after the process of starting the cable detection function or maintaining the cable detection function in a started state, obtain a resistance value of a cable detection pin on the interface when the interface is connected to the cable, and enter the fast charging mode if the resistance values of the two CC pins are both a.
It should be understood that the above partition of the electronic device is only a logical partition, and the actual implementation may be wholly or partially integrated into one physical entity or may be physically separated. And these modules can all be implemented in the form of software invoked by a processing element; or may be implemented entirely in hardware; and part of the modules can be realized in the form of calling by the processing element in software, and part of the modules can be realized in the form of hardware. For example, any one of the startup control module, the shutdown control module, and the cable detection module may be a processing element that is separately installed, or may be integrated in the electronic device, for example, be integrated in a chip of the electronic device, or may be stored in a memory of the electronic device in the form of a program, and a processing element of the electronic device calls and executes the functions of the above modules. Other modules are implemented similarly. In addition, all or part of the modules can be integrated together or can be independently realized. The processing element described herein may be an integrated circuit having signal processing capabilities. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in the form of software.
For example, the power-on control module, the power-off control module, and the cable detection module may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. As another example, when one of the above modules is implemented in the form of a Processing element scheduler, the Processing element may be a general purpose processor, such as a Central Processing Unit (CPU) or other processor capable of invoking programs. As another example, these modules may be integrated together, implemented in the form of a system-on-a-chip (SOC).
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program runs on a computer, the computer is enabled to execute the electronic device control method in any of the above embodiments, and a specific process and a principle of the method are the same as those in the above embodiments, and are not described herein again.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the procedures or functions described in accordance with the present application are generated, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk), among others.
In the embodiments of the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, and means that there may be three relationships, for example, a and/or B, and may mean that a exists alone, a and B exist simultaneously, and B exists alone. Wherein A and B can be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" and similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b, and c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or multiple.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (15)

1. An electronic device control method, wherein an interface of the electronic device is adapted to connect a cable, the method comprising:
responding to a starting instruction to enter a starting process, and starting a cable detection function or keeping the cable detection function in a started state after the starting process is finished;
responding to a shutdown instruction to enter a shutdown process, and in the shutdown process, closing the cable detection function;
in the starting-up process, if the cable detection function is started, acquiring the resistance value of a cable detection pin on an interface of the electronic equipment, and if the resistance value of the cable detection pin meets a flashing condition, entering a flashing mode;
in the boot process, if the cable detection function is not started, the boot process is continuously executed.
2. The method of claim 1,
the power-on instruction includes an instruction generated in response to a power key press in a power-off state.
3. The method of claim 1,
the starting instruction comprises a forced restarting key instruction.
4. The method of claim 3,
the forced restart key instruction is an instruction generated by responding to the forced restart key combination and continuously pressing the forced restart key combination for a preset time length, and the preset time length is more than 20 seconds.
5. The method of claim 1,
and if the resistance value of the cable detection pin does not meet the condition of flashing, continuing to execute the starting-up process.
6. The method of claim 1,
after the process of turning on the cable detection function or maintaining the cable detection function in a turned-on state, the method further includes:
and when the interface is connected with the cable, acquiring the resistance value of the cable detection pin on the interface, and if the resistance value of the cable detection pin meets the quick charging condition, entering a quick charging mode.
7. The method of claim 1,
the cable detection pins are two configuration channel CC pins.
8. The method of claim 7,
the resistance value that the cable detected the pin satisfies the condition of brushing the quick-witted includes:
one of the two CC pins has a resistance value of A, the other CC pin has a resistance value of B, and A is larger than B.
9. The method of claim 8,
A=56K,B=22K;
or a =56K and B = 10K.
10. The method according to claim 8 or 9,
after the process of activating the cable detection function or maintaining the cable detection function in an activated state, the method further comprises:
and when the interface is connected with the cable, acquiring the resistance values of the cable detection pins on the interface, and if the resistance values of the two CC pins are A, entering a fast charging mode.
11. An electronic device, wherein an interface of the electronic device is adapted to connect a cable, the electronic device comprising:
the starting control module is used for responding to a starting instruction to enter a starting process, starting a cable detection function after the starting process is finished, or keeping the cable detection function in a started state;
the shutdown control module is used for responding to a shutdown instruction to enter a shutdown process, and in the shutdown process, the cable detection function is closed;
the cable detection module is used for acquiring the resistance value of a cable detection pin on an interface of the electronic equipment if the cable detection function is started in the starting-up process, and entering a machine-flushing mode if the resistance value of the cable detection pin meets a machine-flushing condition;
the cable detection module is further configured to, in the boot process, continue to execute the boot process if the cable detection function is not turned on.
12. The electronic device of claim 11,
the starting instruction comprises a forced restarting key instruction.
13. The electronic device of claim 11,
the cable detection module is further configured to, after the process of starting the cable detection function or maintaining the cable detection function in a started state, obtain a resistance value of a cable detection pin on the interface when the interface is connected to the cable, and enter a fast charging mode if the resistance value of the cable detection pin meets a fast charging condition.
14. An electronic device, characterized in that an interface of the electronic device is adapted to connect a cable, the electronic device comprising a processor and a memory for storing instructions which, when executed by the electronic device, implement the electronic device control method according to any one of claims 1 to 10.
15. A computer-readable storage medium, in which a computer program is stored which, when run on a computer, causes the computer to execute an electronic device control method according to any one of claims 1 to 10.
CN202210116916.8A 2022-02-08 2022-02-08 Electronic device, control method thereof, and storage medium Active CN114138377B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210116916.8A CN114138377B (en) 2022-02-08 2022-02-08 Electronic device, control method thereof, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210116916.8A CN114138377B (en) 2022-02-08 2022-02-08 Electronic device, control method thereof, and storage medium

Publications (2)

Publication Number Publication Date
CN114138377A CN114138377A (en) 2022-03-04
CN114138377B true CN114138377B (en) 2022-07-05

Family

ID=80381966

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210116916.8A Active CN114138377B (en) 2022-02-08 2022-02-08 Electronic device, control method thereof, and storage medium

Country Status (1)

Country Link
CN (1) CN114138377B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110417069A (en) * 2018-04-28 2019-11-05 华为技术有限公司 Charging equipment and USB cable and charging system
CN110557748A (en) * 2019-07-29 2019-12-10 惠州Tcl移动通信有限公司 detection circuit based on control chip, mobile terminal and data line

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108475227B (en) * 2016-03-31 2020-07-21 华为技术有限公司 Test functional assembly and data debugging method
CN108334357B (en) * 2017-01-20 2021-05-04 北京小米移动软件有限公司 Intelligent terminal and flashing method thereof
KR102521653B1 (en) * 2017-12-13 2023-04-14 삼성전자주식회사 Foreign substance detecting circuit and Electronic device having the same

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110417069A (en) * 2018-04-28 2019-11-05 华为技术有限公司 Charging equipment and USB cable and charging system
CN110557748A (en) * 2019-07-29 2019-12-10 惠州Tcl移动通信有限公司 detection circuit based on control chip, mobile terminal and data line

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"基于SOPC的手持式航空线缆检测仪设计";汪兴海 等;《电子设计工程》;20171220;第55-57页 *

Also Published As

Publication number Publication date
CN114138377A (en) 2022-03-04

Similar Documents

Publication Publication Date Title
US8078893B2 (en) Power supply method for supplying power to external device by selecting power supply mode in memory associated with identification information
CN109542744B (en) Method, device, storage medium and terminal for detecting abnormal starting problem of terminal
US9524216B2 (en) Method, device and mobile terminal for information backup
CN109522147A (en) A kind of method, apparatus, storage medium and the terminal of record booting exception information
WO2013123863A1 (en) Sleep method, wakeup method and mobile terminal device
CN111352038A (en) Method for battery swelling detection, information processing apparatus, and readable storage medium
CN109067416B (en) Method for realizing hot plug and start of SIM card and intelligent hardware
US11216053B2 (en) Systems, apparatus, and methods for transitioning between multiple operating states
US20180210783A1 (en) Information processing apparatus, control method of the same, and storage medium
WO2018045922A1 (en) Backup power method and apparatus
GB2463809A (en) Peripheral device operation method, peripheral device and host
WO2020010864A1 (en) Data storage method, system, and device during abnormal shutdown, and readable storage medium
CN111913669B (en) SSD power-down speed improving method and device, computer equipment and storage medium
US20130111199A1 (en) Information processing apparatus, method of switching between startup modes of information processing apparatus, and recording medium
CN109344104A (en) Electronic equipment and method for transmitting signals
EP2798428A1 (en) Apparatus and method for managing operation of a mobile device
CN115562895A (en) Method and device for recovering abnormality of electronic device
CN104460406A (en) Single-line communication method and single chip microcomputer firmware updating method based on single-line communication
CN114138377B (en) Electronic device, control method thereof, and storage medium
US8769252B2 (en) Computer system and method for resetting the same
US20140115378A1 (en) System and method for restoring network configuration parameters
US20230315157A1 (en) Moisture removal from device port
WO2016141554A1 (en) Self-loop detection method and apparatus for charging device
CN112860501B (en) Detection method, detection device, storage medium and mobile terminal
US20120054382A1 (en) Method of hand-held smart device for accessing data

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
GR01 Patent grant
GR01 Patent grant