CN111857642A - Control method of electronic device, and readable storage medium - Google Patents

Control method of electronic device, and readable storage medium Download PDF

Info

Publication number
CN111857642A
CN111857642A CN202010703607.1A CN202010703607A CN111857642A CN 111857642 A CN111857642 A CN 111857642A CN 202010703607 A CN202010703607 A CN 202010703607A CN 111857642 A CN111857642 A CN 111857642A
Authority
CN
China
Prior art keywords
microphone
waveform
target
key
electronic device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010703607.1A
Other languages
Chinese (zh)
Inventor
冀会卿
崔安阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Goertek Techology Co Ltd
Original Assignee
Goertek Techology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Goertek Techology Co Ltd filed Critical Goertek Techology Co Ltd
Priority to CN202010703607.1A priority Critical patent/CN111857642A/en
Publication of CN111857642A publication Critical patent/CN111857642A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output
    • G06F3/162Interface to dedicated audio devices, e.g. audio drivers, interface to CODECs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/16Constructional details or arrangements
    • G06F1/1613Constructional details or arrangements for portable computers
    • G06F1/1633Constructional details or arrangements of portable computers not specific to the type of enclosures covered by groups G06F1/1615 - G06F1/1626
    • G06F1/1684Constructional details or arrangements related to integrated I/O peripherals not covered by groups G06F1/1635 - G06F1/1675
    • G06F1/1688Constructional details or arrangements related to integrated I/O peripherals not covered by groups G06F1/1635 - G06F1/1675 the I/O peripheral being integrated loudspeakers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R9/00Transducers of moving-coil, moving-strip, or moving-wire type
    • H04R9/08Microphones

Abstract

The invention discloses a control method of electronic equipment, which comprises the following steps: acquiring an acoustic signal acquired by a microphone, and converting the acoustic signal into an electric signal; acquiring a control instruction triggered by the pressed key according to the electric signal; and controlling the electronic equipment to execute the control instruction. The invention also discloses an electronic device and a computer readable storage medium, which achieve the effect of improving the reliability of the electronic device.

Description

Control method of electronic device, and readable storage medium
Technical Field
The present invention relates to the field of electronic devices, and in particular, to a control method for an electronic device, and a computer-readable storage medium.
Background
In the pressing process of the existing key of the electronic equipment, the key body is usually acted on the contact piece, so that the contact piece is elastically deformed to be in contact with a circuit board or other electronic components, the circuit board or other electronic components generate electric signals, and then the function of triggering the key is determined according to the electric signals. After the contact is used for a long time or many times, the contact is easy to wear or damage, so that the key cannot generate an accurate electric signal after being pressed, the pressed key cannot be identified, the electronic equipment cannot acquire a correct control instruction, and the reliability of the electronic equipment is poor.
Disclosure of Invention
The present invention is directed to a method for controlling an electronic device, and a computer-readable storage medium, which are capable of improving the reliability of the electronic device.
In order to achieve the above object, the present invention provides a method for controlling an electronic device, the electronic device including: the control method of the electronic equipment comprises a shell, a circuit board and at least one key, wherein the circuit board is positioned in the shell, the key is positioned on the outer surface of the shell, at least one microphone is arranged on the circuit board, and the control method of the electronic equipment comprises the following steps:
acquiring an acoustic signal acquired by a microphone, and converting the acoustic signal into an electric signal;
acquiring a control instruction triggered by the pressed key according to the electric signal;
and controlling the electronic equipment to execute the control instruction.
Optionally, the electronic device includes at least two keys and at least two microphones, and the step of obtaining a control instruction triggered by the pressed key according to the electrical signal includes:
acquiring the waveform of the electric signal corresponding to each microphone;
generating a waveform group according to the arrangement sequence of each microphone and each waveform;
And determining the control instruction according to the preset waveform group matched with the waveform group.
Optionally, the step of determining the control instruction according to the preset waveform group matched with the waveform group includes:
determining the pressed key according to the preset waveform group;
and acquiring an instruction corresponding to the pressed key as the control instruction.
Optionally, the electronic device includes at least two keys and at least two microphones, and the step of obtaining a control instruction triggered by the pressed key according to the electrical signal includes:
acquiring the waveform of the electric signal corresponding to each microphone;
determining a peak value of each of the waveforms;
and acquiring a control instruction corresponding to the pressed key according to the at least two wave peak values.
Optionally, each key corresponds to one microphone, each microphone coincides with a projection of the corresponding key in the vertical direction, and the step of obtaining the control instruction corresponding to the pressed key according to at least two wave peak values includes:
determining a maximum peak value among at least two of the peak values;
taking the waveform corresponding to the maximum wave peak value as a target waveform, and determining a microphone corresponding to the target waveform as a target microphone;
And acquiring a command of a key corresponding to the target microphone as the control command.
Optionally, each key corresponds to one microphone, each microphone coincides with a projection of the corresponding key in the vertical direction, and the step of obtaining the control instruction corresponding to the pressed key according to at least two wave peak values includes:
determining the deviation amount of each wave peak value and a preset wave peak value corresponding to a preset trigger waveform;
taking the waveform corresponding to the wave peak value with the minimum deviation amount as a target waveform, and determining a microphone corresponding to the target waveform as a target microphone;
and acquiring a command of a key corresponding to the target microphone as the control command.
Optionally, at least two of the microphones are arranged at intervals, one key is arranged between any two adjacent microphones, and the step of obtaining the control instruction corresponding to the pressed key according to at least two of the peak values includes:
determining two wave peak values larger than a first preset threshold value from at least two wave peak values as target wave peak values, and taking two waveforms corresponding to the target wave peak values as target waveforms, wherein the target wave peak values comprise a first target wave peak value and a second target wave peak value, and the target waveforms comprise a first target waveform and a second target waveform;
Determining that the microphone corresponding to the first target waveform is a first target microphone, and determining that the microphone corresponding to the second target waveform is a second target microphone;
and determining the instructions of the keys corresponding to the first target microphone and the second target microphone as the control instructions.
Optionally, before the step of acquiring the triggered control instruction according to the electrical signal, the method further includes:
acquiring a voltage value corresponding to the electric signal;
and when the voltage value is greater than or equal to a second preset threshold value, executing the step of acquiring a triggered control instruction according to the electric signal.
In addition, to achieve the above object, the present invention also provides an electronic device, including: the control program of the electronic equipment realizes the control method of the electronic equipment when being executed by the processor.
In addition, in order to achieve the above object, the present invention further provides an electronic device, which further includes a housing, a circuit board and at least one key, wherein the circuit board is located in the housing, the key is located on an outer surface of the housing, the processor, the memory and at least one microphone are disposed on the circuit board, and the microphone is electrically connected to the processor.
Optionally, a groove is concavely formed in the position where the key is arranged on the outer surface of the shell, and the key is arranged inside the groove.
Optionally, a spacer covering the circuit board is disposed between the housing and the circuit board, a through hole is disposed on the housing, and the key foot of the key passes through the through hole and is connected to the spacer.
Optionally, the position of the projection of the key on the circuit board coincides with the position of the microphone.
Optionally, the number of the microphones and the number of the keys are at least two, the keys are arranged at intervals, and the microphones are arranged between any two of the keys.
Further, to achieve the above object, the present invention also proposes a computer-readable storage medium having stored thereon a control program of an electronic device, which when executed by a processor, implements the steps of the control method of the electronic device as described above.
According to the control method of the electronic equipment, the electronic equipment and the computer readable storage medium provided by the embodiment of the invention, firstly, the sound signal collected by the microphone is obtained, the sound signal is converted into the electric signal, then, the control instruction triggered by the pressed key is obtained according to the electric signal, wherein the control instruction is triggered by the key, and finally, the control instruction is executed. Gather the acoustic signal through the microphone, then judge the button that is triggered according to the acoustic signal who gathers, owing to do not need the button to act on the contact, the circuit board just can obtain the signal that the button was triggered, consequently avoided because the contact wearing and tearing can't produce accurate signal of telecommunication, lead to the condition of unable discernment button to the discernment rate of accuracy of button has been improved.
Drawings
Fig. 1 is a schematic diagram of a hardware architecture of an electronic device according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a first embodiment of a control method of an electronic device according to the present invention;
fig. 3 is a schematic structural diagram of a part of an electronic device designed according to an embodiment of the present invention.
The reference numbers illustrate:
reference numerals Name (R) Reference numerals Name (R)
10 Shell body 30 Circuit board
11 Push-button 31 Microphone (CN)
20 Spacer
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the pressing process of the existing key, the key body is usually acted on the contact piece, so that the contact piece is elastically deformed to be in contact with a circuit board or other electronic parts, the circuit board or other electronic parts generate electric signals, and then the function of triggering the key is determined according to the electric signals. After the contact piece is used for a long time or for multiple times, the contact piece is easy to wear or damage, so that the key cannot generate an accurate electric signal after being triggered, and the identification accuracy of the key is low.
To solve the foregoing drawbacks, an embodiment of the present invention provides a method for controlling an electronic device, and a computer-readable storage medium, where the electronic device includes: the control method of the electronic equipment mainly comprises the following steps:
acquiring an acoustic signal acquired by a microphone, and converting the acoustic signal into an electric signal;
acquiring a control instruction triggered by the pressed key according to the electric signal;
and controlling the electronic equipment to execute the control instruction.
According to the scheme, the microphone is used for collecting sound signals, the triggered key is judged according to the collected sound signals, and then a control instruction corresponding to the triggered key is obtained and executed; because the key is not required to act on the contact, the circuit board can obtain the signal of triggering the key, thereby avoiding the condition that the key cannot be identified due to the fact that the contact is worn and cannot generate an accurate electric signal, and further improving the identification accuracy of the key.
As shown in fig. 1, fig. 1 is a schematic diagram of a hardware architecture of an electronic device according to an embodiment of the present invention.
As shown in fig. 1, the electronic device may include: a first processor 1001, e.g. a CPU, a first user interface 1003, a first network interface 1004, a first memory 1005, a first communication bus 1002. Wherein a first communication bus 1002 is used to enable connectivity communication between these components. The first user interface 1003 may comprise a speaker, an input unit such as a microphone, etc., and the optional first user interface 1003 may further comprise a standard wired interface, a wireless interface. The first network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The first memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The first memory 1005 may alternatively be a storage device separate from the first processor 1001.
Those skilled in the art will appreciate that the hardware architecture of the electronic device shown in fig. 1 does not constitute a limitation of the electronic device, and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, the first memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a control program of an electronic device.
In the electronic device shown in fig. 1, the first network interface 1004 is mainly used for connecting to a service host and performing data communication with the service host; the first processor 1001 may be used to first call a control program of the electronic device stored in the memory 1005, and perform the following operations:
acquiring an acoustic signal acquired by a microphone, and converting the acoustic signal into an electric signal;
acquiring a control instruction triggered by the pressed key according to the electric signal;
and controlling the electronic equipment to execute the control instruction.
Further, the first processor 1001 may be configured to call a control program of the electronic device stored in the first memory 1005, and also perform the following operations:
acquiring the waveform of the electric signal corresponding to each microphone;
generating a waveform group according to the arrangement sequence of each microphone and each waveform;
and determining the control instruction according to the preset waveform group matched with the waveform group.
Further, the first processor 1001 may be configured to call a control program of the electronic device stored in the first memory 1005, and also perform the following operations:
determining the pressed key according to the preset waveform group;
and acquiring an instruction corresponding to the pressed key as the control instruction.
Further, the first processor 1001 may be configured to call a control program of the electronic device stored in the first memory 1005, and also perform the following operations:
acquiring the waveform of the electric signal corresponding to each microphone;
determining a peak value of each of the waveforms;
and acquiring a control instruction corresponding to the pressed key according to the at least two wave peak values.
Further, the first processor 1001 may be configured to call a control program of the electronic device stored in the first memory 1005, and also perform the following operations:
determining a maximum peak value among at least two of the peak values;
taking the waveform corresponding to the maximum wave peak value as a target waveform, and determining a microphone corresponding to the target waveform as a target microphone;
and acquiring a command of a key corresponding to the target microphone as the control command.
Further, the first processor 1001 may be configured to call a control program of the electronic device stored in the first memory 1005, and also perform the following operations:
determining the deviation amount of each wave peak value and a preset wave peak value corresponding to a preset trigger waveform;
taking the waveform corresponding to the wave peak value with the minimum deviation amount as a target waveform, and determining a microphone corresponding to the target waveform as a target microphone;
And acquiring a command of a key corresponding to the target microphone as the control command.
Further, the first processor 1001 may be configured to call a control program of the electronic device stored in the first memory 1005, and also perform the following operations:
determining two wave peak values larger than a first preset threshold value from at least two wave peak values as target wave peak values, and taking two waveforms corresponding to the target wave peak values as target waveforms, wherein the target wave peak values comprise a first target wave peak value and a second target wave peak value, and the target waveforms comprise a first target waveform and a second target waveform;
determining that the microphone corresponding to the first target waveform is a first target microphone, and determining that the microphone corresponding to the second target waveform is a second target microphone;
and determining the instructions of the keys corresponding to the first target microphone and the second target microphone as the control instructions.
Further, the first processor 1001 may be configured to call a control program of the electronic device stored in the first memory 1005, and also perform the following operations:
acquiring a voltage value corresponding to the electric signal;
and when the voltage value is greater than or equal to a second preset threshold value, executing the step of acquiring a triggered control instruction according to the electric signal.
Referring to fig. 2, fig. 2 is a first embodiment of a control method of an electronic device of the present invention, including the steps of:
step S10, acquiring acoustic signals collected by a microphone, and converting the acoustic signals into electric signals;
step S20, acquiring a control instruction triggered by the pressed key according to the electric signal;
and step S30, controlling the electronic equipment to execute the control instruction.
In this embodiment, the control method of the electronic device is applied to an electronic device including: the circuit board is located in the shell, the key is located on the outer surface of the shell, and at least one microphone is arranged on the circuit board. The sound signal is a sound waveform signal collected by a microphone; the electric signal is obtained by converting an acoustic signal, and specifically, the acoustic waveform signal can be represented by a voltage value set, and the voltage values in the voltage value set have a time sequence, that is, the acoustic waveform signal is represented by the waveform of the electric signal; the control instruction is an operation controlled and executed by the processor; the circuit board is integrated with at least a processor, a memory and a microphone.
The microphone collects sound signals generated when the keys are triggered in real time and sends the collected sound signals to the processor; the processor converts the received acoustic signals into electric signals, identifies and judges all the electric signals according to a preset algorithm so as to determine the electric signals corresponding to the triggered keys, and acquires control instructions stored in the memory according to the electric signals corresponding to the triggered keys; or determining that the triggered key generates an electric signal, then determining a key corresponding to the electric signal, and acquiring a control instruction stored in a memory according to the key; the acquired control instructions are then executed.
In the technical scheme disclosed in the embodiment, a microphone is used for collecting an acoustic signal, then the triggered key is judged according to the collected acoustic signal, and then a control instruction corresponding to the triggered key is obtained and executed; because the key is not required to act on the contact, the circuit board can obtain the signal of triggering the key, thereby avoiding the condition that the key cannot be identified due to the fact that the contact is worn and cannot generate an accurate electric signal, and further improving the identification accuracy of the key.
Optionally, based on the first embodiment, in a second embodiment of the control method of an electronic device of the present invention, the step S20 further includes:
Step S21, acquiring the waveform of the electric signal corresponding to each microphone;
step S22, generating a waveform group according to the arrangement order of each microphone and each waveform;
and step S23, determining the control instruction according to the preset waveform group matched with the waveform group.
In this embodiment, each microphone has an electrical signal corresponding thereto, the preset waveform group is composed of waveforms of the electrical signals corresponding to the acoustic signals collected by each microphone when any key is pressed, and each waveform in the preset waveform group is sorted according to the arrangement order of the microphones, specifically, how many keys are provided to the electronic device, and how many preset waveform groups are stored in the memory; the preset waveform groups and the control instructions have a mapping relation, namely each preset waveform group has the corresponding control instruction; the arrangement sequence of the microphones is a preset arrangement sequence, and the arrangement sequence of the microphones is not limited;
the processor acquires the waveform of the electric signal corresponding to each microphone, acquires the arrangement sequence of each microphone, and then sorts the acquired waveforms according to the acquired arrangement sequence to obtain a waveform group for determining the control instruction.
The processor compares the acquired waveform group with the preset waveform group in the memory one by one to determine the preset waveform group matched with the acquired waveform group, and then acquires a control instruction corresponding to the matched preset waveform group; and when the preset waveform group matched with the waveform group does not exist, judging that all keys are not pressed.
Illustratively, the processor obtains waveform similarity of the waveform group and a preset waveform group one by one, and when the waveform similarity is greater than a first preset similarity, the preset waveform group is determined to be a preset waveform group matched with the waveform group.
For example, when four keys are arranged on the outer surface of the shell of the electronic device, four microphones are correspondingly arranged on the circuit board, and four waveforms exist in the waveform group and the preset waveform group; the waveform group comprises a first waveform, a second waveform, a third waveform and a fourth waveform, and the preset waveform group comprises a first preset waveform, a second preset waveform, a third preset waveform and a fourth preset waveform.
The processor may obtain a first waveform similarity of the first waveform and a first preset waveform; when the first waveform similarity is greater than or equal to a second preset similarity, acquiring second waveform similarity of a second waveform and the second preset waveform; when the second waveform similarity is greater than or equal to a second preset similarity, acquiring a third waveform similarity of a third waveform and a third preset waveform; when the similarity of the third waveform is greater than or equal to the second preset similarity, acquiring the similarity of the fourth waveform and the fourth waveform of the fourth preset waveform; and when the fourth waveform similarity is greater than or equal to the second preset similarity, judging that the current preset waveform group is a preset waveform group matched with the waveform group.
Optionally, the step S23 further includes:
step S231, determining the pressed key according to the preset waveform group;
and step S232, acquiring an instruction corresponding to the pressed key as the control instruction.
In this embodiment, the preset waveform groups and the keys have a mapping relationship, that is, each preset waveform group has a corresponding key; each key has a corresponding instruction.
The processor determines a pressed key according to a preset waveform group matched with the waveform group, then acquires an instruction corresponding to the pressed key, and takes the acquired instruction as a control instruction.
In the technical scheme disclosed in this embodiment, when the control instruction is obtained by comparing the waveform group with the preset waveform group, the process of optimally obtaining the control instruction is achieved by setting the mapping relationship between the preset waveform group and the control instruction, or setting the mapping relationship between the preset waveform group and the key.
Optionally, based on the first embodiment, in a third embodiment of the control method of an electronic device of the present invention, the step S20 further includes:
step S24, acquiring the waveform of the electric signal corresponding to each microphone;
step S25, determining the wave peak value of each waveform;
And step S26, acquiring a control instruction corresponding to the pressed key according to at least two wave peak values.
In this embodiment, the electronic device includes at least two keys and at least two microphones; the peak value is a peak value of a waveform of the electrical signal, and when the waveform of the electrical signal is represented by a voltage value set, the peak value is a maximum voltage value in the voltage value set.
The processor acquires the waveform of the electric signal corresponding to each microphone and then acquires the wave peak value corresponding to each waveform; when the mapping relation between the keys and the control instructions is stored in the memory, determining the pressed keys according to at least two acquired wave peak values, and acquiring the control instructions corresponding to the keys; when the mapping relation between the microphone and the control command is stored in the memory, the corresponding control command can be directly obtained according to at least two wave peak values.
Optionally, when each of the keys corresponds to one of the microphones, and each of the microphones coincides with a projection of its corresponding key in a vertical direction, the step S26 further includes:
step S261, determining a maximum wave peak value in at least two wave peak values;
step S262, taking the waveform corresponding to the maximum wave peak value as a target waveform, and determining that a microphone corresponding to the target waveform is a target microphone;
And step S263, acquiring a command of a key corresponding to the target microphone as the control command.
In this embodiment, a mapping relationship between a microphone and an instruction is stored in the memory, and specifically, the instruction is an instruction that the processor should execute when a key corresponding to the microphone is pressed.
When the number of the wave peak values is at least two, the processor determines the maximum wave peak value in all the wave peak values, then takes the waveform corresponding to the maximum wave peak value as a target waveform, and then takes a microphone corresponding to the target waveform as a target microphone, wherein the target microphone is the microphone generating the target waveform; and then acquiring an instruction corresponding to a target microphone in the memory, and taking the acquired instruction as a control instruction.
Optionally, when each of the keys corresponds to one of the microphones, and each of the microphones coincides with a projection of its corresponding key in a vertical direction, the step S26 further includes:
step S264, determining the deviation amount of each wave peak value and a preset wave peak value corresponding to a preset trigger waveform;
step 265, taking the waveform corresponding to the peak value with the minimum deviation amount as a target waveform, and determining that the microphone corresponding to the target waveform is a target microphone;
And step S266, acquiring the instruction of the key corresponding to the target microphone as the control instruction.
In this embodiment, the deviation amount is a difference between the peak value and a preset peak value, and the difference is a positive or negative value.
The method comprises the steps that a processor obtains a preset crest value corresponding to a preset trigger waveform, then obtains deviation amounts of each crest value and the preset crest value, obtains absolute values of each deviation amount, determines the absolute value of the minimum deviation amount in the absolute values of each deviation amount, then determines the crest value corresponding to the absolute value of the minimum deviation amount, takes a waveform corresponding to the crest value as a target waveform, and then takes a microphone corresponding to the target waveform as a target microphone, wherein the target microphone is the microphone generating the target waveform; and then acquiring an instruction corresponding to a target microphone in the memory, and taking the acquired instruction as a control instruction.
Optionally, when at least two of the microphones are spaced apart and one of the keys is disposed between any two adjacent microphones, the step S26 further includes:
step S267, in at least two wave peak values, determining two wave peak values larger than a first preset threshold value as target wave peak values, and taking two waveforms corresponding to the target wave peak values as target waveforms, wherein the target wave peak values comprise a first target wave peak value and a second target wave peak value, and the target waveforms comprise a first target waveform and a second target waveform;
Step S268, determining that the microphone corresponding to the first target waveform is a first target microphone, and determining that the microphone corresponding to the second target waveform is a second target microphone;
step S269 determines, as the control command, a command of the key corresponding to the first target microphone and the second target microphone.
In this embodiment, the processor compares a first preset threshold with each peak value, then uses two peak values larger than the first preset threshold as a first target peak value and a second target peak value, then respectively determines a first target microphone corresponding to the first target peak value, determines a second target microphone corresponding to the second target peak value, then obtains a first instruction set corresponding to the first target microphone in the memory, and obtains a second instruction set corresponding to the second target microphone in the memory, where the first instruction set includes two instructions corresponding to two keys adjacent to the first target microphone, and the second instruction set includes two instructions corresponding to two keys adjacent to the second target microphone; and determining repeated instructions in the acquired first instruction set and the acquired second instruction set, acquiring the repeated instructions, and taking the acquired instructions as control instructions.
And when the number of the wave peak values larger than the first preset threshold value is not two, the processor judges that all the keys are not pressed.
In the technical scheme disclosed in this embodiment, the process of optimally acquiring the control instruction is achieved by acquiring the wave peak value of the waveform corresponding to the electrical signal and acquiring the control instruction according to the wave peak value.
Optionally, based on the first embodiment, in a second embodiment of the method for controlling an electronic device of the present invention, before the step S10, the method further includes:
step S40, acquiring a voltage value corresponding to the electric signal;
and step S50, when the voltage value is greater than or equal to a second preset threshold value, executing the step of acquiring a triggered control instruction according to the electric signal.
In this embodiment, the processor first obtains a voltage value corresponding to the electrical signal, then compares the voltage value with a second preset threshold, determines that the obtained electrical signal is legal when the voltage value is greater than or equal to the second preset threshold, and then executes the process of obtaining the control instruction; and when the voltage value is smaller than a second preset threshold value, judging that the obtained electric signal is illegal, and judging that all keys are not pressed.
In the technical scheme disclosed in this embodiment, because the acoustic signal acquired by the microphone in real time may be noise of the environment where the electronic device is located, rather than an acoustic signal generated when the key is pressed, by first determining whether the acquired electrical signal is legal, filtering of the environmental noise is achieved, the situation that the electronic device is controlled according to the environmental noise is avoided, and the accuracy of control of the electronic device is improved.
In addition, an electronic device is further provided in an embodiment of the present invention, as shown in fig. 3, fig. 3 is a schematic partial structural diagram of the electronic device in this embodiment.
The electronic device comprises a shell 10 and a circuit board 30, wherein at least one key 11 is arranged on the outer surface of the shell 10, at least one microphone 31 is arranged on the circuit board 30, and the microphone 31 is used for detecting sound generated when the key 11 is pressed. The symbols on the keys 11 are merely for illustration, and do not represent corresponding limitations on the keys.
Specifically, the key 11 generates a corresponding sound signal when pressed, and the microphone 31 may collect the sound signal in real time, transmit the collected sound signal to the circuit board 30, and perform key identification by the circuit board 30.
The electronic device may be a sound box, the microphone 31 may be a microphone 31 disposed in the sound box, and the microphone 31 may realize a function of collecting a sound signal generated when the key 11 is pressed, and may also realize other functions of the sound box.
In the technical solution provided in this embodiment, since the electronic device does not need the key 11 to act on the contact, the circuit board 30 can obtain the signal generated when the key 11 is pressed through the microphone 31, thereby avoiding the situation that the key cannot be identified due to the fact that the contact is worn and an accurate electrical signal cannot be generated, and improving the reliability of the electronic device.
Alternatively, in order to prevent liquid or static electricity from penetrating into the inside of the electronic device through the gap between the key 11 and the key housing (casing 10), thereby causing damage or malfunction of the electronic device, the key 11 may be isolated from the circuit board 30 inside the casing 10, and the following description is made by way of two exemplary embodiments:
in the first embodiment, a groove (not shown) is recessed at a position where the key is disposed on the outer surface of the housing 10, and the key 11 is disposed inside the groove.
To further improve the isolation effect, a recess (not shown) is integrally formed with the housing 10, and the key 11 is disposed in the recess. Specifically, the key 11 may include a key foot, a return spring and a key cap, and the key cap of the key 11 is connected with the key foot through the return spring; the user can press the key cap of the key 11, so that the return spring generates elastic deformation, and when the key cap is pressed to the maximum pressing distance, the key cap collides with the key foot, so that a corresponding sound signal is generated, and the sound signal is a recognition basis for the circuit board 30 to recognize the key 11. The key cap of the key 11 may be higher than the outer surface of the casing 10 when being disposed, or may be flush with the outer surface of the casing 10, which is not limited herein.
In the second embodiment, a spacer 20 covering the circuit board 30 is disposed between the housing 10 and the circuit board 30; the housing 10 is provided with a through hole (not shown) through which the key foot is connected to the spacer 20.
The spacer 20 in this embodiment may be a spacer, the area of the spacer 20 is greater than or equal to that of the circuit board 30, and the projection of the spacer 20 in the vertical direction covers the projection of the circuit board 30 in the vertical direction. Specifically, the key 11 may include a key foot, a return spring, and a key cap, and the key cap of the key 11 is connected with the key foot through the return spring. The key cap of the key 11 may be higher than the outer surface of the casing 10 when being disposed, or may be flush with the outer surface of the casing 10, which is not limited herein.
By isolating the keys 11 of the electronic device from the circuit board 30, liquid or static electricity is prevented from permeating into the electronic device through gaps between the keys 11 and the key shell (shell 10), so that the electronic device is prevented from being damaged or being out of service.
Optionally, the microphone 31 may be directly below the key 11 or the microphone 31 may also detect a sound signal between two keys 11, that is, the position of the projection of the key 11 on the circuit board 30 coincides with the position of the microphone 31; or the number of the microphones 31 and the keys 11 is at least two, the keys 11 are arranged at intervals, and the microphones 31 are arranged between any two keys 11.
The sound signals collected by the different microphones 31 may have differences when the keys 11 are pressed, and the arrangement of the different keys 11 may also affect the process of the circuit board 30 for identifying the keys 11.
When the microphone 31 is disposed directly below the key 11, the microphone 31 directly below the pressed key 11 may acquire the highest peak of the sound waveform of the sound signal, and the peaks of the sound waveforms of the sound signals acquired by the remaining microphones 31 decrease as the distance between the microphone 31 and the key 11 increases, that is, the larger the distance between the microphone 31 and the key 11 is, the smaller the peak of the sound waveform acquired by the microphone 31 is. Therefore, the circuit board 30 can identify the pressed key 11 from the peak of the sound signal collected by the microphone 31.
When the microphones 31 are disposed in the middle of two keys 11, that is, there are two microphones 31 with the same distance to the keys 11 and the distance is the smallest in one key 11, the sound waveforms of the sound signals collected by the two microphones 31 corresponding to the pressed key 11 are similar, and the sound waveforms of the sound signals collected by the other microphones 31 decrease as the distance between the microphone 31 and the key 11 increases. Therefore, the circuit board 30 may determine a corresponding preset waveform group according to the sound waveform collected by each microphone 31, and determine the pressed key 11 according to the corresponding preset waveform group.
By setting the position relationship between the microphone 31 and the key 11, the microphone 31 can acquire the sound waveform meeting the identification condition, thereby improving the reliability of the electronic device.
In addition, an embodiment of the present invention further provides an electronic device, where the electronic device includes a memory, a processor, and a control program of the electronic device that is stored in the memory and is executable on the processor, and the control program of the electronic device, when executed by the processor, implements the steps of the control method of the electronic device according to the above embodiments.
Furthermore, an embodiment of the present invention further provides a computer-readable storage medium, where a control program of an electronic device is stored, and the control program of the electronic device, when executed by a processor, implements the steps of the control method of the electronic device according to the above embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on this understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for causing an electronic device to execute the methods according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (15)

1. A method of controlling an electronic device, the electronic device comprising: the control method of the electronic equipment comprises a shell, a circuit board and at least one key, wherein the circuit board is positioned in the shell, the key is positioned on the outer surface of the shell, at least one microphone is arranged on the circuit board, and the control method of the electronic equipment comprises the following steps:
Acquiring an acoustic signal acquired by a microphone, and converting the acoustic signal into an electric signal;
acquiring a control instruction triggered by the pressed key according to the electric signal;
and controlling the electronic equipment to execute the control instruction.
2. The method for controlling an electronic device according to claim 1, wherein the electronic device comprises at least two of the keys and at least two of the microphones, and the step of acquiring the control instruction triggered by the pressed key according to the electrical signal comprises:
acquiring the waveform of the electric signal corresponding to each microphone;
generating a waveform group according to the arrangement sequence of each microphone and each waveform;
and determining the control instruction according to the preset waveform group matched with the waveform group.
3. The method of controlling an electronic device according to claim 2, wherein the step of determining the control instruction according to the preset waveform group to which the waveform group matches comprises:
determining the pressed key according to the preset waveform group;
and acquiring an instruction corresponding to the pressed key as the control instruction.
4. The method for controlling an electronic device according to claim 1, wherein the electronic device comprises at least two of the keys and at least two of the microphones, and the step of acquiring the control instruction triggered by the pressed key according to the electrical signal comprises:
Acquiring the waveform of the electric signal corresponding to each microphone;
determining a peak value of each of the waveforms;
and acquiring a control instruction corresponding to the pressed key according to the at least two wave peak values.
5. The method according to claim 4, wherein each of the keys corresponds to one of the microphones, each of the microphones coincides with a projection of the corresponding key in a vertical direction, and the step of obtaining the control command corresponding to the pressed key according to at least two of the peak values comprises:
determining a maximum peak value among at least two of the peak values;
taking the waveform corresponding to the maximum wave peak value as a target waveform, and determining a microphone corresponding to the target waveform as a target microphone;
and acquiring a command of a key corresponding to the target microphone as the control command.
6. The method according to claim 4, wherein each of the keys corresponds to one of the microphones, each of the microphones coincides with a projection of the corresponding key in a vertical direction, and the step of obtaining the control command corresponding to the pressed key according to at least two of the peak values comprises:
Determining the deviation amount of each wave peak value and a preset wave peak value corresponding to a preset trigger waveform;
taking the waveform corresponding to the wave peak value with the minimum deviation amount as a target waveform, and determining a microphone corresponding to the target waveform as a target microphone;
and acquiring a command of a key corresponding to the target microphone as the control command.
7. The method according to claim 4, wherein at least two of the microphones are spaced apart from each other, and one of the keys is disposed between any two adjacent microphones, and the step of obtaining the control command corresponding to the pressed key according to at least two of the peak values comprises:
determining two wave peak values larger than a first preset threshold value from at least two wave peak values as target wave peak values, and taking two waveforms corresponding to the target wave peak values as target waveforms, wherein the target wave peak values comprise a first target wave peak value and a second target wave peak value, and the target waveforms comprise a first target waveform and a second target waveform;
determining that the microphone corresponding to the first target waveform is a first target microphone, and determining that the microphone corresponding to the second target waveform is a second target microphone;
And determining the instructions of the keys corresponding to the first target microphone and the second target microphone as the control instructions.
8. The method for controlling an electronic device according to any one of claims 1 to 7, wherein the step of obtaining the triggered control instruction according to the electrical signal is preceded by the step of:
acquiring a voltage value corresponding to the electric signal;
and when the voltage value is greater than or equal to a second preset threshold value, executing the step of acquiring a triggered control instruction according to the electric signal.
9. An electronic device, characterized in that the electronic device comprises a memory, a processor, and a control program of the electronic device stored on the memory and executable on the processor, the control program of the electronic device implementing the steps of the control method of the electronic device according to any one of claims 1 to 8 when executed by the processor.
10. The electronic device of claim 9, further comprising a housing, a circuit board, and at least one key, wherein the circuit board is located in the housing, the key is located on an outer surface of the housing, the processor, the memory, and at least one microphone are disposed on the circuit board, and the microphone is electrically connected to the processor.
11. The electronic device of claim 10, wherein a groove is recessed in a position where the key is disposed on the outer surface of the housing, and the key is disposed inside the groove.
12. The electronic device of claim 10, wherein a spacer is disposed between the housing and the circuit board to cover the circuit board, and a through hole is disposed on the housing, and the key foot of the key passes through the through hole to be connected to the spacer.
13. The electronic device of claim 10, wherein a position of a projection of the key on the circuit board coincides with a position of the microphone.
14. The electronic device of claim 10, wherein the number of the microphones and the number of the keys are at least two, the keys are spaced apart, and the microphones are disposed between any two of the keys.
15. A computer-readable storage medium, characterized in that a control program of an electronic device is stored thereon, which when executed by a processor implements the steps of the control method of the electronic device according to any one of claims 1 to 8.
CN202010703607.1A 2020-07-20 2020-07-20 Control method of electronic device, and readable storage medium Pending CN111857642A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010703607.1A CN111857642A (en) 2020-07-20 2020-07-20 Control method of electronic device, and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010703607.1A CN111857642A (en) 2020-07-20 2020-07-20 Control method of electronic device, and readable storage medium

Publications (1)

Publication Number Publication Date
CN111857642A true CN111857642A (en) 2020-10-30

Family

ID=73001612

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010703607.1A Pending CN111857642A (en) 2020-07-20 2020-07-20 Control method of electronic device, and readable storage medium

Country Status (1)

Country Link
CN (1) CN111857642A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112506466A (en) * 2020-12-17 2021-03-16 深圳Tcl新技术有限公司 Electronic equipment and key response method of electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1233125A (en) * 1998-01-30 1999-10-27 皇家菲利浦电子有限公司 Telephony equipment comprising keyboard with sound generating keys
US20020167862A1 (en) * 2001-04-03 2002-11-14 Carlo Tomasi Method and apparatus for approximating a source position of a sound-causing event for determining an input used in operating an electronic device
US20110037734A1 (en) * 2009-08-17 2011-02-17 Apple Inc. Electronic device housing as acoustic input device
US20150355877A1 (en) * 2013-06-21 2015-12-10 Nam Kyu Kim Key input device, key input recognition device, and key input system using same
DE102015205950A1 (en) * 2015-04-01 2016-10-06 Volkswagen Aktiengesellschaft Apparatus, method and computer program for detecting acoustic control instructions
CN106627150A (en) * 2015-11-02 2017-05-10 现代自动车株式会社 Input device, vehicle having the input device, and method for controlling the vehicle
CN110111812A (en) * 2019-04-15 2019-08-09 深圳大学 A kind of self-adaptive identification method and system of keyboard key stroke content

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1233125A (en) * 1998-01-30 1999-10-27 皇家菲利浦电子有限公司 Telephony equipment comprising keyboard with sound generating keys
US20020167862A1 (en) * 2001-04-03 2002-11-14 Carlo Tomasi Method and apparatus for approximating a source position of a sound-causing event for determining an input used in operating an electronic device
US20110037734A1 (en) * 2009-08-17 2011-02-17 Apple Inc. Electronic device housing as acoustic input device
US20150355877A1 (en) * 2013-06-21 2015-12-10 Nam Kyu Kim Key input device, key input recognition device, and key input system using same
DE102015205950A1 (en) * 2015-04-01 2016-10-06 Volkswagen Aktiengesellschaft Apparatus, method and computer program for detecting acoustic control instructions
CN106627150A (en) * 2015-11-02 2017-05-10 现代自动车株式会社 Input device, vehicle having the input device, and method for controlling the vehicle
CN110111812A (en) * 2019-04-15 2019-08-09 深圳大学 A kind of self-adaptive identification method and system of keyboard key stroke content

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112506466A (en) * 2020-12-17 2021-03-16 深圳Tcl新技术有限公司 Electronic equipment and key response method of electronic equipment

Similar Documents

Publication Publication Date Title
CN107576346B (en) Sensor detection method and device and computer readable storage medium
Telford et al. Diagnosis of series DC arc faults—A machine learning approach
US9530407B2 (en) Spatial audio database based noise discrimination
CN106656204A (en) Method and device for implementing interference resistance of touch key
US10432139B2 (en) Electric arc detection in photovoltaic installations
CN111857642A (en) Control method of electronic device, and readable storage medium
KR20170135061A (en) Method and device for acquiring input
CN104575503A (en) Speech recognition method and device
CN110111812B (en) Self-adaptive identification method and system for keyboard keystroke content
US10121048B2 (en) Operating method for a fingerprint sensing device and fingerprint sensing system
CN105825098A (en) Electronic terminal screen unlocking method and image acquisition method and device
CN111664934A (en) Transformer state vibration and sound detection signal filtering method and system using feature selection
CN107546735B (en) Electrical system for connecting to two power sources and electrical apparatus comprising such an electrical system
CN112292671A (en) Device recognition apparatus and device recognition method
US10476257B2 (en) Interface control circuit and control method thereof
CN110649941B (en) Method for recognizing noise by non-contact card reader
CN112761434B (en) Vehicle lock control method and device, vehicle and storage medium
US20170371488A1 (en) Input apparatus, input detection method, and in-vehicle apparatus
CN210247013U (en) Earphone interface recognition circuit and equipment thereof
CN205427059U (en) Safety monitoring system and portable electronic equipment
CN210247027U (en) Universal earphone audio circuit and equipment thereof
US10373776B2 (en) Switch device including dual on/off signal generation units, and numerical control system
KR102107218B1 (en) Self-diagnosing microcontroller for reading correct channels of an analog-to-digital converter
CN113270094A (en) Electrical equipment control method and device
CN111596750A (en) Key system and interaction device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination