Electrical connector status detection and identification method based on data analysis

By analyzing the degree of fluctuation and intermittent influence in voltage signal detection and adjusting the filter window size, the accuracy problem of traditional filters in processing intermittent fault signals from headphone sockets is solved, and more efficient status detection is achieved.

CN118519074BActive Publication Date: 2024-10-08DONGGUAN XINLONG SCI&TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410986333.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-10-08
Estimated Expiration
2044-07-23

AI Technical Summary

Technical Problem

When detecting the status of the headphone socket, traditional filters cannot effectively handle intermittent fault signals caused by increased use time, resulting in reduced accuracy in detecting the status of the headphone socket.

Method used

By setting an initial sliding window at each sampling moment, analyzing the degree of fluctuation and intermittent influence of the voltage signal, and adjusting the window size of the filter to optimize the balance between noise suppression and response speed, more accurate state detection is achieved.

Benefits of technology

It effectively reduces noise interference, enhances the accuracy of electrical connector status detection, avoids the problem of excessive or insufficient smoothing, and improves the detection effect of the headphone socket status.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118519074B_ABST
    Figure CN118519074B_ABST
Patent Text Reader

Abstract

The present application relates to the field of electrical connector detection technology, and specifically to an electrical connector state detection and identification method based on data analysis, the method comprising: obtaining the voltage signal of the electrical connector at each sampling moment; setting the initial sliding window of the filter at each sampling moment with the voltage signal at each sampling moment as the center; determining the state fluctuation degree of the initial sliding window at each sampling moment according to the difference between the voltage signals at different sampling moments in the initial sliding window at each sampling moment, and the degree of fluctuation change; determining the intermittent influence degree of the initial sliding window at each sampling moment according to the interval time between different peaks and the peak value of the peak in the initial sliding window at each sampling moment; determining the sliding window at each sampling moment after the filter is adjusted, and detecting the state of the electrical connector. The present application reduces the interference of noise in the original voltage signal and enhances the effect of electrical connector state detection by adjusting the sliding window of the filter.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of electrical connector detection, and in particular to a method for detecting and distinguishing the state of an electrical connector based on data analysis. Background Art

[0002] An electrical connector is a component used to connect two or more electronic devices to transmit electrical signals or power. A headphone jack is a common electrical connector that is specifically used to connect audio devices and headphones to transmit audio signals. A headphone jack usually has two states: plugged in and unplugged. By detecting the state of the headphone jack, the audio output can be automatically switched, that is, when the headphones are plugged in, the device automatically switches the audio output from the built-in speaker to the headphones.

[0003] The insertion status of the headphone jack can be detected by detecting the voltage change between the two contact points DET and L on the headphone jack. As the use time increases, the headphone jack may degrade, and intermittent fault signals will appear in the obtained voltage signal. Traditional filters use a fixed window size to remove interference signals, which cannot change according to signal characteristics, resulting in poor interference signal removal effect, affecting the detection of the headphone jack status. Summary of the invention

[0004] In order to solve the above technical problems, a method for detecting and identifying the state of an electrical connector based on data analysis is provided to solve the existing problems.

[0005] The solution to the technical problem of the present application is to provide a method for detecting and identifying the state of an electrical connector based on data analysis, comprising the following steps:

[0006] Obtaining a voltage signal of the electrical connector at each sampling moment;

[0007] Taking the voltage signal at each sampling moment as the center, set the initial sliding window of the filter at each sampling moment;

[0008] Determine the state fluctuation degree of the initial sliding window at each sampling moment according to the difference between the voltage signals at different sampling moments in the initial sliding window at each sampling moment and the degree of fluctuation change;

[0009] Determine the intermittent influence degree of the initial sliding window at each sampling moment according to the interval time between different peaks and the peak value of the peak in the initial sliding window at each sampling moment;

[0010] Based on the state fluctuation degree and the intermittent influence degree, a sliding window at each sampling moment after the filter is adjusted is determined to detect the state of the electrical connector.

[0011] Preferably, determining the state fluctuation degree of the initial sliding window at each sampling moment includes:

[0012] Analyze the situation where the voltage signal at adjacent moments of each sampling moment in the initial sliding window is 0, and construct each valid voltage sequence of the initial sliding window at each sampling moment;

[0013] Analyze the length of each valid voltage sequence and determine the voltage stability weight of the initial sliding window at each sampling moment;

[0014] Analyze the differences of voltage signals at each sampling moment in each valid voltage sequence, and determine the voltage cumulative fluctuation value of the initial sliding window at each sampling moment;

[0015] The product of the voltage stability weight and the voltage cumulative fluctuation value is used as the state fluctuation degree of the initial sliding window at each sampling moment.

[0016] Preferably, the method for acquiring each effective voltage sequence of the initial sliding window at each sampling moment is:

[0017] The voltage signal at each sampling moment, in which only one voltage signal at an adjacent moment is 0, is recorded as a state change point;

[0018] If the left voltage signal of the state change point in the initial sliding window at each sampling time is 0 and the right voltage signal is greater than 0, the state change point is recorded as the left state change point; if the right voltage signal of the state change point is 0 and the left voltage signal is greater than 0, the state change point is recorded as the right state change point;

[0019] The voltage signals at all sampling moments between the adjacent left state change points and the right state change points in the initial sliding window at each sampling moment are combined into an effective voltage sequence;

[0020] Among them, if there is no state change point in the initial sliding window, the voltage signals at all times in the initial sliding window are combined into a valid voltage sequence. If there is a state change point in the initial sliding window, the voltage signals at all times on the side where the voltage signal of the state change point in the initial sliding window is not 0 are combined into a valid voltage sequence.

[0021] Preferably, the determining of the voltage stability weight of the initial sliding window at each sampling moment includes:

[0022] Count the length of each valid voltage sequence in the initial sliding window at each sampling moment;

[0023] The sum of the lengths of all valid voltage sequences in the initial sliding window at each sampling moment is recorded as the voltage accumulation time length of the initial sliding window at each sampling moment;

[0024] The ratio of the voltage accumulation time to the preset length of the initial sliding window is used as the voltage stability weight of the initial sliding window at each sampling moment.

[0025] Preferably, the step of determining the voltage cumulative fluctuation value of the initial sliding window at each sampling moment includes:

[0026] Calculate the range and mean of each valid voltage sequence of the initial sliding window at each sampling moment;

[0027] Record the difference between the voltage signal at each sampling moment in each effective voltage sequence and the mean value as a first difference;

[0028] Recording the sum of all the first differences in each valid voltage sequence as the voltage signal difference of each valid voltage sequence in the initial sliding window at each sampling moment;

[0029] The range is merged with the voltage signal difference to determine the voltage fluctuation coefficient of each valid voltage sequence in the initial sliding window at each sampling moment;

[0030] The accumulated sum of the voltage fluctuation coefficients of all valid voltage sequences in the initial sliding window at each sampling moment is taken as the voltage accumulated fluctuation value of the initial sliding window at each sampling moment.

[0031] Preferably, determining the intermittent influence degree of the initial sliding window at each sampling moment includes:

[0032] Obtain the peaks of the initial sliding window at each sampling moment, and record two adjacent peaks whose time interval between adjacent peaks is less than a preset time length as a pair of intermittent double peaks;

[0033] Analyze the time interval length and peak value of each pair of intermittent double peaks, and determine the intermittent occurrence intensity of each pair of intermittent double peaks in the initial sliding window at each sampling time;

[0034] Analyze the time intervals between two adjacent pairs of intermittent double peaks, and determine the intermittent impact weight of each pair of intermittent double peaks in the initial sliding window at each sampling moment;

[0035] The product of the intermittent impact weight and the intermittent occurrence intensity is recorded as the first product;

[0036] The first products of all intermittent double peaks in the initial sliding window at each sampling moment are merged to serve as the intermittent influence degree of the initial sliding window at each sampling moment;

[0037] Among them, if there is no intermittent double peak in the initial sliding window, the intermittent impact degree is assigned a value of 1; if there is a pair of intermittent double peaks in the initial sliding window, the intermittent impact degree is the intermittent occurrence intensity.

[0038] Preferably, determining the intermittent occurrence intensity of each pair of intermittent double peaks in the initial sliding window at each sampling moment includes:

[0039] The time interval between each pair of intermittent double peaks in the initial sliding window at each sampling moment is recorded as the duration;

[0040] Calculate the mean of the peak values ​​of each pair of intermittent double peaks in the initial sliding window at each sampling time, and record it as the first mean value;

[0041] The duration is fused with the first mean value to serve as the intermittent occurrence intensity of each pair of intermittent double peaks in the initial sliding window at each sampling moment.

[0042] Preferably, the step of determining the intermittent impact weight of each pair of intermittent double peaks in the initial sliding window at each sampling moment includes:

[0043] The sampling time corresponding to the previous peak in each pair of intermittent double peaks is recorded as the intermittent occurrence time;

[0044] The time interval between each pair of intermittent double peaks and the intermittent occurrence time of the next pair of intermittent double peaks adjacent to it is recorded as the cumulative occurrence time of each pair of intermittent double peaks;

[0045] The normalized result of the inverse of the cumulative duration of occurrence is used as the intermittent influence weight of each pair of intermittent double peaks in the initial sliding window at each sampling moment.

[0046] Preferably, the step of determining the sliding window of each sampling moment after the filter is adjusted includes: ,in, The filter is adjusted The sliding window size at the sampling time, For filter The initial sliding window length at the sampling time, is the adjustment factor of the initial sliding window at the tth sampling time, is the preset factor.

[0047] Preferably, the adjustment factor of the initial sliding window at each sampling moment is a normalized result of the product of the state fluctuation degree and the intermittent influence degree of the initial sliding window at each sampling moment.

[0048] This application has at least the following beneficial effects:

[0049] The present application takes the voltage signal at each sampling moment as the center, sets the initial sliding window of the filter at each sampling moment, and determines the state fluctuation degree of the initial sliding window at each sampling moment by analyzing the difference between the voltage signals at different sampling moments in the initial sliding window at each sampling moment and the degree of fluctuation change. The beneficial effect is that the fluctuation of the voltage signal in the initial sliding window is taken into account to reflect the noise interference level of the voltage signal; the intermittent influence degree of the initial sliding window at each sampling moment is determined according to the interval time between different peaks and the peak value of the peak in the initial sliding window at each sampling moment, and the beneficial effect is that the interference degree of the intermittent fault of the electrical connector on the voltage signal is taken into account, so as to better detect the state of the electrical connector; based on the state fluctuation degree and the intermittent influence degree, the sliding window of each sampling moment after the filter is adjusted is determined to detect the state of the electrical connector, and the beneficial effect is that by adjusting the sliding window of the filter, the balance between noise suppression and response speed is optimized, the problem of excessive or insufficient smoothing is avoided, a better filtering effect is obtained, the interference of noise in the original voltage signal is reduced, and the effect of detecting the state of the electrical connector is enhanced. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The electrical connector status detection and identification method based on data analysis of the present application is further described in detail below in conjunction with the accompanying drawings.

[0051] Figure 1 A flowchart of the steps of the method for detecting and distinguishing the state of an electrical connector based on data analysis provided in an embodiment of the present application;

[0052] Figure 2 A flowchart of the steps of a method for obtaining the state fluctuation degree of an initial sliding window at each sampling moment provided in an embodiment of the present application;

[0053] Figure 3 A flowchart of the steps of a method for obtaining the intermittent influence degree of an initial sliding window at each sampling moment provided in an embodiment of the present application. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the following is a further detailed description of the electrical connector status detection and identification method based on data analysis proposed in the present application in conjunction with the accompanying drawings and implementation examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0055] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.

[0056] See also Figure 1, which shows a flowchart of a method for detecting and distinguishing the state of an electrical connector based on data analysis provided by an embodiment of the present application, the method comprising the following steps:

[0057] Step 1: Obtain the voltage signal of the electrical connector at each sampling moment.

[0058] A 24-bit data acquisition card is used to collect the voltage signal of the DET contact point of the electrical connector in different states, the sampling time is T, the sampling frequency is set to F, and the collected raw voltage signal is preprocessed. Among them, the voltage signal acquisition belongs to the known technology, and the specific process is not repeated.

[0059] Preferably, in this embodiment, the electrical connector selects the headphone socket, collects the voltage signal of the DET contact point of the headphone socket, and analyzes the headphone socket, sets the collection sampling frequency to 44.1kHz, the sampling time to 10s, and standardizes the collected voltage signal so that the voltage signal range is between -1 and 1, wherein data standardization is a well-known technology and the specific process will not be repeated.

[0060] At this point, the voltage signal at each sampling moment is obtained.

[0061] Step 2, setting the initial sliding window of the filter at each sampling moment with the voltage signal at each sampling moment as the center; determining the state fluctuation degree of the initial sliding window at each sampling moment according to the difference between the voltage signals at different sampling moments within the initial sliding window at each sampling moment and the degree of fluctuation change.

[0062] There are DET, L, R, M and GND contact points on the headphone socket. Among them, the DET and L contact points are not electrically connected to each other before the headphone is inserted. Once the headphone is inserted into the headphone socket, the DET contact point and the L contact point are short-circuited, and an electrical connection is generated. At this time, the voltage of the DET contact point changes. The traditional method judges the state of the contact point on the headphone socket by the voltage on the headphone socket. When there is a stable voltage, it is considered that the headphone has been inserted into the headphone socket, and when there is no voltage, it is considered that the headphone is not inserted. Due to the physical characteristics of the headphone socket, long-term use will cause wear, oxidation or contamination of the contact points, which may cause resistance changes and poor contact. These can cause instability of the voltage signal and form noise and interference in the collected contact point voltage signal.

[0063] When the voltage signal of the headphone jack is affected by noise and interference, it will lead to errors in judging the status of the headphone jack. This is because noise may cause random fluctuations in the voltage signal, which increases the risk of misidentifying the headphone connection status and makes the recognition accuracy low. In addition, due to the masking effect of noise and interference, the real change of the voltage signal may become difficult to identify, making signal recognition complicated. Therefore, it is necessary to process the signal containing noise.

[0064] Using a moving average filter to smooth the voltage signal is an effective processing method. The key parameter of the moving average filter is the window size, which can control the degree of smoothing of the voltage signal by the filter. A larger window can provide a stronger smoothing effect, reduce random noise, and make the voltage signal more stable. But at the same time, it may also introduce a larger time delay and slow down the response speed to signal changes. A smaller window can quickly capture the changes in the voltage signal and reduce the time delay, but it may not be enough to effectively filter high-frequency noise, resulting in the signal still fluctuating after filtering.

[0065] Therefore, in order to better detect the state of the electrical connector, the state of the electrical connector connected to the earphone is analyzed by analyzing the local changes in the voltage signal, specifically:

[0066] The initial sliding window length of the filter is set with the voltage signal at each sampling moment as the center;

[0067] Preferably, in this embodiment, the length of the preset initial sliding window is the time length of 50ms signal acquisition, and the sliding step of the initial sliding window is 1 acquisition moment. It should be noted that if the length of the initial sliding window is insufficient, the voltage mean value in the current window is used to fill it up. As other implementation methods, the implementer can set it according to the actual situation.

[0068] The voltage signal at each sampling moment, in which only one voltage signal at an adjacent moment is 0, is recorded as a state change point;

[0069] If the left voltage signal of the state change point in the initial sliding window at each sampling moment is 0 and the right voltage signal is greater than 0, the state change point is recorded as the left state change point; if the right voltage signal of the state change point is 0 and the left voltage signal is greater than 0, the state change point is recorded as the right state change point.

[0070] It should be noted that the left state change point indicates that the earphone is in the plugged-in state, and the right state change point indicates that the earphone is in the unplugged state.

[0071] In the presence of noise interference, the voltage signal will fluctuate. Even if the earphones are not unplugged, there may be state change points. Therefore, there is a certain relationship between the number of state change points and noise interference. The number of state change points can be used to measure the voltage stability. The more state change points, the more noise interference there is, that is, the worse the voltage stability is.

[0072] If the state change point is caused by noise interference, the time interval between the two state change points will be very short and can be ignored. If the state change point is caused by plugging and unplugging the headphone, the time interval between the two state change points may be very long.

[0073] Based on the above analysis, by analyzing the voltage signal between the two state change points, the voltage stability weight is obtained to reflect the fluctuation of the overall voltage signal, specifically:

[0074] The voltage signals at all sampling moments between the adjacent left state change points and the right state change points in the initial sliding window at each sampling moment are combined into an effective voltage sequence;

[0075] If there is no state change point in the initial sliding window, the voltage signals at all times in the initial sliding window are combined into a valid voltage sequence. If there is a state change point in the initial sliding window, the voltage signals at all times on the side where the voltage signal of the state change point in the initial sliding window is not 0 are combined into a valid voltage sequence.

[0076] Count the length of each valid voltage sequence in the initial sliding window at each sampling moment;

[0077] The sum of the lengths of all valid voltage sequences in the initial sliding window at each sampling moment is recorded as the voltage accumulation time length of the initial sliding window at each sampling moment;

[0078] The ratio of the voltage accumulation time to the preset length of the initial sliding window is used as the voltage stability weight of the initial sliding window at each sampling moment;

[0079] It should be noted that the voltage stability weight reflects the proportion of valid voltage signals in the initial sliding window. Since voltage fluctuations occur only when there are valid voltage signals, the larger the voltage stability weight, the greater the possibility of voltage fluctuations in the initial sliding window.

[0080] Furthermore, the local voltage signal is analyzed to reflect the fluctuation degree of the voltage signal, specifically:

[0081] Calculate the range and mean of each valid voltage sequence of the initial sliding window at each sampling moment;

[0082] The difference between the voltage signal at each sampling moment in each valid voltage sequence in the initial sliding window at each sampling moment and the mean value is recorded as a first difference;

[0083] The sum of all the first differences in each valid voltage sequence in the initial sliding window at each sampling moment is recorded as the voltage signal difference of each valid voltage sequence in the initial sliding window at each sampling moment;

[0084] The range is merged with the voltage signal difference to determine the voltage fluctuation coefficient of each valid voltage sequence in the initial sliding window at each sampling moment;

[0085] The accumulated sum of the voltage fluctuation coefficients of all valid voltage sequences in the initial sliding window at each sampling moment is taken as the voltage accumulated fluctuation value of the initial sliding window at each sampling moment;

[0086] The product of the voltage stability weight and the voltage cumulative fluctuation value is used as the state fluctuation degree of the initial sliding window at each sampling moment;

[0087] It is understandable that the fusion can be expressed as a multiplication relationship, an addition relationship, etc., which is determined by the actual application and the present application does not impose any special restrictions on this.

[0088] Preferably, in this embodiment, the calculation method of the voltage cumulative fluctuation value of the initial sliding window at each sampling moment is: ,in, Indicates The voltage cumulative fluctuation value of the initial sliding window at the sampling time, For the The first The maximum value of a valid voltage sequence, No. The first The minimum value of a valid voltage sequence, No. The first The first in the effective voltage sequence The voltage signal at the moment, For the The first The mean value of an effective voltage sequence, Indicates taking the absolute value, For the The number of valid voltage sequences within the initial sliding window at the sampling moment, For the The first The length of the effective voltage sequence, Indicates extremely poor, represents the first difference, Indicates the voltage signal difference, Indicates the voltage fluctuation coefficient.

[0089] Further, the step flow chart of the method for obtaining the state fluctuation degree of the initial sliding window at each sampling time provided in the embodiment of the present application is as follows: Figure 2 shown.

[0090] It should be noted that the voltage cumulative fluctuation value reflects the cumulative effect of the local fluctuations of all effective voltage signals in the initial sliding window. The larger the voltage cumulative fluctuation value, the larger the voltage fluctuation in the initial sliding window. The voltage fluctuation is usually caused by noise interference, so the larger the voltage cumulative fluctuation value, the higher the noise level in the initial sliding window. Secondly, the state fluctuation degree reflects the fluctuation degree of the voltage signal in the initial sliding window at each sampling moment. The larger the state fluctuation degree, the larger the fluctuation degree of the voltage signal in the initial sliding window, that is, the more serious the noise interference in the initial sliding window, the larger the window size in the filter should be adjusted to make the smoothing effect more obvious; on the contrary, the window of the filter should be reduced to speed up the response speed.

[0091] At this point, the state fluctuation degree of the initial sliding window at each sampling moment is obtained.

[0092] Step 3: Determine the intermittent influence degree of the initial sliding window at each sampling moment according to the interval time between different peaks and the peak value of the peak in the initial sliding window at each sampling moment.

[0093] Intermittent faults are a major type of fault in electrical connectors, and headphone jacks are no exception. The voltage signal characteristics are short duration, repetitive, and sometimes absent. Adjusting the window size based solely on the degree of state fluctuation does not take into account that electrical connectors may experience performance degradation as they are used for a long time, and intermittent faults are very likely to occur.

[0094] The resistance of the headphone jack contact point is related to a large number of conductive spots formed on the contact surface due to various reasons. The random characteristics of intermittent faults come from the interference of various random factors on the contact surface. When the headphone jack is subjected to slight vibration during use, random intermittent fault peaks may appear in the voltage signal.

[0095] When intermittent faults occur in the initial sliding window at each sampling moment, they appear in a single peak, sometimes in a double peak, and sometimes without obvious fault manifestations. It is impossible to identify whether the interference is caused by intermittent faults or other noises by a single peak value, so it is necessary to select double peak characteristics to analyze the interference level of intermittent faults. Specifically:

[0096] Obtain the peaks of the initial sliding window at each sampling moment, and record two adjacent peaks whose time interval between adjacent peaks is less than a preset time length as a pair of intermittent double peaks;

[0097] The time interval between each pair of intermittent double peaks in the initial sliding window at each sampling moment is recorded as the duration;

[0098] Calculate the mean of the peak values ​​of each pair of intermittent double peaks in the initial sliding window at each sampling time, and record it as the first mean value;

[0099] The duration is merged with the first mean value to serve as the intermittent occurrence intensity of each pair of intermittent double peaks in the initial sliding window at each sampling moment;

[0100] Preferably, in this embodiment, the preset duration is taken as the duration of 5 sampling moments; the product of the duration and the first mean value is used as the intermittent occurrence intensity of each pair of intermittent double peaks in the initial sliding window of each sampling moment.

[0101] It should be noted that if there are intermittent double peaks in the initial sliding window of each sampling time, it means that an intermittent fault has occurred; secondly, the greater the intensity of the intermittent occurrence, the stronger the interference caused by the intermittent fault.

[0102] Furthermore, based on the intermittent occurrence intensity, the impact of signal interference caused by intermittent faults is analyzed, specifically:

[0103] The sampling time corresponding to the previous peak in each pair of intermittent double peaks is recorded as the intermittent occurrence time;

[0104] The time interval between each pair of intermittent double peaks and the intermittent occurrence time of the next pair of intermittent double peaks adjacent to it is recorded as the cumulative occurrence time of each pair of intermittent double peaks;

[0105] It should be noted that if there is no intermittent occurrence time of the next pair of intermittent double peaks after the last pair of intermittent double peaks, at this time, the time interval between the intermittent occurrence time of the last pair of intermittent double peaks and the voltage signal at the last moment of the initial sliding window is taken as the cumulative duration of the occurrence of the last pair of intermittent double peaks.

[0106] The normalized result of the inverse of the cumulative duration of occurrence is used as the intermittent impact weight of each pair of intermittent double peaks;

[0107] The product of the intermittent impact weight and the intermittent occurrence intensity is recorded as the first product;

[0108] The first products of all intermittent double peaks in the initial sliding window at each sampling moment are fused as the intermittent influence degree of the initial sliding window at each sampling moment; wherein, if there is no intermittent double peak in the initial sliding window, the intermittent influence degree is assigned a value of 1; if there is a pair of intermittent double peaks in the initial sliding window, the intermittent influence degree is the intermittent occurrence intensity;

[0109] Preferably, in this embodiment, the calculation method of the intermittent influence degree of the initial sliding window at each sampling moment is: ,in, For the The degree of intermittent influence of the initial sliding window at the sampling time, Indicates The first For the intermittent occurrence time of intermittent double peaks, Indicates The first sliding window at the sampling time For the intermittent occurrence time of intermittent double peaks, For the The first sliding window at the sampling time The intermittent occurrence intensity of intermittent double peaks, To obtain the normalized result, For the The number of intermittent bimodals in the initial sliding window at the sampling time, For the The first sliding window at the sampling time The cumulative duration of intermittent double peaks, For the The first sliding window at the sampling time Weighting of intermittent impact on intermittent bimodality.

[0110] Further, the step flow chart of the method for obtaining the intermittent influence degree of the initial sliding window at each sampling moment provided in the embodiment of the present application is as follows: Figure 3 shown.

[0111] It should be noted that the closer the distance between the occurrence times of each pair of intermittent double peaks, that is, the smaller the cumulative duration of occurrence, the more frequently the intermittent faults occur, and the greater the impact of the intermittent faults in the initial sliding window, and the greater the intermittent impact weight; the intermittent impact degree indicates the degree of interference of the intermittent faults appearing in the initial sliding window on the voltage signal. The greater the intermittent impact degree, the greater the impact caused by the intermittent faults, and the larger the filter window should be adjusted to achieve better smoothing effect and reduce the interference of intermittent faults on the headphone jack status detection.

[0112] At this point, the intermittent influence degree of the initial sliding window at each sampling moment is obtained.

[0113] Step 4: Based on the state fluctuation degree and the intermittent influence degree, determine the sliding window of each sampling time after the filter is adjusted, and detect the state of the electrical connector.

[0114] Based on the above analysis, based on the state fluctuation degree and the intermittent impact degree, the sliding window size of the filter is determined, specifically:

[0115] The normalized result of the product of the state fluctuation degree and the intermittent influence degree of the initial sliding window at each sampling moment is used as the adjustment factor of the initial sliding window at each sampling moment;

[0116] The sliding window at each sampling time after the filter adjustment includes: ,in, The filter is adjusted The sliding window size at the sampling time, For filter The initial sliding window length at the sampling time, is the adjustment factor of the initial sliding window at the tth sampling time, is the preset factor.

[0117] Preferably, in this embodiment, the preset factor The value of is 0.5. As other implementation methods, the implementer can set it according to the actual situation.

[0118] Based on the above analysis, the sliding window of the filter can be adjusted by the volatility of the voltage change within the initial sliding window. When the voltage signal is relatively stable and the noise is low, the filter can use a smaller window to maintain a fast response to signal changes and retain more high-frequency details, which helps to capture the transient characteristics and rapid changes of the signal. On the contrary, when the noise level is high or the signal fluctuates greatly, the filter can increase the window size to enhance the smoothing effect and effectively filter out high-frequency noise, thereby improving the stability and reliability of the signal.

[0119] Furthermore, based on the adjusted sliding window, the voltage signal is denoised to detect the state of the electrical connector, specifically:

[0120] Based on the adjusted sliding window of the filter, the collected original voltage signal is filtered to obtain a filtered voltage signal;

[0121] Preferably, in this embodiment, a moving average filter is used to filter the original voltage signal, wherein the moving average filter is a well-known technology and the specific process will not be described in detail.

[0122] When the voltage signal is not 0, the electrical connector is in a connected state, that is, the earphone is in an inserted state; when the voltage signal is zero, the electrical connector is in a separated state, that is, the earphone is in an unplugged state.

[0123] It should be noted that when the voltage signal is interfered by noise, due to intermittent faults, the voltage value may be zero even if the headphone jack is plugged in. This part of the interference is eliminated after filtering.

[0124] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0125] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0126] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the present application. It should be pointed out that, for those of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application. Therefore, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present application without departing from the content of the technical solution of the present application, shall fall within the protection scope of the technical solution of the present application.

Claims

1. A method for detecting and distinguishing the state of an electrical connector based on data analysis, characterized in that: The method comprises the following steps: Obtaining a voltage signal of the electrical connector at each sampling moment; Taking the voltage signal at each sampling moment as the center, set the initial sliding window of the filter at each sampling moment; Determine the state fluctuation degree of the initial sliding window at each sampling moment according to the difference between the voltage signals at different sampling moments in the initial sliding window at each sampling moment and the degree of fluctuation change; Determine the intermittent influence degree of the initial sliding window at each sampling moment according to the interval time between different peaks and the peak value of the peak in the initial sliding window at each sampling moment; Based on the state fluctuation degree and the intermittent influence degree, determining the sliding window of each sampling moment after the filter is adjusted, and detecting the state of the electrical connector; The determining of the state fluctuation degree of the initial sliding window at each sampling moment includes: Analyze the situation where the voltage signal at adjacent moments of each sampling moment in the initial sliding window is 0, and construct each valid voltage sequence of the initial sliding window at each sampling moment; Analyze the length of each valid voltage sequence and determine the voltage stability weight of the initial sliding window at each sampling moment; Analyze the differences of voltage signals at each sampling moment in each valid voltage sequence, and determine the voltage cumulative fluctuation value of the initial sliding window at each sampling moment; The product of the voltage stability weight and the voltage cumulative fluctuation value is used as the state fluctuation degree of the initial sliding window at each sampling moment.

2. The method for detecting and distinguishing the state of an electrical connector based on data analysis according to claim 1, characterized in that: The method for acquiring each effective voltage sequence of the initial sliding window at each sampling moment is: The voltage signal at each sampling moment, in which only one voltage signal at an adjacent moment is 0, is recorded as a state change point; If the left voltage signal of the state change point in the initial sliding window at each sampling time is 0 and the right voltage signal is greater than 0, the state change point is recorded as the left state change point; if the right voltage signal of the state change point is 0 and the left voltage signal is greater than 0, the state change point is recorded as the right state change point; The voltage signals at all sampling moments between the adjacent left state change points and the right state change points in the initial sliding window at each sampling moment are combined into an effective voltage sequence; Among them, if there is no state change point in the initial sliding window, the voltage signals at all times in the initial sliding window are combined into a valid voltage sequence. If there is a state change point in the initial sliding window, the voltage signals at all times on the side where the voltage signal of the state change point in the initial sliding window is not 0 are combined into a valid voltage sequence.

3. The method for detecting and distinguishing the state of an electrical connector based on data analysis according to claim 1, characterized in that: The step of determining the voltage stability weight of the initial sliding window at each sampling moment includes: Count the length of each valid voltage sequence in the initial sliding window at each sampling moment; The sum of the lengths of all valid voltage sequences in the initial sliding window at each sampling moment is recorded as the voltage accumulation time length of the initial sliding window at each sampling moment; The ratio of the voltage accumulation time to the preset length of the initial sliding window is used as the voltage stability weight of the initial sliding window at each sampling moment.

4. The method for detecting and distinguishing the state of an electrical connector based on data analysis according to claim 1, characterized in that: The step of determining the voltage cumulative fluctuation value of the initial sliding window at each sampling moment includes: Calculate the range and mean of each valid voltage sequence of the initial sliding window at each sampling moment; Record the difference between the voltage signal at each sampling moment in each effective voltage sequence and the mean value as a first difference; Recording the sum of all the first differences in each valid voltage sequence as the voltage signal difference of each valid voltage sequence in the initial sliding window at each sampling moment; The range is merged with the voltage signal difference to determine the voltage fluctuation coefficient of each valid voltage sequence in the initial sliding window at each sampling moment; The accumulated sum of the voltage fluctuation coefficients of all valid voltage sequences in the initial sliding window at each sampling moment is taken as the voltage accumulated fluctuation value of the initial sliding window at each sampling moment.

5. The method for detecting and distinguishing the state of an electrical connector based on data analysis according to claim 1, characterized in that: The step of determining the intermittent influence degree of the initial sliding window at each sampling moment includes: Obtain the peaks of the initial sliding window at each sampling moment, and record two adjacent peaks whose time interval between adjacent peaks is less than a preset time length as a pair of intermittent double peaks; Analyze the time interval length and peak value of each pair of intermittent double peaks, and determine the intermittent occurrence intensity of each pair of intermittent double peaks in the initial sliding window at each sampling time; Analyze the time intervals between two adjacent pairs of intermittent double peaks, and determine the intermittent impact weight of each pair of intermittent double peaks in the initial sliding window at each sampling moment; The product of the intermittent impact weight and the intermittent occurrence intensity is recorded as the first product; The first products of all intermittent double peaks in the initial sliding window at each sampling moment are merged to serve as the intermittent influence degree of the initial sliding window at each sampling moment; Among them, if there is no intermittent double peak in the initial sliding window, the intermittent impact degree is assigned a value of 1; if there is a pair of intermittent double peaks in the initial sliding window, the intermittent impact degree is the intermittent occurrence intensity.

6. The method for detecting and distinguishing the state of an electrical connector based on data analysis according to claim 5, characterized in that: The step of determining the intermittent occurrence intensity of each pair of intermittent double peaks in the initial sliding window at each sampling moment includes: The time interval between each pair of intermittent double peaks in the initial sliding window at each sampling moment is recorded as the duration; Calculate the mean of the peak values ​​of each pair of intermittent double peaks in the initial sliding window at each sampling time, and record it as the first mean value; The duration is fused with the first mean value to serve as the intermittent occurrence intensity of each pair of intermittent double peaks in the initial sliding window at each sampling moment.

7. The method for detecting and distinguishing the state of an electrical connector based on data analysis according to claim 5, characterized in that: The step of determining the intermittent influence weight of each pair of intermittent double peaks in the initial sliding window at each sampling moment includes: The sampling time corresponding to the previous peak in each pair of intermittent double peaks is recorded as the intermittent occurrence time; The time interval between each pair of intermittent double peaks and the intermittent occurrence time of the next pair of intermittent double peaks adjacent to it is recorded as the cumulative occurrence time of each pair of intermittent double peaks; The normalized result of the inverse of the cumulative duration of occurrence is used as the intermittent influence weight of each pair of intermittent double peaks in the initial sliding window at each sampling moment.

8. The method for detecting and distinguishing the state of an electrical connector based on data analysis according to claim 1, characterized in that: The step of determining the sliding window of each sampling time after the filter is adjusted includes: ,in, The filter is adjusted The sliding window size at the sampling time, For filter The initial sliding window length at the sampling time, is the adjustment factor of the initial sliding window at the tth sampling time, is a preset factor; the adjustment factor of the initial sliding window at each sampling moment is the normalized result of the product of the state fluctuation degree and the intermittent influence degree of the initial sliding window at each sampling moment.