WO2024131100A1 - 弹簧针接口连接状态检测方法、组合装置和电子设备 - Google Patents
弹簧针接口连接状态检测方法、组合装置和电子设备 Download PDFInfo
- Publication number
- WO2024131100A1 WO2024131100A1 PCT/CN2023/113097 CN2023113097W WO2024131100A1 WO 2024131100 A1 WO2024131100 A1 WO 2024131100A1 CN 2023113097 W CN2023113097 W CN 2023113097W WO 2024131100 A1 WO2024131100 A1 WO 2024131100A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- electronic device
- interface
- external device
- communication
- sensor
- Prior art date
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 75
- 230000006854 communication Effects 0.000 claims abstract description 487
- 238000004891 communication Methods 0.000 claims abstract description 485
- 230000004044 response Effects 0.000 claims abstract description 112
- 238000000034 method Methods 0.000 claims description 68
- 230000002159 abnormal effect Effects 0.000 claims description 32
- 238000003860 storage Methods 0.000 claims description 23
- 238000004590 computer program Methods 0.000 claims description 10
- 238000012360 testing method Methods 0.000 description 48
- 230000006870 function Effects 0.000 description 33
- 238000010586 diagram Methods 0.000 description 27
- 230000008859 change Effects 0.000 description 24
- 238000007726 management method Methods 0.000 description 24
- 238000012545 processing Methods 0.000 description 19
- 238000013461 design Methods 0.000 description 18
- 230000005236 sound signal Effects 0.000 description 17
- 230000001960 triggered effect Effects 0.000 description 17
- 230000005856 abnormality Effects 0.000 description 15
- 238000001179 sorption measurement Methods 0.000 description 14
- 230000005540 biological transmission Effects 0.000 description 13
- 238000005516 engineering process Methods 0.000 description 6
- 238000013500 data storage Methods 0.000 description 5
- 230000000694 effects Effects 0.000 description 5
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 4
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 230000009467 reduction Effects 0.000 description 4
- 229920001621 AMOLED Polymers 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000004519 manufacturing process Methods 0.000 description 3
- 230000005355 Hall effect Effects 0.000 description 2
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 2
- 238000013459 approach Methods 0.000 description 2
- 230000003416 augmentation Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000001413 cellular effect Effects 0.000 description 2
- 238000006073 displacement reaction Methods 0.000 description 2
- 230000014509 gene expression Effects 0.000 description 2
- 230000033001 locomotion Effects 0.000 description 2
- 230000005855 radiation Effects 0.000 description 2
- 238000009877 rendering Methods 0.000 description 2
- 239000000523 sample Substances 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 1
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 1
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 239000004020 conductor Substances 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 230000003862 health status Effects 0.000 description 1
- 230000001939 inductive effect Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 239000010985 leather Substances 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000003825 pressing Methods 0.000 description 1
- 239000002096 quantum dot Substances 0.000 description 1
- 230000003238 somatosensory effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000003786 synthesis reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01R—MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
- G01R31/00—Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
- G01R31/50—Testing of electric apparatus, lines, cables or components for short-circuits, continuity, leakage current or incorrect line connections
- G01R31/66—Testing of connections, e.g. of plugs or non-disconnectable joints
- G01R31/68—Testing of releasable connections, e.g. of terminals mounted on a printed circuit board
- G01R31/69—Testing of releasable connections, e.g. of terminals mounted on a printed circuit board of terminals at the end of a cable or a wire harness; of plugs; of sockets, e.g. wall sockets or power sockets in appliances
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01R—MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
- G01R31/00—Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
- G01R31/50—Testing of electric apparatus, lines, cables or components for short-circuits, continuity, leakage current or incorrect line connections
- G01R31/54—Testing for continuity
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Definitions
- the present application relates to the field of communication technology, and in particular to a method, a combination device and an electronic device for detecting the connection status of a spring pin interface.
- a detachable keyboard connected by spring pins.
- the detachable keyboard achieves physical connection by adsorbing its own spring pin interface with the spring pin interface of the electronic device.
- the detachable keyboard can transmit data with the electronic device through the spring pin interface to achieve communication connection.
- the position of the detachable keyboard may be moved, causing the spring pin interface of the detachable keyboard to contact the spring pin interface of the electronic device and cause position displacement, resulting in the detachable keyboard being disconnected from the electronic device and unable to communicate normally.
- the embodiments of the present application provide a method, a combined device and an electronic device for detecting the connection status of a spring pin interface, and the electronic device can obtain the physical connection status and the communication connection status of an external device in real time, so that the user can timely understand the connection status of a detachable keyboard and optimize the user experience.
- the embodiments of the present application adopt the following technical solutions.
- a method for detecting a connection state of a pogo pin interface is provided, which is applied to an electronic device, wherein the electronic device includes a pogo pin interface and a sensor, and the pogo pin interface includes a communication interface.
- the method includes:
- the electronic device detects the distance between the external device and the electronic device through a sensor; if the distance is less than a preset threshold, the electronic device sends a first instruction to the external device through a communication interface; if the electronic device does not receive a first response within a first time period, the electronic device sends a first prompt message, and the first prompt message is used to prompt the user that the external device and the electronic device have not established a communication connection.
- the first instruction may be a test instruction, and the corresponding first response is a test response; the first instruction may also be a communication instruction, and the corresponding first response is a communication response.
- the electronic device can detect the distance between the external device and the electronic device, and when it is determined that the distance is less than a preset threshold, it is determined that the electronic device and the external device have established a physical connection.
- the electronic device detects the communication connection through the communication interface, and when no response is received from the external device, the electronic device sends a corresponding prompt message to prompt the user that the communication connection between the external device and the electronic device is abnormal.
- the electronic device can obtain real-time The physical connection status and communication connection status between the external device and the electronic device, and a prompt message to remind the user when it is detected that the external device and the electronic device have not established a communication connection, can enable the user to accurately perceive the actual connection status of the external device in real time, without the need for the user to confirm whether the connection between the external device and the electronic device is abnormal by using the external device, thereby improving the user experience.
- the electronic device sends a first instruction to an external device through a communication interface, including:
- the electronic device sends a first instruction to the external device through the communication interface according to the first cycle.
- the first cycle may be a long cycle.
- the electronic device sending the first instruction may be a polling instruction within a long cycle.
- the electronic device sends the first instruction when it detects that the distance between the external device and the electronic device is less than a preset threshold, that is, the electronic device determines that the physical connection with the external device is normal.
- the first cycle may be a long cycle.
- the method further includes:
- the electronic device sends a second instruction to the external device through the communication interface according to a second cycle, and the electronic device does not receive a second response within a second time period; wherein the second cycle is shorter than the first cycle.
- the second cycle is different from the first cycle, and the second cycle is a short cycle.
- the electronic device determines that the communication connection with the external device is abnormal.
- the electronic device can quickly detect the external device. That is, when the electronic device determines that the external device and the electronic device have not established a communication connection, the electronic device can send a second instruction to the external device in a certain short cycle to continuously detect the communication connection status with the external device.
- the second instruction can be a test instruction or a communication instruction.
- the electronic device can quickly confirm whether the communication connection with the external device is really disconnected by performing a short-cycle detection.
- the electronic device determines that the communication with the external device is abnormal and outputs a first prompt message, so that the connection status detection is more timely and accurate.
- the method further includes:
- the electronic device receives the second response through the communication interface within the second time period, and the electronic device does not receive the second response within the second time period.
- the electronic device in the short-cycle detection, if the electronic device receives the second response within the second time period, it means that the communication connection between the electronic device and the external device is normal, and the electronic device can display the external device connection information on the display interface.
- the second response is received by sending the second instruction, thereby avoiding the randomness of the first response result and making the external device communication connection detection result more accurate.
- the electronic device sends a first prompt message, including:
- the electronic device displays the first prompt information; or the electronic device plays the first prompt information.
- the electronic device when the electronic device does not receive the first response and determines that the communication connection with the external device is disconnected, the electronic device can display the first prompt information in the display interface, for example, display the first prompt information in the form of a pop-up window.
- the electronic device can also play the first prompt information by voice.
- the electronic device can also play the first reminder information by other audio output methods.
- the method further includes:
- the electronic device displays external device connection information.
- the first duration is the time that the electronic device waits to receive the first response of the external device, and the first duration can be determined according to the actual communication status.
- the electronic device can display the external device connection information on the display interface. For example, a prompt message indicating that the external device is connected is displayed in a pop-up box on the display interface; or, an external device icon is displayed in the status bar of the display interface to indicate that the external device is connected. In this way, the user can obtain the status of the external device being connected in a timely and intuitive manner, so that the user can use the external device normally.
- the electronic device sends a first prompt message, including:
- the electronic device stops displaying the external device connection information.
- the electronic device when the electronic device does not receive the first response and determines that the communication connection with the external device is disconnected, the electronic device stops displaying the external device connection information.
- the external device icon stops being displayed in the status bar of the display interface.
- the electronic device may also stop displaying the external device icon in the status bar of the display interface while displaying the first prompt information in the form of a pop-up window on the display interface. The user can not only determine the communication connection status of the external device by whether the icon of the external device is displayed in the status bar, but also can more intuitively understand the connection status of the external device through the pop-up window of the display interface, thereby optimizing the user experience.
- the distance is less than a preset threshold, including:
- the electronic device detects that the level of the sensor changes from high to low.
- the electronic device determines the distance from the external device by detecting the level of the sensor.
- the electronic device detects that the level of the sensor will jump from a high level to a low level.
- the electronic device detects that the level of the sensor will jump from a low level to a high level.
- the principle of the high and low level jump of the level of the specific sensor can be determined according to the actual situation. In this way, the electronic device determines whether there is an external device close to the electronic device through the change state of the level of the sensor, thereby determining the physical connection state of the external device and the electronic device, so that the detection result of the connection state is more accurate.
- the high-low level jump of the sensor level includes:
- the level of the sensor changes from high level to low level; or, the level of the sensor changes from low level to high level; or, the level of the sensor generates a high level interrupt when it is at a low level and then restores to a low level; or, the level of the sensor generates a low level interrupt when it is at a high level and then restores to a high level.
- the electronic device can define a high-low level jump rule of a certain sensor level for the case where the distance between the external device and the electronic device is less than a preset threshold.
- a preset threshold When it is detected that the high-low level jump of the sensor level meets the agreed rule, it is determined that the distance between the external device and the electronic device is less than the preset threshold, and it is determined that the external device and the electronic device are physically connected, thereby obtaining the physical connection status of the external device and the electronic device, and the determination scheme is simple.
- the pogo pin interface further includes a power interface
- the method further includes:
- the electronic device controls the power supply interface to be powered on.
- the electronic device when it is detected that the high and low level jumps of the sensor level meet the agreed rules, it is determined that the distance between the external device and the electronic device is less than a preset threshold, and when it is determined that the external device is physically connected to the electronic device, the electronic device controls the power interface to power on, and the power interface of the electronic device supplies power to the power interface of the external device to establish a communication connection.
- the method further includes:
- the electronic device If the electronic device detects again that the level of the sensor changes from high to low, the electronic device sends a third instruction to the external device through the communication interface; if the electronic device does not receive a third response within a third time period, the electronic device controls the power interface to power off.
- the electronic device can determine that the sensor may be triggered by an accidental touch, and there is actually no external device connected to the electronic device.
- the electronic device can control the power interface to power off in time, avoiding the risk of short circuit caused by controlling the power interface to power on.
- the third time period can be the time the electronic device waits to receive the third response from the external device, and the third time period can be determined according to the actual communication conditions.
- the method further includes:
- the electronic device does not detect a high-low level jump of the sensor within a preset time period, and the electronic device sends a fourth instruction to the external device through the communication interface; the electronic device does not receive a fourth response within a fourth time period.
- the electronic device if the electronic device detects that the level of the sensor changes from high to low within a period of time, the electronic device confirms that it has been physically connected to the external device and has not been disconnected. In this case, the electronic device sends a fourth instruction to the external device for detection. If the fourth response is received, the electronic device continues to display the external device connection information; if the fourth response is not received within the fourth time period, the electronic device sends a first reminder message to promptly remind the user that the communication connection has been disconnected. In the present application, the electronic device detects the level of the sensor within a preset time period, and further confirms the physical connection between the electronic device and the external device. Among them, the fourth time period is the time that the electronic device waits to receive the fourth response of the external device, and the fourth time period can be determined according to the actual communication conditions.
- the method further includes:
- the electronic device sends a fifth instruction to an external device through a first communication interface; the first communication interface is any one of multiple communication interfaces; if the electronic device does not receive a fifth response through the first communication interface within a fifth time period, the electronic device displays a second prompt message; the second prompt message is used to indicate that the first communication interface is abnormal.
- the electronic device in combination with the scenario where there are multiple communication interfaces between the electronic device and the external device, in one example, sends a fifth instruction through the first communication interface, and under normal communication connection conditions, the electronic device will receive a fifth response through the first communication interface within the fifth time period. If the electronic device does not receive the fifth response through the first communication interface within the fifth time period, it is determined that the first communication interface is abnormal.
- the fifth time period is the time that the electronic device waits to receive the fifth response of the external device, and the fifth time period can be determined based on the actual communication conditions.
- the senor is any one of a Hall sensor, an infrared sensor, a distance sensor, a pressure sensor, a proximity light sensor, and an ambient light sensor.
- the senor may be a Hall sensor, an infrared sensor, a distance sensor, a pressure sensor, Any one of the proximity light sensor and the ambient light sensor.
- the Hall sensor when the magnet enters the detection area of the Hall sensor, the Hall sensor will be triggered to jump between high and low levels.
- a magnet is set in the external device, and a Hall sensor is set in the electronic device.
- the Hall sensor According to the distance between the magnet and the Hall sensor, for example, when the magnet enters the detection area of the Hall sensor and the distance between the magnet and the Hall sensor is less than a preset threshold, it is determined that the physical connection between the external device and the electronic device has been established.
- the Hall sensor is used in this solution to control the production cost while realizing the detection of the physical connection.
- a combination device of an electronic device and an external device comprising the electronic device and the external device;
- the electronic device includes a processor, a sensor, and a spring pin interface; the spring pin interface includes a communication interface; the processor is used to execute any one of the methods provided in the first aspect; the external device includes a processor and a spring pin interface; the spring pin interface includes a communication interface; when the electronic device is physically connected to the external device, the position of the spring pin interface of the electronic device is aligned with the position of the spring pin interface of the external device.
- the external device also includes a first component; the first component is a magnet; when the electronic device is physically connected to the external device, the magnet is located within the detection area of the Hall sensor.
- an electronic device comprising a memory, a sensor, a spring pin interface, a display screen and one or more processors; the memory, the sensor, the spring pin interface, the display screen are coupled to the processor; a computer program code is stored in the memory, and the computer program code comprises computer instructions, and when the computer instructions are executed by the processor, the electronic device executes a method as described in any one of the above-mentioned first aspects.
- a computer-readable storage medium wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is executed on an electronic device, the electronic device can execute any one of the methods described in the first aspect.
- a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute any one of the methods described in the first aspect.
- an embodiment of the present application provides a chip, the chip including a processor, the processor being used to call a computer program in a memory to execute a method as described in any one of the first aspects.
- beneficial effects that can be achieved by the combination of the electronic device and the external device described in the second aspect, the electronic device described in the third aspect, the computer-readable storage medium described in the fourth aspect, the computer program product described in the fifth aspect, and the chip described in the sixth aspect can refer to the beneficial effects in the first aspect and any possible design method thereof, and will not be repeated here.
- FIG1 is a schematic diagram of an application environment of a method for detecting a connection state of a pogo pin interface provided by an embodiment of the present application
- FIG2 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
- FIG3 is a software architecture diagram of an electronic device provided in an embodiment of the present application.
- FIG4 is a schematic diagram of the structure of an external device provided in an embodiment of the present application.
- FIG5 is a schematic diagram of a tablet computer connected to a detachable keyboard provided in an embodiment of the present application
- FIG6 is a flow chart of an external device detection method provided in an embodiment of the present application.
- FIG7 is a schematic diagram of a Hall sensor output level change of a tablet computer provided in an embodiment of the present application.
- FIG8 is a schematic diagram of another variation of the output level of a Hall sensor of a tablet computer provided in an embodiment of the present application.
- FIG9 is a schematic diagram of another variation of the output level of a Hall sensor of a tablet computer provided in an embodiment of the present application.
- FIG10 is a schematic diagram of another variation in output level of a Hall sensor of a tablet computer provided in an embodiment of the present application.
- FIG11 is a schematic diagram of changes in the output level of a Hall sensor of a tablet computer and the output level of a power interface when the keyboard adsorbs the tablet computer and communicates normally, provided by an embodiment of the present application;
- FIG. 12 is a schematic diagram of changes in the output level of the Hall sensor, the output level of the power interface, and the output level of the communication interface of the tablet computer when the keyboard adsorbs the tablet computer and communicates normally, provided by an embodiment of the present application;
- FIG13 is a schematic diagram of a keyboard icon displayed on a display interface of a tablet computer provided in an embodiment of the present application.
- FIG14 is a schematic diagram of a display interface of a tablet computer provided in an embodiment of the present application showing a communication interface abnormality reminder;
- FIG15 is a schematic diagram of another display interface of a tablet computer provided in an embodiment of the present application showing a communication interface abnormality reminder;
- FIG16 is a schematic diagram of a display interface of a tablet computer provided in an embodiment of the present application showing a reconnection prompt message
- FIG17 is a flow chart of another external device detection method provided in an embodiment of the present application.
- FIG18 is a schematic diagram of a display interface of a tablet computer provided in an embodiment of the present application showing a connection prompt message
- FIG19 is a schematic diagram of a display interface of a tablet computer provided by an embodiment of the present application stopping displaying a keyboard icon;
- 20 is a schematic diagram showing changes in the output level of a Hall sensor of a tablet computer provided by an embodiment of the present application, the output level of a power interface, and the output level of a communication interface when the Hall sensor is falsely triggered;
- FIG21 is a module structure diagram of an electronic device provided in an embodiment of the present application.
- FIG22 is a module structure diagram of an external device provided in an embodiment of the present application.
- FIG23 is a structural diagram of a chip system provided in an embodiment of the present application.
- a and/or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural.
- the character "/” generally indicates that the associated objects before and after are a kind of "or" relationship.
- references to "one embodiment” or “some embodiments” in this specification mean that one or more embodiments of the present application include a particular feature, structure or characteristic described in conjunction with the embodiment.
- the phrases “in one embodiment”, “in some embodiments”, “in other embodiments” and so on appearing in different places in this specification are interchangeable.
- “in other embodiments”, etc. do not necessarily refer to the same embodiment, but mean “one or more but not all embodiments", unless otherwise specifically emphasized in another way.
- the terms “including”, “comprising”, “having” and their variations all mean “including but not limited to", unless otherwise specifically emphasized in another way.
- the term “connected” includes direct and indirect connections, unless otherwise specified. "First” and “second” are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.
- words such as “exemplary” or “for example” are used to indicate examples, illustrations or descriptions. Any embodiment or design described as “exemplary” or “for example” in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as “exemplary” or “for example” is intended to present related concepts in a specific way.
- Figure 1 shows a schematic diagram of an electronic device 100 and an external device 200 connected through a pogo pin interface.
- the electronic device 100 and the external device 200 can achieve communication connection through the pogo pin interface.
- the pogo pin interface is a pogo pin interface.
- the electronic device 100 involved in this application can be a mobile phone, tablet computer, projector, laptop computer and other devices with a spring pin interface;
- the external device involved in this application can be a keyboard, drawing board, speaker device, camera, printer, external display, scanner and other devices with a spring pin interface.
- the external device can also be a smart headset, watch, bracelet and other devices with a spring pin interface, and the electronic device can be a headset shell, watch charger, bracelet charger, wireless charging device and other devices with a spring pin interface that provide power to the external device.
- a spring pin is a spring-type probe that is formed by riveting and pre-pressing three basic components: a pin shaft, a spring, and a pin tube.
- the probe enables the power supply of the device or the circuit conduction between devices to communicate.
- a spring pin interface is provided on the surface of the external device, and a spring pin interface is provided on the surface of the electronic device; one is a male socket and the other is a female socket.
- the spring pin interface of the external device is connected to the spring pin interface of the electronic device to achieve the effect of physical connection and communication connection between the external device and the electronic device through the spring pin.
- the spring pin interface of the external device is a male socket; the spring pin interface of the electronic device is a female socket.
- the relative position of the external device and the electronic device may move, causing the position of the spring pin interface to shift, causing the external device and the electronic device to be disconnected and unable to communicate normally.
- the position of the external device is moved, and the spring pin interface of the external device is not aligned with the spring pin interface of the electronic device, causing the external device and the electronic device to be disconnected and unable to communicate normally.
- the user often needs to use the external device to confirm whether the disconnection has occurred. The user cannot accurately perceive the actual status of the external device in a timely manner, resulting in a poor user experience.
- the keyboard is connected to the tablet computer's spring pin interface through a spring pin interface to achieve physical adsorption of the keyboard and the tablet computer, as well as communication connection between the keyboard and the tablet computer.
- the keyboard may not be able to communicate with the tablet computer.
- the user can only determine whether the keyboard and the tablet computer are disconnected by using the keyboard, which makes it impossible for the user to obtain the actual connection status of the keyboard in a timely manner, resulting in a poor user experience.
- a microcontroller unit is set in the electronic device and the external device, and the electronic device detects whether there is a signal loop in the spring pin interface through the MCU to determine whether the electronic device is connected to the external device.
- MCU microcontroller unit
- This solution requires the MCU to be set in the electronic device and the external device, and the hardware cost is relatively high.
- the electronic device and the external device are disconnected, it is impossible to distinguish whether the user manually disconnects or the external device and the electronic device are accidentally disconnected. In other words, this solution also cannot enable the user to accurately perceive the actual status of the external device.
- An embodiment of the present application provides an external device detection method.
- the physical connection status of the external device and the electronic device can be determined through the physical connection sensing device.
- the communication connection status of the external device and the electronic device is determined through the communication data of the spring pin interface between the electronic device and the external device.
- the actual connection status of the external device can be continuously obtained.
- the electronic device can prompt the user that the external device has been connected or disconnected by outputting prompt information on the display screen or outputting audio information, which can enable the user to accurately perceive the actual connection status of the external device in real time and improve the user experience.
- the electronic device 100 and the external device 200 involved in this application have the same number of spring pin interfaces.
- the spring pin interface between the electronic device and the external device may include a power interface, a ground interface, and at least one communication interface.
- the roles of different communication interfaces in the communication process can be agreed upon.
- the electronic device and the external device involved in this application are supporting devices, that is, the electronic device and the external device involved in this application have agreed on a communication protocol.
- the communication protocol stipulates the communication message format, the transmission direction and transmission content of each communication interface, etc.
- FIG. 2 shows a block diagram of an electronic device (such as an electronic device 100) provided in an embodiment of the present application.
- the electronic device 100 may include a processor 310, an external memory interface 320, an internal memory 321, a universal serial bus (USB) interface 330, a charging management module 340, a power management module 341, a battery 342, an antenna 1, a communication module 360, an audio module 370, a speaker 370A, a receiver 370B, a microphone 370C, an earphone interface 370D, a sensor module 380, a button 390, a motor 391, an indicator 392, a camera 393, a display screen 394 and a spring pin interface 399.
- USB universal serial bus
- the sensor module 380 may include a pressure sensor 380A, a gyroscope sensor 380B, an air pressure sensor 380C, a magnetic sensor 380D, a distance sensor 380F, a proximity light sensor 380G, a fingerprint sensor 380H, a temperature sensor 380J, a touch sensor 380K, an ambient light sensor 380L, and the like.
- the structure shown in the embodiment of the present invention does not constitute a limitation on the electronic device 100. It may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently.
- the components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
- the processor 310 may include one or more processing units.
- the processor 310 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and/or a neural-network processing unit (NPU).
- AP application processor
- GPU graphics processor
- ISP image signal processor
- controller a memory
- DSP digital signal processor
- DSP digital signal processor
- NPU neural-network processing unit
- Different processing units may be independent devices or integrated in one or more processors.
- the controller may be a decision maker that directs the various components of the electronic device 100 to work in coordination according to instructions.
- the controller generates operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
- the processor 310 may also be provided with a memory for storing instructions and data.
- the memory in the processor 310 is a high-speed cache memory, which can store instructions or data that the processor 310 has just used or cyclically used. If the processor 310 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 310, and thus improves the efficiency of the system.
- the processor 310 may include an interface.
- the interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input/output (GPIO) interface, and/or a USB interface.
- I2C inter-integrated circuit
- I2S inter-integrated circuit sound
- PCM pulse code modulation
- UART universal asynchronous receiver/transmitter
- MIPI mobile industry processor interface
- GPIO general-purpose input/output
- the interface connection relationship between the modules shown in the embodiment of the present invention is only for illustrative purposes and does not constitute a structural limitation on the electronic device 100.
- the electronic device 100 may adopt different interface connection methods in the embodiment of the present invention, or a combination of multiple interface connection methods.
- the charging management module 340 is used to receive charging input from a charger.
- the charger may be a wireless charger or a wired charger.
- the charging management module 340 may receive charging input from a wired charger through the USB interface 330.
- the charging management module 340 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 340 is charging the battery 342, it may also power the electronic device 100 through the power management module 341.
- the power management module 341 is used to connect the battery 342, the charging management module 340 and the processor 310.
- the power management module 341 receives input from the battery 342 and/or the charging management module 340, and supplies power to the processor 310, the internal memory 321, the external memory interface 320, the display screen 394, the camera 393, and the communication module 360.
- the power management module 341 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc.
- the power management module 341 can also be set in the processor 310.
- the power management module 341 and the charging management module 340 can also be set in the same device.
- the power management module 341 can also supply power to the power interface in the pogo pin interface 399.
- the processor can control the power management module to supply power to the power interface in the pogo pin interface 399.
- the processor determines that the external device has been physically disconnected from the electronic device, the processor can control the power management module to power off the power interface in the pogo pin interface 399.
- the wireless communication function of the electronic device 100 can be implemented through the antenna 1, the communication module 360, the modem and the baseband processor.
- the communication module 360 can provide a communication processing module for wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100.
- WLAN wireless local area networks
- BT Bluetooth
- GNSS global navigation satellite system
- FM frequency modulation
- NFC near field communication
- IR infrared
- the communication module 360 can be one or more devices integrating at least one communication processing module.
- the communication module 360 is connected to the electronic device 100 via the antenna 1 Receive electromagnetic waves, frequency modulate and filter the electromagnetic wave signals, and send the processed signals to the processor 310.
- the communication module 360 can also receive the signal to be sent from the processor 310, frequency modulate and amplify it, and convert it into electromagnetic waves for radiation through the antenna 1.
- the antenna 1 of the electronic device 100 is coupled to the communication module 360 so that the electronic device 100 can communicate with a network and other devices through wireless communication technology.
- the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and/or IR technology.
- the GNSS may include a global satellite positioning system (satellite based augmentation systems, SBAS), a global navigation satellite system (GLONASS), a BeiDou navigation satellite system (BDS), a Quasi-Zenith satellite system (QZSS) and/or a satellite based augmentation system (SBAS).
- SBAS global satellite positioning system
- GLONASS global navigation satellite system
- BDS BeiDou navigation satellite system
- QZSS Quasi-Zenith satellite system
- SBAS satellite based augmentation system
- the electronic device 100 implements the display function through a GPU, a display screen 394, and an application processor.
- the GPU is a microprocessor for image processing, which connects the display screen 394 and the application processor.
- the GPU is used to perform mathematical and geometric calculations for graphics rendering.
- the processor 310 may include one or more GPUs that execute program instructions to generate or change display information.
- Display screen 394 is used to display images, videos, etc.
- display screen 394 can display the real-time connection status of an external device.
- a small keyboard icon is displayed in the status bar of the display screen to indicate that the current external device (keyboard) is connected.
- the electronic device 100 when the electronic device 100 detects that the keyboard is connected, it can display a small keyboard icon in the status bar of the display screen, or output a prompt message that the keyboard is connected in the current display interface of the display screen; if it is detected that the keyboard is disconnected, the small keyboard icon displayed in the status bar of the display screen disappears, that is, the small keyboard icon is not displayed.
- a reminder pop-up window can also be output in the current interface displayed on the display screen, and the pop-up window content is used to remind the user to adjust the keyboard position so that the keyboard connection is restored to normal connection.
- the processor can also display abnormal communication interface information on the display screen when it is detected that there is no data communication between the keyboard and the electronic device and it is determined that there is an abnormality in the communication interface, reminding the user to maintain the communication interface in time.
- the display screen 394 includes a display panel.
- the display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc.
- the electronic device 100 may include 1 or N display screens 394, where N is a positive integer greater than 1.
- the electronic device 100 can realize the shooting function through ISP, camera 393, video codec, GPU, display screen and application processor.
- the external memory interface 320 can be used to connect an external memory card, such as a Micro SD card, to expand the electronic The storage capacity of the device 100.
- the external memory card communicates with the processor 310 through the external memory interface 320 to implement the data storage function. For example, music, video and other files are stored in the external memory card.
- the internal memory 321 can be used to store computer executable program codes, which include instructions.
- the processor 310 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 321.
- the internal memory 321 may include a program storage area and a data storage area.
- the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.
- the data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc.
- the internal memory 321 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, other volatile solid-state storage devices, a universal flash storage (UFS), etc.
- a non-volatile memory such as at least one disk storage device, a flash memory device, other volatile solid-state storage devices, a universal flash storage (UFS), etc.
- the electronic device 100 can implement audio functions such as music playing and recording through the audio module 370, the speaker 370A, the receiver 370B, the microphone 370C, the headphone jack 370D, and the application processor.
- the audio module 370 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal.
- the audio module 370 can also be used to encode and decode audio signals.
- the audio module 370 can be arranged in the processor 310, or some functional modules of the audio module 370 can be arranged in the processor 310.
- the speaker 370A also called a "speaker" is used to convert an audio electrical signal into a sound signal.
- the electronic device 100 can listen to music or listen to a hands-free call through the speaker 370A.
- the receiver 370B also called a "earpiece" is used to convert audio electrical signals into sound signals.
- the voice can be received by placing the receiver 370B close to the human ear.
- Microphone 370C also called “microphone” or “microphone” is used to convert sound signals into audio electrical signals. When making a call or sending a voice message, the user can make a sound by putting his mouth close to microphone 370C to input the sound signal into microphone 370C.
- the electronic device 100 can be provided with at least one microphone 370C. In some embodiments, the electronic device 100 can be provided with two microphones 370C, which can not only collect sound signals but also realize noise reduction function. In some embodiments, the electronic device 100 can also be provided with three, four or more microphones 370C to realize the collection of sound signals, noise reduction, identification of sound sources, realization of directional recording function, etc.
- the earphone interface 370D is used to connect a wired earphone.
- the earphone interface 370D may be the USB interface 330, or may be a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
- OMTP open mobile terminal platform
- CTIA cellular telecommunications industry association of the USA
- the spring pin interface 399 is used to establish a physical connection and a communication connection with an external device.
- the physical connection refers to the attachment connection between the external device and the electronic device.
- the communication connection refers to the data communication connection between the external device and the electronic device.
- the spring pin interface includes a power interface, a ground interface and at least one communication interface.
- the power interface is used to provide power to the external device when the electronic device determines to establish a physical connection with the external device.
- At least one communication interface is used to transmit data during the process of establishing a connection between the electronic device and the external device and after the connection is established.
- the electronic device and the external device follow the same communication protocol, for example, the electronic device and the external device follow the same public communication protocol; for example, the electronic device and the external device follow an agreed private communication protocol.
- the communication protocol may specify the communication message format, the transmission direction and content of each communication interface, etc. For example, if there is only one communication interface, the communication protocol between the electronic device and the external device may stipulate that the communication interface is in In the same time period, data can only be transmitted in one direction. For example, when the communication interface of the electronic device receives communication data sent by the external device, it cannot send communication data to the external device. When the communication interface of the external device sends communication data to the electronic device, it cannot receive communication data sent by the external device.
- the communication protocol between the electronic device and the external device can stipulate that the communication mode of the communication interface is that the communication interface 1 of the electronic device is only used for communication data sent to the external device, and the communication interface 2 is only used for receiving communication data sent by the external device; accordingly, the communication interface 1 of the external device is only used to receive communication data sent by the electronic device, and the communication interface 2 is only used for communication data sent to the electronic device.
- the communication interface 1 between the electronic device and the external device can be used for sending and receiving communication data; the communication interface 2 between the electronic device and the external device is a backup interface. For example, under normal circumstances, the electronic device and the external device perform data transmission through the communication interface 1.
- the electronic device can send a request to the external device to perform data transmission through the communication interface 2, so that the external device performs communication data transmission through the communication interface 2.
- the communication data types of communication interface 1 and communication interface 2 are different.
- communication interface 1 between the electronic device and the external device is used to transmit normal communication data
- communication interface 2 between the electronic device and the external device is used to transmit test data, etc.
- the role of the communication interface of the spring pin interface can be agreed in the communication protocol according to the actual usage scenario.
- the pressure sensor 380A is used to sense the pressure signal and can convert the pressure signal into an electrical signal.
- the pressure sensor 380A can be set on the display screen 394.
- pressure sensors 380A such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc.
- a capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor, the capacitance between the electrodes changes.
- the electronic device 100 determines the intensity of the pressure based on the change in capacitance.
- the electronic device 100 detects the intensity of the touch operation based on the pressure sensor 380A.
- the electronic device 100 can also calculate the position of the touch based on the detection signal of the pressure sensor 380A.
- the processor or SOC of the electronic device can detect whether the external device has established a physical connection with the electronic device through a pressure sensor. For example, if the pressure value obtained by the processor or SOC of the electronic device through the pressure sensor is less than the pressure threshold, it is determined that the external device is connected and is in place. If the pressure value obtained by the processor or SOC of the electronic device through the pressure sensor is greater than the pressure threshold, it is determined that the external device is disconnected and is not in place.
- the processor or SOC of the electronic device detects that the external device is connected through the pressure sensor, it can also combine the gyroscope sensor to obtain the current posture of the electronic device to further confirm the physical connection status between the electronic device and the external device.
- the gyro sensor 380B can be used to determine the motion posture of the electronic device 100.
- the angular velocity of the electronic device 100 around three axes i.e., x, y, and z axes
- the gyro sensor 380B can be used for anti-shake shooting.
- the gyro sensor 380B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake.
- the gyro sensor 380B can also be used for navigation and somatosensory game scenes.
- the Hall sensor 380C is a magnetic field sensor made based on the Hall effect. When a magnet enters the detection area of the Hall sensor, the Hall sensor is triggered and its output level is interrupted.
- the Hall sensor can be used to detect the physical connection between the external device and the electronic device, that is, the Hall sensor can detect the distance between the external device and the electronic device.
- the electronic device may also include other magnetic field sensors.
- the Hall sensor is a magnetic field sensor made based on the Hall effect.
- the magnet When approaching or moving away from the detection area of the Hall sensor, the magnet will trigger the magnetic field of the Hall sensor to change.
- the Hall sensor in the electronic device maintains an output level when the magnet is not detected in the detection area. For example, the output level of the Hall sensor is low when the magnet is not detected in the detection area.
- the magnetic field that triggers the Hall sensor changes, and the output level of the Hall sensor also changes.
- the output level of the Hall sensor can be changed from a low level to a high level.
- the output level of the Hall sensor generates an adsorption interrupt.
- the magnetic field that triggers the Hall sensor changes, and the output level of the Hall sensor also changes.
- the output level of the Hall sensor can be changed from a high level to a low level.
- the output level of the Hall sensor generates an adsorption interrupt.
- the processor or system on chip (SOC) of the electronic device 100 generates an adsorption interrupt when detecting that the output level of the Hall sensor changes from a low level to a high level, or when detecting that the output level of the Hall sensor is at a low level, and determines that the magnet enters the detection area of the Hall sensor. That is, it is determined that the external device is in a physically connected state with the electronic device 100, and the external device is in a position state.
- SOC system on chip
- the processor or SOC of the electronic device 100 generates an adsorption interrupt when detecting that the output level of the Hall sensor can change from a high level to a low level, or when detecting that the output level of the Hall sensor is at a high level, and determines that the magnet leaves the detection area of the Hall sensor. That is, it is determined that the external device is in a separated state with the electronic device 100, and the external device is not in a position state.
- the distance sensor 380F is used to measure the distance.
- the electronic device 100 can measure the distance by infrared or laser.
- the processor or SOC of the electronic device can detect whether the external device has established a physical connection with the electronic device through a distance sensor. For example, if the distance value obtained by the processor or SOC of the electronic device through the infrared sensor is less than the first distance threshold, it is determined that the external device is connected and is in a state. If the distance value obtained by the processor or SOC of the electronic device through the infrared sensor is greater than the second distance threshold, it is determined that the external device is disconnected and is not in a state.
- the processor or SOC of the electronic device detects that the external device is connected through the distance sensor, it can also combine the gyroscope sensor to obtain the current posture of the electronic device to further confirm the physical connection status between the electronic device and the external device.
- the proximity light sensor 380G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode.
- the light emitting diode may be an infrared light emitting diode. Infrared light is emitted outward through the light emitting diode.
- a photodiode is used to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, it can be determined that there is no object near the electronic device 100.
- the electronic device 100 can use the proximity light sensor 380G to detect when a user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power.
- the proximity light sensor 380G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.
- the ambient light sensor 380L is used to sense the ambient light brightness.
- the electronic device 100 can adaptively adjust the display brightness according to the perceived ambient light brightness.
- the ambient light sensor 380L can also be used to automatically adjust the white balance when taking pictures.
- the ambient light sensor 380L can also cooperate with the proximity light sensor 380G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
- the processor or SOC of the electronic device can detect whether the external device has established a physical connection with the electronic device through the ambient light sensor. For example, if the brightness value obtained by the processor or SOC of the electronic device through the ambient light sensor is less than the brightness threshold, it is determined that the external device is connected and is in place. If the brightness value obtained by the processor or SOC of the electronic device through the infrared sensor is greater than the brightness threshold, it is determined that the external device has been disconnected and is not in place.
- the processor or SOC of the electronic device detects that the external device is connected through the ambient light sensor, it can also combine with the gyroscope sensor to obtain the current posture of the electronic device to further confirm the physical connection status between the electronic device and the external device.
- the temperature sensor 380J is used to detect temperature.
- the electronic device 100 uses the temperature detected by the temperature sensor 380J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 380J exceeds a threshold, the electronic device 100 reduces the performance of a processor located near the temperature sensor 380J to reduce power consumption and implement thermal protection.
- the touch sensor 380K also called a “touch panel”, may be disposed on the display screen 394 to detect a touch operation applied thereto or thereabout. The detected touch operation may be transmitted to the application processor to determine the type of touch event and provide a corresponding visual output through the display screen 394.
- the key 390 includes a power key, a volume key, etc.
- the key 390 may be a mechanical key or a touch key.
- the electronic device 100 receives the key 390 input and generates a key signal input related to the user settings and function control of the electronic device 100.
- Motor 391 can generate vibration prompts.
- Motor 391 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback.
- touch operations acting on different applications can correspond to different vibration feedback effects.
- Touch operations acting on different areas of the display screen 394 can also correspond to different vibration feedback effects.
- Different application scenarios for example: time reminders, receiving messages, alarm clocks, games, etc.
- the touch vibration feedback effect can also support customization.
- Indicator 392 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
- the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture.
- the Android system of the layered architecture is taken as an example to exemplify the software structure of the electronic device 100.
- FIG3 is a block diagram of the operating system software structure of the electronic device 100 of an embodiment of the present invention.
- the layered architecture divides the software into several layers, each layer has a clear role and division of labor.
- the layers communicate with each other through software interfaces.
- the operating system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the system runtime and system library, and the kernel layer.
- the application layer can include a series of application packages.
- the application package may include applications such as camera, gallery, calendar, phone, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
- the application framework layer provides application programming interface (API) and programming framework for the applications in the application layer.
- API application programming interface
- the application framework layer includes some predefined functions.
- the application framework layer may include a detection module, a window manager, a content provider, a view system, a telephony manager, a resource manager, and a notification manager.
- the detection module is used to continuously detect the connection status of the external device in real time.
- the detection module outputs the connection information on the display interface of the electronic device through the viewing system, and displays the icon of the external device in the status bar of the display interface; when it is detected that the external device is disconnected from the electronic device, the detection module outputs the reconnection information on the display interface of the electronic device through the viewing system.
- the detection module can output the information of the communication interface abnormality on the display interface of the electronic device through the viewing system.
- the window manager is used to manage window programs.
- the window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
- the content provider is used to store and obtain data and make the data accessible to applications.
- the data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
- the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc.
- the view system can be used to build applications.
- the display interface can be composed of one or more views.
- the phone manager is used to provide communication functions for the electronic device 100. For example, the management of call status (including connected, hung up, etc.).
- the resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, etc.
- the notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify the completion of downloads, message reminders, etc.
- the notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in the status bar, a prompt sound is emitted, the electronic device vibrates, the indicator light flashes, etc.
- the system runtime includes the core library and the virtual machine.
- the system runtime is responsible for the scheduling and management of the operating system.
- the core library contains two parts: one is the function that the Java language needs to call, and the other is the core library of the operating system.
- the application layer and the application framework layer run in a virtual machine.
- the virtual machine executes the Java files of the application layer and the application framework layer as binary files.
- the virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
- the system library can include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as openGL ES), 2D graphics engine (such as SGL), etc.
- functional modules such as surface manager, media libraries, 3D graphics processing library (such as openGL ES), 2D graphics engine (such as SGL), etc.
- the surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
- the media library supports playback and recording of multiple common audio and video formats, as well as static image files.
- the media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
- the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing.
- the 2D graphics engine is a drawing engine for 2D drawing.
- the kernel layer is the layer between hardware and software.
- the kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
- the senor is a Hall sensor.
- the Hall sensor When a magnet enters the detection area of the Hall sensor, the Hall sensor is triggered, and the sensor driver transmits the output level of the Hall sensor to the detection module.
- the detection module controls the power on or off of the power interface according to the change of the output level of the Hall sensor.
- the detection module determines the connection status between the external device and the electronic device according to the change of the output level of the Hall sensor and the change of the output level of the detected communication interface, and displays the corresponding content in the display interface of the display screen by controlling the display driver.
- the detection module determines that the electronic device and the external device are connected in communication
- the detection module controls the display driver to display the keyboard icon in the display interface of the display screen
- the detection module determines that the communication connection between the electronic device and the external device is disconnected
- the detection module stops displaying the keyboard icon in the display interface of the display screen by controlling the display driver, and so on.
- FIG 4 shows a structural block diagram of an external device (such as an external device 200) provided in an embodiment of the present application.
- the external device 200 may include a processor 410, a spring pin interface 420, a communication module 430, an indicator 450, a button 460, an audio module 470, a speaker 470A, a receiver 470B, a microphone 470C, and an earphone interface 470D.
- the structure shown in the embodiment of the present invention does not constitute a limitation on the external device 200. It may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently.
- the components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
- the processor 410 may include one or more processing units.
- the processor 410 may include an application processor AP, a microcontroller unit (MCU), a modem processor, a controller, a memory, a video codec, a digital signal processor DSP, and/or a baseband processor, etc.
- Different processing units may be independent devices or integrated into one or more processors.
- the controller can be a decision maker that directs the various components of the external device 200 to work in coordination according to the instructions. It is the nerve center and command center of the external device 200.
- the controller generates an operation control signal according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
- the processor 410 may also be provided with a memory for storing instructions and data.
- the memory in the processor 410 is a high-speed cache memory, which can store instructions or data that the processor 410 has just used or cyclically used. If the processor 410 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 410, and thus improves the efficiency of the system.
- the processor 410 may include an interface.
- the interface may include an integrated circuit I2C interface, an integrated circuit built-in audio I2S interface, a pulse code modulation PCM interface, a universal asynchronous receiver and transmitter UART interface, a mobile industry processor interface MIPI, a general purpose input and output GPIO interface and/or a USB interface, etc.
- the interface connection relationship between the modules shown in the embodiment of the present invention is only for illustrative purposes and does not constitute a structural limitation on the external device 200.
- the external device 200 may adopt different interface connection methods in the embodiment of the present invention, or a combination of multiple interface connection methods.
- the internal memory 421 can be used to store computer executable program codes, which include instructions.
- the processor 410 executes various functional applications and data processing of the external device 200 by running the instructions stored in the internal memory 421.
- the internal memory 421 may include a program storage area and a data storage area.
- the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.
- the data storage area may store data created during the use of the external device 200 (such as audio data, a phone book, etc.), etc.
- the internal memory 421 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, other volatile solid-state storage devices, a universal flash storage (UFS), etc.
- a non-volatile memory such as at least one disk storage device, a flash memory device, other volatile solid-state storage devices, a universal flash storage (UFS), etc.
- the wireless communication function of the external device 200 can be implemented through the antenna 1, the communication module 430 and the baseband processor.
- the communication module 430 can provide a communication processing module for wireless communication solutions including wireless local area network WLAN (such as Wi-Fi network), Bluetooth BT, global navigation satellite system GNSS, frequency modulation FM, near-field wireless communication technology NFC, infrared technology IR, etc. applied to the communication module 360.
- the communication module 430 can be one or more devices integrating at least one communication processing module.
- the communication module 430 receives electromagnetic waves via the antenna 1, modulates the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 410.
- the communication module 430 can also receive the electromagnetic wave signal from the processor 410.
- the device 410 receives the signal to be sent, modulates the frequency of the signal, amplifies the signal, and converts the signal into electromagnetic waves for radiation through the antenna 1.
- the electronic device 100 can implement audio functions, such as playing prompt sounds, through the audio module 470 , the speaker 470A, the receiver 470B, the microphone 470C, the headphone jack 470D, and the application processor.
- audio functions such as playing prompt sounds, through the audio module 470 , the speaker 470A, the receiver 470B, the microphone 470C, the headphone jack 470D, and the application processor.
- the audio module 470 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal.
- the audio module 470 can also be used to encode and decode audio signals.
- the audio module 470 can be arranged in the processor 410, or some functional modules of the audio module 470 can be arranged in the processor 410.
- the speaker 470A also called a "speaker" is used to convert audio electrical signals into sound signals.
- the external device 200 can play a prompt tone through the speaker 470A.
- the processor 410 can control the speaker 470A to output a "beep" prompt tone to prompt the user that a connection has been established with the electronic device.
- the receiver 470B also called a "handset" is used to convert audio electrical signals into sound signals.
- Microphone 470C also called “microphone” or “microphone” is used to convert sound signals into audio electrical signals.
- the external device 200 can be provided with two microphones 470C, which can not only collect sound signals but also realize noise reduction function.
- the electronic device 100 can also be provided with three, four or more microphones 470C to realize sound signal collection, noise reduction, sound source identification, directional recording function, etc.
- the earphone interface 470D is used to connect a wired earphone and can be a USB interface, or a 3.5 mm open mobile terminal platform OMTP standard interface, or a CTIA standard interface of the United States Cellular Telecommunications Industry Association.
- the spring pin interface 420 is used to establish a physical connection and a communication connection with the electronic device 100.
- the spring pin interface includes a power interface, a ground interface and at least one communication interface.
- the power interface is used to provide power to the external device when establishing a physical connection with the electronic device.
- At least one communication interface is used to transmit data during the process of establishing a connection between the electronic device and the external device and after the connection is established.
- the electronic device and the external device agree on a communication protocol.
- the communication protocol can stipulate the communication message format, the transmission direction and transmission content of each communication interface, etc. For example, if there is only one communication interface, the communication protocol between the electronic device and the external device can stipulate that the communication interface can only transmit data in one direction within the same time period.
- the communication interface of the electronic device when the communication interface of the electronic device receives communication data sent by the external device, it cannot send communication data to the external device.
- the communication interface of the external device sends communication data to the electronic device, it cannot receive communication data sent by the external device.
- the communication protocol between the electronic device and the external device may stipulate that the communication mode of the communication interface is that the communication interface 1 of the electronic device is only used for communication data sent to the external device, and the communication interface 2 is only used for receiving communication data sent by the external device; accordingly, the communication interface 1 of the external device is only used to receive communication data sent by the electronic device, and the communication interface 2 is only used for communication data sent to the electronic device.
- the communication interface 1 between the electronic device and the external device can be used for sending and receiving communication data; the communication interface 2 between the electronic device and the external device is a backup interface.
- the electronic device and the external device transmit data through the communication interface 1.
- the electronic device cannot obtain communication data from the communication interface 1, the electronic device can send a request to the external device to transmit data through the communication interface 2, so that the external device transmits communication data through the communication interface 2.
- the communication data types of the communication interface 1 and the communication interface 2 are different.
- the communication interface 1 between the electronic device and the external device is used to transmit normal communication data
- the communication interface 2 between the electronic device and the external device is used to transmit test data, etc.
- the role of the communication interface can be stipulated in the communication protocol according to the actual usage scenario.
- the position of the spring pin interface of the electronic device 100 corresponds to the position of the spring pin interface of the external device 200.
- the electronic device 100 and the external device 200 are adsorbed, the female spring pin socket of the electronic device 100 and the male spring pin socket of the external device 200 are correspondingly fitted.
- This embodiment does not limit the specific position of the spring pin interface in the electronic device.
- the external device 200 includes a first component 440 .
- the first component 440 is a component that matches the sensor in the electronic device 100.
- the electronic device 100 can detect the presence status of the external device 200 based on the sensor and the first component.
- the sensor in the electronic device 100 is a Hall sensor
- the first component 440 of the external device 200 can be a magnet.
- the magnet enters or leaves the detection area of the Hall sensor, triggering a change in the output level of the Hall sensor.
- the electronic device 100 can determine the connection status of the external device based on the level change.
- the senor in the electronic device 100 and the first component in the external device 200 constitute a sensing device for the physical connection between the electronic device and the external device.
- the position of the sensor of the electronic device 100 corresponds to the position of the first component 440 of the external device 200. This embodiment does not limit the positions of the sensor of the electronic device 100 and the first component 440 of the external device 200.
- Indicator 450 may be an indicator light, which may be used to indicate charging status, power changes, messages, notifications, etc.
- the key 460 includes a keyboard key, etc.
- the key 460 can be a mechanical key or a touch key.
- the external device 200 receives the key 460 input and generates a key signal input related to the data input and function control of the electronic device 100.
- the spring pin interface connection status detection method provided by the present application is to set a sensor on the electronic device, and set a component corresponding to the sensor on the external device to realize the detection of the physical connection status between the electronic device and the external device.
- the physical connection status between the electronic device and the external device can be further determined.
- the detection of the communication connection between the electronic device and the external device can also be realized when the physical connection between the electronic device and the external device is determined to be normal by the sensor.
- the connection status (communication connection status) of the spring pin interface between the electronic device and the external device is detected, and the detection result obtained is more accurate.
- the spring pin interface connection status detection method provided in the present application can be applied to FIG5, which shows an example of an electronic device and an external device.
- the electronic device is a tablet computer
- the external device is a detachable keyboard (hereinafter referred to as keyboard).
- the tablet computer and the detachable keyboard are both provided with three spring pin interfaces, wherein the three spring pin interfaces include a power interface, a ground interface, and a communication interface.
- the sensor for detecting the physical position connection is a Hall sensor, and accordingly, the component for detecting the physical position connection set in the keyboard is a magnet.
- the position of the spring pin interface of the tablet computer corresponds to the position of the spring pin interface of the keyboard.
- the position of the spring pin interface of the tablet computer and the position of the spring pin interface of the keyboard are in an aligned state.
- the spring pin interface of the tablet computer and the spring pin interface of the keyboard are correspondingly arranged on the left side of the device.
- the Hall sensor in the tablet computer corresponds to the position of the magnet of the keyboard.
- the magnet of the keyboard should be within the detection area of the Hall sensor of the tablet computer.
- the Hall sensor in the tablet computer and the magnet of the keyboard are correspondingly arranged on the right side of the device.
- the magnet of the keyboard enters the detection area of the Hall sensor of the tablet computer, triggering a change in the output level of the Hall sensor.
- the SOC of the tablet computer detects a change in the output level of the Hall sensor, controls the power interface to be powered on, and sends a command to the keyboard through the communication interface. If the SOC receives a response from the keyboard, it is determined that the keyboard and the tablet computer have established a communication connection.
- the SOC sends a command to the keyboard but does not receive a corresponding response, and the SOC determines that the output level of the Hall sensor has not changed, that is, the keyboard has not been removed from the tablet by the user, the spring pin interface may be displaced and unable to communicate.
- the electronic device sends a prompt message to remind the user to reconnect the keyboard to restore the connection.
- the prompt message is output on the display interface of the display screen.
- the SOC of the electronic device in this embodiment is the execution subject of the external device detection method, and an external device detection method is provided.
- the method includes:
- the keyboard may be a magnetic keyboard.
- the tablet computer When the user connects the keyboard to the tablet computer, the tablet computer may be placed in the magnetic slot of the keyboard to achieve magnetic adsorption of the tablet computer and the keyboard.
- the spring pin interface of the keyboard may be disposed in the magnetic slot, and the spring pin interface of the tablet computer may be disposed on a surface adsorbed to the magnetic slot of the keyboard.
- the spring pin interface of the tablet computer and the spring pin interface of the keyboard are in a fit and alignment state.
- the magnet in the keyboard enters the detection area of the Hall sensor of the tablet computer, and the magnet approaches the Hall sensor, causing the output level of the Hall sensor to change.
- the SOC of the tablet computer monitors the output level of the Hall sensor to determine whether the keyboard and the tablet computer are adsorbed and connected.
- the SOC detects that the output level of the Hall sensor changes, and the SOC controls the power supply interface to power on.
- the Hall sensor in the tablet computer can maintain an output level before being triggered by a magnet.
- the output level of the Hall sensor remains at a low level before being triggered by a magnet.
- the output level of the Hall sensor remains at a high level before being triggered by a magnet.
- the SOC can obtain the output level of the Hall sensor through the sensor driver at a certain detection frequency.
- the SOC can continuously monitor the output level of the Hall sensor through the sensor driver; or, the SOC can obtain and record the output level of the Hall sensor through the sensor driver every 1 second.
- the SOC can compare the currently obtained output level with the historically obtained output level to determine whether the output level of the Hall sensor has changed over a period of time.
- the user adsorbs and connects the keyboard to the tablet computer, and after the tablet computer is physically connected to the keyboard through the spring pin interface, the distance between the magnet of the keyboard and the Hall sensor of the tablet computer is less than a preset threshold.
- the tablet computer detects through the Hall sensor that the magnet enters the detection area of the Hall sensor, the Hall sensor is triggered, and its output level changes.
- the output level of the Hall sensor before being triggered is Low level
- the Hall sensor detects the magnet in the detection area, and the output level of the Hall sensor becomes high level.
- the SOC can determine whether the level changes from low to high based on the output level of the Hall sensor obtained over a period of time. If the output level of the Hall sensor changes from low to high, the SOC powers on by controlling the power interface of the tablet.
- the output level of the Hall sensor is high before being triggered.
- the Hall sensor detects a magnet in the detection area, and the output level of the Hall sensor becomes low.
- the SOC can determine whether there is a change from high to low based on the output level of the Hall sensor obtained over a period of time. If the output level of the Hall sensor changes from a high level to a low level, the SOC powers on by controlling the power interface of the tablet.
- the output level of the Hall sensor is high before being triggered.
- the Hall sensor detects the magnet in the detection area, and the output level of the Hall sensor generates a low-level adsorption interrupt.
- the SOC can determine whether there is an adsorption interrupt based on the output level of the Hall sensor obtained over a period of time. If the SOC detects that the output level of the Hall sensor is high for a period of time, an adsorption interrupt is generated, and the SOC powers on by controlling the power interface of the tablet.
- the output level of the Hall sensor is low before being triggered.
- the Hall sensor detects the magnet in the detection area, and the output level of the Hall sensor generates a high-level adsorption interrupt.
- the SOC can determine whether there is an adsorption interrupt based on the output level of the Hall sensor obtained over a period of time. If the SOC detects that the output level of the Hall sensor is low for a period of time, an adsorption interrupt is generated, and the SOC powers on by controlling the power interface of the tablet.
- the range size of the detection area of the Hall sensor is determined by the factory parameters of the sensor.
- the SOC determines that the Hall sensor is triggered by a magnet
- the power interface of the tablet computer is powered on.
- the output level of the power interface can be shown in FIG. 11, and the initial output level of the Hall sensor is a high level.
- the magnet of the keyboard approaches the Hall sensor of the tablet computer, the magnet enters the detection area of the Hall sensor, triggering the output level of the Hall sensor to generate an adsorption interrupt, and the output level of the Hall sensor changes from a high level to a low level.
- the SOC controls the power interface to be powered on, and the output level of the power interface changes from an unpowered state (low level) to a powered state (high level).
- the SOC can also determine whether the power interface is abnormal based on the output level of the power interface. If the power interface is abnormal, the SOC can also output information about the abnormality of the power interface on the display interface to remind users to maintain the power interface in time.
- the SOC detects that the output level of the Hall sensor changes from a high level to a low level and controls the power supply interface to be powered on
- the communication interface of the tablet computer transmits communication data
- the output level of the communication interface changes with the transmission of the communication data.
- a communication connection is established between the keyboard and the tablet computer. Under normal communication connection conditions, the keyboard and the tablet computer transmit communication instructions through the communication interface, and the output level of the communication interface changes regularly in accordance with the communication protocol agreement.
- a change in the output level of the communication interface indicates that data is being transmitted between the communication interfaces.
- the SOC may To further verify whether the transmitted data is abnormal, if the SOC determines that the transmitted data is abnormal, that is, the level change pattern does not conform to the communication protocol, then the communication interface communication connection is considered abnormal.
- the communication instruction carries communication data, where the format of the communication data between the keyboard and the tablet computer can be agreed upon in the communication protocol.
- the SOC sends a first instruction to the keyboard through the communication interface, and if the SOC receives a first response, determines to establish a communication connection with the keyboard, and executes S104. If the SOC does not receive the first response within the first time period, executes S106.
- the first instruction is used to test whether the communication connection between the tablet computer and the keyboard is normal.
- the first instruction may be a test instruction, the test instruction may carry test data, and the data format of the test data and the communication data may be the same.
- the SOC may send a first instruction to the keyboard in a first cycle.
- the first cycle may be a long cycle, for example, the first cycle may be 10 seconds or 15 seconds.
- the first instruction may be a polling instruction under normal connection.
- the first instruction may be a test instruction.
- the data format of the test instruction and the communication instruction may be the same or different.
- a certain bit of the data format may be agreed to be a test flag. If the value of the test flag is a first value, the command is a test instruction; if the value of the test flag is a second value, the command is a communication instruction. Among them, the first value may be 0, and the second value may be 1, without limitation.
- the data format of the test instruction and the communication instruction may also be different. For example, the test instruction is 32-bit data; the communication instruction is 64-bit data. After the communication protocol is agreed, the external device can distinguish whether the currently received instruction is a test instruction or a communication instruction according to the agreed data format.
- Test flag after receiving the test instruction, the keyboard reads the test flag by analyzing the test instruction, and returns a test response corresponding to the test instruction to the tablet computer. If the SOC does not receive the test response returned by the keyboard within a preset time period, it means that the keyboard and the tablet computer have not established a communication connection. Among them, considering the processing time of the keyboard, it is set to receive the test response returned by the keyboard within a preset time period. If the communication connection is normal, the test response returned by the keyboard should be completed in a short time. Exemplarily, the preset time period may be 30 milliseconds.
- the first instruction may also be a communication instruction.
- the keyboard After receiving the communication instruction, the keyboard returns a corresponding communication response to the tablet computer according to the communication data carried in the communication instruction.
- the communication response carries response data corresponding to the communication data. If the SOC receives the communication response within a preset time period, it is determined that a communication connection is established with the keyboard. If the SOC does not receive a communication response within a preset time period, or if the SOC receives a response returned by the keyboard within a preset time period, and the response does not carry response data corresponding to the communication data, it is determined that the keyboard and the tablet computer have not established a communication connection.
- the SOC sends the first instruction through the one communication interface; if the tablet computer includes multiple communication interfaces, the SOC may send the first instruction through one or more communication interfaces according to a communication protocol.
- the SOC sends a first instruction to the keyboard through the communication interface 1. If the SOC receives a first response returned by the keyboard through the communication interface 1, the communication interface 1 of the keyboard and the communication interface 1 of the tablet computer are normal, and the keyboard and the tablet computer establish a communication connection. If the SOC does not receive the first response returned by the keyboard within a preset time period, it is determined that at least one of the communication interface 1 of the keyboard and the communication interface 1 of the tablet computer is abnormal, and the keyboard and the tablet computer do not establish a communication connection.
- the spring pin interface of the keyboard and the tablet computer both include two communication interfaces.
- communication interface 1 is the main communication interface
- the communication interface 1 of the keyboard is responsible for receiving or sending communication data and test data between the tablet computer.
- Communication interface 2 is a backup interface, for example, when the keyboard cannot transmit data through communication interface 1, it can switch to communication interface 2 to transmit data.
- the SOC sends a first instruction to the communication interface 1 of the keyboard through communication interface 1.
- the keyboard receives the first instruction through communication interface 1, and returns the first response corresponding to the first instruction to the communication interface 1 of the tablet computer through communication interface 1.
- the keyboard receives the first instruction through communication interface 1, but cannot transmit the first response through communication interface 1, the keyboard switches to communication interface 2 to return the first response, that is, the keyboard returns the first response to the communication interface 2 of the tablet computer through communication interface 2.
- the SOC receives the first response through communication interface 1, it is determined that the communication interface 1 of the keyboard is normal and the keyboard and the tablet computer are in normal communication connection. If the SOC does not receive the first response through communication interface 1, but receives the first response through communication interface 2, it is determined that the communication interface 1 of the keyboard is abnormal and the communication interface 2 of the keyboard is normal.
- the tablet computer can switch to communication interface 2 to perform subsequent data transmission when communication interface 1 is abnormal and communication interface 2 is normal. If the SOC does not receive a first response returned through any communication interface within a preset time period, it is determined that the keyboard and the tablet computer have not established a communication connection.
- the SOC can control the display screen of the tablet computer to output to the user on the display interface relevant prompt information that the tablet computer has established a communication connection with the keyboard, that is, execute S105. If the SOC does not receive the first response returned by the keyboard, it is determined that the tablet computer has not established a communication connection with the keyboard. In this case, the SOC can further confirm whether the failure to receive the first response from the keyboard is an accidental event, and the SOC can send a second instruction to the keyboard multiple times to further determine whether the tablet computer has not established a communication connection with the keyboard, that is, execute S106.
- the SOC controls the display screen to display a keyboard icon in the display interface.
- the SOC determines that the tablet computer has established a communication connection with the keyboard.
- the SOC can output relevant prompt information that the tablet computer has established a communication connection with the keyboard on the display interface by controlling the tablet computer display screen.
- the SOC can display relevant prompt information that the tablet computer has established a communication connection with the keyboard on the main interface of the tablet computer.
- the SOC displays a small keyboard icon 130 in the status bar of the main interface of the display screen, indicating that the tablet computer has established a communication connection with the keyboard.
- the main interface includes multiple application icons and multiple function controls.
- the status bar also includes a battery usage icon for the tablet computer.
- the SOC After the keyboard establishes a communication connection with the tablet computer, the SOC sends a first instruction to the keyboard through the communication interface, and executes a corresponding operation according to whether the keyboard returns a corresponding first response.
- the SOC determines that the keyboard and the tablet computer establish a communication connection based on the above S101-104. After the keyboard and the tablet computer establish a communication connection, the SOC can poll the communication connection status of the keyboard in a first cycle to timely detect the connection status of the keyboard and the tablet computer. Here, the SOC can send a first instruction to the keyboard in a first cycle to continuously detect the connection status of the keyboard and the tablet computer in real time. It should be noted that when the physical connection and communication connection between the keyboard and the tablet computer are normal, the SOC periodically sends the first instruction to the keyboard, which belongs to polling under normal communication connection conditions. This polling cycle does not need to be too frequent, and the first cycle is a long cycle.
- the first cycle can be 10 seconds, 15 seconds, etc.
- the test frequency is to send the first instruction to the keyboard every 10 seconds or every 15 seconds, so as to avoid the power consumption caused by the frequent sending of the test instruction by the SOC; it also avoids the frequent sending of the first instruction affecting the normal communication between the keyboard and the tablet computer.
- the first instruction can be a test instruction. If the SOC receives the first response returned by the keyboard based on the test instruction, it is determined that the communication connection between the keyboard and the tablet computer is normal; if the SOC If the first response returned by the keyboard is not received within the first time period, it is determined that the keyboard and the tablet computer have not established a communication connection.
- the method for determining the communication connection state between the keyboard and the tablet computer according to whether the keyboard returns a corresponding first response can refer to S104.
- the SOC sends a second instruction to the keyboard through the communication interface. If a second response is received, S104 is executed; if no second response is received within a second time period, S107 is executed.
- the SOC does not receive a second response returned by the keyboard within a preset time period.
- the SOC may send a second instruction to the keyboard via the communication interface in a second cycle.
- the tablet computer may also send a communication instruction to the keyboard.
- the first instruction may be the same as or different from the second instruction.
- the second duration in S1015 may be the same as the first duration in S106, and the second duration and the first duration are determined according to the actual sending and receiving rate of the instruction.
- the first cycle in this embodiment is different from the first cycle in S105.
- the first cycle in the above S105 is a polling when the SOC determines that the communication connection between the keyboard and the tablet computer is normal.
- the second cycle in this embodiment is an abnormal test when the SOC determines that the communication connection between the keyboard and the tablet computer is abnormal.
- the SOC needs to determine whether a communication connection is established between the keyboard and the tablet computer in a shorter time. Based on this, the second cycle of this embodiment is a short cycle.
- the second cycle can be 20 milliseconds, 30 milliseconds, etc.
- the second cycle can be 20 milliseconds, 30 milliseconds, etc.
- the SOC can send a second instruction multiple times in the second cycle to determine whether the communication connection between the keyboard and the tablet computer is normal.
- the SOC can send the second instruction to the keyboard three times in a row within a period of 30 milliseconds. Whether the keyboard and the tablet computer have established a communication connection is determined based on whether the keyboard returns a second response.
- the SOC receives at least one second response returned by the keyboard through the communication interface, it is determined that the communication interface of the tablet computer is in contact with the communication interface of the keyboard, and the tablet computer and the keyboard are in a normal communication state, and the SOC can realize data transmission through the communication interface. In this case, the SOC executes S104 to control the display screen to display the keyboard icon on the display interface. If the SOC does not receive the second response returned by the keyboard for multiple consecutive times, it is determined that the tablet computer and the keyboard have not established a communication connection, and the SOC executes S107. At least one of the communication interface of the tablet computer and the communication interface of the keyboard is in an abnormal state, and the SOC cannot transmit data through the communication interface.
- the SOC when the tablet computer and the keyboard have only one communication interface, the SOC sends the second instruction through the one communication interface by default. If the SOC does not receive a second response returned by the keyboard through the one communication interface, it is determined that the communication interface between the tablet computer and the keyboard is abnormal and a communication connection is not established between the keyboard and the tablet computer.
- the communication protocol may stipulate that communication data is transmitted through communication interface 1; and test data is transmitted through communication interface 2.
- the SOC sends a second instruction to the communication interface 2 of the keyboard through communication interface 2. If the SOC does not receive a second response returned by the keyboard, the SOC determines that the communication interface 2 between the tablet computer and the keyboard is abnormal, and the keyboard and the tablet computer have not established a communication connection.
- the tablet computer and the keyboard include two communication interfaces, and both communication interfaces can receive and send data.
- the communication interface 1 of the keyboard is responsible for receiving or sending communication data and test data with the tablet computer.
- Communication interface 2 is a backup interface.
- the communication protocol stipulates that the communication interface 1 of the tablet computer corresponds to the communication interface 1 of the keyboard for data transmission by default. When the communication interface 1 cannot transmit data, other communication interfaces can be switched for data transmission. In this case, when the SOC sends the second instruction through the communication interface 1, during normal communication, the keyboard receives the second instruction through the communication interface 1, and returns the test response corresponding to the second instruction to the communication interface 1 of the tablet computer through the communication interface 1.
- the keyboard receives the test instruction through the communication interface 1, but cannot transmit the second response through the communication interface 1, the keyboard switches to the communication interface 2 to return the second response, that is, the keyboard returns the second response to the communication interface 2 of the tablet computer through the communication interface 2.
- the SOC sends the second instruction through the communication interface 1
- the keyboard receives the second instruction through the communication interface 1, and returns the test response corresponding to the second instruction to the communication interface 1 of the tablet computer through the communication interface 1. If the SOC receives the second response through communication interface 1, it determines that the communication interface 1 of the keyboard is normal, and the communication connection between the keyboard and the tablet computer is normal.
- the SOC does not receive the second response through communication interface 1, but receives the second response through communication interface 2, it determines that the communication interface 1 of the keyboard is abnormal, the communication interface 2 of the keyboard is normal, and the communication connection between the keyboard and the tablet computer is normal.
- the SOC can output abnormal information 140 of the communication interface 1 of the keyboard to the user to further locate the abnormal communication interface, so that the user can perform timely maintenance on the abnormal communication interface. Refer to Figure 14.
- the SOC determines, based on the communication protocol, that there are abnormalities in both the communication interface 1 and the communication interface 2 of the keyboard, and the keyboard and the tablet computer have not established a communication connection.
- the cause of the abnormality may be that the keyboard and the tablet computer are not in good contact, that is, the communication interface of the keyboard and the communication interface of the tablet computer are not in an aligned position.
- information 150 of the abnormal communication interface can also be output on the display screen to remind the user to maintain the abnormal communication interface in time. Refer to Figure 15.
- the SOC stops displaying the keyboard icon on the display screen and displays a reminder message on the display screen.
- the SOC When the SOC continuously sends the second instruction to the keyboard within the second cycle, but does not receive the second response returned by the keyboard, it is determined that the keyboard and the tablet computer have not established a communication connection, and the SOC can stop displaying the keyboard icon on the display screen.
- the SOC can also display a prompt message on the display screen to remind the user that the keyboard and the tablet computer have not established a communication connection; or, the SOC can play a prompt message through voice to remind the user that the keyboard and the tablet computer have not established a communication connection.
- the SOC can also output a reminder message 160 on the current display interface of the display screen to remind the user to reconnect the keyboard.
- the SOC displays a reminder message 160 on the current display interface (main interface) of the display screen to remind the user to reconnect the keyboard.
- the SOC can also determine whether the physical connection between the tablet computer and the keyboard is disconnected by detecting the output level of the Hall sensor, so as to provide accuracy of keyboard detection. For example, if the magnet leaves the detection area of the Hall sensor and the output level of the Hall sensor changes, it is determined that the physical connection between the tablet computer and the keyboard is disconnected. There may be a situation where the user manually disassembles the keyboard. For example, if the magnet is always in the detection area of the Hall sensor and the output level of the Hall sensor does not change, it is determined that the physical connection between the tablet computer and the keyboard is normal.
- S108 SOC determines whether the output level of the Hall sensor changes. If the output level of the Hall sensor changes, execute S109 ; if the output level of the Hall sensor does not change, execute S111 .
- the SOC can further determine whether the keyboard is removed manually, that is, the keyboard and the tablet computer are completely disconnected; or the keyboard and the tablet computer are disconnected due to relative position displacement.
- the SOC can obtain the signal state of the output level of the Hall sensor within a preset time. Refer to the method for determining the output level of the Hall sensor described in S102 above. If the SOC determines that the output level of the Hall sensor has changed within the most recent preset time, for example, in FIG8 , after the Hall sensor is triggered by a magnet, the output level changes from an initial high level to a low level. Within the most recent preset time, for example, 1 minute before the current moment Within 10 seconds, the output level of the Hall sensor changes from low level to high level and remains at a high level. This indicates that the magnet leaves the detection area of the Hall sensor, causing the output level of the Hall sensor to change.
- the SOC executes S109 and then sends a third instruction to the keyboard for a response test.
- the SOC determines that the output level of the Hall sensor has changed within the most recent preset time period when the keyboard and the tablet computer are connected for the first time in the most recent period of time. That is, after the tablet computer and the keyboard have been separated for a period of time, when the tablet computer and the keyboard are connected again, the magnet enters the detection area of the Hall sensor, triggering the output level of the Hall sensor of the tablet computer to change, and the output level of the Hall sensor changes from a high level to a low level.
- the SOC also needs to execute S109 and then send a third instruction to the keyboard for a response test.
- the output level changes from the initial high level to the low level.
- the output level of the Hall sensor is always at a low level.
- the SOC determines that the current keyboard is always in contact with the tablet computer, and the magnet of the keyboard is still within the detection area of the Hall sensor of the tablet computer.
- the SOC executes S111 and then sends a fourth instruction to the keyboard for a response test.
- the fourth instruction can be the same as the second instruction.
- the result caused by the SOC sending the fourth instruction to the keyboard for testing in S111 is different from the result caused by the SOC sending the third instruction to the keyboard for testing in S109.
- the instruction contents of the fourth instruction and the third instruction may be the same.
- the SOC sends a third instruction to the keyboard through the communication interface, and if a third response is received, executes S104; if no third response is received within a third time period, the SOC executes S110 to control the power interface to power off.
- the SOC determines that the output level of the Hall sensor has changed.
- the SOC can send a third instruction to the keyboard in a third cycle.
- the third instruction here is a query under abnormal circumstances.
- the third cycle is a short cycle.
- the third cycle can be 20 milliseconds, 30 milliseconds, etc.
- the third instruction is sent three times continuously within 30 milliseconds, and the third instruction is sent multiple times within the third cycle to avoid the accidental problem of not receiving the third response once.
- the third instruction can be the same as the second instruction, the third instruction can be a test instruction, and the third instruction can also be a communication instruction.
- the SOC determines that the output level of the Hall sensor has changed within the most recent preset time period. If the SOC receives a third response returned by the keyboard within the third time period, it may be that the keyboard and the tablet computer are connected for the first time after being completely disconnected. Complete disconnection refers to manually separating the keyboard from the tablet computer, so that the keyboard and the tablet computer are disconnected in terms of both physical location and communication connection. In this case, the SOC executes S104 to control the display screen to display a small keyboard icon in the status bar of the display interface. At the same time, the SOC can also display information that the tablet computer and the keyboard have established a communication connection in the current interface (main interface) of the display screen.
- the SOC displays a prompt message 180 that the keyboard is connected in a pop-up window on the current interface of the display screen.
- the prompt message can also include an icon used to indicate that the tablet computer is connected to the keyboard, so that the user can more intuitively understand that the tablet computer and the keyboard have established a communication connection.
- the SOC determines that the output level of the Hall sensor has changed within a recent preset time period, and if the SOC does not receive a third response from the keyboard within a third time period, it indicates that the keyboard and the tablet computer have been completely disconnected.
- the third time period can be determined according to the actual rate of sending and receiving instructions.
- the SOC controls the display screen to stop displaying the small keyboard icon in the status bar of the display screen, indicating that the keyboard and the tablet computer are disconnected, and there is no external keyboard available for the current tablet computer, as shown in Figure 19.
- FIG. 20 gives an example.
- the SOC detects that the output level of the Hall sensor changes from the initial high level to the low level, controls the power interface to power on, and the output level of the power interface changes from the initial low level to the high level.
- the SOC did not receive the third response returned by the keyboard for a period of time, that is, the SOC detected that the output level of the communication interface remained at a low level.
- the SOC controls the power interface to power off to avoid the risk of short circuit caused by the port being energized.
- the display interface does not display the keyboard icon.
- the SOC detects that the output level of the Hall sensor changes from the initial high level to the low level, controls the power interface to power on, and the output level of the power interface changes from the initial low level to the high level.
- the SOC receives the third response returned by the keyboard, and the output level of the communication interface changes.
- the SOC verifies the data carried in the third response, and finds that the data carried in the third response is abnormal. Accordingly, the changing pattern of the output level of the communication interface does not conform to the changing pattern agreed upon in the communication protocol. At this time, the SOC determines that the communication connection of the communication interface is abnormal. In order to avoid the risk of short circuit caused by the port being powered, the SOC also needs to control the power supply interface to power off in this case.
- the SOC sends a fourth instruction to the keyboard through the communication interface, and if a fourth response is received, S104 is executed, and the SOC controls the display screen to display a keyboard icon in the display interface. If no fourth response is received within a fourth time period, S107 is executed, and the SOC stops displaying the keyboard icon on the display screen and displays a reminder message on the display screen.
- the fourth instruction may be the same as the second instruction.
- the fourth instruction may be a test instruction or a communication instruction.
- the SOC receives a fourth response returned by the keyboard within a fourth time length
- the keyboard icon is displayed. Refer to the method provided in the S104 embodiment, which is not described in detail in this embodiment. If the SOC does not receive the fourth response returned by the keyboard within the fourth time length, a reminder message is displayed, refer to the method provided in the S107 embodiment, which is not described in detail in this embodiment.
- the fourth time length may be the same as the third time length, and the fourth time length may be determined according to the actual rate of sending and receiving instructions.
- An embodiment of the present application provides an external device detection method, by setting a matching physical connection sensing device in the electronic device and the external device, the physical connection status of the external device and the electronic device can be determined through the physical connection sensing device.
- the communication connection status of the external device and the electronic device is determined through the communication data of the spring pin interface between the electronic device and the external device.
- the actual connection status of the external device can be continuously obtained, and the electronic device can prompt the user that the external device has established a communication connection or has not established a communication connection by outputting prompt information on the display screen or outputting audio information, which can enable the user to accurately perceive the actual connection status of the external device in real time and optimize the user experience.
- the electronic device can also check and lock one or more communication interfaces with specific abnormalities when determining that the physical connection between the external device and the electronic device is normal and the communication connection is not established, thereby outputting information about the abnormality of the communication interface, so that the user can check and maintain the communication interface in time, and provide the user with more accurate abnormality resolution reminder information, which is extremely convenient. Dadi has optimized the user experience.
- the electronic device as a tablet computer with a display screen as an example.
- the wireless headset can prompt the user to adjust the position by outputting audio when detecting that the headset charger is disconnected from it. For example, a beep sound or a voice prompt message is played.
- the external device detection method provided in the above embodiments is applicable to all electronic devices and external devices with a spring pin interface.
- the above embodiment takes the example of an electronic device sensing the presence status of an external device through a Hall sensor and a magnet of the external device.
- the electronic device may also sense the presence status of the external device through other sensors.
- the electronic device may sense whether the external device has been physically connected to the electronic device through a light sensor, a distance sensor, a pressure sensor, an electrical sensor, and other magnetic sensors, etc., which is not limited in this embodiment.
- the electronic device can output relevant information through voice output or prompt sound. For example, when the electronic device detects that an external device is connected, the voice output is that the external device is connected; if the electronic device detects that the external device is disconnected, the voice output is that the external device is disconnected, so that the user can directly obtain the connection status of the external device when using the external device, optimizing the user experience.
- the electronic device includes a processor 1001 , a display screen 1002 , a communication module 1003 , a storage module 1004 and a sensor 1005 .
- the processor 1001 can be a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof.
- the processor may include an application processor and a baseband processor. It can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application.
- the processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
- the communication module 1003 may be a transceiver, a transceiver circuit, and the like.
- the storage module may be a memory.
- the processor 1001 may be the processor 310 as shown in FIG. 2, and the communication module 1003 includes a radio frequency module (such as the radio frequency module 350 as shown in FIG. 2).
- the communication module may include communication modules such as a Wi-Fi module, a Bluetooth module, and a pogo pin communication module (such as the communication module 360 as shown in FIG. 2).
- the communication module storage module may be a memory (such as the internal memory 321 as shown in FIG. 2).
- the display screen 1002 may be a display screen 394 as shown in FIG. 2, and the display screen 394 may be a touch screen, in which a display panel and a touch panel may be integrated.
- the sensor may be a Hall sensor 380C, a pressure sensor 380A, a distance sensor 380F, a proximity light sensor 380G, an ambient light sensor 380L, etc. as shown in FIG. 2.
- the terminal provided in the embodiment of the present application may be the electronic device 100 shown in FIG. 2.
- the above-mentioned processor and display screen, communication module, memory, sensor, etc. may be connected together, for example, via a bus connection.
- the electronic device includes a processor 2001 , a communication module 2002 , a first component 2003 and a storage module 2004 .
- the processor 2001 may be a CPU, a DSP, an ASIC, an FPGA, a microcontroller unit (MCU) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof.
- the processor may include an application processor and a baseband processor. It may implement or execute the contents disclosed in this application. Various exemplary logic blocks, modules and circuits described.
- the processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of DSP and microprocessor, etc.
- the communication module 2003 may be a transceiver, a transceiver circuit, etc.
- the storage module may be a memory.
- the processor 2001 may also be the processor 410 as shown in FIG4.
- the communication module 2002 may include communication modules such as a Wi-Fi module, a Bluetooth module, and a pogo pin communication module (the communication module 430 as shown in FIG4).
- the storage module may be a memory (the internal memory 421 as shown in FIG4).
- the first component 2002 may be a component that matches a sensor in an electronic device.
- the electronic device 1000 includes a Hall sensor 380E
- the first component is a magnet that matches the Hall sensor 380E.
- the processor, the first component, the communication module, and the memory provided in the embodiment of the present application may be connected together, for example, via a bus.
- the embodiment of the present application also provides a chip system (for example, a system on a chip (SoC)), as shown in Figure 23, the chip system includes at least one processor 701 and at least one interface circuit 702.
- the processor 701 and the interface circuit 702 can be interconnected through lines.
- the interface circuit 702 can be used to receive signals from other devices (such as a memory of an electronic device).
- the interface circuit 702 can be used to send signals to other devices (such as a processor 701 or a camera of an electronic device).
- the interface circuit 702 can read instructions stored in the memory and send the instructions to the processor 701.
- the electronic device can execute the various steps in the above embodiments.
- the chip system can also include other discrete devices, which are not specifically limited in the embodiment of the present application.
- An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions.
- the computer instructions When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step executed by the electronic device 100 in the above-mentioned method embodiment.
- the embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions.
- the external device 200 executes each function or step executed by the external device in the above-mentioned method embodiment.
- the embodiment of the present application further provides a computer program product, which, when executed on a computer, enables the computer to execute the functions or steps executed by the electronic device 100 in the above method embodiment.
- the computer may be the above electronic device 100.
- the embodiment of the present application further provides a computer program product.
- the computer program product When the computer program product is run on a computer, the computer is enabled to execute each function or step executed by the external device 200 in the above method embodiment.
- the disclosed devices and methods can be implemented in other ways.
- the device embodiments described above are only schematic.
- the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed.
- Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
- the units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
- each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
- the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium.
- the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application.
- the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Telephone Function (AREA)
Abstract
本申请公开了一种弹簧针接口连接状态检测方法、组合装置和电子设备,涉及通信技术领域,应用于包括弹簧针接口和传感器的电子设备,弹簧针接口包括通信接口。电子设备通过传感器检测外接设备与电子设备的距离。若距离小于预设阈值,电子设备通过弹簧针通信接口向外接设备发送第一指令,如果电子设备在第一时长内未接收到第一响应,电子设备发出第一提示信息,提示用户外接设备与电子设备未建立通信连接。电子设备通过传感器获取电子设备与外接设备的物理连接情况,通过弹簧针通信接口的响应确定外接设备与电子设备的通信连接情况,在检测到外接设备与电子设备未建立通信连接时发出提示信息,向用户反馈外接设备的连接情况,优化用户体验。
Description
本申请要求于2022年12月23日提交国家知识产权局、申请号为202211662608.1、发明名称为“弹簧针接口连接状态检测方法、组合装置和电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及通信技术领域,尤其涉及一种弹簧针接口连接状态检测方法、组合装置和电子设备。
随着平板电脑、笔记本电脑等电子设备的功能升级,通过弹簧针连接的外接设备越来越多的应用在电子设备中。比如,通过弹簧针连接的可拆卸键盘。可拆卸键盘通过自身的弹簧针接口与电子设备的弹簧针接口的吸附来实现物理连接,可拆卸键盘可以通过弹簧针接口与电子设备传输数据来实现通信连接。
在用户实际使用可拆卸键盘的过程中,可能会移动可拆卸键盘的位置,而导致可拆卸键盘的弹簧针接口与电子设备的弹簧针接口接触产生位置偏移,造成可拆卸键盘与电子设备断开连接无法正常通信。
但是,用户对于可拆卸键盘的实际状态无法及时准确感知,需要使用时才能发现可拆卸键盘已经断开连接,从而再手动连接,造成用户使用体验差。
发明内容
本申请实施例提供一种弹簧针接口连接状态检测方法、组合装置和电子设备,电子设备可以实时获取外接设备的物理连接状态和通信连接状态,使得用户可以及时了解可拆卸键盘的连接状态,优化用户体验。达到上述目的,本申请的实施例采用如下技术方案。
第一方面,提供了一种弹簧针接口连接状态检测方法,应用于电子设备,电子设备包括弹簧针接口和传感器,弹簧针接口包括通信接口,该方法包括:
电子设备通过传感器检测外接设备与电子设备的距离;若距离小于预设阈值,电子设备通过通信接口向外接设备发送第一指令;如果电子设备在第一时长内未接收到第一响应,电子设备发出第一提示信息,第一提示信息用于提示用户外接设备与电子设备未建立通信连接。
在本申请中,第一指令可以为测试指令,相应地第一响应为测试响应;第一指令也可以为通信指令,相应地第一响应为通信响应。电子设备与外接设备物理连接后,外接设备与电子设备的距离小于预设阈值的情况下,电子设备向外接设备发送第一指令,用于检测外接设备与电子设备的通信连接状态。
本申请中,通过在电子设备可以检测外接设备与电子设备之间的距离,在确定距离小于预设阈值的情况下,确定电子设备与外接设备建立物理连接。从而电子设备通过通信接口进行通信连接的检测,在未得到外接设备的响应时,电子设备发出相应的提示信息,提示用户外接设备与电子设备的通信连接异常。电子设备可以实时地获取
外接设备与电子设备的物理连接状态以及通信连接状态,并且在检测到外接设备与电子设备未建立通信连接时发出提示信息提醒用户,可以使得用户实时地准确地感知外接设备的实际连接状态,不需要用户通过使用外接设备来确认外接设备与电子设备的连接是否异常,提升用户体验。
结合第一方面,在一种可能的设计方式中,电子设备通过通信接口向外接设备发送第一指令,包括:
电子设备按照第一周期,通过通信接口向外接设备发送第一指令。
在本申请中,第一周期可以为长周期。电子设备发送第一指令可以为长周期内的轮询指令。电子设备在检测到外接设备与电子设备的距离小于预设阈值的情况下发送第一指令,也即,电子设备确定与外接设备的物理连接正常,在这种情况下,第一周期可以为长周期。电子设备通过长周期发送轮询指令,可以实时获取外接设备的实际连接状态。
结合第一方面,在一种可能的设计方式中,在电子设备发出第一提示信息之前,该方法还包括:
电子设备通过通信接口,按照第二周期向外接设备发送第二指令,电子设备在第二时长内未接收到第二响应;其中,第二周期小于第一周期。
在本申请中,第二周期不同于第一周期,第二周期为短周期。电子设备在未接收到第一响应时,确定与外接设备的通信连接异常,在这种情况下,电子设备可以快速地对外接设备进行检测。也即,在电子设备确定外接设备与电子设备未建立通信连接的情况,电子设备可以按照一定的短周期向外接设备发送第二指令,持续检测与外接设备的通信连接状态。第二指令可以为测试指令,也可以为通信指令。电子设备进行短周期的检测可以快速确认与外接设备的通信连接是否真的断开,在没有收到第二响应时,电子设别确定与外接设备通信异常,输出第一提示信息,使得连接状态检测更及时准确。
结合第一方面,在一种可能的设计方式中,该方法还包括:
电子设备在第二时长内通过通信接口接收到第二响应,电子设备在第二时长内未接收到第二响应。
在本申请中,在短周期的检测中,如果电子设备在第二时长内接收到第二响应,说明电子设备与外接设备的通信连接正常,电子设备可以在显示界面显示外接设备连接信息。在没有接收到第一响应时通过发送第二指令,接收到第二响应,避免了第一响应结果的偶然性,使得外接设备通信连接检测结果更准确。
结合第一方面,在一种可能的设计方式中,电子设备发出第一提示信息,包括:
电子设备显示第一提示信息;或者,电子设备播放第一提示信息。
在本申请中,在电子设备未收到第一响应,确定与外接设备的通信连接断开时,电子设备可以在显示界面中显示第一提示信息,比如,以弹窗的形式显示第一提示信息。或者,电子设备也可以通过语音播放第一提示信息。或者,电子设备也可以通过其他音频输出方式播放第一提醒信息。
结合第一方面,在一种可能的设计方式中,该方法还包括:
如果电子设备在第一时长内接收到第一响应,电子设备显示外接设备连接信息。
在本申请中,第一时长为电子设备等待接收外接设备第一响应的时间,第一时长可以根据实际通信状况确定。在电子设备在第一时长内接收到第一响应,确定与外接设备的建立通信连接时,电子设备可以在显示界面显示外接设备连接信息。比如,在显示界面以弹框显示外接设备已连接的提示信息;或者,在显示界面的状态栏显示外接设备图标,来表示外接设备已连接。这样,用户可以及时、直观地获得外接设备已连接的状态,以使用户可以正常使用外接设备。
结合第一方面,在一种可能的设计方式中,电子设备发出第一提示信息,包括:
电子设备停止显示外接设备连接信息。
在本申请中,在电子设备未收到第一响应,确定与外接设备的通信连接断开时,电子设备停止显示外接设备连接信息。比如,停止在显示界面的状态栏显示外接设备图标。可选地,电子设备也可以在显示界面以弹窗的形式显示第一提示信息的同时,停止在显示界面的状态栏显示外接设备图标。用户不仅可以通过状态栏中外接设备的图标是否显示确定外接设备的通信连接状态,还可以通过显示界面的弹窗更直观的了解外接设备的连接状态,优化用户使用体验。
结合第一方面,在一种可能的设计方式中,距离小于预设阈值,包括:
电子设备检测到传感器的电平发生高低电平跳变。
在本申请中,电子设备确定与外接设备的距离通过检测传感器的电平确定。在外接设备靠近电子设备时,比如,外接设备与电子设备物理连接,外接设备与电子设备的距离小于预设阈值时,电子设备检测到传感器的电平会发生由高电平变成低电平的跳变。或者,外接设备与电子设备的距离小于预设阈值时,电子设备检测到传感器的电平会发生由低电平变成高电平的跳变。具体传感器的电平发生高低电平跳变的原则可以根据实际情况确定。这样,电子设备通过传感器的电平的变化状态确定是否有外接设备靠近电子设备,以此来确定外接设备与电子设备的物理连接状态,使得连接状态的检测结果更准确。
结合第一方面,在一种可能的设计方式中,传感器的电平发生高低电平跳变包括:
传感器的电平由高电平变为低电平;或者,传感器的电平由低电平变为高电平;或者,传感器的电平在低电平时产生一个高电平中断后,恢复低电平;或者,传感器的电平在高电平时产生一个低电平中断后,恢复高电平。
在本申请中,电子设备可以为外接设备与电子设备的距离小于预设阈值的情况,定义某一种传感器的电平的高低电平跳变规则。在检测到传感器的电平的高低电平跳变符合约定规则时,确定外接设备与电子设备的距离小于预设阈值,确定外接设备与电子设备物理连接,以此获取外接设备与电子设备的物理连接状态,确定方案简单。
结合第一方面,在一种可能的设计方式中,弹簧针接口还包括电源接口,在电子设备检测到传感器的电平发生高低电平跳变之后,该方法还包括:
电子设备控制电源接口上电。
在本申请中,在检测到传感器的电平的高低电平跳变符合约定规则时,确定外接设备与电子设备的距离小于预设阈值,确定外接设备与电子设备物理连接时,电子设备控制电源接口上电,电子设备的电源接口为外接设备的电源接口供电,以进行通信连接。
结合第一方面,在一种可能的设计方式中,在电子设备检测到传感器的电平发生高低电平跳变之后,该方法还包括:
如果电子设备再次检测到传感器的电平发生高低电平跳变,电子设备通过通信接口,向外接设备发送第三指令;如果电子设备在第三时长内未接收到第三响应,电子设备控制电源接口下电。
在本申请中,如果电子设备在一段时间内检测到传感器的电平发生高低电平跳变,但是向外接设备发送第三指令,在第三时长内并未接收到第三响应,在这种情况下,电子设备可以确定传感器被触发可能是误触导致,实际上并没有外接设备与电子设备连接,这种,电子设备可以及时控制电源接口下电,避免了控制电源接口上电造成短路的危险。其中,第三时长可以为电子设备等待接收外接设备第三响应的时间,第三时长可以根据实际通信状况确定。
结合第一方面,在一种可能的设计方式中,在电子设备发出第一提示信息之前,该方法还包括:
电子设备在预设的时间段内未检测到传感器的电平发生高低电平跳变,电子设备通过通信接口,向外接设备发送第四指令;电子设备在第四时长内未接收到第四响应。
在本申请中,如果电子设备在一段时间内检测到传感器的电平发生高低电平跳变,电子设备确认与外接设备一直处于物理连接未断开的情况,在这种情况下,电子设备向外接设备发送第四指令进行检测,如果接收到第四响应,电子设备还是持续显示外接设备连接信息;如果在第四时长内未接收到第四响应,电子设备发出第一提醒信息,及时提醒用户通信连接已断开的情况。本申请中,电子设备对预设的时间段内的传感器的电平进行检测,进一步地确认了电子设备与外接设备的物理连接情况。其中,第四时长为电子设备等待接收外接设备第四响应的时间,第四时长可以根据实际通信状况确定。
结合第一方面,在一种可能的设计方式中,该方法还包括:
电子设备通过第一通信接口向外接设备发送第五指令;第一通信接口为多个通信接口中任意一个;如果电子设备在第五时长内未通过第一通信接口接收到第五响应,电子设备显示第二提示信息;第二提示信息用于提示第一通信接口异常。
在本申请中,结合电子设备与外接设备存在多个通信接口的场景,在一种示例中,电子设备通过第一通信接口发送第五指令,在正常通信连接情况下,电子设备在第五时长内会通过第一通信接口接收到第五响应。若电子设备在第五时长内没有通过第一通信接口接收到第五响应,则确定第一通信接口异常。通过在电子设备与外接设备的通信协议中约定各个通信接口的通信方式,可以在通信过程中,确定出存在异常的某一个或多个通信接口,进而,电子设备可以将通信接口异常的信息输出给用户,使得用户可以及时地对通信接口进行维护,降低了电子设备与外接设备的故障成本,优化了用户体验。其中,第五时长为电子设备等待接收外接设备第五响应的时间,第五时长可以根据实际通信状况确定。
结合第一方面,在一种可能的设计方式中,传感器为霍尔传感器、红外传感器、距离传感器、压力传感器、接近光传感器、环境光传感器中任意一个。
在本申请中,传感器可以为霍尔传感器、红外传感器、距离传感器、压力传感器、
接近光传感器、环境光传感器中任意一个。这在实现对外接设备与电子设备的物理连接检测的同时,由于生产成本交底,降低了整个技术方案的成本。以霍尔传感器为例,在磁铁进入霍尔传感器的检测区域内,霍尔传感器会被触发发生高低电平的跳变。本申请中,外接设备中设置磁铁,电子设备中设置霍尔传感器,根据磁铁与霍尔传感器的距离,比如,磁铁进入霍尔传感器的检测区域,磁铁与霍尔传感器的距离小于预设阈值,来确定外接设备与电子设备的物理连接已建立。霍尔传感器作为成本较低的传感器,本方案在实现检测物理连接的同时,也控制了生产成本。
第二方面,提供了一种电子设备与外接设备的组合装置,该组合装置包括电子设备和外接设备;
电子设备包括处理器、传感器、弹簧针接口;弹簧针接口包括通信接口;处理器,用于执行如第一方面提供的任一项的方法;外接设备包括处理器和弹簧针接口;弹簧针接口包括通信接口;在电子设备与外接设备物理连接时,电子设备的弹簧针接口的位置与外接设备的弹簧针接口的位置对齐。
结合第二方面,在一种可能的设计方式中,如果电子设备的传感器为霍尔传感器,外接设备还包括第一组件;第一组件为磁铁;在电子设备与外接设备物理连接时,磁铁位于霍尔传感器的检测区域内。
第三方面,提供了一种电子设备,该电子设备包括存储器、传感器、弹簧针接口、显示屏和一个或多个处理器;所述存储器、所述传感器、所述弹簧针接口、所述显示屏与所述处理器耦合;所述存储器中存储有计算机程序代码,所述计算机程序代码包括计算机指令,当所述计算机指令被所述处理器执行时,使得所述电子设备执行如上述第一方面中任一项所述的方法。
第四方面,提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在电子设备上运行时,使得电子设备可以执行上述第一方面中任一项所述的方法。
第五方面,提供了一种包含指令的计算机程序产品,当其在电子设备上运行时,使得电子设备可以执行上述第一方面中任一项所述的方法。
第六方面,本申请实施例提供了一种芯片,芯片包括处理器,处理器用于调用存储器中的计算机程序,以执行如第一方面中任一项所述的方法。
可以理解地,上述提供的第二方面所述的电子设备与外接设备的组合装置,第三方面所述的电子设备,第四方面所述的计算机可读存储介质,第五方面所述的计算机程序产品,第六方面所述的芯片所能达到的有益效果,可参考第一方面及其任一种可能的设计方式中的有益效果,此处不再赘述。
图1为本申请实施例提供的一种弹簧针接口连接状态检测方法的应用环境示意图;
图2为本申请实施例提供的一种电子设备的结构示意图;
图3为本申请实施例提供的一种电子设备的软件架构图;
图4为本申请实施例提供的一种外接设备的结构示意图;
图5为本申请实施例提供的一种平板电脑与可拆卸键盘连接的示意图;
图6为本申请实施例提供的一种外接设备检测方法的流程图;
图7为本申请实施例提供的一种平板电脑的霍尔传感器输出电平变化的示意图;
图8为本申请实施例提供的另一种平板电脑的霍尔传感器输出电平变化的示意图;
图9为本申请实施例提供的另一种平板电脑的霍尔传感器输出电平变化的示意图;
图10为本申请实施例提供的另一种平板电脑的霍尔传感器输出电平变化的示意图;
图11为本申请实施例提供的一种在键盘吸附平板电脑且正常通信时,平板电脑的霍尔传感器输出电平、电源接口上电的输出电平变化的示意图;
图12为本申请实施例提供的一种在键盘吸附平板电脑且正常通信时,平板电脑的霍尔传感器输出电平、电源接口的输出电平、通信接口的输出电平变化示意图;
图13为本申请实施例提供的一种平板电脑的显示界面显示键盘图标的示意图;
图14为本申请实施例提供的一种平板电脑的显示界面显示通信接口异常提醒的示意图;
图15为本申请实施例提供的另一种平板电脑的显示界面显示通信接口异常提醒的示意图;
图16为本申请实施例提供的一种平板电脑的显示界面显示重新连接提示信息的示意图;
图17为本申请实施例提供的另一种外接设备检测方法的流程图;
图18为本申请实施例提供的一种平板电脑的显示界面显示已连接提示信息的示意图;
图19为本申请实施例提供的一种平板电脑的显示界面停止显示键盘图标的示意图;
图20为本申请实施例提供的一种平板电脑的霍尔传感器被误触发时的输出电平、电源接口的输出电平、通信接口的输出电平的变化示意图;
图21为本申请实施例提供的一种电子设备的模块结构图;
图22为本申请实施例提供的一种外接设备的模块结构图;
图23为本申请实施例提供的一种芯片***的结构图。
在本申请实施例的描述中,以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一种”、“所述”、“上述”、“该”和“这一”旨在也包括例如“一个或多个”这种表达形式,除非其上下文中明确地有相反指示。还应当理解,在本申请以下各实施例中,“至少一个”、“一个或多个”是指一个或两个以上(包含两个)。术语“和/或”,用于描述关联对象的关联关系,表示可以存在三种关系;例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A、B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他
一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。术语“连接”包括直接连接和间接连接,除非另外说明。“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。
随着手机、平板电脑、笔记本电脑等电子设备的功能升级,通过弹簧针接口连接的外接设备类型也逐渐增多。图1给出了一种电子设备100与外接设备200通过弹簧针接口连接的示意图。其中,电子设备100与外接设备200通过弹簧针接口可以实现通信连接。其中,弹簧针接口为pogo pin接口。
本申请所涉及到的电子设备100可以为手机、平板电脑、投影仪、笔记本电脑等具有弹簧针接口的设备;本申请所涉及到的外接设备可以为键盘、手绘板、音箱装置、摄像头、打印机、外接显示器、扫描仪等具有弹簧针接口的设备。可选地,外接设备还可以为智能耳机、手表、手环等具有弹簧针接口的设备,电子设备可以为外接设备提供电源的耳机壳、手表充电器、手环充电器、无线充电装置等具有弹簧针接口的设备。
弹簧针是一种由针轴、弹簧、针管三个基本部件通过精密仪器铆压预压之后形成的弹簧式探针。探针实现本设备的通电或设备之间的电路导通来进行通信。在实际生产中,外接设备表面设置有弹簧针接口,电子设备表面设置有弹簧针接口;其中,一个为公座,一个为母座。外接设备的弹簧针接口与电子设备的弹簧针接口连接,实现外接设备与电子设备通过弹簧针物理连接与通信连接的效果。一般的,外接设备的弹簧针接口为公座;电子设备的弹簧针接口为母座。
由于弹簧针的结构设计,在外接设备的弹簧针接口与电子设备的弹簧针接口连接过程中,可能由于外接设备与电子设备的相对位置移动,导致弹簧针接口与弹簧针接口的位置出现偏移,使得外接设备与电子设备产生断连,而无法正常通信。比如,在用户使用外接设备过程中,移动了外接设备的位置,外接设备的弹簧针接口与电子设备的弹簧针接口没对准,而导致外接设备与电子设备产生断连无法正常通信。在这种情况下,用户往往需要通过使用外接设备来确认是否已经产生断连,用户对于外接设备的实际状态无法及时准确感知,造成用户使用体验比较差。
以外接设备为键盘、电子设备为平板电脑为例来说明,键盘通过弹簧针接口与平板电脑的弹簧针接口连接,实现键盘与平板电脑的物理吸附,以及键盘与平板电脑的通信连接。在用户使用键盘的过程中,若键盘的位置发生移动使得键盘的弹簧针接口相对于平板电脑的弹簧针接口发生偏移,可能导致键盘无法与平板电脑通信。而用户只能通过使用键盘来确定键盘与平板电脑之间是否已经断开连接,这样导致用户无法及时地获取键盘的实际连接状态,使用体验较差。
现有技术中也有通过电子设备的处理器与外接设备的处理器进行通信来实现监测外接设备连接状态的目的。例如,在电子设备与外接设备中设置微控制单元(microcontroller unit,MCU),电子设备通过MCU检测弹簧针接口是否有信号回路,来判断电子设备是否连接外接设备。这种方案需要在电子设备与外接设备中设置MCU,硬件成本较高。并且,在电子设备和外接设备断开连接时,无法分辨是用户人为断开连接还是外接设备与电子设备意外断开连接。也即,这种方案也无法使得用户准确感知外接设备的实际状态。
本申请实施例提供了一种外接设备检测方法,通过在电子设备与外接设备中设置配套的物理连接的感知装置,可以通过物理连接的感知装置确定外接设备与电子设备的物理连接情况。通过电子设备与外接设备的弹簧针接口的通信数据,确定外接设备与电子设备的通信连接情况。基于物理连接情况与通信连接情况,可以持续地获取外接设备的实际连接状态。这样,电子设备可以通过在显示屏输出提示信息或输出音频信息来提示用户外接设备已连接或断开连接的信息,可以使得用户实时地准确地感知外接设备的实际连接状态,提升用户体验。
本申请涉及到的电子设备100与外接设备200的弹簧针接口的数量一致。示例性地,电子设备与外接设备的弹簧针接口可以包括一个电源接口,一个接地接口,以及至少一个通信接口。可选地,在通信接口为多个时,可以约定不同通信接口在通信过程中的作用。需要说明的是,本申请中所涉及的电子设备与外接设备为配套设备,即,本申请所述涉及到的电子设备与外接设备已约定通信协议。其中,通信协议中约定了通信报文格式、各个通信接口的传输方向与传输内容等。
请参考图2,其示出本申请实施例提供一种电子设备(如电子设备100)的结构框图。其中,电子设备100可以包括处理器310,外部存储器接口320,内部存储器321,通用串行总线(universal serial bus,USB)接口330,充电管理模块340,电源管理模块341,电池342,天线1,通信模块360,音频模块370,扬声器370A,受话器370B,麦克风370C,耳机接口370D,传感器模块380,按键390,马达391,指示器392,摄像头393,显示屏394和弹簧针接口399。
其中传感器模块380可以包括压力传感器380A,陀螺仪传感器380B,气压传感器380C,磁传感器380D,距离传感器380F,接近光传感器380G,指纹传感器380H,温度传感器380J,触摸传感器380K,环境光传感器380L等。
本发明实施例示意的结构并不构成对电子设备100的限定。可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器310可以包括一个或多个处理单元。例如,处理器310可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
上述控制器可以是指挥电子设备100的各个部件按照指令协调工作的决策者。是
电子设备100的神经中枢和指挥中心。控制器根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器310中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器310中的存储器为高速缓冲存储器,可以保存处理器310刚用过或循环使用的指令或数据。如果处理器310需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器310的等待时间,因而提高了***的效率。
在一些实施例中,处理器310可以包括接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口和/或USB接口等。
本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。电子设备100可以采用本发明实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块340用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块340可以通过USB接口330接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块340可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块340为电池342充电的同时,还可以通过电源管理模块341为电子设备100供电。
电源管理模块341用于连接电池342,充电管理模块340与处理器310。电源管理模块341接收所述电池342和/或充电管理模块340的输入,为处理器310,内部存储器321,外部存储器接口320,显示屏394,摄像头393,和通信模块360等供电。电源管理模块341还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在一些实施例中,电源管理模块341也可以设置于处理器310中。在一些实施例中,电源管理模块341和充电管理模块340也可以设置于同一个器件中。
在本实施例中,电源管理模块341还可以为弹簧针接口399中的电源接口供电。例如,在处理器确定外接设备与电子设备已经建立物理连接时,处理器可以控制电源管理模块为弹簧针接口399中的电源接口供电。在处理器确定外接设备与电子设备已经断开物理连接时,处理器可以控制电源管理模块为弹簧针接口399中的电源接口下电。
电子设备100的无线通信功能可以通过天线1,通信模块360,调制解调器以及基带处理器等实现。
通信模块360可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(blue tooth,BT),全球导航卫星***(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案的通信处理模块。通信模块360可以是集成至少一个通信处理模块的一个或多个器件。通信模块360经由天线1
接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器310。通信模块360还可以从处理器310接收待发送的信号,对其进行调频,放大,经天线1转为电磁波辐射出去。
在一些实施例中,电子设备100的天线1和通信模块360耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯***(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位***(satellite based augmentation systems,SBAS),全球导航卫星***(global navigation satellite system,GLONASS),北斗卫星导航***(BeiDou navigation satellite system,BDS),准天顶卫星***(Quasi-Zenith satellite system,QZSS)和/或星基增强***(satellite based augmentation systems,SBAS)。
电子设备100通过GPU,显示屏394,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏394和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器310可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏394用于显示图像,视频等。例如,显示屏394可以显示外接设备的实时连接状态。比如,在显示屏的状态栏中显示键盘小图标,来表征当前外接设备(键盘)已连接。本申请实施例中,电子设备100在检测到键盘已连接时,可以在显示屏的状态栏中显示键盘小图标,或者,在显示屏的当前显示界面输出键盘已连接的提示信息;若检测到键盘已断开连接时,显示屏的状态栏中显示键盘小图标消失,也即,不显示键盘小图标。若在使用键盘过程中,检测到键盘断开连接,还可以在显示屏显示的当前界面中,输出提醒弹窗,弹窗内容用于提醒用户调整键盘位置,以使键盘连接恢复正常连接。可选地,处理器还可以在检测到键盘与电子设备没有数据通信,确定通信接口存在异常时,在显示屏显示异常的通信接口信息,提醒用户及时进行通信接口的维护。
显示屏394包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏394,N为大于1的正整数。
电子设备100可以通过ISP,摄像头393,视频编解码器,GPU,显示屏以及应用处理器等实现拍摄功能。
外部存储器接口320可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子
设备100的存储能力。外部存储卡通过外部存储器接口320与处理器310通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器321可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器310通过运行存储在内部存储器321的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器321可以包括存储程序区和存储数据区。其中,存储程序区可存储操作***,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器321可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,其他易失性固态存储器件,通用闪存存储器(universal flash storage,UFS)等。
电子设备100可以通过音频模块370,扬声器370A,受话器370B,麦克风370C,耳机接口370D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块370用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块370还可以用于对音频信号编码和解码。在一些实施例中,音频模块370可以设置于处理器310中,或将音频模块370的部分功能模块设置于处理器310中。
扬声器370A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备100可以通过扬声器370A收听音乐,或收听免提通话。
受话器370B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备100接听电话或语音信息时,可以通过将受话器370B靠近人耳接听语音。
麦克风370C,也称“话筒”,“传声器”,用于将声音信号转换为音频电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风370C发声,将声音信号输入到麦克风370C。电子设备100可以设置至少一个麦克风370C。在一些实施例中,电子设备100可以设置两个麦克风370C,除了采集声音信号,还可以实现降噪功能。在一些实施例中,电子设备100还可以设置三个,四个或更多麦克风370C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口370D用于连接有线耳机。耳机接口370D可以是USB接口330,也可以是3.5mm的开放移动终端平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
弹簧针接口399用于与外接设备建立物理连接和通信连接。其中,物理连接指的是外接设备与电子设备的位置的贴附连接。通信连接指的是外接设备与电子设备的数据通信连接。弹簧针接口包括一个电源接口、一个接地接口以及至少一个通信接口。其中,电源接口用于在电子设备确定与外接设备建立物理连接时,为外接设备提供电源。至少一个通信接口用于在电子设备与外接设备建立连接过程中以及建立连接后进行数据传输。电子设备与外接设备遵循相同的通信协议,比如,电子设备与外接设备遵循相同的公有通信协议;比如,电子设备与外接设备遵循约定的私有通信协议。其中,通信协议中可以规定通信报文格式、各个通信接口的传输方向与传输内容等。示例性地,若只有一个通信接口,电子设备与外接设备的通信协议可约定该通信接口在
同一时间段内,只能进行一个方向的数据传输。比如,电子设备的通信接口在接收外接设备发送的通信数据时,无法向外接设备发送通信数据。外接设备的通信接口在向电子设备发送通信数据时,无法接收外接设备发送的通信数据。可选地,若有两个通信接口,电子设备与外接设备的通信协议可约定该通信接口的通信方式为,电子设备的通信接口1只用于向外接设备发送的通信数据,通信接口2只用于接收外接设备发送的通信数据;相应地,外接设备的通信接口1只用于接收电子设备发送的通信数据,通信接口2至用于向电子设备发送的通信数据。或者,约定电子设备与外接设备的通信接口1可用于收发通信数据;电子设备与外接设备的通信接口2为备用接口。比如,正常情况下,电子设备与外接设备通过通信接口1进行数据传输,在电子设备无法从通信接口1获取通信数据的情况下,电子设备可以向外接设备发送通过通信接口2进行数据传输的请求,使得外接设备通过通信接口2进行通信数据传输。可选地,还可以约定通信接口1与通信接口2的通信数据类型不同。比如,电子设备与外接设备的通信接口1用于传输正常通信数据,电子设备与外接设备的通信接口2用于传输测试数据等等。弹簧针接口的通信接口的作用可根据实际的使用场景在通信协议中约定。
压力传感器380A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器380A可以设置于显示屏394。压力传感器380A的种类很多,如电阻式压力传感器,电感式压力传感器,电容式压力传感器等。电容式压力传感器可以是包括至少两个具有导电材料的平行板。当有力作用于压力传感器,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏394,电子设备100根据压力传感器380A检测所述触摸操作强度。电子设备100也可以根据压力传感器380A的检测信号计算触摸的位置。
在一些实施例中,电子设备的处理器或者SOC可以通过压力传感器检测外接设备是否已经与电子设备建立物理连接,比如,电子设备的处理器或者SOC通过压力传感器获取压力值小于压力阈值,则确定外接设备已连接,处于在位状态。电子设备的处理器或者SOC通过压力传感器获取压力值大于压力阈值,则确定外接设备已断开连接,处于不在位状态。可选地,电子设备的处理器或者SOC在通过压力传感器检测到外接设备已连接时,还可以结合陀螺仪传感器获取电子设备的当前姿态,进一步确认电子设备与外接设备的物理连接状态。
陀螺仪传感器380B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器380B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器380B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器380B检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器380B还可以用于导航,体感游戏场景。
霍尔传感器380C是根据霍尔效应制作的一种磁场传感器,在有磁铁进入霍尔传感器的检测区域时,霍尔传感器被触发,其输出电平会产生中断。霍尔传感器可以用于检测外接设备与电子设备的物理连接情况,也即,霍尔传感器可以检测外接设备与电子设备的距离。可选I地,电子设备还可以包括其他磁场传感器。
在一些实施例中,霍尔传感器是根据霍尔效应制作的一种磁场传感器。在磁铁靠
近或远离霍尔传感器的检测区域时,磁铁均会触发霍尔传感器的磁场发生变化。电子设备中的霍尔传感器在检测区域没有检测到磁铁时,保持一种输出电平。比如,霍尔传感器在检测区域没有检测到磁铁时输出电平为低电平。在磁铁进入霍尔传感器的检测区域时,触发霍尔传感器的磁场发生变化,霍尔传感器的输出电平也发生变化。示例性地,霍尔传感器的输出电平可以由低电平变为高电平。或者,在霍尔传感器检测到磁铁靠近时,霍尔传感器的输出电平产生一个吸附中断。在磁铁离开霍尔传感器的检测区域时,触发霍尔传感器的磁场发生变化,霍尔传感器的输出电平也发生变化。示例性地,霍尔传感器的输出电平可以由高电平变为低电平。或者,在霍尔传感器检测到磁铁离开检测区域时,霍尔传感器的输出电平产生一个吸附中断。
在一些实施例中,电子设备100的处理器或者***级芯片(system on chip,SOC)在检测到霍尔传感器的输出电平由低电平变为高电平,或者,检测到霍尔传感器在输出电平为低电平时产生吸附中断,确定磁铁进入霍尔传感器的检测区域。也即,确定外接设备与电子设备100处于物理连接状态,外接设备处于在位状态。电子设备100的处理器或者SOC在检测到霍尔传感器的输出电平可以由高电平变为低电平,或者,检测到霍尔传感器的输出电平为高电平时产生吸附中断,确定磁铁离开霍尔传感器的检测区域。也即,确定外接设备与电子设备100处于分离状态,外接设备处于不在位状态。
距离传感器380F,用于测量距离。电子设备100可以通过红外或激光测量距离。
在一些实施例中,电子设备的处理器或者SOC可以通过距离传感器检测外接设备是否已经与电子设备建立物理连接,比如,电子设备的处理器或者SOC通过红外传感器获取距离值小于第一距离阈值,则确定外接设备已连接,处于在位状态。电子设备的处理器或者SOC通过红外传感器获取距离值大于第二距离阈值,则确定外接设备已断开连接,处于不在位状态。可选地,电子设备的处理器或者SOC在通过距离传感器检测到外接设备已连接时,还可以结合陀螺仪传感器获取电子设备的当前姿态,进一步确认电子设备与外接设备的物理连接状态。
接近光传感器380G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。通过发光二极管向外发射红外光。使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,可以确定电子设备100附近没有物体。电子设备100可以利用接近光传感器380G检测用户手持电子设备100贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。接近光传感器380G也可用于皮套模式,口袋模式自动解锁与锁屏。
环境光传感器380L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏亮度。环境光传感器380L也可用于拍照时自动调节白平衡。环境光传感器380L还可以与接近光传感器380G配合,检测电子设备100是否在口袋里,以防误触。
在一些实施例中,电子设备的处理器或者SOC可以通过环境光传感器检测外接设备是否已经与电子设备建立物理连接,比如,电子设备的处理器或者SOC通过环境光传感器获取光亮度值小于亮度阈值,则确定外接设备已连接,处于在位状态。电子设
备的处理器或者SOC通过红外传感器获取光亮度值大于亮度阈值,则确定外接设备已断开连接,处于不在位状态。可选地,电子设备的处理器或者SOC在通过环境光传感器检测到外接设备已连接时,还可以结合陀螺仪传感器获取电子设备的当前姿态,进一步确认电子设备与外接设备的物理连接状态。
温度传感器380J用于检测温度。电子设备100利用温度传感器380J检测的温度,执行温度处理策略。例如,当温度传感器380J上报的温度超过阈值,电子设备100执行降低位于温度传感器380J附近的处理器的性能,以便降低功耗实施热保护。
触摸传感器380K,也称“触控面板”。可设置于显示屏394。用于检测作用于其上或附近的触摸操作。可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型,并通过显示屏394提供相应的视觉输出。
按键390包括开机键,音量键等。按键390可以是机械按键。也可以是触摸式按键。电子设备100接收按键390输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。
马达391可以产生振动提示。马达391可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏394不同区域的触摸操作,也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器392可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
电子设备100的软件***可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Android***为例,示例性说明电子设备100的软件结构。
图3是本发明实施例的电子设备100的操作***软件结构框图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将操作***分为四层,从上至下分别为应用程序层,应用程序框架层,***运行时和***库,以及内核层。
应用程序层可以包括一系列应用程序包。
如图3所示,应用程序包可以包括相机,图库,日历,电话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
如图3所示,应用程序框架层可以包括检测模块、窗口管理器,内容提供器,视图***,电话管理器,资源管理器和通知管理器。
在一些实施例中,检测模块,用于对外接设备的连接状态进行实时持续检测。在检测到外接设备与电子设备建立连接时,检测模块通过视图***在电子设备的显示界面输出已连接的信息,以及在显示界面的状态栏中显示外接设备的图标;在检测到外接设备与电子设备断开连接时,检测模块通过视图***在电子设备的显示界面输出重
新连接的信息等。在检测到通信接口异常时,检测模块可以通过视图***在电子设备的显示界面输出通信接口异常的信息等等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。视图***包括可视控件,例如显示文字的控件,显示图片的控件等。视图***可用于构建应用程序。显示界面可以由一个或多个视图组成的。
电话管理器用于提供电子设备100的通信功能。例如,通话状态的管理(包括接通,挂断等)。资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在***顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。
***运行时包括核心库和虚拟机。***运行时负责操作统的调度和管理。核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是操作***的核心库。
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
***库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(media libraries),三维图形处理库(例如:openGL ES),2D图形引擎(例如:SGL)等。
表面管理器用于对显示子***进行管理,并且为多个应用程序提供了2D和3D图层的融合。媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。2D图形引擎是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
在一些实施例中,以传感器为霍尔传感器来说明,当有磁铁进入霍尔传感器的检测区域内时,霍尔传感器被触发,传感器驱动将霍尔传感器的输出电平传输至检测模块。检测模块根据霍尔传感器的输出电平的变化,控制电源接口上电或下电。以及,检测模块根据霍尔传感器的输出电平的变化和检测到的通信接口的输出电平的变化,确定外接设备与电子设备的连接状态,通过控制显示驱动在显示屏的显示界面中显示相应的内容。比如,检测模块在确定电子设备与外接设备立通信连接的情况下,通过控制显示驱动在显示屏的显示界面中显示键盘图标;检测模块在确定电子设备与外接设备通信连接断开的情况下,通过控制显示驱动,停止在显示屏的显示界面中显示键盘图标等等。
请参考图4,其示出本申请实施例提供一种外接设备(如外接设备200)的结构框图。其中,外接设备200可以包括处理器410,弹簧针接口420,通信模块430,指示器450,按键460,音频模块470,扬声器470A,受话器470B,麦克风470C和耳机接口470D等。
本发明实施例示意的结构并不构成对外接设备200的限定。可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器410可以包括一个或多个处理单元。例如,处理器410可以包括应用处理器AP,微控制单元(microcontroller unit,MCU),调制解调处理器,控制器,存储器,视频编解码器,数字信号处理器DSP,和/或基带处理器等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
上述控制器可以是指挥外接设备200的各个部件按照指令协调工作的决策者。是外接设备200的神经中枢和指挥中心。控制器根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器410中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器410中的存储器为高速缓冲存储器,可以保存处理器410刚用过或循环使用的指令或数据。如果处理器410需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器410的等待时间,因而提高了***的效率。
在一些实施例中,处理器410可以包括接口。接口可以包括集成电路I2C接口,集成电路内置音频I2S接口,脉冲编码调制PCM接口,通用异步收发传输器UART接口,移动产业处理器接口MIPI,通用输入输出GPIO接口和/或USB接口等。
本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对外接设备200的结构限定。外接设备200可以采用本发明实施例中不同的接口连接方式,或多种接口连接方式的组合。
内部存储器421可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器410通过运行存储在内部存储器421的指令,从而执行外接设备200的各种功能应用以及数据处理。内部存储器421可以包括存储程序区和存储数据区。其中,存储程序区可存储操作***,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储外接设备200使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器421可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,其他易失性固态存储器件,通用闪存存储器(universal flash storage,UFS)等。
外接设备200的无线通信功能可以通过天线1,通信模块430以及基带处理器等实现。
通信模块430可以提供应用在通信模块360上的包括无线局域网WLAN(如Wi-Fi网络),蓝牙BT,全球导航卫星***GNSS,调频FM,近距离无线通信技术NFC,红外技术IR等无线通信的解决方案的通信处理模块。通信模块430可以是集成至少一个通信处理模块的一个或多个器件。通信模块430经由天线1接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器410。通信模块430还可以从处理
器410接收待发送的信号,对其进行调频,放大,经天线1转为电磁波辐射出去。
电子设备100可以通过音频模块470,扬声器470A,受话器470B,麦克风470C,耳机接口470D,以及应用处理器等实现音频功能。例如,提示音播放等。
音频模块470用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块470还可以用于对音频信号编码和解码。在一些实施例中,音频模块470可以设置于处理器410中,或将音频模块470的部分功能模块设置于处理器410中。
扬声器470A,也称“喇叭”,用于将音频电信号转换为声音信号。外接设备200可以通过扬声器470A播放提示音。在一些实施例中,若外接设备与电子设备建立通信连接,外接设备200在接收到电子设备100发送的建立通信连接信号之后,处理器410可以控制扬声器470A输出“滴”的提示音,用于提示用户已与电子设备建立连接。
受话器470B,也称“听筒”,用于将音频电信号转换成声音信号。
麦克风470C,也称“话筒”,“传声器”,用于将声音信号转换为音频电信号。外接设备200可以设置两个麦克风470C,除了采集声音信号,还可以实现降噪功能。在一些实施例中,电子设备100还可以设置三个,四个或更多麦克风470C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。
耳机接口470D用于连接有线耳机。耳机接口470D可以是USB接口,也可以是3.5mm的开放移动终端平台OMTP标准接口,美国蜂窝电信工业协会CTIA标准接口。
弹簧针接口420用于与电子设备100建立物理连接和通信连接。弹簧针接口包括一个电源接口、一个接地接口以及至少一个通信接口。其中,电源接口用于在与电子设备建立物理连接时为外接设备提供电源。至少一个通信接口用于在电子设备与外接设备建立连接过程中以及建立连接后进行数据传输。电子设备与外接设备约定通信协议。其中,通信协议中可以约定通信报文格式、各个通信接口的传输方向与传输内容等。示例性地,若只有一个通信接口,电子设备与外接设备的通信协议可约定该通信接口在同一时间段内,只能进行一个方向的数据传输。比如,电子设备的通信接口在接收外接设备发送的通信数据时,无法向外接设备发送通信数据。外接设备的通信接口在向电子设备发送通信数据时,无法接收外接设备发送的通信数据。可选地,若有两个通信接口,电子设备与外接设备的通信协议可约定该通信接口的通信方式为,电子设备的通信接口1只用于向外接设备发送的通信数据,通信接口2只用于接收外接设备发送的通信数据;相应地,外接设备的通信接口1只用于接收电子设备发送的通信数据,通信接口2只用于向电子设备发送的通信数据。或者,约定电子设备与外接设备的通信接口1可用于收发通信数据;电子设备与外接设备的通信接口2为备用接口。比如,正常情况下,电子设备与外接设备通过通信接口1进行数据传输,在电子设备无法从通信接口1获取通信数据的情况下,电子设备可以向外接设备发送通过通信接口2进行数据传输的请求,使得外接设备通过通信接口2进行通信数据传输。可选地,还可以约定通信接口1与通信接口2的通信数据类型不同。比如,电子设备与外接设备的通信接口1用于传输正常通信数据,电子设备与外接设备的通信接口2用于传输测试数据等等。通信接口的作用可根据实际的使用场景在通信协议中约定。
电子设备100的弹簧针接口的位置与外接设备200的弹簧针接口的位置具有对应
关系。在电子设备100与外接设备200吸附时,电子设备100的弹簧针母座与外接设备200的弹簧针公座对应贴合。本实施例对弹簧针接口在电子设备中的具***置不做限定。
可选地,在电子设备100的传感器为霍尔传感器或者其他磁力传感器的情况下,外接设备200包括第一组件440。
第一组件440为与电子设备100中传感器匹配的组件,电子设备100可以基于传感器与第一组件来检测外接设备200的在位状态。示例性地,若电子设备100中的传感器为霍尔传感器,外接设备200的第一组件440可以为磁铁。在外接设备与电子设备建立物理连接时,磁铁进入或离开霍尔传感器的检测区域,触发霍尔传感器的输出电平发生变化。电子设备100可以根据电平变化确定外接设备的连接状态。
在一些实施例中,电子设备100中的传感器与外接设备200中的第一组件构成电子设备与外接设备中配套的物理连接的感知装置。
电子设备100的传感器的位置与外接设备200的第一组件440的位置具有对应关系。本实施例对电子设备100的传感器与外接设备200的第一组件440的位置不做限定。
指示器450可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,通知等。
在外接设备为键盘的情况下,按键460包括键盘按键等。按键460可以是机械按键。也可以是触摸式按键。外接设备200接收按键460输入,产生与电子设备100的数据输入以及功能控制有关的键信号输入。
现有的电子设备与外接设备通过吸附,使得电子设备的弹簧针接口与外接设备的弹簧针接口贴合从而实现电子设备与外接设备的通信。若电子设备的弹簧针接口与外接设备的弹簧针接口出现位置偏移,弹簧针接口偏移可能会导致弹簧针接口无法通信,也即,即使在外接设备仍然吸附于电子设备的情况下,依然会出现电子设备与外接设备通信断开连接的情况。
本申请提供的弹簧针接口连接状态检测方法,电子设备上设置传感器,外接设备上设置与传感器对应的组件,来实现电子设备与外接设备的物理连接状态的检测。在电子设备与外接设备通信断开连接的情况下,可以进一步确定电子设备与外接设备的物理连接状态。可选地,也可以在通过传感器确定电子设备与外接设备物理连接正常的情况下,实现电子设备与外接设备通信连接的检测。结合电子设备与外接设备的物理连接状态,检测电子设备与外接设备的弹簧针接口的连接状态(通信连接状态),得到的检测结果更准确。解决了现有技术无法分辨电子设备与外接设备是物理连接断开而导致的通信连接断开,还是电子设备与外接设备只有通信连接断开的问题。避免了由于电子设备与外接设备的物理连接断开而造成的对于通信连接状态检测结果的干扰。
本申请提供的弹簧针接口连接状态检测方法可应用于图5中,图5给出一种电子设备与外接设备的示例。图5中,电子设备为平板电脑,外接设备为可拆卸键盘(以下实施例中简称键盘)。平板电脑和可拆卸键盘均设置有三个弹簧针接口,其中,三个弹簧针接口包括电源接口、接地接口以及通信接口。图5中,平板电脑中设置的用
于检测物理位置连接的传感器为霍尔传感器,相应地,键盘中设置的用于检测物理位置连接的组件为磁铁。图5中,平板电脑的弹簧针接口的位置对应键盘的弹簧针接口的位置,在平板电脑与键盘正常吸附的情况下,平板电脑的弹簧针接口的位置与键盘的弹簧针接口的位置处于对准状态。图5中,平板电脑的弹簧针接口与键盘的弹簧针接口对应设置在设备的左侧。平板电脑中的霍尔传感器对应键盘的磁铁的位置,在平板电脑与键盘正常吸附的情况下,键盘的磁铁应处于平板电脑的霍尔传感器的检测区域内。图5中平板电脑中的霍尔传感器与键盘的磁铁对应设置在设备的右侧。平板电脑的弹簧针接口与键盘的弹簧针接口吸附时,键盘的磁铁进入平板电脑的霍尔传感器的检测区域,触发霍尔传感器的输出电平发生变化。平板电脑的SOC监测到霍尔传感器的输出电平发生变化,SOC控制电源接口上电,通过通信接口向键盘发送命令,若SOC接收到键盘的响应,则确定键盘与平板电脑已建立通信连接。若在键盘连接过程中,SOC向键盘发送命令没有得到相应的响应,SOC在确定霍尔传感器的输出电平没有发生变化的情况下,也即,键盘未被用户从平板电脑上取下,可能弹簧针接口发生位置偏移导致无法通信。在这种情况下,电子设备发出提示信息,用于提醒用户重新连接键盘,以恢复连接。在一种示例中,在显示屏的显示界面输出提醒信息。
结合图5给出的示例,本实施例电子设备的SOC为外接设备检测方法的执行主体,提供的一种外接设备检测方法,参考图6,该方法包括:
S101、平板电脑的弹簧针接口与键盘的弹簧针接口对准贴合。
在一些实施例中,键盘可以为磁吸键盘,用户将键盘与平板电脑连接,可以将平板电脑放置在键盘磁槽中实现平板电脑与键盘的磁力吸附。可选地,键盘的弹簧针接口可设置于磁槽中,平板电脑的弹簧针接口可以设置于与键盘磁槽吸附的表面。在平板电脑放置于键盘的磁槽处于吸附状态时,平板电脑的弹簧针接口与键盘的弹簧针接口处于贴合对准状态。
在平板电脑与键盘处于吸附连接状态时,键盘中的磁铁进入平板电脑的霍尔传感器的检测区域,磁铁靠近霍尔传感器,使得霍尔传感器的输出电平发生变化。平板电脑的SOC监测霍尔传感器的输出电平,来确定键盘与平板电脑是否已经吸附连接。
S102、SOC检测到霍尔传感器的输出电平发生变化,SOC控制电源接口上电。
在一些实施例中,平板电脑中的霍尔传感器在被磁铁触发之前可以维持一种输出电平。比如,霍尔传感器在被磁铁触发之前输出电平保持低电平。或者,霍尔传感器在被磁铁触发之前输出电平保持为高电平。SOC可以按照一定的检测频率通过传感器驱动来获取霍尔传感器的输出电平。比如,SOC可以持续地通过传感器驱动监听霍尔传感器的输出电平;或者,SOC可以每隔1秒通过传感器驱动获取并记录霍尔传感器的输出电平。从而SOC可以根据当前获取到的输出电平与历史获取到的输出电平进行比较,确定霍尔传感器的输出电平在一段时间内是否有变化。
在本实施例中,用户将键盘与平板电脑吸附连接,平板电脑通过弹簧针接口与键盘物理连接后,键盘的磁铁与平板电脑的霍尔传感器的距离小于预设阈值。平板电脑通过霍尔传感器检测到磁铁进入霍尔传感器的检测区域内,霍尔传感器被触发,其输出电平会发生变化。
在一种可能方式中,示例性地,如图7所示,霍尔传感器在触发之前输出电平为
低电平,在键盘与平板电脑吸附时,霍尔传感器在检测区域内检测到磁铁,霍尔传感器的输出电平变成高电平。在这种情况下,SOC可以基于一段时间内获取到的霍尔传感器的输出电平判断是否存在电平由低变高,如果霍尔传感器的输出电平由低电平变为高电平,SOC通过控制平板电脑的电源接口上电。
在一种可能方式中,示例性地,如图8所示,霍尔传感器在触发之前输出电平为高电平,在键盘与平板电脑吸附时,霍尔传感器在检测区域内检测到磁铁,霍尔传感器的输出电平变成低电平。在这种情况下,SOC可以基于一段时间内获取到的霍尔传感器的输出电平判断是否存在电平由高变低,如果霍尔传感器的输出电平由高电平变为低电平,SOC通过控制平板电脑的电源接口上电。
在一种可能方式中,示例性地,如图9所示,霍尔传感器在触发之前输出电平为高电平,在键盘与平板电脑吸附时,霍尔传感器在检测区域内检测到磁铁,霍尔传感器的输出电平会产生一个低电平的吸附中断。在这种情况下,SOC可以基于一段时间内获取到的霍尔传感器的输出电平判断是否存在吸附中断,如果SOC检测到一段时间内霍尔传感器的输出电平为高电平时,产生一个吸附中断,SOC通过控制平板电脑的电源接口上电。
在一种可能方式中,示例性地,如图10所示,霍尔传感器在触发之前输出电平为低电平,在键盘与平板电脑吸附,霍尔传感器在检测区域内检测到磁铁,霍尔传感器的输出电平会产生一个高电平的吸附中断。在这种情况下,SOC可以基于一段时间内获取到的霍尔传感器的输出电平判断是否存在吸附中断,如果SOC检测到一段时间内霍尔传感器的输出电平为低电平时,产生一个吸附中断,SOC通过控制平板电脑的电源接口上电。可选地,霍尔传感器的检测区域的范围大小由传感器出厂参数确定。
在一些实施例中,SOC在确定霍尔传感器被磁铁触发,也即,确定键盘吸附于平板电脑上时,控制平板电脑的电源接口上电。电源接口的输出电平可参考图11所示,霍尔传感器的初始输出电平为高电平。在键盘的磁铁靠***板电脑的霍尔传感器时,磁铁进入霍尔传感器的检测区域,触发霍尔传感器的输出电平产生吸附中断,霍尔传感器的输出电平由高电平变为低电平。SOC在检测到霍尔传感器的输出电平产生变化后,控制电源接口上电,电源接口的输出电平由未上电的状态(低电平)变成上电状态(高电平)。也就是说,若电源接口出现问题,或者,平板电脑无法正常为电源接口供电,霍尔传感器被磁铁触发后,电源接口的信号仍然保持低电平。SOC也可以根据电源接口的输出电平来确定电源接口是否存在异常。若电源接口存在异常,SOC也可以通过在显示界面输出电源接口异常的信息,提醒用于及时对电源接口进行维护。
可选地,在一些实施例中,在SOC在检测到霍尔传感器的输出电平由高电平变为低电平,控制电源接口上电之后,在键盘的弹簧针接口与平板电脑的弹簧针接口建立通信连接的情况下,平板电脑的通信接口传输通信数据,通信接口的输出电平会随着通信数据传输发生变化。可参考图12所示。键盘与平板电脑之间建立通信连接,在正常通信连接情况下,键盘与平板电脑通过通信接口传输通信指令,通信接口的输出电平产生符合通信协议约定的规律性变化。可选地,通信接口的输出电平变化,说明通信接口之间有数据传输。若传输的数据异常,则通信接口的输出电平的变化规律不符合通信协议约定的变化规律。基于此,在通信接口的输出电平变化的情况下,SOC可
以进一步校验所传输的数据是否存在异常,如果SOC确定传输的数据异常,也即,电平变化规律不符合通信协议约定,则认为通信接口通信连接异常。通信指令中携带通信数据,其中,键盘与平板电脑的通信数据的格式可以在通信协议中约定。
S103、SOC通过通信接口向键盘发送第一指令,如果SOC接收到第一响应,确定与键盘建立通信连接,执行S104。如果SOC在第一时长内未接收到第一响应,则执行S106。
其中,第一指令用于测试平板电脑与键盘之间的通信连接是否正常。可选地,第一指令可以为测试指令,测试指令中可以携带测试数据,测试数据与通信数据的数据格式可以相同。
在一些实施例中,键盘与平板电脑正常连接的情况下,SOC可以以第一周期向键盘发送第一指令。第一周期可以长周期,比如,第一周期可以为10秒、15秒。第一指令可以为正常连接下的轮询指令。
在一些实施例中,第一指令可以为测试指令。测试指令与通信指令的数据格式可以相同,也可以不同,可以约定数据格式的某一位为测试标志位,若测试标志位的值为第一值,则该命令为测试指令;若测试标志位的值为第二值,则该命令为通信指令。其中,第一值可以为0,第二值可以为1,不做限定。测试指令与通信指令的数据格式也可以不同,比如,测试指令为32位数据;通信指令为64位数据,在通信协议约定之后,外接设备可以根据约定数据格式,分辨当前收到的指令是测试指令还是通信指令。本实施例对测试指令的数据格式、通信指令的数据格式不做限定。测试标志位,键盘在接收到测试指令后,通过分析测试指令读取测试标志位,向平板电脑返回测试指令对应的测试响应。如果SOC在预设时间段内未接收到键盘返回的测试响应,则说明键盘与平板电脑未建立通信连接。其中,考虑到键盘的处理时间,设定在预设时间段内接收键盘返回的测试响应。如果通信连接正常,键盘返回的测试响应应该是在短时间内完成,示例性地,预设时间段可以为30毫秒。
或者,在一些实施例中,第一指令也可以为通信指令,在正常通信连接的情况下,键盘在接收到通信指令之后,根据通信指令中携带的通信数据向平板电脑返回对应的通信响应。该通信响应中携带与通信数据对应的响应数据。若SOC在预设时间段内接收到通信响应,则确定与键盘建立通信连接。若SOC在预设时间段内未接收到通信响应,或者,SOC在预设时间段内接收到键盘返回的响应,该响应中未携带与通信数据对应的响应数据,则确定键盘与平板电脑未建立通信连接。
可选地,若平板电脑包括一个通信接口,则SOC通过该一个通信接口发送第一指令;若平板电脑包括多个通信接口,则SOC可以根据通信协议约定,通过一个或多个通信接口发送第一指令。
在一些实施例中,若键盘和平板电脑的弹簧针接口只有一个通信接口1。这种情况下,SOC通过通信接口1向键盘发送第一指令。若SOC通过通信接口1接收到键盘返回的第一响应,则键盘的通信接口1、平板电脑的通信接口1正常,键盘与平板电脑建立通信连接。如果SOC在预设时间段内没有接收到键盘返回的第一响应,则确定键盘的通信接口1、平板电脑的通信接口1至少有一个通信接口异常,键盘与平板电脑未建立通信连接。
在一些实施例中,若键盘和平板电脑的弹簧针接口均包括两个通信接口。其中,通信协议中约定,通信接口1为主通信接口,比如,键盘的通信接口1负责接收或发送与平板电脑之间的通信数据和测试数据。通信接口2为备用接口,比如,在键盘无法通过通信接口1传输数据时,可切换至通信接口2传输数据。在这种情况下,SOC通过通信接口1向键盘的通信接口1发送第一指令,正常通信时,键盘通过通信接口1收到第一指令,通过通信接口1向平板电脑的通信接口1返回第一指令对应的第一响应。若键盘通过通信接口1接收到第一指令,但是无法通过通信接口1传输第一响应,则键盘切换至通信接口2返回第一响应,也即,键盘通过通信接口2向平板电脑的通信接口2返回第一响应。若SOC通过通信接口1接收到第一响应,则确定键盘的通信接口1正常,键盘与平板电脑通信连接正常。若SOC未通过通信接口1接收到的第一响应,通过通信接口2接收到第一响应,则确定键盘的通信接口1异常,键盘的通信接口2正常。可选地,平板电脑可以在通信接口1异常,通信接口2正常的情况下,切换至通信接口2执行后续的数据传输。若SOC在预设时间段内未接收到通过任意一个通信接口返回的第一响应,则确定键盘与平板电脑未建立通信连接。
在一些实施例中,若SOC接收到键盘返回的第一响应,确定平板电脑与键盘已建立通信连接。在这种情况下,SOC可以控制平板电脑的显示屏,在显示界面向用户输出平板电脑与键盘已建立通信连接的相关提示信息,即执行S105。若SOC没有接收到键盘返回的第一响应,确定平板电脑与键盘未建立通信连接。在这种情况下,SOC还可以进一步确认未收到键盘的第一响应是否为偶然事件,SOC可以向键盘多次发送第二指令,来进一步确定平板电平与键盘是否未建立通信连接,即执行S106。
S104、SOC控制显示屏在显示界面中显示键盘图标。
在一些实施例中,SOC确定平板电脑与键盘已建立通信连接。在这种情况下,SOC可以通过控制平板电脑显示屏,在显示界面输出平板电脑与键盘已建立通信连接的相关提示信息。示例性地,SOC可以在平板电脑的主界面显示平板电脑与键盘已建立通信连接的相关提示信息。参考图13,SOC在显示屏的主界面的状态栏显示键盘的小图标130,表示平板电脑与键盘已建立通信连接。其中,主界面包括多个应用图标和多个功能控件。状态栏里还包括平板电脑的电池用量图标。
S105、在键盘与平板电脑建立通信连接后,SOC通过通信接口向键盘发送第一指令,根据键盘是否返回对应的第一响应,执行相应的操作。
在一些实施例中,SOC基于上述S101-104确定键盘与平板电脑建立通信连接。在键盘与平板电脑建立通信连接后,SOC可以以第一周期对键盘的通信连接状态进行轮询,以及时检测键盘与平板电脑的通信的连接状态。这里,SOC可以以第一周期向键盘发送第一指令,实时持续地检测键盘与平板电脑的连接状态。需要说明的是,在键盘与平板电脑物理连接正常、通信连接正常的情况下,SOC周期性地向键盘发送第一指令,属于通信连接正常情况下轮询,这个轮询周期不需要太频繁,第一周期为长周期。示例性地,第一周期可以为10秒、15秒等。比如,测试频率为每10秒或每15秒向键盘发送第一指令,以此来避免SOC频繁发送测试指令造成的功耗;也避免频繁发送第一指令影响键盘与平板电脑正常通信。第一指令可以为测试指令。若SOC接收到键盘基于测试指令返回的第一响应,则确定键盘与平板电脑通信连接正常;若SOC
在第一时长内未接收到键盘返回的第一响应,则确定键盘与平板电脑未建立通信连接。其中,根据键盘是否返回对应的第一响应,确定键盘与平板电脑的通信连接状态的方法可参考S104。
S106、SOC通过通信接口向键盘发送第二指令,如果接收到第二响应,则执行S104;如果在第二时长内没有接收到第二响应,则执行S107。
在本实施例中,SOC在预设时间段内未收到键盘返回的第二响应。在这种情况下,SOC可以以第二周期通过通信接口向键盘发送第二指令。可选地,平板电脑也可以向键盘发送通信指令。第一指令可以与第二指令相同,也可以不同。S1015中的第二时长可以与S106中的第一时长相同,第二时长与第一时长根据实际指令的收发速率确定。
本实施例中的第一周期与S105中的第一周期不同。上述S105中的第一周期是SOC确定键盘与平板电脑通信连接正常情况下的轮询。本实施例的第二周期是SOC确定键盘与平板电脑通信连接异常情况下的异常测试。SOC需要在较短的时间内确定键盘与平板电脑之间是否建立通信连接,基于此,本实施例的第二周期为短周期。示例性地,第二周期可以为20毫秒、30毫秒等。可选地,为了进一步避免SOC未接收到键盘的测试响应的偶然性。SOC可以在第二周期内发送多次第二指令,来确定键盘与平板电脑的通信连接是否正常。示例性地,SOC可以在30毫秒的周期内,向键盘连续发送3次第二指令。根据键盘是否返回第二响应,确定键盘与平板电脑是否建立通信连接。
若SOC接收到至少一次键盘通过通信接口返回的第二响应,确定平板电脑的通信接口与键盘的通信接口贴合,平板电脑与键盘处于通信正常的状态,SOC可以通过通信接口可以实现数据的传输。在这种情况下,SOC执行S104,控制显示屏在显示界面显示键盘图标。若SOC连续多次均没有接收到键盘返回的第二响应,则确定平板电脑与键盘未建立通信连接,SOC执行S107。平板电脑的通信接口与键盘的通信接口至少有一方处于异常状态,SOC无法通过通信接口进行数据传输。
在一些实施例中,在平板电脑与键盘只有一个通信接口的情况下,SOC默认通过一个通信接口发送第二指令,若SOC未收到键盘通过一个通信接口返回的第二响应,则确定平板电脑与键盘的通信接口异常,键盘与平板电脑未建立通信连接。
在一些实施例中,若平板电脑与键盘包括两个通信接口,其通信协议中可以约定通过通信接口1进行通信数据传输;通过通信接口2进行测试数据的传输。SOC通过通信接口2向键盘的通信接口2发送第二指令,若未接收到键盘返回的第二响应,SOC确定平板电脑与键盘的通信接口2异常,键盘与平板电脑未建立通信连接。
在一些实施例中,平板电脑与键盘包括两个通信接口,两个通信接口均可以进行数据的接收与发送。比如,键盘的通信接口1负责接收或发送与平板电脑之间的通信数据和测试数据。通信接口2为备用接口。通信协议约定默认为平板电脑的通信接口1对应键盘的通信接口1进行数据传输,在通信接口1无法进行数据传输的情况下,可切换其他通信接口进行数据传输。在这种情况下,SOC通过通信接口1发送第二指令时,正常通信时,键盘通过通信接口1收到第二指令,通过通信接口1向平板电脑的通信接口1返回第二指令对应的测试响应。若键盘通过通信接口1接收到测试指令,但是无法通过通信接口1传输第二响应,则键盘切换至通信接口2返回第二响应,也即,键盘通过通信接口2向平板电脑的通信接口2返回第二响应。若SOC通过通信接
口1接收到第二响应,则确定键盘的通信接口1正常,键盘与平板电脑通信连接正常。若SOC未通过通信接口1接收到第二响应,通过通信接口2接收到第二响应,则确定键盘的通信接口1异常,键盘的通信接口2正常,键盘与平板电脑通信连接正常。可选地,SOC可以将向用户输出键盘的通信接口1的异常信息140,进一步定位异常的通信接口,可以使得用户对异常的通信接口进行及时的维护。参考图14。
若SOC连续多次均没有接收到键盘返回的第二响应,SOC基于通信协议约定,确定键盘的通信接口1与通信接口2均存在异常,键盘与平板电脑未建立通信连接。导致异常的原因可能为键盘与平板电脑接触不好,也即,键盘的通信接口与平板电脑的通信接口未处于对准位置。或者,也可能是键盘的通信接口1与通信接口2存在硬件异常。可选地,在SOC确定键盘的通信接口1与通信接口2存在硬件异常情况下,还可以在显示屏中输出异常通信接口的信息150,提醒用户及时对异常通信接口进行维护。参考图15。
S107、SOC停止在显示屏上显示键盘图标,在显示屏上显示提醒信息。
在SOC在第二周期内连续向键盘发送第二指令,但是均没有接收到键盘返回的第二响应的情况下,确定键盘与平板电脑未建立通信连接,SOC可以停止在显示屏上显示键盘图标。可选地,SOC还可以在显示屏显示用于提示用户键盘与平板电脑未建立通信连接的提示信息;或者,SOC可以通过语音播放用于提示用户键盘与平板电脑未建立通信连接的提示信息。相应地,为了避免是键盘的通信接口与平板电脑的通信接口未处于对准位置导致的异常,SOC还可以在显示屏的当前显示界面输出用于提醒用户重新连接键盘的提醒信息160。比如,参考图16,SOC在显示屏的当前显示界面(主界面)弹窗显示提醒用户重新连接键盘的提醒信息160。
在一些实施例中,平板电脑的SOC在没有收到键盘返回的第一响应之后,也即,SOC确定平板电脑与键盘未建立通信连接之后,SOC还可以通过检测霍尔传感器的输出电平来确定平板电脑与键盘的物理连接是否断开,以此来提供键盘检测的准确性。比如,若磁铁离开霍尔传感器的检测区域,霍尔传感器的输出电平发生变化,则确定平板电脑与键盘的物理连接断开。可能存在情况是用户人为的拆卸了键盘。比如,若磁铁一直处于霍尔传感器的检测区域内,霍尔传感器的输出电平没有发生变化,则确定平板电脑与键盘的物理连接正常,可能存在的情况是键盘的通信接口与平板电脑的通信接口未对准,导致平板电脑与键盘未建立通信连接。参考图17,在执行到上述S101至S103时,如果SOC没有收到键盘返回的第一响应,SOC执行S108,具体包括:
S108、SOC判断霍尔传感器的输出电平是否发生变化,如果霍尔传感器的输出电平发生变化,执行S109;如果霍尔传感器的输出电平未发生变化,则执行S111。
在一些实施例中,若SOC没有接收到键盘返回的第一响应,SOC可以进一步确定是人为取下键盘,也即,键盘与平板电脑完全断开连接;还是键盘与平板电脑出现相对位置偏移,而造成的断开连接。
在本实施例中,SOC可以获取预设时长内霍尔传感器的输出电平的信号状态。参考上述S102中所描述的霍尔传感器的输出电平的判断方法。若SOC确定最近预设时长内霍尔传感器的输出电平发生变化,比如,以图8为例,霍尔传感器被磁铁触发后,输出电平由初始高电平变为低电平。在最近预设时长内,比如在当前时刻之前的1分
钟内,霍尔传感器的输出电平由低电平变成高电平,且,一直保持高电平。说明磁铁离开霍尔传感器的检测区域,导致霍尔传感器的输出电平发生变化,也即,当前键盘与平板电脑已物理分离,键盘的磁铁已经不在平板电脑的霍尔传感器的检测区域内,这种情况下,为了进一步确认键盘与平板电脑是否已完全断开连接,SOC执行S109,再向键盘发送第三指令进行响应测试。
可选地,SOC确定最近预设时长内,霍尔传感器的输出电平发生变化的情况还可以为,键盘与平板电脑最近一段时间首次连接时。也即,在平板电脑与键盘分离一段时间后,再次将平板电脑与键盘连接时,磁铁进入霍尔传感器的检测区域,触发平板电脑的霍尔传感器的输出电平发生变化,霍尔传感器的输出电平由高电平变成低电平,但是在键盘与平板电脑物理连接时,可能存在通信接口未对准的情况,导致SOC未能接收到来自键盘的第一响应。在这种情况下,SOC同样需要执行S109,再向键盘发送第三指令进行响应测试。
仍以图7为例,霍尔传感器被磁铁触发后,输出电平由初始高电平变为低电平。在预设时长内,比如在当前时刻之前的30秒内,霍尔传感器的输出电平一直为低电平。SOC确定当前键盘与平板电脑始终贴合,键盘的磁铁仍在平板电脑的霍尔传感器的检测区域内,这种情况下,SOC执行S111,再向键盘发送第四指令进行响应测试。这里第四指令可以与第二指令相同。
需要说明的是,S111中SOC向键盘发送第四指令进行测试与S109中SOC向键盘发送第三指令进行测试所导致的结果不同。第四指令与第三指令的指令内容可以相同。
S109、SOC通过通信接口向键盘发送第三指令,如果接收到第三响应,执行S104;如果在第三时长内没有接收到第三响应,SOC执行S110,控制电源接口下电。
在本实施例中,SOC确定霍尔传感器的输出电平发生变化,在这种情况下,SOC可以以第三周期向键盘发送第三指令。这里的第三指令属于异常情况下的查询,为尽快确认键盘与平板电脑的连接状态,第三周期为短周期,示例性地,第三周期可以为20毫秒、30毫秒等。比如,在30毫秒内持续发送3次第三指令,在第三周期内多次发送第三指令,避免一次未接收到第三响应的偶然性问题。可选地,第三指令可以与第二指令相同,第三指令可以为测试指令,第三指令也可以为通信指令。
在本实施例中,SOC确定霍尔传感器的输出电平在最近预设时间段内发生变化,若SOC在第三时长内接收到键盘返回的第三响应,其可能存在的情况为,键盘与平板电脑为完全断开连接后的首次连接。完全断开连接指的是人为将键盘与平板电脑分离,使得键盘与平板电脑从物理位置、通信连接方面均断开连接。在这种情况下,SOC执行S104,控制显示屏在显示界面的状态栏里显示键盘小图标,同时,SOC还可以在显示屏的当前界面(主界面)显示平板电脑与键盘已建立通信连接的信息。比如,参考图18,SOC在显示屏的当前界面以弹窗显示键盘已连接的提示信息180。提示信息中还可以包括用于表示平板电脑与键盘连接的图标,用户可以更直观的了解平板电脑与键盘已建立通信连接。
在一些实施例中,SOC确定霍尔传感器的输出电平在最近预设时间段内发生变化,如果SOC在第三时长内没有接收到键盘返回的第三响应,则说明键盘与平板电脑已被完全断开连接。其中,第三时长可以根据实际收发指令的速率确定。
可能存在两种情况,其中一种可能为,示例性地,可能是磁铁离开霍尔传感器的检测区域,也即,用户人为将键盘与平板电脑拆开,键盘与平板电脑物理连接断开、通信连接断开。此时,SOC控制显示屏,停止在显示屏的状态栏里显示键盘小图标,表示键盘与平板电脑已断开连接,当前平板电脑没有可用外接键盘,可参考图19所示。
另一种情况可能为,当前并没有键盘与平板电脑物理连接,是其他磁铁进入平板电脑的霍尔传感器的检测区域造成霍尔传感器的输出电平发生变化,产生误触发。参考图20,图20给出一种示例,在磁铁进入霍尔传感器的检测区域内,SOC检测到霍尔传感器的输出电平由初始的高电平变为低电平,控制电源接口上电,电源接口的输出电平由初始的低电平变为高电平。但是在一段时间内SOC均未接收到键盘返回的第三响应,也即,SOC检测到通信接口的输出电平一直保持低电平。这种情况下,可能是其他磁铁进入平板电脑的霍尔传感器的检测区域造成的误触发,SOC控制电源接口下电,避免端口带电导致的短路风险。同时,显示界面也不显示键盘图标。可选地,还存在其他情况,比如,在磁铁进入霍尔传感器的检测区域内,SOC检测到霍尔传感器的输出电平由初始的高电平变为低电平,控制电源接口上电,电源接口的输出电平由初始的低电平变为高电平。SOC接收到键盘返回的第三响应,通信接口的输出电平发生变化,但是,SOC对第三响应中携带的数据进行校验,第三响应中携带的数据存在异常,相应地,通信接口的输出电平的变化规律也不符合通信协议约定的变化规律,此时,SOC确定通信接口的通信连接异常,为了避免产生端口带电导致的短路风险,SOC在这种情况下也需要控制电源接口下电。
S111、SOC通过通信接口向键盘发送第四指令,如果接收到第四响应,则执行S104,SOC控制显示屏在显示界面中显示键盘图标。如果在第四时长内没有接收到第四响应,则执行S107,SOC停止在显示屏上显示键盘图标,在显示屏上显示提醒信息。
其中,第四指令可以与第二指令相同。第四指令可以测试指令,也可以为通信指令。其中,如果SOC在第四时长内接收到键盘返回的第四响应,则显示键盘图标。参考S104实施例所提供的方法,本实施例不做赘述。如果SOC在第四时长内未接收到键盘返回的第四响应,显示提醒信息,参考S107实施例所提供的方法,本实施例不做赘述。其中,第四时长可以与第三时长相同,第四时长可以根据实际收发指令的速率确定。
本申请实施例提供了一种外接设备检测方法,通过在电子设备与外接设备中设置配套的物理连接的感知装置,可以通过物理连接的感知装置确定外接设备与电子设备的物理连接情况。通过电子设备与外接设备的弹簧针接口的通信数据,确定外接设备与电子设备的通信连接情况。基于物理连接情况与通信连接情况,可以持续地获取外接设备的实际连接状态,并且,电子设备可以通过在显示屏输出提示信息或输出音频信息来提示用户外接设备已建立通信连接或未建立通信连接的信息,可以使得用户实时地准确地感知外接设备的实际连接状态,优化用户体验。
在本实施例中,进一步地,在多个通信接口进行通信的场景下,按照通信协议约定,电子设备在确定外接设备与电子设备物理连接正常、未建立通信连接的情况下,还可以排查锁定具体异常的某一个或多个通信接口,从而输出通信接口异常的信息,便于用户及时对通信接口进行检查维护,为用户提供更准确地异常解决提醒信息,极
大地优化了用户体验。
上述实施例以电子设备为具有显示屏的平板电脑为例说明,在一些实施例中,针对没有显示屏的电子设备,例如,电子设备为无线耳机,外接设备为耳机充电器时,无线耳机在检测到耳机充电器与其断开连接时,可以通过输出音频来提示用户进行位置调整。比如,播放蜂鸣声、或者播放语音提示信息。上述实施例所提供的外接设备检测方法可适用于所有具有弹簧针接口的电子设备与外接设备。
上述实施例以电子设备通过霍尔传感器与外接设备的磁铁来感知外接设备的在位状态为例说明,可选地,在一些实施例中,电子设备也可以通过其他传感器来感知外接设备的在为状态。示例性地,电子设备可以通过光传感器、距离传感器、压力传感器、电传感器以及其他磁力传感器等来感知外接设备是否已经与电子设备进行物理连接,本实施例对此不做限定。
电子设备可以在外接设备连接状态发生变化的情况下,通过语音输出或者提示音输出相关的信息。比如,电子设备在检测到外接设备连接时,语音输出外接设备已连接;若检测到外接设备断开连接时,语音输出外接设备已断开连接,使得用户可以在使用外接设备的过程中直接了当地获取外接设备的连接状态,优化用户体验。
在一些实施例中,如图21所示,提供一种电子设备1000的结构示意图。电子设备包括处理器1001、显示屏1002、通信模块1003、存储模块1004以及传感器1005。
其中,处理器1001可以是中央处理器(central processing unit,CPU),数字信号处理器(digital signal processor,DSP),专用集成电路(application-specific integrated circuit,ASIC),现场可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。处理器可以包括应用处理器和基带处理器。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。所述处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等等。通信模块1003可以是收发器、收发电路等。存储模块可以是存储器。
例如,处理器1001可以为如图2所示的处理器310,通信模块1003包括射频模块(如图2所示的射频模块350)。通信模块可以包括Wi-Fi模块、蓝牙模块以及pogo pin通信模块等通信模块(如图2所示的通信模块360)。通信模块存储模块可以为存储器(如图2所示的内部存储器321)。显示屏1002可以为如图2所示的显示屏394,该显示屏394可以为触摸屏,该触摸屏中可以集成显示面板和触控面板。传感器可以为如图2所示的霍尔传感器380C、压力传感器380A、距离传感器380F、接近光传感器380G、环境光传感器380L等。本申请实施例所提供的终端可以为图2所示的电子设备100。其中,上述处理器和显示屏、通信模块、存储器以及传感器等可以连接在一起,例如通过总线连接。
在一些实施例中,如图22所示,提供一种外接设备2000的结构示意图。电子设备包括处理器2001、通信模块2002、第一组件2003以及存储模块2004。
其中,处理器2001可以是CPU、DSP、ASIC、FPGA、微控制单元(microcontroller unit,MCU)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。处理器可以包括应用处理器和基带处理器。其可以实现或执行结合本申请公开内容所
描述的各种示例性的逻辑方框,模块和电路。所述处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等等。通信模块2003可以是收发器、收发电路等。存储模块可以是存储器。
例如,处理器2001也可以为如图4所示的处理器410。通信模块2002可以包括Wi-Fi模块、蓝牙模块以及pogo pin通信模块等通信模块(如图4所示的通信模块430)存储模块可以为存储器(如图4所示的内部存储器421)。
第一组件2002可以为与电子设备中的传感器配套的组件,比如,电子设备1000中包括霍尔传感器380E,那么第一组件为与霍尔传感器380E配套的磁铁。本申请实施例所提供的处理器和第一组件、通信模块以及存储器等可以连接在一起,例如通过总线连接。
本申请实施例还提供一种芯片***(例如,片上***(system on a chip,SoC)),如图23所示,该芯片***包括至少一个处理器701和至少一个接口电路702。处理器701和接口电路702可通过线路互联。例如,接口电路702可用于从其它装置(例如电子设备的存储器)接收信号。又例如,接口电路702可用于向其它装置(例如处理器701或者电子设备的摄像头)发送信号。示例性的,接口电路702可读取存储器中存储的指令,并将该指令发送给处理器701。当所述指令被处理器701执行时,可使得电子设备执行上述实施例中的各个步骤。当然,该芯片***还可以包含其他分立器件,本申请实施例对此不作具体限定。
本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质包括计算机指令,当所述计算机指令在上述电子设备上运行时,使得该电子设备执行上述方法实施例中电子设备100执行的各个功能或者步骤。
本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质包括计算机指令,当所述计算机指令在上述电子设备上运行时,使得该外接设备200执行上述方法实施例中外接设备执行的各个功能或者步骤。
本申请实施例还提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行上述方法实施例中电子设备100执行的各个功能或者步骤。例如,该计算机可以是上述电子设备100。
本申请实施例还提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行上述方法实施例中外接设备200执行的各个功能或者步骤。
通过以上实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。
Claims (17)
- 一种弹簧针接口连接状态检测方法,其特征在于,应用于电子设备,所述电子设备包括弹簧针接口和传感器,所述弹簧针接口包括通信接口,所述方法包括:所述电子设备通过所述传感器检测外接设备与所述电子设备的距离;若所述距离小于预设阈值,所述电子设备通过所述通信接口向所述外接设备发送第一指令;如果所述电子设备在第一时长内未接收到第一响应,所述电子设备发出第一提示信息,所述第一提示信息用于提示用户所述外接设备与所述电子设备未建立通信连接。
- 根据权利要求1所述的方法,其特征在于,所述电子设备通过所述通信接口向所述外接设备发送第一指令,包括:所述电子设备按照第一周期通过所述通信接口向所述外接设备发送所述第一指令。
- 根据权利要求2所述的方法,其特征在于,在所述电子设备发出第一提示信息之前,所述方法还包括:所述电子设备通过所述通信接口,按照第二周期向所述外接设备发送第二指令;所述第二周期小于所述第一周期;所述电子设备在第二时长内未接收到第二响应。
- 根据权利要求3所述的方法,其特征在于,所述方法还包括:所述电子设备在第二时长内通过所述通信接口接收到所述第二响应,所述电子设备显示外接设备连接信息。
- 根据权利要求1-4中任一项所述的方法,其特征在于,所述方法还包括:如果所述电子设备在所述第一时长内接收到所述第一响应,所述电子设备显示外接设备连接信息。
- 根据权利要求1-5中任一项所述的方法,其特征在于,所述电子设备发出第一提示信息,包括:所述电子设备停止显示外接设备连接信息;或者,所述电子设备在显示界面显示所述第一提示信息;或者,所述电子设备播放所述第一提示信息。
- 根据权利要求1-6中任一项所述的方法,其特征在于,所述距离小于预设阈值,包括:所述电子设备检测到所述传感器的电平发生高低电平跳变。
- 根据权利要求7所述的方法,其特征在于,所述传感器的电平发生高低电平跳变包括:所述传感器的电平由高电平变为低电平;或者,所述传感器的电平由低电平变为高电平;或者,所述传感器的电平在低电平时产生一个高电平中断后,恢复低电平;或者,所述传感器的电平在高电平时产生一个低电平中断后,恢复高电平。
- 根据权利要求7所述的方法,其特征在于,所述弹簧针接口还包括电源接口,在所述电子设备检测到所述传感器的电平发生高低电平跳变之后,所述方法还包括:所述电子设备控制所述电源接口上电。
- 根据权利要求9所述的方法,其特征在于,在所述电子设备检测到所述传感器的电平发生高低电平跳变之后,所述方法还包括:如果所述电子设备再次检测到所述传感器的电平发生高低电平跳变,所述电子设备通过所述通信接口,向所述外接设备发送第三指令;如果所述电子设备在第三时长内未接收到第三响应,所述电子设备控制所述电源接口下电。
- 根据权利要求1-10中任一项所述的方法,其特征在于,在所述电子设备发出第一提示信息之前,所述方法还包括:所述电子设备在预设的时间段内未检测到所述传感器的电平发生高低电平跳变,所述电子设备通过所述通信接口,向所述外接设备发送第四指令;所述电子设备在第四时长内未接收到第四响应。
- 根据权利要求1-11中任一项所述的方法,其特征在于,所述方法还包括:所述电子设备通过第一通信接口向外接设备发送第五指令;所述第一通信接口为多个所述通信接口中任意一个;如果所述电子设备在第五时长内未通过所述第一通信接口接收到第五响应,所述电子设备显示第二提示信息;所述第二提示信息用于提示所述第一通信接口异常。
- 根据权利要求1-12中任一项所述的方法,其特征在于,所述传感器为霍尔传感器、红外传感器、距离传感器、压力传感器、接近光传感器、环境光传感器中任意一个。
- 一种电子设备与外接设备的组合装置,其特征在于,所述组合装置包括电子设备和外接设备;所述电子设备包括处理器、传感器、弹簧针接口;所述弹簧针接口包括通信接口;所述处理器,用于执行如权利要求1-13中任一项所述的方法;所述外接设备包括处理器和弹簧针接口;所述弹簧针接口包括通信接口;在所述电子设备与所述外接设备物理连接时,所述电子设备的弹簧针接口的位置与所述外接设备的弹簧针接口的位置对齐。
- 根据权利要求14所述的组合装置,其特征在于,如果所述电子设备的传感器为霍尔传感器,所述外接设备还包括第一组件;所述第一组件为磁铁;在所述电子设备与所述外接设备物理连接时,所述磁铁位于所述霍尔传感器的检测区域内。
- 一种电子设备,其特征在于,所述电子设备包括存储器、传感器、弹簧针接口、显示屏和一个或多个处理器;所述存储器、所述传感器、所述弹簧针接口、所述显示屏与所述处理器耦合;所述存储器中存储有计算机程序代码,所述计算机程序代码包括计算机指令,当所述计算机指令被所述处理器执行时,使得所述电子设备执行如权利要求1-13中任一项所述的方法。
- 一种计算机可读存储介质,其特征在于,包括计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如权利要求1-13中任一项所述的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211662608.1 | 2022-12-23 | ||
CN202211662608.1A CN116699477A (zh) | 2022-12-23 | 2022-12-23 | 弹簧针接口连接状态检测方法、组合装置和电子设备 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2024131100A1 true WO2024131100A1 (zh) | 2024-06-27 |
Family
ID=87843983
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2023/113097 WO2024131100A1 (zh) | 2022-12-23 | 2023-08-15 | 弹簧针接口连接状态检测方法、组合装置和电子设备 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN116699477A (zh) |
WO (1) | WO2024131100A1 (zh) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20000032787A (ko) * | 1998-11-18 | 2000-06-15 | 정태기 | 이동통신 단말기와 외부장치간의 통신방법 |
JP2019134334A (ja) * | 2018-01-31 | 2019-08-08 | キヤノン株式会社 | 電子機器及びその制御方法、通信システム |
CN113543107A (zh) * | 2021-08-04 | 2021-10-22 | 陆维平 | 一种移动终端与蓝牙音箱自动匹配无线连接*** |
CN113923254A (zh) * | 2021-08-26 | 2022-01-11 | 北京旷视科技有限公司 | 一种确定设备的连接状态的方法、装置、电子设备及介质 |
CN114615587A (zh) * | 2022-03-25 | 2022-06-10 | 歌尔股份有限公司 | 耳机与耳机盒通信方法、设备及计算机可读存储介质 |
CN114915721A (zh) * | 2021-02-09 | 2022-08-16 | 华为技术有限公司 | 建立连接的方法与电子设备 |
Family Cites Families (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10733115B2 (en) * | 2016-01-29 | 2020-08-04 | Dell Products L.P. | Information handling system automated wireless pairing of peripheral devices |
US10283975B1 (en) * | 2016-03-28 | 2019-05-07 | Amazon Technologies, Inc. | Smart diagnostics for hot-pluggable battery systems |
CN107547301B (zh) * | 2017-06-21 | 2021-07-30 | 新华三信息安全技术有限公司 | 一种主备设备倒换方法及装置 |
US10437286B2 (en) * | 2017-06-24 | 2019-10-08 | Lenovo (Singapore) Pte. Ltd. | Computing device |
CN109062840A (zh) * | 2018-07-25 | 2018-12-21 | 合肥联宝信息技术有限公司 | 一种复用接口管脚的方法及装置 |
CN109688330A (zh) * | 2018-12-27 | 2019-04-26 | 联想(北京)有限公司 | 一种控制方法、装置及电子设备 |
CN111181218A (zh) * | 2020-01-22 | 2020-05-19 | 维沃移动通信有限公司 | 充电提示方法、电子设备及介质 |
CN212208083U (zh) * | 2020-05-20 | 2020-12-22 | 上海闻泰电子科技有限公司 | 一种禁止开机电路及笔记本电脑装置 |
CN111880635B (zh) * | 2020-07-24 | 2022-04-26 | 青岛海信移动通信技术股份有限公司 | 电子设备及其供电控制方法、供电控制*** |
CN114666694A (zh) * | 2020-12-22 | 2022-06-24 | 华为技术有限公司 | 蓝牙耳机防丢失方法及电子设备 |
CN114915910A (zh) * | 2021-02-10 | 2022-08-16 | 华为技术有限公司 | 数据传输方法、电子设备及计算机可读存储介质 |
-
2022
- 2022-12-23 CN CN202211662608.1A patent/CN116699477A/zh active Pending
-
2023
- 2023-08-15 WO PCT/CN2023/113097 patent/WO2024131100A1/zh unknown
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20000032787A (ko) * | 1998-11-18 | 2000-06-15 | 정태기 | 이동통신 단말기와 외부장치간의 통신방법 |
JP2019134334A (ja) * | 2018-01-31 | 2019-08-08 | キヤノン株式会社 | 電子機器及びその制御方法、通信システム |
CN114915721A (zh) * | 2021-02-09 | 2022-08-16 | 华为技术有限公司 | 建立连接的方法与电子设备 |
CN113543107A (zh) * | 2021-08-04 | 2021-10-22 | 陆维平 | 一种移动终端与蓝牙音箱自动匹配无线连接*** |
CN113923254A (zh) * | 2021-08-26 | 2022-01-11 | 北京旷视科技有限公司 | 一种确定设备的连接状态的方法、装置、电子设备及介质 |
CN114615587A (zh) * | 2022-03-25 | 2022-06-10 | 歌尔股份有限公司 | 耳机与耳机盒通信方法、设备及计算机可读存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN116699477A (zh) | 2023-09-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7293398B2 (ja) | ブルートゥース接続方法、デバイス、およびシステム | |
WO2021052263A1 (zh) | 语音助手显示方法及装置 | |
CN112399390B (zh) | 一种蓝牙回连的方法及相关装置 | |
US7725141B2 (en) | Multi-functional detached mobile phone | |
CN113691842B (zh) | 一种跨设备的内容投射方法及电子设备 | |
WO2022111665A1 (zh) | 应用的管理方法、装置、设备及存储介质 | |
WO2023284415A1 (zh) | 电源键误触检测方法及电子设备 | |
WO2018187940A1 (zh) | 消息获取方法和装置 | |
EP4096204A1 (en) | Method for controlling communication service state, terminal device and readable storage medium | |
CN109766098B (zh) | 应用程序的运行方法、设备及存储介质 | |
WO2022053006A1 (zh) | 一种接近光传感器控制方法及相关设备 | |
US20240237115A1 (en) | Message Push Method and Apparatus | |
KR20210101702A (ko) | 전자 장치와 외부 전자 장치의 전기적 연결에 의해 생성된 통신 채널을 이용하는 전자 장치 및 전자 장치의 동작 방법 | |
US20240224357A1 (en) | Data Download Method, Apparatus, and Terminal Device | |
CN115016697A (zh) | 投屏方法、计算机设备、可读存储介质和程序产品 | |
WO2022048453A1 (zh) | 解锁方法及电子设备 | |
CN115278625A (zh) | 蓝牙多媒体包的传输方法、装置、设备和*** | |
KR20210116118A (ko) | 오디오용 전자 장치 및 오디오용 전자 장치에서 전원 관리 방법 | |
CN111132047A (zh) | 网络连接方法及装置 | |
WO2018176611A1 (zh) | 一种显示方法和电子设备 | |
WO2023197709A1 (zh) | 器件识别方法和相关装置 | |
WO2024131100A1 (zh) | 弹簧针接口连接状态检测方法、组合装置和电子设备 | |
CN114095542A (zh) | 显示控制方法及电子设备 | |
CN114143906B (zh) | 一种电子设备连接方法及电子设备 | |
CN115883807A (zh) | 工作模式的调整方法、装置、终端、介质及产品 |