Keyboard, scanning method and electronic equipment

By introducing ground wires in the keyboard and setting up the input status of the circuit route to high level, the problem of limited key expansion of the CPU portal resource limits is solved. Ensure the availability and recognition accuracy of the keys.

CN119341576APending Publication Date: 2025-01-21FUJIAN LANDI COMMERCIAL EQUIPMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411359171.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

In the prior art, the keyboard wants to increase the number of keys, but due to the limited port resources of the CPU, the expansion of the keys is greatly limited.

Method used

By introducing a ground wire into the keyboard, the keys are extended by drawing out one more ground wire, and the input state of the column circuit line is defaulted to high level to realize the status recognition of the extended keys.

Benefits of technology

Without increasing port resources, the number of keys is extended, and the availability of the extended buttons is ensured, while avoiding the interference of the expansion button to the matrix key scanning result.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119341576A_ABST
    Figure CN119341576A_ABST
Patent Text Reader

Abstract

The invention discloses a keyboard, a scanning method and electronic equipment. The keyboard comprises a row circuit line, a column circuit line, a grounding line, matrix keys and extension keys, each row of circuit lines are respectively connected with all columns of circuit lines through the matrix keys; and a grounding wire is connected with all columns of circuit lines through the expansion keys respectively. The ground wire is equivalent to a low-level signal, and the input state of the column circuit line which can be conducted with the ground wire is changed from a default high level to a low level at the moment, so that the state recognition of the expanded keys is realized, row circuit lines do not need to be increased, namely the number of the keys which can be read does not need to be increased by increasing port line resources, and the recognition efficiency is improved. According to the method and the device, the usability of the extended key is ensured, the corresponding scanning method is provided, the interference of the extended key on the scanning result of the matrix key is avoided in a manner of separately scanning the extended key and the matrix key, and thus the successful recognition of the key pressing process can be ensured while the extended key is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of key design, and in particular to a keyboard, a scanning method and an electronic device. Background Art

[0002] In the related art, if the number of keys on the keyboard is to be increased, the corresponding port line resources (interfaces and lines) need to be increased to read the key status. However, the port line resources of the CPU are limited, which greatly restricts the expansion of the keys. Summary of the invention

[0003] The technical problem to be solved by the present invention is to provide a keyboard, a scanning method and an electronic device, which can expand the number of keys without increasing the required port line resources.

[0004] In order to solve the above technical problems, a technical solution adopted by the present invention is:

[0005] A keyboard comprises row circuit lines, column circuit lines, ground lines, matrix keys and extended keys;

[0006] Each of the row circuit lines is respectively connected to all the column circuit lines through the matrix keys;

[0007] The ground line is connected to all the column circuit lines respectively through the extended key.

[0008] In order to solve the above technical problems, another technical solution adopted by the present invention is:

[0009] A scanning method is applied to an electronic device, wherein the electronic device comprises a keyboard according to claim 1, and the method comprises:

[0010] Performing a first preprocessing on the row circuit lines and the column circuit lines;

[0011] When a key trigger signal is obtained, the column circuit line is traversed and scanned to determine whether a first preset condition is triggered, and if so, an extended keyboard trigger signal is obtained;

[0012] Otherwise, after performing a second preprocessing on the row circuit line, the state of the row circuit line is traversed and changed and the column circuit line is scanned to determine whether a second preset condition is triggered, and if so, a matrix keyboard trigger signal is obtained.

[0013] In order to solve the above technical problems, another technical solution adopted by the present invention is:

[0014] An electronic device comprises a memory, a processor and a computer program stored in the memory and running on the processor, wherein the processor implements each step of the above-mentioned scanning method when executing the computer program.

[0015] The beneficial effects of the present invention are as follows: the number of keys can be expanded by leading out an extended key by leading out an additional ground line, and during the scanning process, the input state of the column circuit line is defaulted to a high level. Since the extended key is connected to the column circuit line and the ground line, when the extended key is pressed, the column circuit line is connected to the ground line, and the ground line is equivalent to a low-level signal. At this time, the input state of the column circuit line that can be connected to the ground line will change from the default high level to a low level, thereby realizing the state recognition of the extended key, without increasing the row circuit line, that is, without increasing the port line resources to increase the number of keys that can be read, ensuring the usability of the extended key, and providing a corresponding scanning method. By scanning the extended key and the matrix key separately, the interference of the extended key on the matrix key scanning result is avoided, thereby ensuring the successful recognition of the key pressing process while realizing the extended key. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is a structural diagram of a matrix keyboard in the related art;

[0017] Figure 2 A structural diagram of a matrix keyboard provided by an embodiment of the present invention;

[0018] Figure 3 A flowchart of a scanning method provided by an embodiment of the present invention;

[0019] Figure 4 A flowchart of the extended steps of a scanning method provided by an embodiment of the present invention;

[0020] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0021] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0022] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0023] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0024] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0025] In the related art, if the number of keys on the keyboard needs to be increased, it is usually necessary to increase the port line resources in the CPU. However, the port line resources are limited, and other functions also need to be used, so too many port line resources cannot be invested in the keys.

[0026] For example, see Figure 1 For an ordinary M*N matrix keyboard (assuming M is rows and N is columns), M+N port line resources are required to implement M*N key functions. If the number of M and N is to be increased, the corresponding number of port line resources needs to be expanded.

[0027] In order to solve the above problems, the present application provides a keyboard, a scanning method and an electronic device. The following first specifically introduces a keyboard of the present application.

[0028] Please refer to Figure 2 The present invention provides a keyboard, including row circuit lines, column circuit lines, ground lines, matrix keys and extended keys; the key pressing status can be confirmed by the following scanning method;

[0029] Each row circuit line is connected to all column circuit lines respectively through matrix keys;

[0030] The ground wire is connected to all column circuit wires through the expansion key;

[0031] A keyboard of the present invention realizes key expansion through a ground wire, and the ground wire does not occupy port line resources, so that a maximum of N key functions can be additionally expanded without changing the port line resources;

[0032] In one embodiment of the present application, referring to Figure 2, including two column circuit lines, two row circuit lines and one ground line; the two column circuit lines are Column_1 and Column_2; the two row circuit lines are Row_1 and Row_2; the one ground line is G; the matrix keys are Key_1 connecting Column_1 and Row_1, Key_2 connecting Column_2 and Row_1, Key_3 connecting Column_1 and Row_2, and Key_4 connecting Column_2 and Row_2; the extended keys are Key_5 connecting Column_1 and G, and Key_6 connecting Column_2 and G Key_6; when the matrix key is pressed, the corresponding row circuit line will be connected to the column circuit line, and when the extension key is pressed, the corresponding ground line will be connected to the column circuit line, thereby transmitting the corresponding signal; wherein, the number of column circuit lines and row circuit lines can be configured according to the port line resources and the required number of keys, for example, if one row circuit line is added, there are 6 matrix keys and 2 extension keys; if one column circuit line is added, there are 6 matrix keys and 3 extension keys; if there are 3 row circuit lines, 3 column circuit lines and one ground line, there are 9 matrix keys and 3 extension keys; the number of other row circuit lines and column circuit lines can be changed by analogy, which will not be repeated here;

[0033] According to Figure 2 The solution in the figure can expand up to 2 additional keys, namely Key_5 and Key_6 in the figure; a keyboard in this embodiment can be scanned by one of the following scanning methods.

[0034] A scanning method in the present application is introduced below, and the scanning method in the present application can be used for a keyboard in the present application.

[0035] Please refer to Figure 3 The scanning method of the present invention is described in detail below, including steps S110-S150.

[0036] S110 , performing a first preprocessing on a row circuit line (row) and a column circuit line (column).

[0037] In one embodiment of the present application, the input state of the column circuit line is configured to be high by default, the output signal of the row circuit line is low, and the interrupt mode of the column circuit line is turned on. The interrupt mode is used to indicate that a system interrupt is generated when the input state of the column circuit line changes to a low level. The ground line is used as a row circuit line, and the ground line is fixed to output a low level, so the default state of all row circuit lines is configured to output a low level to adapt to the newly added grounded row circuit line; because the key is located at the junction of the row circuit line and the column circuit line, and the row circuit line and the column circuit line are connected at the same time, when the key is pressed, the row circuit line and the column circuit line will be connected. Because the column circuit line is in a signal receiving mode, the input state is high by default, but changes with external signals. Therefore, after the circuit is connected, the column circuit line receives the low level output by the row circuit line, and the input state changes to a low level, thereby triggering the interrupt mode of the column circuit line to notify the system that a key has been pressed, and the position of the specific pressed key can be determined;

[0038] In this way, the column circuit line is configured to be in the input state, that is, the state of receiving signals, and the default value of the input state is configured to be high level. Correspondingly, the row circuit line is configured to output a low level signal. Because each key in the matrix keyboard is connected to the row circuit line and the column circuit line, and the extended ground line itself can be regarded as an output low level, so it can be regarded as a row circuit line; and the interrupt mode of the column circuit line is turned on. When the input state of the column circuit line changes to a low level, the interrupt mode can be used to promptly feedback to the system that the column circuit line is pulled low. The principle of the column circuit line being pulled low when the key is pressed is: before the key is pressed, the column circuit line port line crossing the key is in the input state high level (input pull-up), and the row circuit line port line is in the output signal low level (output low). When the key is pressed, the corresponding crossed row circuit line is connected to the column circuit line, and the low level of the row circuit line output signal will pull the column circuit line port line input state low. Input and output are the functional modes of the port line. Input means that the port line is in the signal receiving state, and output means that the port line is in the signal sending state. Pull-up and pull-down, high and low both indicate the level state of the port line. Pull-up and high can be understood as high level, and pull-down and low can be understood as low level. Here, input pull-up means that the column circuit line port line is in the signal receiving state, and when there is no external signal or the external signal is interrupted, it is in or restored to the pull-up state by default. When there is an external signal, the input state is determined by the external signal. Output low means sending a low level signal.

[0039] S120, when a key trigger signal is obtained, traverse the scan column circuit line to determine whether the first preset condition is triggered, if so, execute S130; otherwise, execute S140.

[0040] In one embodiment of the present application, obtaining a key trigger signal includes: S121, determining whether a system interrupt is generated, and if so, obtaining a key trigger signal; and turning off the interrupt mode.

[0041] In this way, after the system interrupt is generated and has successfully instructed the system to start processing data, the interrupt mode of the column circuit line is turned off to avoid triggering the system interrupt and affecting the processing process when the system has begun to confirm the specific key that has been pressed; that is, the interrupt mode is to notify the system that a key has been pressed, and it can start to determine the specific key that has been pressed. After the system interrupt has been generated, the interrupt mode of the column circuit line is turned off. After receiving the first interrupt mode signal, the system will start processing. Therefore, if the interrupt mode of the column circuit line is turned on subsequently, it will no longer be able to remind the system to start processing the key. Turning it off can reduce unnecessary signal sending.

[0042] In one embodiment of the present application, traversing the scan column circuit lines to determine whether the first preset condition is triggered includes: S122, setting the output signals of all row circuit lines to a high level, and determining in turn whether the input state of the column circuit lines is a low level, and if so, triggering the first preset condition.

[0043] In this way, scanning of the keys in the extended area is achieved; because after the output signal of the row circuit line is set to a high level, if the key connecting the row circuit line and the column circuit line is pressed, the input state of the corresponding column circuit line will be consistent with the connected row circuit line and also be a high level. If the column circuit line is not pressed, it will maintain its default input state of a high level; and because the ground line cannot be configured to a high level, setting the row circuit line to a high level at this time can distinguish between the extended keyboard and the matrix keyboard. Therefore, if the key connecting the ground line and the column circuit line is pressed, the input state of the corresponding column circuit line can only be a low level. Therefore, if the input state of a column circuit line is a low level at this time, it means that the key connecting the column circuit line and the ground line is pressed. In this way, confirmation of the pressing of the keys in the extended area can be achieved.

[0044] S130: Acquire an extended keyboard trigger signal.

[0045] In one embodiment of the present application, in step S120, the column circuit line that triggers the first preset condition has been determined, and the key at the connection between the column circuit line that triggers the first preset condition and the ground line is marked as a trigger key, and the number or position of the trigger key is used as the extended keyboard trigger signal, so that it can be confirmed which specific position of the key is pressed, so as to perform the corresponding operation according to the preset association between the key and the operation; please refer to Figure 3 , where Key_5 and Key_6 are the extended keyboard.

[0046] In an optional implementation, after executing step S130, step S122 is executed in a loop until step S140 is executed; because the row circuit line corresponding to the extended key in the extended keyboard is grounded, when the extended key is pressed, the column circuit line corresponding to the extended key will also be at a low level; at this time, if the matrix key located on the same column circuit line as the extended key in the matrix keyboard is pressed, it cannot be accurately reflected in the state change of the column circuit line; that is, the state of the extended key will affect the state judgment of the matrix key, so step S122 is continuously executed when it is confirmed that the extended key is pressed, and the judgment of the pressing of the matrix key is executed after no extended key is pressed, so as to avoid misjudgment of the pressing of the matrix key; and in a separate matrix keyboard or extended keyboard, multiple keys can be pressed at the same time without affecting the judgment result;

[0047] S140, after performing the second preprocessing on the row circuit line, traverse and change the state of the row circuit line and scan the column circuit line to determine whether the second preset condition is triggered, if so, execute S150; otherwise, execute S170. If the first preset condition is not triggered, it means that the state change of the row circuit line does not cause the state change of the column circuit line, and the row circuit line and its corresponding column circuit line are not connected;

[0048] In one embodiment of the present application, performing a second preprocessing on the row circuit line includes: configuring the output signals of all the row circuit lines to be high level; because the ground line can only output a low level, it is necessary to perform a separate judgment on the keys in the extended area, and for the keys in the non-extended area, since there are multiple row circuit lines, if they are set to a low level at the same time, it is impossible to uniquely determine which row circuit line is connected to which column circuit line; therefore, the output signals of all the row circuit lines are configured to be high level, and then traversed and changed to a low level, so that only one row circuit line has a low level output signal each time, thereby being able to confirm whether the key connected to the row circuit line is pressed according to whether the input state of the column circuit line becomes a low level, thereby achieving the determination of the position of the pressed key;

[0049] Traverse and change the state of the row circuit line and scan the column circuit line to determine whether the second preset condition is triggered. If so, execute S150 including: traverse the row circuit line, when traversing to the target row circuit line, configure the output signal of the target row circuit line to a low level, and determine whether there is a target column circuit line with an input state of a low level; if so, execute S150, otherwise, continue traversing directly.

[0050] In this way, the output signals of all row circuit lines are first configured to a high level, and the row circuit lines are traversed, and the target row circuit line that is traversed is switched to a low level. Since the default input state of the column circuit line is a high level, if the column circuit line connected to the target row circuit line is conducted to the row circuit line through a key, it will become a low level, indicating that the corresponding key is pressed. If the column circuit line does not become a low level, it means that none of the keys on the column circuit line corresponding to the target row circuit line have been pressed. In this way, the pressing state judgment of the keyboard that is not connected to the ground wire is realized.

[0051] In one embodiment of the present application, the row circuit line is traversed in a random manner in step S140. In this way, the overall response speed of the keys is improved, because the fixed order will cause the keys at the back of the order to have a long response time, and the random order gives each key an equal chance of detection, thereby improving the overall response speed. It can also reduce electromagnetic interference. Key scanning involves rapid switching of the CPU port line state and high and low levels. A fixed scanning order may generate electromagnetic radiation of a specific frequency, thereby affecting the scanning results of the front and rear scanning lines. Random scanning can reduce this regular switching, thereby reducing electromagnetic interference problems. It can also improve security. Random scanning can reduce the possibility of eavesdroppers predicting the key input sequence.

[0052] S150, obtaining a matrix keyboard trigger signal.

[0053] In one embodiment of the present application, the state of the matrix key that conducts the target row circuit line and the target column circuit line is marked as triggered, and then the traversal continues; in step S140, the column circuit line that triggers the second preset condition can be obtained, and it can be known that the key connecting the column circuit line and the traversed target row circuit line corresponding to the intersection of the two is the pressed key, and the key can be marked as the trigger key, and the number or position of the trigger key is used as the matrix keyboard trigger signal; refer to Figure 3 , wherein the keys Key_1, Key_2, Key_3 and Key_4 are the matrix keyboard. The key state determination of the matrix keyboard in steps S140 and S150 in the present application can also be used in the existing matrix keyboard;

[0054] Please refer to Figure 4 In one embodiment of the present application, step S160 is also included, determining whether the traversal in S140 is completed, if so, executing S170, otherwise continuing the traversal.

[0055] S170, after configuring the output signals of all row circuit lines to a low level and turning on the interrupt mode of the column circuit line, return to execute S120. In this way, after completing a round of key status judgment, the interrupt mode is turned on again, and a system interrupt is generated when the column circuit line is pulled low, and the event of the column circuit line being pulled low can be sensed immediately, that is, the signal that a new key is pressed can be sensed. Turning off the interrupt during the key scanning process tells the system not to notify the column circuit line that the port line is pulled low again, and it is already being processed. After the key scan is completed, all column circuit line port line interrupts are turned on again, so that when the next key is pressed, the event of the column circuit line being pulled low can be sensed in time, and then the key scan can be performed.

[0056] It can be seen that in this embodiment, the pressing status of the extended key is judged first. After confirming that the extended key judgment is completed and no extended key is pressed, the pressing status of the matrix key is judged. In this way, even in the scenario where multiple keys are pressed in the extended keyboard or matrix keyboard, the pressing status of the keys can be accurately obtained, avoiding the interference of the extended ground wire on the reading result. Moreover, for the keys in the extended keyboard or matrix keyboard, the situation where multiple keys are pressed at the same time can be successfully identified in their respective areas.

[0057] The above scanning method is further described below through a specific implementation method. Figure 2 .

[0058] 1. Set all Column port lines (i.e. column circuit lines) to input pull-up and configure the Column port lines to interrupt mode.

[0059] 2. Configure all Row port lines (i.e. row circuit lines) to output low mode;

[0060] 3. If a user presses a key, the Row port line and the Column port line will be connected, triggering the interrupt mode of the Column port line, starting to scan the keyboard and temporarily turning off the interrupt mode of all Column port lines.

[0061] 4. Prioritize whether the extended key is pressed. The judgment method is as follows:

[0062] 4.1、Set all Row ports to output high mode, and determine whether the Column ports become input pull-down mode in turn. If so, it means that the expansion key on the corresponding Column port is pressed, that is, the ground wire and the Column port are connected;

[0063] 4.2. If the extended key judgment is completed, that is, there is no Column port line input pull-down mode, all Row port lines are restored to output low mode;

[0064] 4.3. After the extension key is pressed, the Column port line and the ground line are turned on, which will affect the judgment of the pressing results of other matrix keys on the corresponding Column port line. Therefore, when the extension key is pressed and not released, the matrix keyboard cannot be scanned, and only the extension key scan is performed (that is, steps 4.1-4.2 are executed repeatedly) until the extension key is released.

[0065] 5. Continue to scan the matrix keys; configure all Row port lines to output high mode, and randomly set a Row port line to output low mode, and determine whether there is a Column port line in the input pull-down mode. If so, it means that the matrix keyboard at the intersection of the random Row port line and the Column port line in the input pull-down mode is pressed (Column is low, which is different from the default state, indicating that the signal of the corresponding Row port line is received); until all Row port lines have completed a traversal.

[0066] 6. After the scan is completed, configure all Row port lines to output low mode and re-enable the interrupt mode of the Column port line.

[0067] Please refer to Figure 5 The present invention also provides an electronic device 300, including a memory 301 and a processor 302, and a computer program stored in the memory 301 and running on the processor 302. When the processor 302 executes the computer program, each step in the multi-channel audio output control method as described above is implemented.

[0068] The beneficial effects of the electronic device of the present invention are the same as those of the above method and will not be described in detail here.

[0069] In summary, the keyboard, scanning method and electronic device provided by the present invention use the grounding wire as an extended row circuit line by adding a grounding wire. Since the output signal of the grounding wire is low level by default, the default input state of the column circuit line is configured to be high level, and the output signal of the row circuit line is configured to be low level. The interrupt mode of the column circuit line is also configured to be turned on. If a key is pressed to connect the column circuit line and the grounding wire or the column circuit line and the row circuit line, the input state of the column circuit line will change from the default high level to the low level, so that the system can be notified in time that a key has been pressed; enter the confirmation stage of the specific key state. In the confirmation process of the specific key, by first judging the extended key and then judging the key in the original matrix keyboard, the problem that the input state of the column circuit line will only be low level after the extended key is pressed, which affects the judgment accuracy, is avoided; and in the traversal process of the row circuit line, a random traversal method is adopted to improve the response speed and security.

[0070] The above are only embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the specification and drawings of the present invention, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A keyboard, characterized in that: It includes row circuit lines, column circuit lines, ground lines, matrix buttons and extended buttons; Each of the row circuit lines is respectively connected to all the column circuit lines through the matrix keys; The ground line is connected to all the column circuit lines respectively through the extended key.

2. A scanning method, characterized in that: Applied to an electronic device, the electronic device includes a keyboard as claimed in claim 1, and the method includes: Performing a first preprocessing on the row circuit lines and the column circuit lines; When a key trigger signal is obtained, the column circuit line is traversed and scanned to determine whether a first preset condition is triggered, and if so, an extended keyboard trigger signal is obtained; Otherwise, after performing a second preprocessing on the row circuit line, the state of the row circuit line is traversed and changed and the column circuit line is scanned to determine whether a second preset condition is triggered, and if so, a matrix keyboard trigger signal is obtained.

3. A scanning method according to claim 2, characterized in that: The first preprocessing of the row circuit lines and the column circuit lines comprises: The input state of the column circuit line is configured to be high level by default, the output signal of the row circuit line is low level, and the interrupt mode of the column circuit line is turned on. The interrupt mode is used to indicate that a system interrupt is generated when the input state of the column circuit line becomes low level.

4. A scanning method according to claim 3, characterized in that: The acquiring of the key trigger signal comprises: Determine whether the system interruption occurs, and if so, obtain a key trigger signal; Turn off the interrupt mode.

5. A scanning method according to claim 4, characterized in that: The step of traversing and scanning the column circuit lines to determine whether a first preset condition is triggered includes: The output signals of all row circuit lines are set to a high level, and whether the input state of the column circuit lines is a low level is determined in turn. If so, the first preset condition is triggered.

6. A scanning method according to claim 2, characterized in that: The performing second preprocessing on the row circuit lines and the column circuit lines comprises: configuring the output signals of all the row circuit lines to be high level; The traversing and changing the state of the row circuit line and scanning the column circuit line to determine whether a second preset condition is triggered, and if so, obtaining a matrix keyboard trigger signal comprises: Traversing the row circuit lines, when traversing to a target row circuit line, configuring the output signal of the target row circuit line to be a low level, and determining whether there is a target column circuit line with an input state of a low level; If so, the state of the matrix key that conducts the target row circuit line and the target column circuit line is marked as triggered, and then the traversal continues; otherwise, the traversal continues directly.

7. A scanning method according to claim 6, characterized in that: Also includes: After the traversal is completed, the output signals of all row circuit lines are configured to be low level, and after the interrupt mode of the column circuit line is turned on, the step of traversing and scanning the column circuit line when the key trigger signal is obtained is returned to be executed.

8. A scanning method according to claim 6, characterized in that: The traversing the row circuit line comprises: The row circuit lines are traversed in a random manner.

9. A scanning method according to claim 7, characterized in that: The traversing and changing the state of the row circuit line and scanning the column circuit line to determine whether the first preset condition is triggered further comprises: If the first preset condition is not triggered, the process jumps to executing the step of configuring the output signals of all row circuit lines to be low level.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, each step in a scanning method according to any one of claims 2 to 9 is implemented.