CN110457005B - Equipment signal filtering method, device, system and medium - Google Patents

Equipment signal filtering method, device, system and medium Download PDF

Info

Publication number
CN110457005B
CN110457005B CN201910758762.0A CN201910758762A CN110457005B CN 110457005 B CN110457005 B CN 110457005B CN 201910758762 A CN201910758762 A CN 201910758762A CN 110457005 B CN110457005 B CN 110457005B
Authority
CN
China
Prior art keywords
signal
timing
function
external equipment
time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910758762.0A
Other languages
Chinese (zh)
Other versions
CN110457005A (en
Inventor
王宸
戴敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Goertek Inc
Original Assignee
Goertek Inc
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 Inc filed Critical Goertek Inc
Priority to CN201910758762.0A priority Critical patent/CN110457005B/en
Publication of CN110457005A publication Critical patent/CN110457005A/en
Application granted granted Critical
Publication of CN110457005B publication Critical patent/CN110457005B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Abstract

The embodiment of the invention discloses a device signal filtering method, a device, a system and a computer readable storage medium, wherein when an on-off signal of an external device is detected, a timing function is started; judging whether a new on-off signal is generated within a preset timing time; if yes, restarting the timing function and judging whether a new on-off signal is generated within the preset timing time. If not, controlling the on-off of the external equipment according to the current on-off signal. By setting the timing function to judge each on-off signal of the external equipment, the reliability of effective signal acquisition can be ensured while invalid signals generated by hardware jitter are filtered, the timeliness and stability of the feedback of the terminal equipment operating system are improved from the software angle, the waste of related system resources and the possible system breakdown are reduced, and the working stability and reliability of the external equipment are improved.

Description

Equipment signal filtering method, device, system and medium
Technical Field
The present invention relates to the field of signal processing technologies, and in particular, to a device signal filtering method, device, system, and computer readable storage medium.
Background
Currently, terminal devices mainly mounted on embedded real-time operating systems (Real Time Operating System, RTOS) occupy the market of future mainstream entertainment and application development by virtue of their continuous perfection and enhanced interactivity and immersion. In addition to the extreme rendering of images, the detailed processing on audio is also a great guarantee for the immersive experience and sensory stimulation effect.
The earphone is used as an external device for playing necessary audio of the terminal device, so that stability and reliability of the earphone in operation in the plugging process are important points of software and hardware design. The artificial plug earphone often causes the shake, leads to the frequent execution break-make operation of earphone, influences the steady operation of earphone.
Therefore, how to improve the working stability and reliability of the external device is a problem that needs to be solved by those skilled in the art.
Disclosure of Invention
The embodiment of the invention aims to provide a device signal filtering method, device, system and computer readable storage medium, which can improve the working stability and reliability of external devices.
In order to solve the above technical problems, an embodiment of the present invention provides a device signal filtering method, including:
when an on-off signal of the external equipment is detected, starting a timing function;
judging whether a new on-off signal is generated within a preset timing time;
if yes, restarting the timing function, and returning to the step of judging whether a new on-off signal is generated within the preset timing time;
if not, the on-off of the external equipment is controlled according to the current on-off signal.
Optionally, before the timing function is started when the on-off signal of the external device is detected, the method further includes:
detecting whether an external device is connected or not after the terminal device is powered on;
if yes, power is supplied to the external equipment;
if not, executing the step of starting the timing function when the on-off signal of the external equipment is detected.
Optionally, the setting process of the timing time includes:
acquiring an invalid time interval of an invalid interrupt signal and an effective time interval of an effective interrupt signal of an external device connection test by using a logic analyzer;
and taking the intermediate value of the invalid time interval and the valid time interval as a timing time.
Optionally, when the on-off signal of the external device is detected, starting the timing function includes:
detecting whether an on-off signal exists or not in real time by utilizing various interrupt callback functions;
when the target interrupt callback function detects an on-off signal, triggering a corresponding timing callback function to start a timing function; the timing callback functions corresponding to the interrupt callback functions of different types have different timing times.
Optionally, after the controlling the on/off of the external device according to the current on/off signal, the method further includes:
receiving a timing time adjustment instruction; the timing time adjustment instruction carries new timing time and a timing callback function identifier;
and replacing the new timing time with the timing time of the timing callback function corresponding to the timing callback function identifier.
Optionally, the on-off signal includes a plug signal of an external device.
Optionally, after the restarting the timing function, the method further includes:
counting the times of continuously restarting the timing function;
and when the times are greater than or equal to a preset value, carrying out alarm prompt.
The embodiment of the invention also provides a device signal filtering device, which comprises an opening unit, a judging unit, a restarting unit and a control unit;
the starting unit is used for starting a timing function when the on-off signal of the external equipment is detected;
the judging unit is used for judging whether a new on-off signal is generated within a preset timing time; if yes, triggering the restarting unit; if not, triggering the control unit;
the restarting unit is used for restarting the timing function and returning to the step of judging whether a new on-off signal is generated within the preset timing time;
and the control unit is used for controlling the on-off of the external equipment according to the current on-off signal.
Optionally, the device further comprises a detection unit;
the detection unit is used for detecting whether an external device is connected after the terminal device is powered on; if yes, triggering the control unit to supply power to the external equipment; if not, triggering the starting unit to execute the step of starting the timing function when the on-off signal of the external equipment is detected.
Optionally, for the setting process of the timing time, the apparatus includes an acquisition unit and a setting unit;
the acquisition unit is used for acquiring an invalid time interval of an invalid interrupt signal and an effective time interval of an effective interrupt signal of the external equipment connection test by using the logic analyzer;
the unit is used for taking the intermediate value of the invalid time interval and the valid time interval as a timing time.
Optionally, the opening unit is specifically configured to detect whether an on-off signal exists in real time by using various interrupt callback functions; when the target interrupt callback function detects an on-off signal, triggering a corresponding timing callback function to start a timing function; wherein the timing callback functions corresponding to the interrupt callback functions of different types have different timing times
Optionally, the device further comprises a receiving unit and a replacing unit;
the receiving unit is used for receiving the timing time adjustment instruction; the timing time adjustment instruction carries new timing time and a timing callback function identifier;
and the replacing unit is used for replacing the new timing time with the timing time of the timing callback function corresponding to the timing callback function identifier.
Optionally, the on-off signal includes a plug signal of an external device.
Optionally, the system further comprises a statistics unit and an alarm unit;
the counting unit is used for counting the times of continuously restarting the timing function;
and the alarm unit is used for carrying out alarm prompt when the times are greater than or equal to a preset value.
The embodiment of the invention also provides a device signal jitter elimination system, which comprises external devices and terminal devices; the external equipment is connected with the terminal equipment through a data plug;
the terminal equipment is used for starting a timing function when the on-off signal of the external equipment is detected; judging whether a new on-off signal is generated within a preset timing time; if yes, restarting the timing function, and returning to the step of judging whether a new on-off signal is generated within the preset timing time; if not, the on-off of the external equipment is controlled according to the current on-off signal.
Embodiments of the present invention also provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the device signal filtering method according to any of the preceding claims.
According to the technical scheme, when the on-off signal of the external equipment is detected, the timing function is started; judging whether a new on-off signal is generated within a preset timing time; when a new on-off signal is generated in the timing time, the jitter phenomenon is indicated, and the timing function can be restarted at the moment, and whether the new on-off signal is generated in the preset timing time is judged again. When no new on-off signal is generated in the timing time, the external equipment is in a relatively stable connection or disconnection state, the current on-off signal is an effective signal, and the on-off of the external equipment can be controlled according to the current on-off signal. By setting the timing function to judge each on-off signal of the external equipment, the reliability of effective signal acquisition can be ensured while invalid signals generated by hardware jitter are filtered, the timeliness and stability of the feedback of the terminal equipment operating system are improved from the software angle, the waste of related system resources and the possible system breakdown are reduced, and the working stability and reliability of the external equipment are improved.
Drawings
For a clearer description of embodiments of the present invention, the drawings that are required to be used in the embodiments will be briefly described, it being apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to the drawings without inventive effort for those skilled in the art.
Fig. 1 is a schematic sectional view of a four-section earphone plug according to the prior art;
fig. 2 is a flowchart of a device signal filtering method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a device signal filtering apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an apparatus signal filtering system according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without making any inventive effort are within the scope of the present invention.
In order to better understand the aspects of the present invention, the present invention will be described in further detail with reference to the accompanying drawings and detailed description.
The external equipment is connected with the data jack of the terminal equipment through the data plug, and when the external equipment is manually plugged and unplugged, a shaking signal is easy to generate. Terminal equipment based on RTOS can be according to the break-make of the signal control external equipment that detects, because the existence of shake signal can cause external equipment frequent break-make, influences external equipment job stabilization nature and reliability. And the terminal equipment continuously analyzes invalid jitter signals, so that related system resources are wasted, and even the system is crashed due to frequent operation in a short time.
The earphone is used as a common external device, so that good audio experience is guaranteed, and stability and reliability of the earphone are high. Fig. 1 is a schematic sectional view of a four-segment earphone plug, in which four segments from Left to Right in fig. 1 correspond to a ground segment (GND), a general purpose input output (General Purpose Input Output, GPIO) Detection segment (Jack Detection), a Left Channel signal segment (Left Channel) and a Right Channel signal segment (Right Channel), respectively. And a second section (Jack Detection) from outside to inside of the earphone plug is used for GPIO plug Detection, and a GPIO interrupt signal is triggered each time the corresponding section of the external earphone is plugged into the second section and contacted with the second section, and the GPIO interrupt signal is further obtained by an interrupt callback function and used as a judgment basis for earphone identification. However, the detection band is generally designed to be about 3mm, and the small change of the contact point causes frequent state change, and is not capable of switching between the two closed states as stably as a switch. Therefore, when the earphone is plugged or pulled out manually, interruption triggering multiple GPIO state changes is unavoidable, and for the interruption, the original ROTS software system can acquire the earphone one by one and conduct on-off operation of the earphone in real time, so that a great amount of system resources are wasted to conduct actual operation on meaningless interruption signals. More seriously, when the earphone detection contact point is deliberately kept in a critical state (incomplete insertion), the instantaneous interrupt signal is too high, so that the system is operated too frequently, and the whole equipment system is crashed.
Therefore, the embodiment of the invention provides a device signal filtering method, a device signal filtering system and a computer readable storage medium, and by adding a system timing detection function, when a new on-off signal is generated in a timing time, the timing is restarted. Until no new on-off signal is generated in the timing time, the external equipment is in a relatively stable state, and the on-off of the external equipment can be controlled according to the current on-off signal. By means of software timing detection, invalid shaking signals are filtered, meanwhile reliable acquisition of effective signals is guaranteed, and working stability and reliability of external equipment are improved.
Next, a method for filtering a device signal provided by the embodiment of the present invention is described in detail. Fig. 2 is a flowchart of a device signal filtering method according to an embodiment of the present invention, where the method includes:
s201: when the on-off signal of the external equipment is detected, the timing function is started.
The external device is easy to generate signal jitter in the plugging process, and the detected on-off signal in the embodiment of the invention can comprise the plugging signal of the external device. When the external equipment is provided with a key, the shake of the signal is easy to generate in the artificial key process, and the on-off signal can comprise a key interrupt signal.
The type of external device may be varied, for example, headphones, a keyboard, etc. For convenience of description, headphones are used as examples in the following description.
The earphone is generally inserted into a GPIO port of the terminal device, and correspondingly, the plug signal generated in the earphone plug process is a GPIO interrupt signal. Considering that the frequent state change is caused by the small change of the contact point of the GPIO detection section during the plugging operation of the earphone, the earphone generates multiple GPIO state changes in a short time. In order to eliminate the influence of jitter when the earphone is plugged in and pulled out, the time interval of the earphone GPIO interrupt signal can be detected.
In practical application, a timing callback function based on a system timer (osTimer) can be set, and when the interrupt callback function detects that an on-off signal exists, the timing callback function is triggered to start the timing function.
Taking the earphone as an example, a system timing detection function can be added between the process of detecting the interrupt callback function of the earphone plug operation and feeding back the GPIO interrupt signal to the system end.
S202: judging whether a new on-off signal is generated within a preset timing time.
When the external equipment has signal jitter, on-off signals are continuously generated in a shorter time interval; when the external device does not have signal jitter, the time interval between two on-off signals can be longer.
In the embodiment of the invention, the on-off signal of the external device during signal jitter can be called an invalid signal, and the on-off signal when the external device and the terminal device enter a relatively stable connection or disconnection state is called an valid signal.
When a new on-off signal is generated within the preset timing time, the existence of the jitter phenomenon is indicated, and at this time, S203 can be executed; when no new on-off signal is generated within the preset timing time, it indicates that the external device is in a relatively stable connection or disconnection state, and the current on-off signal is a valid signal, at this time, S204 may be executed.
S203: restarting the timing function, and returning to the step of judging whether a new on-off signal is generated within the preset timing time.
S204: and controlling the on-off of the external equipment according to the current on-off signal.
Taking the plugging of the earphone as an example, starting a timer every time a GPIO interrupt signal is detected, and controlling the on-off of the earphone according to the GPIO interrupt signal if a new GPIO interrupt signal is not received within the timing time. If a new GPIO interrupt signal is detected, a new timing is started for the new GPIO signal and the previous GPIO signal is discarded. The timing callback function is just like a filter switch, filters each GPIO interrupt signal, and controls the on-off of the earphone only according to the effective signal.
According to the technical scheme, when the on-off signal of the external equipment is detected, the timing function is started; judging whether a new on-off signal is generated within a preset timing time; when a new on-off signal is generated in the timing time, the jitter phenomenon is indicated, and the timing function can be restarted at the moment, and whether the new on-off signal is generated in the preset timing time is judged again. When no new on-off signal is generated in the timing time, the external equipment is in a relatively stable connection or disconnection state, the current on-off signal is an effective signal, and the on-off of the external equipment can be controlled according to the current on-off signal. By setting the timing function to judge each on-off signal of the external equipment, the reliability of effective signal acquisition can be ensured while invalid signals generated by hardware jitter are filtered, the timeliness and stability of the feedback of the terminal equipment operating system are improved from the software angle, the waste of related system resources and the possible system breakdown are reduced, and the working stability and reliability of the external equipment are improved.
The value of the timing time can be set according to the type of the on-off signal. For example, for a plug signal of a headset, the timing time may be accurate to the millisecond level; for key interrupt signals of keys, the timing time can be accurate to microsecond level.
In the embodiment of the invention, different interrupt callback functions can be set according to different types of on-off signals, and the timing time of the timing callback functions corresponding to the different types of interrupt callback functions is different.
In practical application, various interrupt callback functions can be utilized to detect whether on-off signals exist in real time; when the target interrupt callback function detects an on-off signal, the corresponding timing callback function is triggered to start a timing function.
For setting the value of the timing time, in the embodiment of the invention, a logic analyzer can be utilized to obtain the invalid time interval of the invalid interrupt signal and the valid time interval of the valid interrupt signal of the connection test of the external equipment; and taking the intermediate value of the invalid time interval and the valid time interval as the timing time.
The intermediate value may be an average value of the invalid time interval and the valid time interval, or may be a value between the invalid time interval and the valid time interval.
Taking earphone plug as an example, a logic analyzer can be used for grabbing the waveforms of GPIO interrupt signals of a large number of earphone plug pressure tests, the interval of a plurality of invalid interrupt signals generated by pulling out and inserting the GPIO ports each time can be found to be smaller than 20ms based on the plug tests, and the interval of each valid signal is larger than 100ms when the earphone is pulled out and inserted at extremely high speed in the plug tests, and is larger than 200ms in most cases, so that 50ms of intermediate value can be used as timing time for the plug operation of the earphone to ensure that the invalid interrupt signals are filtered under the condition that the valid signals are not lost.
By setting different types of interrupt callback functions, detection of different types of on-off signals of the external equipment can be achieved. And the timing time of the timing callback function triggered by each interrupt callback function is different, so that accurate filtering of different types of on-off signals is ensured.
In practical application, when the external device and the terminal device are in a connection state, the terminal device may be powered off. When the terminal equipment is powered on, the on-off signal of the external equipment is detected again, and in order to avoid reentry of the timing detection flow, whether the external equipment is connected or not can be detected after the terminal equipment is powered on; when detecting that the external equipment is connected, supplying power to the external equipment; and when no external equipment is connected, executing the step of starting the timing function when the on-off signal of the external equipment is detected.
After the terminal equipment is electrified, whether the external equipment is connected or not is detected, so that the power can be directly supplied to the external equipment under the condition that the external equipment is stably connected, the process that the terminal equipment reenters the timing detection is avoided, and the timely power supply of the external equipment is ensured.
In the embodiment of the invention, the value of the timing time can be adjusted according to different detection requirements. The terminal equipment can be provided with a user operation interface, a user can input a timing time adjustment instruction on the operation interface, and the timing time adjustment instruction carries new timing time and a timing callback function identifier. When an operating system of the terminal equipment receives a timing time adjustment instruction; the new timing time can be replaced with the timing time of the timing callback function corresponding to the timing callback function identifier.
Through the adjustment to the timing time, the detection of external equipment signal jitter of different grade type that can be better is applicable to has promoted the accuracy of signal filtration.
Considering that when the external device is connected with the terminal device, the contact point of the plug may be in a critical state all the time, so that the situation that the on-off signal is generated is continuously caused, and aiming at the situation, a prompt mechanism can be set for facilitating the user to adjust the connection of the external device and the terminal device in time.
Specifically, after restarting the timing function, the operating system of the terminal device may count the number of times of continuously restarting the timing function; when the number of times is greater than or equal to a preset value, the connection between the external equipment and the terminal equipment is always in an unstable state, and at the moment, alarm prompt can be carried out.
The alarm prompting modes can be various, for example, prompting information for adjusting the connection of the external equipment can be displayed on the terminal equipment, and voice prompts can be played.
By setting the alarm prompt, a user can conveniently find out the abnormal connection condition of the external equipment in time, so that the connection between the external equipment and the terminal equipment can be adjusted in time.
Fig. 3 is a schematic diagram of an apparatus signal filtering device according to an embodiment of the present invention, including an opening unit 31, a judging unit 32, a restarting unit 33, and a control unit 34;
an opening unit 31, configured to open a timing function when an on-off signal of an external device is detected;
a judging unit 32, configured to judge whether a new on-off signal is generated within a preset timing time; if yes, a restarting unit 33 is triggered; if not, triggering the control unit 34;
a restarting unit 33, configured to restart the timing function, and return to a step of determining whether a new on-off signal is generated within a preset timing time;
the control unit 34 is configured to control on-off of the external device according to the current on-off signal.
Optionally, the device further comprises a detection unit;
the detection unit is used for detecting whether an external device is connected after the terminal device is powered on; if yes, triggering the control unit to supply power to the external equipment; if not, triggering the starting unit to execute the step of starting the timing function when the on-off signal of the external equipment is detected.
Optionally, for a setting process of the timing time, the apparatus includes an acquisition unit and a unit;
the acquisition unit is used for acquiring an invalid time interval of an invalid interrupt signal and an effective time interval of an effective interrupt signal of the external equipment connection test by utilizing the logic analyzer;
as a unit, the intermediate value between the invalid time interval and the valid time interval is used as the timing time.
Optionally, the opening unit is specifically configured to detect whether an on-off signal exists in real time by using various interrupt callback functions; when the target interrupt callback function detects an on-off signal, triggering a corresponding timing callback function to start a timing function; the timing callback functions corresponding to the interrupt callback functions of different types have different timing times.
Optionally, the device further comprises a receiving unit and a replacing unit;
the receiving unit is used for receiving the timing time adjustment instruction; the timing time adjustment instruction carries new timing time and a timing callback function identifier;
and the replacing unit is used for replacing the new timing time with the timing time of the timing callback function corresponding to the timing callback function identifier.
Optionally, the on-off signal includes a plug signal of the external device.
Optionally, the system further comprises a statistics unit and an alarm unit;
the counting unit is used for counting the times of continuously restarting the timing function;
and the alarm unit is used for carrying out alarm prompt when the times are greater than or equal to a preset value.
The description of the features in the embodiment corresponding to fig. 3 may be referred to the related description of the embodiment corresponding to fig. 2, which is not repeated here.
According to the technical scheme, when the on-off signal of the external equipment is detected, the timing function is started; judging whether a new on-off signal is generated within a preset timing time; when a new on-off signal is generated in the timing time, the jitter phenomenon is indicated, and the timing function can be restarted at the moment, and whether the new on-off signal is generated in the preset timing time is judged again. When no new on-off signal is generated in the timing time, the external equipment is in a relatively stable connection or disconnection state, the current on-off signal is an effective signal, and the on-off of the external equipment can be controlled according to the current on-off signal. By setting the timing function to judge each on-off signal of the external equipment, the reliability of effective signal acquisition can be ensured while invalid signals generated by hardware jitter are filtered, the timeliness and stability of the feedback of the terminal equipment operating system are improved from the software angle, the waste of related system resources and the possible system breakdown are reduced, and the working stability and reliability of the external equipment are improved.
Fig. 4 is a schematic structural diagram of an apparatus signal jitter reduction system 40 according to an embodiment of the present invention, including an external apparatus 41 and a terminal apparatus 42; the external device 41 is connected with the terminal device 42 through a data plug;
the terminal device 42 is configured to start a timing function when detecting an on-off signal of the external device 41; judging whether a new on-off signal is generated within a preset timing time; if yes, restarting the timing function, and returning to the step of judging whether a new on-off signal is generated in the preset timing time; if not, the external device 41 is controlled to be turned on or off according to the current on-off signal.
The embodiment of the invention also provides a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the steps of the device signal filtering method according to any one of the above steps are realized.
The method, the device, the system and the computer readable storage medium for filtering the device signals provided by the embodiment of the invention are described in detail. In the description, each embodiment is described in a progressive manner, and each embodiment is mainly described by the differences from other embodiments, so that the same similar parts among the embodiments are mutually referred. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section. It should be noted that it will be apparent to those skilled in the art that various modifications and adaptations of the invention can be made without departing from the principles of the invention and these modifications and adaptations are intended to be within the scope of the invention as defined in the following claims.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

Claims (8)

1. A method of filtering a device signal, comprising:
when an on-off signal of the external equipment is detected, starting a timing function;
judging whether a new on-off signal is generated within a preset timing time;
if yes, restarting the timing function, and returning to the step of judging whether a new on-off signal is generated within the preset timing time;
if not, controlling the on-off of the external equipment according to the current on-off signal;
when the on-off signal of the external equipment is detected, the timing function is started, and the method comprises the following steps:
detecting whether an on-off signal exists or not in real time by utilizing various interrupt callback functions;
when the target interrupt callback function detects an on-off signal, triggering a corresponding timing callback function to start a timing function; the timing callback functions corresponding to the interrupt callback functions of different types have different timing times;
counting the times of continuously restarting the timing function;
and when the times are greater than or equal to a preset value, carrying out alarm prompt.
2. The method of claim 1, further comprising, prior to turning on the timing function when the on-off signal of the external device is detected:
detecting whether an external device is connected or not after the terminal device is powered on;
if yes, power is supplied to the external equipment;
if not, executing the step of starting the timing function when the on-off signal of the external equipment is detected.
3. The method of claim 1, wherein the setting of the timed time comprises:
acquiring an invalid time interval of an invalid interrupt signal and an effective time interval of an effective interrupt signal of an external device connection test by using a logic analyzer;
and taking the intermediate value of the invalid time interval and the valid time interval as a timing time.
4. The method of claim 1, further comprising, after said controlling the on/off of the external device according to the current on/off signal:
receiving a timing time adjustment instruction; the timing time adjustment instruction carries new timing time and a timing callback function identifier;
and replacing the new timing time with the timing time of the timing callback function corresponding to the timing callback function identifier.
5. The method of claim 1, wherein the on-off signal comprises a plug-in signal of an external device.
6. The equipment signal filtering device is characterized by comprising an opening unit, a judging unit, a restarting unit and a control unit;
the starting unit is used for starting a timing function when the on-off signal of the external equipment is detected;
the judging unit is used for judging whether a new on-off signal is generated within a preset timing time; if yes, triggering the restarting unit; if not, triggering the control unit;
the restarting unit is used for restarting the timing function and returning to the step of judging whether a new on-off signal is generated within the preset timing time;
the control unit is used for controlling the on-off of the external equipment according to the current on-off signal;
the starting unit is specifically used for detecting whether on-off signals exist or not in real time by utilizing various interrupt callback functions; when the target interrupt callback function detects an on-off signal, triggering a corresponding timing callback function to start a timing function; the timing callback functions corresponding to the interrupt callback functions of different types have different timing times;
the system also comprises a statistics unit and an alarm unit;
the counting unit is used for counting the times of continuously restarting the timing function;
and the alarm unit is used for carrying out alarm prompt when the times are greater than or equal to a preset value.
7. The equipment signal jitter elimination system is characterized by comprising external equipment and terminal equipment; the external equipment is connected with the terminal equipment through a data plug;
the terminal equipment is used for starting a timing function when the on-off signal of the external equipment is detected; judging whether a new on-off signal is generated within a preset timing time; if yes, restarting the timing function, and returning to the step of judging whether a new on-off signal is generated within the preset timing time; if not, controlling the on-off of the external equipment according to the current on-off signal; when the on-off signal of the external equipment is detected, the timing function is started, and the method comprises the following steps: detecting whether an on-off signal exists or not in real time by utilizing various interrupt callback functions; when the target interrupt callback function detects an on-off signal, triggering a corresponding timing callback function to start a timing function; the timing callback functions corresponding to the interrupt callback functions of different types have different timing times; counting the times of continuously restarting the timing function; and when the times are greater than or equal to a preset value, carrying out alarm prompt.
8. A computer readable storage medium, characterized in that it has stored thereon a computer program which, when executed by a processor, implements the steps of the device signal filtering method according to any of claims 1 to 5.
CN201910758762.0A 2019-08-16 2019-08-16 Equipment signal filtering method, device, system and medium Active CN110457005B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910758762.0A CN110457005B (en) 2019-08-16 2019-08-16 Equipment signal filtering method, device, system and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910758762.0A CN110457005B (en) 2019-08-16 2019-08-16 Equipment signal filtering method, device, system and medium

Publications (2)

Publication Number Publication Date
CN110457005A CN110457005A (en) 2019-11-15
CN110457005B true CN110457005B (en) 2023-06-20

Family

ID=68487288

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910758762.0A Active CN110457005B (en) 2019-08-16 2019-08-16 Equipment signal filtering method, device, system and medium

Country Status (1)

Country Link
CN (1) CN110457005B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201248410A (en) * 2011-05-27 2012-12-01 Asustek Comp Inc Controller and associated controlling method
CN106681190A (en) * 2016-12-29 2017-05-17 北京经纬恒润科技有限公司 Filtering method and apparatus
CN109614286A (en) * 2018-12-04 2019-04-12 郑州云海信息技术有限公司 A kind of hot plug recognition methods, device and the medium of PCIe device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201248410A (en) * 2011-05-27 2012-12-01 Asustek Comp Inc Controller and associated controlling method
CN106681190A (en) * 2016-12-29 2017-05-17 北京经纬恒润科技有限公司 Filtering method and apparatus
CN109614286A (en) * 2018-12-04 2019-04-12 郑州云海信息技术有限公司 A kind of hot plug recognition methods, device and the medium of PCIe device

Also Published As

Publication number Publication date
CN110457005A (en) 2019-11-15

Similar Documents

Publication Publication Date Title
US11127398B2 (en) Method for voice controlling, terminal device, cloud server and system
KR102231094B1 (en) Apparatus and method for detecting insertion anomaly of an audio jack
KR101920020B1 (en) Status Change Control Method and Electronic Device supporting the same
CN107728992B (en) Volume adjusting method and system
EP2506114A1 (en) Method and device for intelligent terminal reset
US20160277826A1 (en) Earphone Line Control Device and Earphone
CN104536551A (en) Method and device for clearing away information on complementary metal oxide semiconductor (CMOS)
CN106484061A (en) Terminal resets control method, controller and system
CN105306817B (en) A kind of control method taken pictures and mobile terminal
CN110457005B (en) Equipment signal filtering method, device, system and medium
WO2019134665A1 (en) Screen switching method and dual-screen terminal
WO2017148270A1 (en) Volume control method and device, and terminal
CN105668662B (en) Water purifier and its control method, device
US9584893B2 (en) Apparatus and method for recovering from partial insertion of an audio jack
CN105893020A (en) Screen recording starting method, screen recording starting device and mobile terminal
US6952357B2 (en) Power supply control apparatus
CN112714215A (en) Mobile terminal sound setting processing method and device, terminal equipment and storage medium
CN107592842B (en) The detection of the operation of operating element in motor vehicle
JPH11136784A (en) Feeder for plug
CN108495220B (en) Bluetooth headset circuit and Bluetooth headset
US9532129B2 (en) Earphone line control device and earphone
KR100632117B1 (en) Apparatus for driving end key, and portable terminal using the same
US8218282B2 (en) Portable electronic device and method for using the same
CN104572510A (en) Method and device for judging working state of external equipment
CN111669576B (en) Method and device for identifying volume output abnormality of smart television and electronic equipment

Legal Events

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