Level setting method and electronic equipment

By adjusting the output pin level of the keyboard and reducing the potential difference, the key scanning error caused by abnormal oxides in the keyboard circuit is solved, extending the service life of the keyboard and improving the user experience.

CN119248116APending Publication Date: 2025-01-03HONOR DEVICE CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202310810477.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-03
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

The abnormal oxides of the keyboard circuit lead to incorrect key scanning results, shortening service life and reducing user experience.

Method used

Slow the generation of abnormal oxides by setting the levels of all output pins to low when the keyboard is in the off state; when the key is turned on, the corresponding keys are pressed. The output pin level of the second or third level is set to reduce the speed of abnormal oxide generation and ensure the accuracy of key scanning results.

Benefits of technology

Extend the service life of the keyboard, improve user experience, and ensure the accuracy and stability of key scanning results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248116A_ABST
    Figure CN119248116A_ABST
Patent Text Reader

Abstract

The embodiment of the invention is applied to the field of circuit control, and provides a level setting method and electronic equipment. Under the condition that the electronic equipment determines that the keyboard is in the closed state, the level states of all the output pins in the keyboard are configured to be the first level, so that potential difference between the input pins and the output pins is avoided. And under the condition that the keyboard is in the open state, the electronic equipment configures the levels of all output pins corresponding to keys in the keyboard as a second level or a third level. Under the condition that the level of the output pin is the second level or the third level, when the keyboard receives the click operation of the user on the key, interruption can be normally generated, so that the electronic equipment can determine the key clicked by the user based on the interruption. In the application, generation of abnormal oxides can be slowed down by reducing the duration of the potential difference, the probability of keyboard aging is reduced, the service life of the electronic equipment is prolonged, and the use experience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of circuit control, and in particular to a level setting method and electronic equipment. Background Art

[0002] With the development of technology, electronic devices (such as tablet computers) are usually equipped with corresponding keyboards. When a user uses the keyboard to input, the user can click the keys on the keyboard. The keyboard responds to the key click operation and generates an interrupt. The electronic device can perform key scan based on the interrupt to obtain the corresponding key scan result, that is, determine the key clicked by the user, and then perform corresponding processing operations, such as displaying the content corresponding to the key clicked by the user.

[0003] However, after using the keyboard for a period of time, abnormal oxides may be generated on the keyboard circuit, causing the electronic device to obtain erroneous key scanning results, thereby causing the electronic device to be unable to correctly perform corresponding processing, shortening the service life of the keyboard and reducing the user experience. Summary of the invention

[0004] The embodiments of the present application provide a level setting method and an electronic device, which are used to ensure the accuracy of key scanning results and extend the service life of a keyboard.

[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

[0006] In a first aspect, a level setting method is provided, which can be applied to an electronic device equipped with or connected to a keyboard. The electronic device can obtain the use status of the keyboard, wherein the use status of the keyboard includes an off state and an on state. When the keyboard is in an off state, the electronic device can configure the level state of all output pins in the keyboard to a first level; or, when the keyboard is in an on state, the electronic device configures the levels of all output pins corresponding to the keys in the keyboard to a target level; wherein the target level includes a second level or a third level, the target level is higher than the first level, the second level is lower than the third level, and the second level and the third level are used for the keyboard to generate an interrupt in response to the triggering operation of the keys in the keyboard; the levels of all input pins corresponding to the keys in the keyboard are the first level.

[0007] In the present application, if the keyboard is in the off state, it means that the keyboard is not used by the user, therefore, the electronic device can adjust the level state of all output pins in the keyboard to a low level, and from the above, it can be seen that all input pins in the keyboard default to the first level, therefore, it can be explained that if the keyboard is in the off state, there is no potential difference between the input pin and the output pin, that is, by the above method of judging the use state of the keyboard, the duration of the potential difference between the input pin and the output pin can be reduced, thereby slowing down the generation of abnormal oxides, reducing the probability of keyboard aging, increasing the service life of the electronic device, and improving the user's experience. If the keyboard is in the on state, it means that the user may use the keyboard, therefore, the electronic device can set the level of all output pins corresponding to the keys in the keyboard to the second level or the third level. When the level of the output pin is the second level, the potential difference between the input pin and the output pin is small, the smaller the potential difference, the slower the abnormal oxide is generated, therefore, the abnormal oxide generation speed can be reduced, the accuracy of the keyboard scanning result is ensured, and the service life of the keyboard is extended.

[0008] In a possible implementation of the first aspect, the keyboard may be a matrix keyboard. An electronic device having a keyboard means that the keyboard is a part of the electronic device, and the keyboard is generally not disassembled. An electronic device connected with a keyboard means that the keyboard is externally connected to the electronic device, and the keyboard can be disassembled according to user needs. The keyboard being externally connected to the electronic device may mean that the keyboard is connected to the electronic device by wired connection, or the keyboard may be connected to the electronic device by wireless connection.

[0009] In the present application, since the keyboard is a matrix keyboard, and the matrix keyboard refers to a keyboard group with a matrix-like arrangement used in the external device of the microcontroller unit, by adopting a matrix keyboard, multiple keys in the keyboard can share an input pin or multiple keys can share an output pin. In this way, the waste of interface resources can be reduced and the interface utilization rate can be improved.

[0010] In a possible implementation manner of the first aspect, in response to a user pushing operation on the electronic device and / or the keyboard, the electronic device can obtain a usage status of the keyboard.

[0011] In this embodiment, when the user pushes the electronic device and / or the keyboard, the angle between the surface where the display screen in the electronic device is located and the front of the keyboard changes. Therefore, the electronic device can obtain the usage status of the keyboard. In this way, the waste of resources caused by real-time acquisition of the usage status of the keyboard can be reduced, thereby reducing unnecessary power consumption losses.

[0012] In a possible implementation manner of the first aspect, the on state of the keyboard includes an unfolded static state and a scanning state, wherein the unfolded static state indicates that the keyboard can be used as an input device but has not received a trigger operation for a key in the keyboard, and the scanning state indicates that the keyboard is used as an input device;

[0013] The process of configuring the target level may specifically include: when the keyboard is in the unfolded static state, the electronic device configures the levels of all the output pins to the second level respectively; when the keyboard is in the scanning state, the electronic device configures the levels of all the output pins to the third level respectively.

[0014] In this application, if the keyboard is in the unfolded static state, it means that the keyboard is in the open state, but the keys in the keyboard are not clicked, that is, the keyboard does not generate an interrupt, and the electronic device does not scan the keyboard. Therefore, in order to slow down the generation of abnormal oxides, the electronic device can configure the levels of all output pins to the second level to reduce the potential difference between the input pins and the output pins, thereby slowing down the generation of abnormal oxides, reducing the probability of keyboard aging, increasing the service life of the electronic device, and improving the user experience. And because there is a potential difference between the input pin and the output pin corresponding to the key, the keyboard can still generate an interrupt.

[0015] In a possible implementation of the first aspect, when the keyboard is in an unfolded static state, the electronic device configures the levels of all output pins corresponding to the keys in the keyboard to a second level. Thereafter, in response to a trigger operation of a user on a key in the keyboard, the electronic device converts the use state of the keyboard from the unfolded static state to a scanning state, and configures the levels of all output pins corresponding to the keys in the keyboard to a third level. Thereafter, the electronic device scans the keys on the keyboard to determine the key triggered by the user, that is, to determine the target key.

[0016] In the present application, if the keyboard is in an expanded static state and a key in the keyboard is triggered, it means that the keyboard is currently being used by the user. Therefore, the electronic device can convert the keyboard's usage state from the expanded static state to the scanning state, and configure the levels of all output pins corresponding to the keys in the keyboard to the third level, so as to facilitate scanning of the keys on the keyboard according to the generated interrupt signal. In this way, the generation of abnormal oxides can be slowed down while ensuring the accuracy of target key determination, thereby improving the user experience.

[0017] In a possible implementation manner of the first aspect, the trigger operation on a key in the keyboard may be a click operation on the key in the keyboard.

[0018] In a possible implementation of the first aspect, the process of determining the target key may include: the electronic device configures the levels of output pins other than the target output pin to be the first level; wherein the target output pin refers to any pin among all the output pins in the keyboard. Afterwards, the electronic device obtains the level information of all input pins, wherein the level information includes the first level and the third level. Afterwards, the electronic device determines whether there is a target key in the keys corresponding to the target output pin according to the level information of each input pin, and if there is a target key in the keys corresponding to the target output pin, the input pin with the level of the third level and the key corresponding to the target output pin are determined as the target key.

[0019] In the present application, by configuring the level of any one of all the output pins to be the third level, the input pin with the third level is determined, and the target key is determined based on the input pin with the third level and the output pin with the third level. In this way, the accuracy of determining the target key can be improved.

[0020] In a possible implementation manner of the first aspect, the target output pin may be an output pin located at the first position in the keyboard, or may be an output pin located at the last position in the keyboard.

[0021] In this application, the level of the output pin can be regularly configured to improve the working efficiency of key scanning.

[0022] In a possible implementation of the first aspect, the above-mentioned process of obtaining the level information of all input pins may specifically include: the electronic device may simultaneously obtain the level information of all input pins. After the level information is obtained, the electronic device determines whether the key corresponding to the target output pin is clicked based on the level information of each input pin, that is, determines whether the target key exists among the keys corresponding to the target output pin.

[0023] In the present application, the level information of the input pins can be obtained at the same time, so that the efficiency of obtaining the level information can be improved, thereby improving the efficiency of determining the target key.

[0024] In a possible implementation of the first aspect, the process of obtaining the level information of all input pins may specifically include: the electronic device may obtain the level information of a first input pin, wherein the first input pin refers to any one of all input pins corresponding to keys in the keyboard. Afterwards, the electronic device may determine whether the key corresponding to the first input pin and the target output pin is a target key based on the level information of the first input pin, and if the key corresponding to the first input pin and the target output pin is a target key, the electronic device may determine that the target key exists among the keys corresponding to the target output pin.

[0025] In the present application, if the key corresponding to the first input pin and the above-mentioned target output pin is the target key, the electronic device can directly determine the target key without performing subsequent key scanning steps, thus improving the efficiency of determining the target key.

[0026] In a possible implementation of the first aspect, the above also includes: if the key corresponding to the first input pin and the target output pin is not the target key, or the key corresponding to the first input pin and the target output pin is the target key, the electronic device can obtain the level information of the second input pin. After that, the electronic device uses the second input pin as the first input pin, and returns to execute the above step of "the electronic device can determine whether the key corresponding to the first input pin and the target output pin is the target key according to the level information of the first input pin" until it is determined that the target key exists or the key corresponding to the target output pin is determined.

[0027] In the present application, regardless of whether the key corresponding to the first input pin and the above-mentioned target output pin is the target key, the level information of other input pins except the first input pin can be obtained. In this way, the accuracy of target key determination can be improved and the occurrence of keys being clicked but not scanned can be reduced.

[0028] In a possible implementation of the first aspect, the method further includes: when the target key does not exist in the keys corresponding to the target output pin, the electronic device configures the level of the first output pin to the third level, and configures the levels of other output pins except the first output pin to the first level; wherein the first output pin refers to any output pin that is not determined as the target output pin among all the output pins corresponding to the keys in the keyboard. Afterwards, the electronic device uses the first output pin as the target output pin, and returns to the step of "the electronic device determines whether the target key exists in the keys corresponding to the target output pin according to the level information of each input pin" until the target key is obtained.

[0029] In the present application, by scanning the keys sequentially, the accuracy of determining the target keys can be improved, thereby improving the user experience.

[0030] In a possible implementation of the first aspect, after determining the target key, the electronic device determines whether there is a key pressed in the keyboard. If all keys in the keyboard are not pressed, the electronic device stops scanning and configures the levels of all output pins to the second level.

[0031] In the present application, after determining the target key, the electronic device can continue to determine whether there is a key in the keyboard that has been pressed, that is, whether the user has clicked a key in the keyboard again. If all the keys in the keyboard have not been pressed, it means that the electronic device has not received a click operation from the user on any key in the keyboard. Therefore, the electronic device can stop scanning the keys on the keyboard and configure the levels of all output pins to the second level to wait for the user's next click operation. In this way, the potential difference between the input pin and the output pin can be reduced, thereby slowing down the rate of generation of abnormal oxides.

[0032] In a possible implementation of the first aspect, when the keyboard is in a scanning state, the method further includes: in response to a first operation (such as a push operation, a folding operation, or a closing operation) of the user on the electronic device and / or the keyboard, determining an angle between a surface where a display screen in the electronic device is located and a front surface of the keyboard. Thereafter, when the angle is a reflex angle, a full angle, or a zero angle, the electronic device configures the levels of all output pins to be a first level, and switches the use state of the keyboard from the scanning state to the closed state.

[0033] In the present application, if the angle between the surface where the display screen is located in the electronic device and the front face of the keyboard is an apparent angle, a full angle or a zero angle, it means that the keyboard cannot be used by the user. Therefore, the electronic device can configure the levels of all output pins to the first level to reduce the duration of the potential difference between the input pin and the output pin, thereby slowing down the generation of abnormal oxides, reducing the probability of keyboard aging, increasing the service life of the electronic device, and improving the user experience.

[0034] In a possible implementation of the first aspect, when the keyboard is in the unfolded static state, the method further includes: in response to a second operation (such as a push operation, a folding operation, or a closing operation) of the user on the electronic device and / or the keyboard, determining an angle between a surface where the display screen of the electronic device is located and a front surface of the keyboard. Thereafter, when the angle is a reflex angle, a circumferential angle, or a zero angle, the electronic device configures the levels of all output pins to be a first level, and switches the use state of the keyboard from the unfolded static state to the closed state.

[0035] In the present application, if the angle between the surface where the display screen is located in the electronic device and the front face of the keyboard is an apparent angle, a full angle or a zero angle, it means that the keyboard cannot be used by the user. Therefore, the electronic device can configure the levels of all output pins to the first level to reduce the duration of the potential difference between the input pin and the output pin, thereby slowing down the generation of abnormal oxides, reducing the probability of keyboard aging, increasing the service life of the electronic device, and improving the user experience.

[0036] In a possible implementation of the first aspect, when the keyboard is in a closed state, the method further includes: in response to a third operation of the electronic device and / or the keyboard, determining an angle between a surface where a display screen in the electronic device is located and a front surface of the keyboard. Thereafter, when the angle is a poor angle (such as an obtuse angle, a right angle, an acute angle, or a flat angle), the electronic device may switch the state of the keyboard to a static unfolded state, and configure the levels of all output pins to the second level.

[0037] In the present application, if the angle between the surface where the display screen is located in the electronic device and the front face of the keyboard is a minor angle, it means that the keyboard can be used by the user. Therefore, the electronic device can configure the levels of all output pins to the second level to wait for the user to click on the keys in the keyboard. In this way, the accuracy of the target key determination can be guaranteed while slowing down the generation of abnormal oxides, thereby improving the user experience.

[0038] In a possible implementation manner of the first aspect, the first level is 0V, and the second level is 1.8V.

[0039] In the present application, since the hardware default voltage in the electronic device is three levels, namely 0V, 1.8V and 3.3V, an interrupt can be generated when there is a potential difference between the input pin and the output pin corresponding to the key. Therefore, in order to generate an interrupt while reducing the value of the potential difference, the voltage corresponding to the second level can be configured to 1.8V.

[0040] In addition, considering that the speed of abnormal oxide generation is also related to the size of the potential difference, the larger the potential difference, the faster the abnormal oxide generation, and the smaller the potential difference, the slower the abnormal oxide generation. Therefore, compared with the potential difference of 3.3V, the potential difference of 1.8V can slow down the speed of abnormal oxide generation, thereby reducing the probability of keyboard aging, increasing the service life of electronic equipment, ensuring the correctness of keyboard scanning results, and then being able to correctly receive the user's click operation on any key on the keyboard, thereby improving the user's experience.

[0041] In a possible implementation manner of the first aspect, the third level is 3.3V.

[0042] In the present application, since the hardware default voltage in the electronic device is three levels, namely 0V, 1.8V and 3.3V, and the electronic device requires sufficient voltage when scanning the keys in the keyboard, if the potential difference between the input pin and the output pin is still 1.8V, the electronic device may not be able to scan the keys. In order to ensure normal scanning, the electronic device can configure the voltage corresponding to the third level to 3.3V.

[0043] In a second aspect, an electronic device is provided, comprising: a keyboard, a display screen, a memory and one or more processors; the keyboard, the display screen, the memory and the processor are coupled; the keyboard is used to receive a trigger operation for a key in the keyboard, the display screen is used to display an image generated by the processor, and the memory is used to store computer program code, wherein the computer program code comprises computer instructions; when the processor executes the computer instructions, the electronic device executes the level setting method of any one of the above-mentioned first aspect.

[0044] In a third aspect, an electronic device is provided, comprising: an external keyboard connected to the electronic device, the keyboard being used to receive a trigger operation for a key in the keyboard, the electronic device comprising a display screen, a memory and one or more processors; the display screen, the memory and the processor are coupled; the display screen is used to display an image generated by the processor, the memory is used to store computer program code, the computer program code comprising computer instructions; when the processor executes the computer instructions, the electronic device executes the level setting method of any one of the above-mentioned first aspect.

[0045] In a fourth aspect, a computer-readable storage medium is provided, comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes any one of the user identity identification methods of the first aspect.

[0046] In a fifth aspect, a computer program product is provided. When the computer program product is run on a computer, the computer executes any one of the user identity identification methods of the first aspect.

[0047] In a sixth aspect, a chip is provided, comprising: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, the processor is used to execute the code in the memory, and when the code is executed, the processor is used to execute the method as described above.

[0048] It can be understood that the beneficial effects that can be achieved by the electronic device described in the second and third aspects provided above, 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 be referred to the beneficial effects in the first aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1A A schematic diagram of a WIFI connection interface provided in an embodiment of the present application;

[0050] Figure 1BA schematic diagram of a WIFI connection interface provided in an embodiment of the present application Figure 2 ;

[0051] Figure 2 A hardware schematic diagram of a matrix keyboard provided in an embodiment of the present application;

[0052] Figure 3 A flow chart of a method for determining a target key provided in an embodiment of the present application;

[0053] Figure 4 A physical picture showing that foreign matter is attached to the intersection of a display matrix keyboard provided in an embodiment of the present application;

[0054] Figure 5 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0055] Figure 6 A flow chart of a level setting method provided in an embodiment of the present application;

[0056] Figure 7 A schematic diagram of a scenario in which a keyboard is in a locked support state provided in an embodiment of the present application;

[0057] Figure 8 A schematic diagram of a scene when a keyboard is in a closed state provided in an embodiment of the present application;

[0058] Fig. 9 A schematic diagram of a scene when a keyboard is in a folded state provided in an embodiment of the present application;

[0059] Fig.10 A schematic diagram of a scene in which a keyboard is in an unfolded support state provided in an embodiment of the present application;

[0060] Fig.11 A schematic diagram of a scene when a keyboard is in an unfolded state provided in an embodiment of the present application;

[0061] Fig.12 A schematic diagram of a scenario in which a keyboard provided in an embodiment of the present application is switched from a closed state to an unfolded static state;

[0062] Fig.13 A schematic diagram of a scenario in which a keyboard is converted from a scanning state to an unfolded static state provided in an embodiment of the present application;

[0063] Fig.14 A schematic diagram of a scenario in which a keyboard is converted from a scanning state to a closed state provided in an embodiment of the present application;

[0064] Fig.15 A flowchart of a key scanning method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0065] The technical scheme in the embodiment of the present application will be described below in conjunction with the accompanying drawings in the embodiment of the present application. Wherein, in the description of the present application, unless otherwise specified, the "and / or" in the present application is only a kind of association relationship describing the associated object, indicating that there can be three kinds of relationships, for example, A and / or B, which can be represented by: A exists alone, A and B exist at the same time, and B exists alone, wherein A, B can be singular or plural. And, in the description of the present application, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following (individuals)" or its similar expressions refers to any combination of these items, including any combination of single items (individuals) or plural items (individuals). For example, at least one of a, b, or c (individuals) can be represented by: a, b, c, ab, ac, bc, or abc, wherein a, b, c can be single or multiple. In addition, in order to facilitate the clear description of the technical scheme of the embodiment of the present application, in the embodiment of the present application, the words "first", "second" and the like are used to distinguish the same items or similar items with substantially the same functions and effects. Those skilled in the art will appreciate that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit the difference. At the same time, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. 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 concrete way for easy understanding.

[0066] In some embodiments, electronic devices (such as laptops, tablet computers, etc.) are usually equipped with corresponding keyboards, and users can trigger the electronic devices to perform corresponding operations by clicking keys on the keyboard. For example, when a user wants the tablet computer to connect to a WIFI network named "Xiaohong", the user can trigger the following operation: Figure 1A The "Little Red" control 10 shown. In response to the triggering operation of the control 10, the tablet computer can display the password input interface corresponding to the WIFI network named "Little Red", and the password input interface includes a password input control. Afterwards, the user can enter the password in the password input control. For example, the user can click on the keys "1", "2" and "3" on the keyboard in sequence to input the password. Afterwards, the tablet computer can display the corresponding content (such as the password input interface) in the password input control on the password input interface according to the keys clicked (keys "1", "2" and "3"). Figure 1B "123" shown).

[0067] It should be noted that the above-mentioned key "1", key "2" and key "3" can be input keys on the keyboard, and the keyboard can also have functional keys, such as the above-mentioned Figure 1A or Figure 1B Functional buttons shown.

[0068] It is understandable that before using the keyboard, the user needs to connect the tablet computer to the keyboard, for example, via Bluetooth, a data cable, etc. After the connection is completed, the user can trigger the tablet computer to perform corresponding operations by clicking a button on the keyboard.

[0069] In some embodiments, the above Figure 1A or Figure 1B As can be seen from the keyboard shown, there are multiple keys on the keyboard. If the input pin and output pin of each key are connected to the general-purpose input / output port (GPIO) in the microcontroller unit (MCU), it will cause excessive waste of interface resources. Therefore, in this embodiment, the waste of interface resources can be reduced by adopting a method in which multiple keys share one input pin or multiple keys share one output pin.

[0070] For example, the keys in the same column may correspond to an output pin, and the keys in the same row may correspond to an input pin. Figure 2 For example, the 4*4 matrix keyboard in the embodiment of the present invention includes 16 keys, that is, each row of the 4*4 matrix keyboard includes 4 keys, and each column also includes 4 keys. The matrix keyboard refers to a keyboard group with a matrix-like arrangement used in the external device of the microcontroller unit.

[0071] In the implementation mode of the present application, the four horizontal pins are used as a group of input pins (keyboard scan in), that is, P17, P16, P15 and P14 are used as input pins, and the level of the input pins is low by default; the four vertical pins are used as a group of output pins (keyboard scan out), that is, P33, P34, P35 and P36 are used as output pins, and the level of the output pins is high by default. That is to say, each column of keys corresponds to an output pin (or is described as each column of keys is connected in parallel to / shares an output pin), such as key "1", key "5", key "9" and key "stop" share an output pin P33; each row of keys corresponds to an input pin (or is described as each row of keys is connected in parallel to / shares an input pin), such as key "1", key "2", key "3" and key "4" share an input pin P17.

[0072] It is understandable that the above-mentioned input pins and output pins are respectively connected to the general-purpose input / output port (GPIO) in the microcontroller unit (MCU), that is, the above-mentioned input pins and output pins can be controlled by 8 GPIO pins derived from the MCU. Among them, the electronic device can configure the input pin to the interrupt input mode, which refers to setting the GPIO pin connected to the above-mentioned input pin to the interrupt input mode to realize the interrupt function. Specifically, when the key on the keyboard is pressed, the rising edge corresponding to the key is triggered, that is, the level of the input pin corresponding to the key will be pulled up, so that the input signal corresponding to the GPIO pin connected to the input pin changes, and an interrupt is generated (or described as generating an interrupt signal). After that, the MCU executes the corresponding interrupt process, such as starting a key scan to determine the key pressed by the user, that is, the key triggered by the user.

[0073] Correspondingly, the electronic device can configure the output pin to a push-pull output mode, which means that the GPIO pin connected to the above output pin is set to a push-pull output mode to implement a push-pull output control mode. Specifically, when a key on the keyboard is pressed, the MCU can pull up or down the output signal of the output pin corresponding to the key. Exemplarily, the electronic device can configure the voltage of the output pin to a high level (such as 3.3V), and output a high level by default.

[0074] It should be noted that the above-mentioned method in which each input pin corresponds to a GPIO pin and each output pin corresponds to a GPIO pin (such as the above-mentioned input pins and output pins can be controlled by 8 GPIO pins brought out by the MCU) is only an example. Multiple input pins or output pins may also be connected to one GPIO pin. This application does not limit the connection relationship between the input pins and output pins and the GPIO pins in the microcontroller unit.

[0075] In some embodiments, in response to a user clicking a key on a keyboard, the electronic device triggers an interrupt. Afterwards, the electronic device can sequentially scan the keys on the keyboard to determine a target key, that is, the clicked key.

[0076] For details, see Figure 3As shown, the electronic device's scanning process for the keys on the keyboard may specifically include: the electronic device may set the output pins other than the output pins corresponding to the keys in the first column to a low level. Afterwards, the electronic device may sequentially obtain the level states (or simply referred to as levels) of all input pins. If there is an input pin with a high level state among the multiple input pins, the electronic device may determine that there is a target key in the first column of keys, that is, the key corresponding to the input pin with a high level state and the output pin of the first column is determined as the target key; if the level states of the multiple input pins are all low levels, the electronic device may determine that the keys in the first column have not been clicked by the user, so the electronic device may continue to set the level of the output pin corresponding to the keys in the second column to a high level, and set the output pins other than the output pin corresponding to the keys in the second column to a low level. Afterwards, the electronic device may return to the step of "the electronic device may sequentially obtain the level states of all input pins" until all output pins are scanned, the target key is determined, and scanning is achieved row by row and column by column.

[0077] For example, the above Figure 2 Take the 4*4 matrix keyboard in as an example, the user presses a key in the keyboard, and the keyboard generates an interrupt. First, in response to the interrupt, the electronic device can set the level of the output pin P33 to a high level, and then set the levels of P34, P35, and P36 to a low level (such as 0V). If the level of the input pin P17 is a high level, the electronic device can determine that the key "1" corresponding to the output pin P33 and the input pin P17 is the clicked key, that is, the target key. If the input pin P17 is a low level, the electronic device can continue to scan the input pins (such as P16, P15, and P14) corresponding to the other row keys in the column where the output pin P33 is located in sequence to determine whether the other row keys (key "5", key "9", and key "stop") are triggered. If the input pin P16 is a high level, the electronic device can use the key "5" corresponding to the output pin P33 and the input pin P16 as the target key.

[0078] If the input pins P16, P15 and P14 are all low level, it means that the key "1" corresponding to the output pin P33 and the input pin P17, the key "5" corresponding to the output pin P33 and the input pin P16, the key "9" corresponding to the output pin P33 and the input pin P15, and the key "stop" corresponding to the output pin P33 and the input pin P14 have not been clicked by the user, that is, the keys in the first column have not been clicked, and the electronic device can continue to scan the keys in the second column. Therefore, the electronic device can continue to set the level of the output pin P34 to a high level, and set the levels of the output pins P33, P35 and P36 to low levels respectively. Afterwards, the electronic device can determine whether the keys in the second column are clicked according to the levels of the input pins P17, P16, P15 and P14. If the input pin P16 is high level, the electronic device can determine that the key "6" corresponding to the output pin P34 and the input pin P16 is clicked, which is the target key.

[0079] It should be noted that before a key in the keyboard is clicked, the electronic device can configure the voltage of the output pin to a high level (such as 3.3V), so that all output pins in the keyboard output a high level, and all input pins in the keyboard are set to a low level.

[0080] It can be understood that there are usually connections between the input pins and output pins corresponding to the keys on the keyboard. Figure 4 The intersection is shown, and there is generally an electric potential difference at the intersection. The electronic device can determine the key pressed by the user in the keyboard by judging the change of the above electric potential difference.

[0081] However, due to the influence of factors such as the environment and the operating time, the intersection between the input pin and the output pin corresponding to the key in the keyboard will promote the generation of abnormal oxides due to the existence of potential difference. If an electronic device (that is, the keyboard corresponding to the electronic device) works for a long time in a high temperature and high humidity environment, the intersection between the input pin and the output pin corresponding to the key in the keyboard will produce such Figure 4 The gray attachments on the edge of the black line cause impedance changes, which in turn causes abnormal conduction between the input pin and the output pin where the abnormal oxide exists, ultimately affecting the accuracy of the key scanning results. It may happen that a key is not pressed by the user but is mistakenly considered to be pressed, and the service life of the keyboard is reduced, reducing the user's experience.

[0082] Therefore, in view of the above problems, considering that the generation of abnormal oxides is related to the potential difference, in order to slow down the generation of abnormal oxides, increase the service life of the keyboard and ensure the accuracy of the key scanning results, the embodiment of the present application provides a level setting method. In this method, the electronic device obtains the use state of the keyboard, wherein the use state of the keyboard includes a closed state and an open state. When the keyboard is in a closed state, the keyboard is in a locked state, indicating that the keyboard is not currently used as an input device, that is, the user will not use the keyboard, therefore, the electronic device can adjust the levels of all output pins corresponding to the keys in the keyboard to a first level (such as 0V) respectively. When the keyboard is in an open state, it indicates that the keyboard can currently be used as an input device, and the user may use the keyboard. Therefore, in order to ensure that the keyboard can be used normally by the user, the electronic device can adjust the levels of all output pins corresponding to the keys in the keyboard to a target level respectively, and the target level includes a second level or a third level, and the third level is greater than the second level. The target level is greater than the first level, and when the level of the output pin is the target level, the keyboard can normally generate an interrupt when receiving a user's click operation on the key, so that the electronic device can perform related processing based on the interrupt to ensure the user's experience. Wherein, no matter which use state the keyboard is in, the levels of all input pins corresponding to the keys in the keyboard are all at the first level.

[0083] In this embodiment, if the keyboard is in the off state, the levels of the input pin and the output pin are both at the first level, and there is no potential difference between the input pin and the output pin. That is to say, by the above method of judging the use state of the keyboard, the duration of the potential difference between the input pin and the output pin can be reduced, thereby slowing down the generation of abnormal oxides, ensuring the accuracy of the keyboard scanning results, and reducing the probability of keyboard aging, increasing the service life of the keyboard, and improving the user experience. When the keyboard is in the on state, the electronic device can set the level of the output pin to the second level or the third level as required. When the level of the output pin is the second level, the potential difference between the input pin and the output pin is small. The smaller the potential difference, the slower the speed of abnormal oxide generation. Therefore, the speed of abnormal oxide generation can be reduced, ensuring the accuracy of the keyboard scanning results, and extending the service life of the keyboard.

[0084] Exemplarily, the electronic device in the embodiments of the present application may be a tablet computer, a laptop computer, a portable computer, a personal computer (PC), a car computer, or other device that has a keyboard or can be connected to a keyboard. The following embodiments do not impose any special restrictions on the specific form of the electronic device.

[0085] Take the above-mentioned electronic device as an example, which is a tablet computer. Figure 5 A schematic structural diagram of an electronic device 100 is shown.

[0086] The electronic device 100 may include a processor 110, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a sensor module 180, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, a button 190, a motor 191, an indicator 192, cameras 1-N 193, a display 194, and subscriber identification module (SIM) card interfaces 1-N 195, etc. Among them, the sensor module 180 may include an acceleration sensor 180A, a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.

[0087] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate 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.

[0088] The processor 110 may include one or more processing units, for example, the processor 110 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), etc. Different processing units may be independent devices or integrated into one or more processors.

[0089] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0090] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0091] In some embodiments, the processor 110 may include one or more interfaces. 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, etc.

[0092] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.

[0093] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0094] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0095] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0096] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0097] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0098] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as WIFI (wireless fidelity) network), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) and the like applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of the signal, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2. In some embodiments, at least some functional modules of the wireless communication module 160 can be set in the processor 110.

[0099] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the 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 positioning system (GPS), 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).

[0100] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0101] The charging management module 140 is used to receive charging input from a charger. While the charging management module 140 is charging the battery 142 , it can also supply power to the electronic device 100 through the power management module 141 .

[0102] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0103] The display screen 194 is used to display images, videos, etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.

[0104] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0105] The ISP is used to process data fed back by the camera 193. The camera 193 is used to capture static images or videos. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0106] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0107] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface, and the application processor.

[0108] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0109] The speaker 170A, 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.

[0110] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.

[0111] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.

[0112] The headphone jack is used to connect a wired headphone, and the headphone jack may be a USB interface 130, or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0113] The acceleration sensor 180A can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0114] In this embodiment, the acceleration sensor 180A can be used to detect the angle between the surface where the display screen is located and the front side of the keyboard (i.e., the side with keys), so as to determine the use status of the keyboard. It can be understood that if the angle between the surface where the display screen is located and the front side of the keyboard is between 90 degrees and 180 degrees, it can be confirmed that the keyboard is in the open state; if the angle between the surface where the display screen is located and the front side of the keyboard is 0 degrees or between 180 degrees and 360 degrees, it can be confirmed that the keyboard is in the closed state.

[0115] The gyro sensor may be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (ie, x, y, and z axes) may be determined by the gyro sensor.

[0116] The touch sensor is also called a "touch panel". The touch sensor can be arranged on the display screen 194, and the touch sensor and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor can also be arranged on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0117] A magnetometer can be used to test the strength and direction of a magnetic field and locate the orientation of an electronic device. The principle of a magnetometer is similar to that of a compass, and it can measure the angle between the current electronic device and the four directions of east, south, west and north.

[0118] The linear acceleration sensor is the data obtained by the acceleration sensor minus the effect of gravity.

[0119] The gravity acceleration sensor can sense the change of acceleration force, which is the force acting on the electronic device when it is accelerating.

[0120] The rotation vector in the rotation vector sensor represents the direction of the electronic device and is a data obtained by mixing the coordinate axis and the angle.

[0121] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100 .

[0122] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, 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. In addition, the internal memory 121 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, a universal flash storage (UFS), etc.

[0123] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0124] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. Indicator 192 can be an indicator light.

[0125] The SIM card interface 195 is used to connect a SIM card.

[0126] An embodiment of the present application provides a level setting method, which can be applied to an electronic device equipped with or connected to a keyboard, the keyboard including a plurality of keys, the keyboard can be a matrix keyboard as described above, or other types of keyboards. Among them, an electronic device equipped with a keyboard means that the keyboard is a part of the electronic device, and generally the keyboard is not disassembled, such as the electronic device equipped with a keyboard can be a laptop computer. An electronic device connected to a keyboard means that the keyboard is externally connected to the electronic device, and the keyboard can be disassembled according to user needs, such as the electronic device connected to the keyboard can be a tablet computer. Exemplarily, the keyboard is externally connected to the electronic device, which can be the keyboard connected to the electronic device by a wired connection (such as a data cable), or the keyboard can be connected to the electronic device by a wireless connection (such as Bluetooth), and there is no specific limitation.

[0127] The following example takes the electronic device as a tablet computer and the keyboard connected to the electronic device as a matrix keyboard. Figure 6 As shown, the level setting method may include S701 to S708.

[0128] S701, the tablet computer obtains the usage status of the keyboard.

[0129] The keyboard usage status may include a closed state and an open state.

[0130] In some embodiments, the closed state of the keyboard indicates that the keyboard is not used as an input device, that is, the keyboard cannot be used, that is, the keyboard is locked.

[0131] In one example, the closed state of the keyboard indicates a locked support state, which may be a state corresponding to when the front side of the keyboard (i.e., the side with the keys) serves as the support surface of the display screen, such as Figure 7 As shown, the front side 2A of the keyboard fits with the working surface E, that is, the angle θ between the back side 2B of the keyboard (i.e., the side without keys) and the back side of the display screen (or the back side of the tablet computer) 1B is an acute angle or a right angle, that is, the locked support state means that the keyboard keycaps are supported as a supporting surface at this time, and the keyboard is locked. Among them, the working surface refers to the plane on which the tablet computer is placed, and the working surface can be a desktop, a cabinet surface, a user's leg, etc., where the keyboard is placed, and there is no specific limitation.

[0132] In another example, the closed state of the keyboard refers to a closed state, which may be a state corresponding to when the front surface of the keyboard is attached to the surface where the display screen is located, such as Figure 8 As shown, the angle between the front side 2A of the keyboard (the side opposite to the back side 2B of the keyboard) and the side 1A where the display screen is located (the side opposite to the back side 1B of the above-mentioned display screen) is zero, that is, the closed state indicates that the keyboard keycaps are facing the display screen and the keyboard is locked.

[0133] In another example, the closed state of the keyboard represents a folded state, which may be a state in which the back of the keyboard (the side opposite to the front 2A of the keyboard) is fitted with the back of the display screen (the side opposite to the side 1A where the display screen is located), that is, the front of the keyboard is opposite to the side where the display screen is located, such as Fig. 9 As shown, the angle between the back side 2B of the keyboard and the back side 1B of the display screen is zero, that is, the folded state means that the keyboard keycaps are facing away from the display screen, and the front side of the keyboard serves as the supporting surface of the display screen, and the keyboard is locked.

[0134] In other embodiments, the open state of the keyboard indicates that the keyboard can be used, that is, the keyboard is activated. In one example, the open state of the keyboard indicates an unfolded support state, which may be a state corresponding to when the back of the keyboard is used as a support surface for the display screen, such as Fig.10 As shown, the back side 2B of the keyboard fits with the working surface, that is, the angle γ between the front side 2A of the keyboard and the surface 1A where the display screen is located is an obtuse angle, a right angle, or an acute angle. In the unfolded support state, the tablet computer is used in combination with the keyboard, and the keyboard is activated.

[0135] In another example, the open state of the keyboard refers to the unfolded state, which may be a state corresponding to when the keyboard and the display screen are in the same plane, such as Fig.11 As shown, the back of the keyboard is in contact with the work surface and / or the back of the display screen is in contact with the work surface, and the angle between the front 2A of the keyboard and the surface 1A where the display screen is located is a right angle. In the unfolded state, the tablet computer and the keyboard are located on the same horizontal plane, and the keyboard is activated.

[0136] Among them, the on state of the above-mentioned keyboard may include an expanded static state and a scanning state. The expanded static state indicates that the keyboard can be used as an input device, but has not received a trigger operation for a key in the keyboard, that is, the keyboard is in an on state, but a key in the keyboard has not been clicked. It can be understood that the expanded static state can be the above-mentioned expanded support state or the above-mentioned expanded state. The scanning state indicates the state in which the keyboard is used as an input device, that is, the keyboard receives a user click on a key in the keyboard. In other words, the electronic device needs to scan the keyboard. For example, in response to a user click operation on any key in the keyboard, the tablet computer scans the keys in the keyboard, so that the tablet computer can receive the content corresponding to the clicked key. Therefore, the tablet computer can convert the use state of the keyboard from the expanded static state to the scanning state. Exemplarily, if the above-mentioned Figure 1A or Figure 1B If the "Enter" button in the keyboard is clicked, it means that the keyboard is currently being used by the user, so the use state of the keyboard can be switched from the expanded static state to the scanning state. For another example, after determining that the keyboard is in the scanning state, if the tablet computer does not receive a click operation from the user on any key in the keyboard (such as not receiving a click operation from the user on a key within a preset time), it means that the user is not currently using the keyboard, but the user may still use the keyboard. Therefore, in order to ensure that the keyboard can generate interrupts normally, that is, in order to enable the keyboard to be used normally by the user, the tablet computer can switch the use state of the keyboard from the scanning state to the expanded static state.

[0137] In some embodiments, when the user performs relevant operations on the keyboard or electronic device, causing the angle between the keyboard and the tablet computer to change, resulting in a change in the use state of the keyboard, the tablet computer can obtain the latest use state of the keyboard, that is, the tablet computer does not need to obtain the use state of the keyboard in real time, thus reducing the waste of resources caused by obtaining the use state of the keyboard in real time and reducing unnecessary power consumption. Alternatively, the tablet computer can periodically obtain the use state of the keyboard.

[0138] S702: When the keyboard is in the closed state, the tablet computer configures the level states of all output pins corresponding to the keys in the keyboard to be the first level.

[0139] Specifically, if the keyboard is in the closed state, it means that the keyboard is locked, that is, the possibility of the user using the keyboard is very small, therefore, the tablet computer does not need to scan the keys in the closed keyboard to determine the target keys clicked by the user, and the tablet computer can adjust the level states of all output pins corresponding to the keys in the keyboard to the first level. The first level can be a low level, for example, the voltage value corresponding to the low level can be 0V.

[0140] It can be understood that from the above, all input pins corresponding to the keys in the keyboard are set to a low level by default. If all output pins corresponding to the keys in the keyboard are also set to a low level, the level of the input pin is the same as the level of the output pin, and there will be no potential difference at the intersection of the input pin and the output pin. Therefore, by adjusting the level state of all output pins in the keyboard, the duration of the potential difference between the input pin and the output pin can be reduced, thereby slowing down the generation of abnormal oxides, reducing the probability of keyboard aging, increasing the service life of electronic equipment, improving user experience, and reducing the probability of errors in key scanning results due to abnormal oxides.

[0141] S703, when the keyboard is in the unfolded static state, the tablet computer configures the level states of all output pins corresponding to the keys in the keyboard to be the second level respectively.

[0142] In the embodiment of the present application, after determining that the keyboard is not in the closed state, that is, the key is in the open state, the tablet computer can determine whether the keyboard is in the unfolded static state. If the keyboard is in the unfolded static state, in order to trigger an interrupt, the tablet computer can configure the levels of all output pins corresponding to the keys in the keyboard to the second level. Wherein, the second level is higher than the above-mentioned first level. For example, since the default voltage of the hardware (such as MCU) in the tablet computer is three levels, namely 0V, 1.8V and 3.3V, when there is a potential difference between the input pin and the output pin corresponding to the key, an interrupt can be generated. Therefore, in order to reduce the value of the potential difference while generating an interrupt, the voltage corresponding to the second level can be configured to 1.8V.

[0143] It can be understood that, from the above, all input pins corresponding to the keys in the keyboard default to a low level, that is, the voltage value of all input pins corresponding to the keys in the keyboard is 0V. If the voltage of all output pins corresponding to the keys in the keyboard is configured to 1.8V, it can be determined that the level of the input pin is different from the level of the output pin, and the potential difference between the input pin and the output pin is 1.8V. Considering that the generation speed of abnormal oxides is also related to the size of the potential difference, the larger the potential difference, the faster the generation speed of abnormal oxides, and the smaller the potential difference, the slower the generation speed of abnormal oxides. Therefore, compared with the potential difference of 3.3V, the potential difference of 1.8V can slow down the generation speed of abnormal oxides, thereby reducing the probability of keyboard aging, increasing the service life of electronic equipment, ensuring the correctness of keyboard scanning results, and then being able to correctly receive the user's click operation on any key in the keyboard, and improving the user's experience. And the keyboard can generate a corresponding interrupt after the user presses the key to ensure that the key pressed by the user can be detected.

[0144] In some embodiments, the keyboard can be switched from a closed state to an unfolded static state. Fig.12 As shown, in response to the user's pushing operation on the keyboard 2 and / or the tablet computer 1 in the closed state, that is, the user unfolds the tablet computer 1 and the keyboard 2 that are being attached. The tablet computer detects that the angle between the front surface of the tablet computer (i.e., the surface where the display screen is located) and the front surface of the keyboard meets the angle corresponding to the unfolded static state (such as the angle is a right angle), and the tablet computer can change the use state of the keyboard from the scanning state to the unfolded static state, so as to facilitate the subsequent user to perform key clicking operations.

[0145] In other embodiments, the keyboard can be used in a state from a scanning state to an unfolded static state. Fig.13 As shown, after any key in keyboard 2 (such as the "space" key) is clicked, if the tablet computer does not receive any click operation from the user on any key in the keyboard within a preset time, it means that the user has not clicked any key after clicking the "space" key, that is, the user has not used the keyboard again. Therefore, the tablet computer can switch the use state of the keyboard from the scanning state to the expanded and static state to slow down the speed of abnormal oxide generation, and because the keyboard may still be used by the user at this time, by switching to the expanded and static state, the keyboard can still respond to the user's click operation and generate an interrupt (or described as an interrupt signal).

[0146] In a possible implementation, the scanning state and the static state are merely examples of the on state. After determining that the keyboard is not in the off state, that is, the key is in the on state, the tablet computer can directly configure the levels of all output pins corresponding to the keys in the keyboard to the second level or the third level without determining whether the keyboard is in the unfolded static state or the scanning state.

[0147] S704, in response to a user clicking operation on any key in the keyboard, the tablet computer changes the use state of the keyboard from the unfolded static state to the scanning state, and configures the level states of all output pins corresponding to the keys in the keyboard to the third level.

[0148] In one embodiment, if a key in the keyboard is clicked and the keyboard generates a corresponding interrupt signal, it means that the key in the keyboard is currently being used by the user. Therefore, after receiving the interrupt signal, the tablet computer can convert the keyboard's usage state from the unfolded static state to the scanning state.

[0149] It can be understood that after determining that a key in the keyboard is clicked, the tablet computer needs to stop the task before the key is clicked to perform the task of scanning the keys in the keyboard. That is to say, after any key in the keyboard is clicked, the tablet computer responds to the interrupt signal about the keyboard, and the tablet computer can perform the key scanning task.

[0150] Specifically, when the keyboard is in the scanning state, it means that the keyboard is being used by the user, that is, the user has clicked on the keys on the keyboard. In order to determine the keys clicked by the user, the tablet computer can configure the level states of all output pins corresponding to the keys in the keyboard to the third level. The third level is higher than the second level. For example, since the hardware default voltage in the tablet computer is three levels, namely 0V, 1.8V and 3.3V, and the tablet computer needs sufficient voltage when scanning the keys in the keyboard, if the potential difference between the input pin and the output pin is still 1.8V, the tablet computer may not be able to scan the keys. In order to ensure normal scanning, the tablet computer can configure the third level to 3.3V.

[0151] In some embodiments, when the above-mentioned open state does not include the expanded static state and the scanning state, if any key in the keyboard is clicked, the tablet computer does not need to switch the usage state of the keyboard, and can directly configure the level of the output pin. In this way, unnecessary power consumption loss can be reduced and the work efficiency of key scanning can be improved.

[0152] S705, the tablet computer scans the keys on the keyboard to determine the target keys.

[0153] In some embodiments, the process of scanning the keys on the keyboard and determining the target keys may include the following steps: Figure 3 The key scanning process is shown.

[0154] Specifically, after configuring the levels of all output pins corresponding to the keys in the keyboard to the third level, the tablet computer can retain the level corresponding to the target output pin, and configure the levels of other output pins except the target output pin to the first level. The target output pin refers to any pin among all the output pins in the keyboard, for example, Figure 2 As shown, the target output pin may be any one of P33, P34, P35 and P36. In this embodiment, the target output pin may be an output pin located at the first position of the keyboard, such as the target output pin is as described above. Figure 2 In other implementations, the target output pin may also be the output pin at the last position in the keyboard, for example, see Figure 2 As shown, the target output pin is P36.

[0155] After that, the tablet can obtain the level status of all input pins.

[0156] In some embodiments, the tablet computer can simultaneously obtain the level states of all input pins corresponding to each row of keys in the column where the target output pin is located, that is, obtain the level states of all input pins in the keyboard. After the level states are obtained, the tablet computer determines whether the key corresponding to the target output pin (that is, each key in the column where the target output pin is located) is clicked based on the level state of each input pin among all the input pins, that is, determines whether the target key exists among the keys corresponding to the target output pin.

[0157] For example, the above Figure 2 For example, the target output pin is P33, and the tablet computer can obtain the level states of input pins P17, P16, P15, and P14. Afterwards, if input pin P17 is at the third level, the tablet computer can determine the key "1" corresponding to input pin P17 and target output pin P33 as the target key; if the level states of input pins P17, P16, P15, and P14 are all at the first level, the tablet computer can determine that the key "1", key "5", key "9", and key "stop" corresponding to target output pin P33 do not exist as the target key, that is, key "1", key "5", key "9", and key "stop" are not clicked by the user.

[0158] In some other embodiments, the tablet computer may sequentially obtain the level status of the input pins. Specifically, the tablet computer may obtain the level status of the first input pin. The first input pin refers to any one of all input pins corresponding to the keys in the keyboard, for example, Figure 2 As shown, the target input pin may be any one of P17, P16, P15 and P14. In this embodiment, the first input pin may be an input pin located at the first position in the keyboard, for example, see Figure 3 As shown, the first input pin is P17. In other implementations, the first input pin may also be the input pin at the last position in the keyboard, for example, see Figure 2 As shown, the first input pin is P14.

[0159] Afterwards, the tablet computer can determine whether the key corresponding to the first input pin and the target output pin is the target key according to the level state of the first input pin. If the key corresponding to the first input pin and the target output pin is not the target key, the tablet computer can obtain the level state of the second input pin. Afterwards, the tablet computer uses the second input pin as the first input pin and returns to execute the above step of "the tablet computer can determine whether the key corresponding to the first input pin and the target output pin is the target key according to the level state of the first input pin" until it is determined that the target key exists or the key corresponding to the target output pin is determined.

[0160] In one example, if the key corresponding to the first input pin and the above-mentioned target output pin is the target key, the tablet computer can directly determine the target key without performing subsequent key scanning steps, thereby improving the efficiency of determining the target key; in another example, if the key corresponding to the first input pin and the above-mentioned target output pin is the target key, the tablet computer can continue to obtain the level status of other input pins except the first input pin until the key corresponding to the above-mentioned target output pin is judged and the target key is determined, thereby improving the accuracy of target key determination and reducing the occurrence of buttons being clicked but not scanned.

[0161] For example, the above Figure 2 Taking the 4*4 matrix keyboard in as an example, the tablet computer can first obtain the level state of the input pin P17. If the input pin P17 is at the third level, the tablet computer can determine the key "1" corresponding to the input pin P17 and the target output pin P33 as the target key; if the input pin P17 is at the first level, the tablet computer can continue to obtain the level state of the input pin P16 until it is determined that the target key exists in the keyboard or the key corresponding to the target output pin is determined.

[0162] In some embodiments, if there is a target key among the keys corresponding to the target output pin, the tablet computer may determine the key corresponding to the input pin with the third level as the target key. Figure 2 As shown, it can be known from the above that the target output pin is P33, and if the input pin whose level state is the third level is P16, the tablet computer can determine that the key "5" is the target key.

[0163] In some other embodiments, if there is no target key among the keys corresponding to the target output pin, the tablet computer may configure the level of the first output pin to be the third level, and configure the levels of other output pins except the first output pin to be the first level. The first output pin refers to any output pin among all the output pins corresponding to the keys in the keyboard that is not determined as the target output pin. For example, see Figure 2 As shown, from the above, it can be known that the target output pin is P33, and the first output pin can be any output pin among P34, P35 and P36.

[0164] Afterwards, the tablet computer can use the first output pin as the target output pin and return to the above step of "the tablet computer determines whether there is a target key among the keys corresponding to the target output pin based on the level information of all input pins" to continue to determine whether there is a target key among the keys corresponding to the target output pin based on the level information of the input pins, until all output pins corresponding to the keys in the keyboard are scanned or it is determined that the target key exists in the keyboard, thereby obtaining the target key.

[0165] S706: The tablet computer determines whether there is a key pressed on the keyboard.

[0166] Specifically, after determining the target key, the tablet computer can continue to determine whether there is a key pressed in the keyboard, that is, whether the user clicks a key in the keyboard again. If there is a key pressed in the keyboard, it means that the tablet computer has received the user's click operation on the key in the keyboard again, that is, the current keyboard usage status is still in the scanning status, so the tablet computer can return to the above step S705 to continue scanning the keys on the keyboard; if all the keys in the keyboard are not pressed, it means that the tablet computer has not received the user's click operation on any key in the keyboard, so the tablet computer can stop scanning the keys on the keyboard.

[0167] In some embodiments, after determining the target key, if the tablet computer does not receive an interrupt signal sent by the keyboard within a certain period of time (such as the preset time mentioned above), the tablet computer can determine that the user is no longer using the keyboard. Therefore, the tablet computer can stop scanning the keys on the keyboard to reduce unnecessary power consumption caused by key scanning.

[0168] S707, the tablet computer stops scanning and changes the use state of the keyboard from the scanning state to the unfolded static state.

[0169] S708: The tablet computer configures the level states of all the above output pins to be the second level respectively.

[0170] Specifically, after determining that no key on the keyboard is pressed, the tablet computer may stop scanning the keys on the keyboard and change the keyboard usage state from the scanning state to the unfolded static state. Afterwards, the tablet computer may return to the above step S703 to wait for the next click operation of the user.

[0171] In some embodiments, after determining that no key is pressed in the keyboard, the use state of the keyboard can also be switched from the scanning state to the closed state. The user performs relevant operations on the tablet computer or the keyboard, so that the angle θ between the back of the keyboard and the back of the display screen is an acute angle or a right angle, or the angle between the front of the keyboard and the surface where the display screen is located is zero, or the angle between the back of the keyboard and the back of the display screen is zero. In response to the operation, the tablet computer switches the use state of the keyboard to the closed state. For example, see Fig.14 As shown, after any key in the keyboard 2 (such as the "space" key) is clicked, if the tablet computer receives a push operation on the display screen by the user, so that the surface where the display screen is located is fitted with the front surface of the keyboard, the tablet computer can stop scanning the keys on the keyboard, and change the keyboard's usage state from the scanning state to the closed state, and set the levels of all output pins to the levels in the closed state (i.e., the first level).

[0172] In some embodiments, the use state of the keyboard can also be switched from the unfolded static state to the closed state. The process of switching from the unfolded static state to the closed state is similar to the process of converting the scanning state to the closed state. However, the tablet computer in the unfolded static state does not need to scan. The user performs relevant operations on the tablet computer or the keyboard so that the angle θ between the back of the keyboard and the back of the display screen is an acute angle or a right angle, or the angle between the front of the keyboard and the surface where the display screen is located is zero, or the angle between the back of the keyboard and the back of the display screen is zero. In response to the operation, the tablet computer switches the use state of the keyboard in the unfolded static state to the closed state.

[0173] In some embodiments, when the above-mentioned open state does not include the expanded static state and the scanning state, if no key is pressed in the keyboard, the tablet computer does not need to switch the usage state of the keyboard, and can directly return to the above-mentioned step S703 to wait for the user's next click operation. In this way, unnecessary power consumption loss can be reduced and the work efficiency of key scanning can be improved.

[0174] The following will combine the above Figure 5 The structure shown and Fig.15 The key scanning process shown in the figure details how the tablet performs key scanning.

[0175] S1501: In response to a user pushing operation on a display screen and / or a keyboard, an acceleration sensor in the tablet computer determines an angle between a surface where the display screen is located and a front surface of the keyboard.

[0176] The push operation on the display screen and / or keyboard refers to the operation of the user's finger touching the display screen and / or keyboard and pushing the display screen and / or keyboard. In one example, the push operation can be the first operation, which can trigger the keyboard to switch from the scanning state to the closed state. Specifically, the push operation can be the operation of fitting the display screen and the keyboard together, that is, Fig.14 As shown, the user turns off the tablet computer after clicking a button on the keyboard. In one example, the push operation can be a second operation, which can trigger the keyboard's usage state to switch from the expanded static state to the closed state. Specifically, the push operation can be an operation to fit the display screen and the keyboard together, that is, the user turns off the tablet computer without clicking a button. In another example, the push operation can be a third operation, which can trigger the keyboard's usage state to switch from the closed state to the expanded static state. Specifically, the push operation can be an operation to separate the display screen from the keyboard, that is, Fig.12 As shown, the user turns on the operation of the tablet computer.

[0177] In some embodiments, the acceleration sensor is used to detect the acceleration and gravity of the tablet computer during movement. Specifically, the acceleration and gravity can be detected through three axes (X axis, Y axis and Z axis). For example, the acceleration sensor can detect the tilt direction of the tablet computer, and then calculate the angle between the surface where the display screen is located and the front of the keyboard according to the tilt direction.

[0178] S1502: The processor in the tablet computer receives the angle between the surface where the display screen is located and the front surface of the keyboard sent by the acceleration sensor.

[0179] Specifically, after the acceleration sensor determines the angle between the surface where the display screen is located and the front surface of the keyboard, the angle can be sent to the processor in the tablet computer to facilitate subsequent determination of the use status of the keyboard.

[0180] S1503. The processor determines the usage status of the keyboard according to the angle between the surface where the display screen is located and the front surface of the keyboard.

[0181] In some embodiments, if the angle between the surface where the display screen is located and the front surface of the keyboard is a reflex angle, a full angle, or a zero angle, the processor can determine that the use state of the keyboard is a closed state. The reflex angle refers to an angle greater than 180 degrees and less than 360 degrees. The full angle refers to an angle of 360 degrees. The zero angle refers to an angle of 0 degrees.

[0182] In other embodiments, if the angle between the front of the tablet computer body (i.e., the side where the display screen is located) and the front of the keyboard is a bad angle, the processor may determine that the keyboard is in an open state. Wherein, the bad angle refers to an angle greater than 0 degrees and less than 180 degrees. The bad angle may include an acute angle, a right angle, and an obtuse angle. The acute angle refers to an angle greater than 0 degrees and less than 90 degrees. The right angle refers to an angle of 90 degrees. The obtuse angle refers to an angle greater than 90 degrees and less than 180 degrees.

[0183] S1504: When the keyboard is in a closed state, the processor sends a first configuration instruction to the micro control unit.

[0184] S1505. The micro control unit receives the first configuration instruction and configures the level states of all output pins corresponding to the keys in the keyboard to be the first level.

[0185] S1506: When the keyboard is in the unfolded and static state, the processor sends a second configuration instruction to the micro control unit.

[0186] S1507: The micro control unit receives the second configuration instruction and configures the level states of all output pins corresponding to the keys in the keyboard to the second level.

[0187] S1508: The keyboard receives a click operation from the user on any key on the keyboard.

[0188] S1509. The keyboard sends a scan instruction to the processor.

[0189] S1510. The processor receives the scanning instruction and converts the keyboard usage state from the unfolded static state to the scanning state.

[0190] S1511. The keyboard sends an interrupt signal to the microcontroller unit.

[0191] In some embodiments, the above S1509 and S1511 can be performed simultaneously, that is, after receiving a click operation of the user on any key, the keyboard can simultaneously send a scan instruction to the processor and an interrupt instruction to the microcontroller unit. In this way, work efficiency can be improved and time cost can be reduced.

[0192] In other embodiments, the above S1509 and S1511 may also be performed in sequence, that is, after receiving a click operation from the user on any key, the keyboard may first send a scan indication to the processor and then send an interrupt indication to the microcontroller unit; or, may first send an interrupt indication to the microcontroller unit and then send a scan indication to the processor, without specific limitation.

[0193] S1512: The micro control unit receives the interrupt signal, triggers an interrupt, and configures the level states of all output pins in the keyboard to be the third level.

[0194] In some embodiments, after receiving a click operation of a user on any key in the keyboard, the keyboard may directly send a scan instruction to the processor, or the keyboard may first send an interrupt signal to the microcontroller unit, and after the microcontroller unit receives the interrupt signal, the microcontroller unit triggers an interrupt and sends a scan instruction to the processor. In other words, the scan instruction may be sent by the keyboard or by the microcontroller unit, and is not specifically limited.

[0195] S1513: The micro control unit sets the output pins other than the target output pin to the first level.

[0196] S1514. The micro control unit determines whether a target key exists among the keys corresponding to the target output pin according to the levels of all input pins.

[0197] Exemplarily, if the levels of all input pins are the first level, it means that there is no target key among the keys corresponding to the target output pin; if the level of any input pin among all input pins is the third level, it means that there is a target key among the keys corresponding to the target output pin.

[0198] S1515. When there is no target key among the keys corresponding to the target output pin, the micro control unit configures the level of the first output pin to the third level, and configures the levels of other output pins except the first output pin to the first level.

[0199] The first output pin refers to any output pin among all output pins corresponding to keys in the keyboard that is not determined as a target output pin.

[0200] In some embodiments, after determining that the target key does not exist among the keys corresponding to the target output pin, the microcontroller unit can configure the level of the first output pin to the third level, and configure the levels of other output pins except the first output pin to the first level, so as to continue to determine whether the target key exists among the keys corresponding to the first output pin.

[0201] S1516: The micro control unit uses the first output pin as the target output pin and returns to the above step S1514.

[0202] Specifically, after setting the level state of the output pin, the micro control unit can use the first output pin as the new target output pin and return to the above step S1514 to continue to determine whether there is a target key in the keys corresponding to the new target output pin based on the level of the input pin.

[0203] S1517: When the target key exists in the keys corresponding to the target output pin, the micro control unit reports the data corresponding to the input pin with the third level and the target output pin to the processor.

[0204] S1518. The processor receives the above data and determines the target button based on the data.

[0205] Specifically, after the processor receives the above data, it can compare the data with the target data corresponding to each key in the keyboard to determine the target key. It can be understood that each key in the keyboard corresponds to a target data, and the target data can be pre-set to indicate that the key is pressed, for example, Figure 2 Taking the key "1" in the keyboard as an example, if the data 01 indicates that the key "1" is pressed, and the data reported to the processor is 01, the processor can determine that the key "1" in the keyboard is pressed by the user.

[0206] S1519: After determining the target key, the keyboard determines whether there is a key pressed.

[0207] Specifically, after determining the target key, the keyboard can continue to determine whether there is a key pressed, that is, whether the user clicks on a key on the keyboard again. If there is a key pressed on the keyboard, the keyboard can return to the above step S1511 to continue scanning the keys on the keyboard; if all keys on the keyboard are not pressed, indicating that the user may not use the keyboard temporarily, the microcontroller unit can stop scanning the keys on the keyboard, that is, the keyboard can send a stop scanning instruction to the microcontroller unit.

[0208] S1520: When no key is pressed in the keyboard, the keyboard may send a stop scanning instruction to the micro control unit.

[0209] In some embodiments, after determining that all keys on the keyboard are not pressed, the keyboard may send a stop scanning instruction to the micro control unit so that the micro control unit stops scanning the keys on the keyboard.

[0210] S1521. The micro control unit receives the above-mentioned stop scanning instruction and stops scanning the keys on the keyboard.

[0211] S1522. The keyboard sends a static instruction to the processor.

[0212] Specifically, after determining that all keys on the keyboard are not pressed, the keyboard can directly send a static instruction to the processor, or the keyboard can first send a stop scanning instruction to the microcontroller unit, and after the microcontroller unit receives the stop scanning instruction, the microcontroller unit stops scanning the keys on the keyboard and sends a static instruction to the processor. In other words, the static instruction can be sent by the keyboard or by the microcontroller unit, and is not specifically limited.

[0213] In some embodiments, the above S1520 and S1522 can be performed simultaneously, that is, after the keyboard determines that all keys are not pressed, it can simultaneously send a static instruction to the processor and a stop scanning instruction to the microcontroller unit. In this way, work efficiency can be improved and time cost can be reduced.

[0214] In other embodiments, the above S1520 and S1522 may be performed in sequence, that is, after the keyboard determines that all keys are not pressed, it may first send a static instruction to the processor, and then send a stop scanning instruction to the microcontroller unit; or, it may first send a stop scanning instruction to the microcontroller unit, and then send a static instruction to the processor, without specific limitation.

[0215] S1523: The processor receives the static instruction and changes the keyboard usage state from the scanning state to the unfolded static state.

[0216] It should be noted that the above S1504 and S1505 as well as the above S1506 to S1523 are parallel schemes, that is, if the keyboard is in the closed state, the above S1504 and S1505 are executed; if the keyboard is in the open state, the above S1506 to S1523 are executed.

[0217] It should be understood that the corresponding steps executed by each module in the mobile phone may also be executed by other modules in the tablet computer. For example, the process in which the keyboard sends a scan instruction to the processor may also be sent by the microcontroller unit to the processor. For another example, the process in which the keyboard sends a static instruction to the processor may also be sent by the microcontroller unit to the processor, and the specific steps are not limited.

[0218] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step in the above-mentioned method embodiment.

[0219] The embodiment of the present application also provides a computer program product, including a computer program. When the computer program runs on an electronic device, the electronic device executes each function or step in the above method embodiment.

[0220] The embodiment of the present application provides a chip, the chip is used to execute instructions, when the chip is running, the technical solution in the above embodiment is executed. The implementation principle and technical effect are similar, and will not be repeated here.

[0221] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a high-density digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).

[0222] It should be understood that the "embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, the various embodiments in the entire specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.

[0223] It should also be understood that in the present application, "when", "if" and "if" all mean that the UE or base station will take corresponding actions under certain objective circumstances. It is not a time limit, and it does not require the UE or base station to make judgments when implementing it, nor does it mean that there are other limitations.

[0224] A person skilled in the art may understand that the various numerical numbers such as first and second involved in the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application, and also indicate the order of precedence.

[0225] In this application, elements expressed in the singular are intended to mean "one or more" rather than "one and only one", unless otherwise specified. In this application, "at least one" is intended to mean "one or more", and "more than one" is intended to mean "two or more", unless otherwise specified.

[0226] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. A can be singular or plural, and B can be singular or plural.

[0227] In this document, the term "at least one of..." or "at least one of..." means all or any combination of the listed items. For example, "at least one of A, B, and C" may mean: A exists alone, B exists alone, C exists alone, A and B exist at the same time, B and C exist at the same time, and A, B, and C exist at the same time, where A may be singular or plural, B may be singular or plural, and C may be singular or plural.

[0228] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0229] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0230] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the 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 system, 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.

[0231] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0232] In addition, 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.

[0233] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.

[0234] The same or similar parts between the various embodiments in this application can refer to each other. In the various embodiments in this application, and the various implementation methods / implementation methods / implementation methods in each embodiment, if there is no special explanation and logical conflict, the terms and / or descriptions between different embodiments and the various implementation methods / implementation methods / implementation methods in each embodiment are consistent and can be referenced to each other. The technical features in different embodiments and the various implementation methods / implementation methods / implementation methods in each embodiment can be combined to form new embodiments, implementation methods, implementation methods, or implementation methods according to their inherent logical relationships. The above-described implementation methods of this application do not constitute a limitation on the scope of protection of this application.

[0235] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims. In short, the above is only a preferred embodiment of the technical solution of the present application, and is not used to limit the protection scope of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A level setting method, characterized in that: Applied to an electronic device having or connected to a keyboard, the keyboard comprising a plurality of keys, the method comprising: When the keyboard is in a closed state, the electronic device configures the levels of all output pins corresponding to the keys in the keyboard to be a first level; wherein the closed state indicates that the keyboard is not used as an input device; When the keyboard is in an on state, the electronic device configures the levels of all output pins corresponding to the keys in the keyboard to be a target level; the target level includes a second level or a third level, the target level is higher than the first level; the second level is lower than the third level, and the second level and the third level are used for the keyboard to generate an interrupt in response to a triggering operation of the keys in the keyboard; Wherein, the levels of all input pins corresponding to the keys in the keyboard are the first level.

2. The method according to claim 1, characterized in that The open state includes an unfolded static state and a scanning state, wherein the unfolded static state indicates that the keyboard can be used as an input device but has not received a trigger operation for a key in the keyboard; the scanning state indicates that the keyboard is used as an input device; When the keyboard is in the on state, the electronic device configures the levels of all output pins corresponding to the keys in the keyboard to be target levels, including: When the keyboard is in an unfolded static state, the electronic device configures the levels of all the output pins to be the second level; When the keyboard is in a scanning state, the electronic device configures the levels of all the output pins to be the third level.

3. The method according to claim 1 or 2, characterized in that: The open state includes an unfolded static state and a scanning state, and the method further includes: When the keyboard is in an unfolded and stationary state, the electronic device receives a trigger operation for a key in the keyboard; In response to the trigger operation, the electronic device configures the levels of all output pins corresponding to the keys in the keyboard to the third level; wherein the third level corresponds to the scanning state; The electronic device scans the keys on the keyboard to determine the target keys.

4. The method according to claim 3, characterized in that After determining the target key, the method further includes: In the case where the trigger operation for the key in the keyboard is not received, the electronic device stops scanning and configures the levels of all the output pins to be the second level; wherein the second level corresponds to the expanded static state.

5. The method according to any one of claims 2 to 4, characterized in that: When the keyboard is in the scanning state, the method further includes: In response to a first operation of the electronic device and / or the keyboard, the electronic device configures the levels of all the output pins to the first level; wherein the first level corresponds to the off state; and the first operation can trigger the use state of the keyboard to switch from the scanning state to the off state.

6. The method according to claim 2 or 4, characterized in that: When the keyboard is in an unfolded static state, the method further includes: In response to a second operation of the electronic device and / or the keyboard, the electronic device configures the levels of all the output pins to the first level; wherein the first level corresponds to the closed state; and the second operation can trigger the use state of the keyboard to switch from the expanded static state to the closed state.

7. The method according to claim 1, characterized in that When the keyboard is in a closed state, the method further includes: In response to a third operation of the electronic device and / or the keyboard, the electronic device configures the levels of all the output pins to the second level; wherein the second level corresponds to the expanded and static state of the keyboard, and the third operation can trigger the use state of the keyboard to switch from the closed state to the expanded and static state.

8. The method according to any one of claims 1 to 7, characterized in that The first level is 0V, the second level is 1.8V, and the third level is 3.3V.

9. An electronic device, characterized in that: include: The electronic device comprises a keyboard, a display screen, a memory and one or more processors; the keyboard, the display screen, the memory and the processor are coupled; The keyboard is used to receive a trigger operation for a key in the keyboard, the display screen is used to display an image generated by the processor, and the memory is used to store computer program code, wherein the computer program code includes computer instructions; when the processor executes the computer instructions, the electronic device executes the level setting method as described in any one of claims 1 to 8.

10. An electronic device, characterized in that: include: The electronic device is connected to an external keyboard, and the keyboard is used to receive a trigger operation for a key in the keyboard. The electronic device includes a display screen, a memory and one or more processors; the display screen, the memory and the processor are coupled; the display screen is used to display an image generated by the processor, and the memory is used to store computer program code, and the computer program code includes computer instructions; when the processor executes the computer instructions, the electronic device executes the level setting method as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The method comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the level setting method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Level setting method and electronic device

    EP4671932A1

  • Level setting method and electronic device

    WO2025007583A1