Magnetic field interference detection method, magnetic field interference detection equipment and storage medium
By periodically detecting magnetic field interference using a dual-inductor resonant sensor circuit and calculating the offset and offset type, the problem of high cost and low accuracy in magnetic field detection in existing technologies is solved, achieving low-cost and high-precision magnetic field interference detection.
Patent Information
- Application Number
- CN202511388209.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-26
- Publication Date
- 2025-12-26
AI Technical Summary
In existing technologies, magnetic field detection methods are costly, have low accuracy, cannot effectively detect alternating magnetic fields, have poor anti-interference performance, and cannot comprehensively detect magnetic fields in all directions.
By employing a dual-inductor resonant sensor circuit, the resonant frequency signal is periodically detected to obtain the continuous periodic detection frequency, calculate the offset and offset type, and combine it with a preset database to perform magnetic field interference detection, thereby achieving low-cost and high-precision magnetic field interference detection.
It improves the accuracy and precision of magnetic field interference detection, avoids equipment malfunctions caused by misjudged noise, eliminates the need to stack multiple Hall sensors, and achieves low-cost, high-precision detection.
Smart Images

Figure CN121208718A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of magnetic field interference detection, in particular to a magnetic field interference detection method, a magnetic field interference detection device and a storage medium. BACKGROUND
[0002] In the scenarios of power system monitoring, smart meters, leakage current detection and industrial equipment safety monitoring, the stability of the magnetic field environment plays a crucial role in the normal operation of the equipment and the accuracy of data measurement. External magnetic field interference, as a common form of electromagnetic interference, may come from power transmission lines, industrial electrical equipment, electromagnetic induction devices and other scenarios. It not only causes deviations in equipment operating parameters, but also may cause equipment failure, data acquisition distortion and other problems, and in severe cases, it may even affect the safety and reliability of the entire system.
[0003] Currently, the related art mainly relies on a single Hall sensor for magnetic field detection, but this method is costly and cannot effectively detect alternating magnetic fields. In addition, the single Hall sensor has strong directivity, which makes it impossible to comprehensively detect magnetic fields in all directions. If comprehensive detection is to be achieved, multiple Hall sensors need to be connected in parallel, which will further increase the cost. Although some high-precision Hall sensor modules can achieve multi-directional detection and have high precision and detection range, they are large in size, high in cost and power consumption, and poor in anti-interference performance. Therefore, there is an urgent need for a low-cost, high-precision magnetic field interference detection method. SUMMARY
[0004] Embodiments of the present application provide a magnetic field interference detection method, a magnetic field interference detection device and a storage medium to provide a low-cost, high-precision magnetic field interference detection method.
[0005] According to an aspect of an embodiment of the present application, a magnetic field interference detection method is provided, applied to a to-be-detected device, the to-be-detected device being provided with a dual-inductor resonant sensor circuit, the dual-inductor resonant sensor circuit being used to output a resonant frequency signal. The method comprises: periodically detecting the resonant frequency signal output by the dual-inductor resonant sensor circuit to obtain detection frequencies corresponding to at least two consecutive periods respectively; if the detection frequency is outside a preset frequency range, obtaining a target offset of the detection frequency compared to a reference frequency; determining an offset type based on the target offset; wherein the offset type is used to represent the frequency variation law caused by external magnetic field interference on the detection frequency; and performing magnetic field interference detection according to the target offset of the detection frequency and the offset type to obtain a magnetic field interference detection result.
[0006] In another example embodiment, the target offset of the detection frequency relative to the reference frequency is obtained by: obtaining the offset between each detection frequency and the reference frequency; and taking the extreme value of the offsets as the target offset of the detection frequency relative to the reference frequency.
[0007] In another example embodiment, the offset type is determined based on the target offset, including: if the target offsets corresponding to at least two consecutive periods are the same fixed value and are both within a preset offset range, determining that the offset type is a fixed offset; and if the target offsets corresponding to at least two consecutive periods vary regularly with the periods, determining that the offset type is a periodic offset.
[0008] In another example embodiment, the magnetic field interference detection is performed based on the target offset of the detection frequency and the offset type, and a magnetic field interference detection result is obtained, including: matching an interference magnetic field type corresponding to the offset type from a preset database; wherein the preset database stores a correspondence between the offset type and the interference magnetic field type; querying the target offset corresponding to the interference magnetic field size in the database corresponding to the magnetic field interference type; and taking the interference magnetic field type and the interference magnetic field size as the magnetic field interference detection result.
[0009] In another example embodiment, the resonance frequency signal output by the dual-inductor resonant sensor circuit is periodically detected to obtain detection frequencies corresponding to at least two consecutive periods, including: collecting the resonance frequency signal output by the dual-inductor resonant sensor circuit within a preset time period; wherein the preset time period includes at least two consecutive periods; performing interference signal filtering and shaping on the resonance frequency signal within the preset time period to obtain a preset waveform signal; filtering other signals higher than the reference frequency and different from the preset waveform signal from the preset waveform signal to obtain a target waveform signal; and obtaining the detection frequencies corresponding to the at least two consecutive periods from the target waveform signal.
[0010] In another example embodiment, the detection frequencies corresponding to the at least two consecutive periods are obtained from the target waveform signal, including: analyzing the target waveform signal to obtain edge count values and edge type coefficients of the target waveform signal within each period; and performing frequency calculation based on the edge count values and the edge type coefficients to obtain the detection frequency corresponding to each period.
[0011] In another example embodiment, after the resonance frequency signal output by the dual-inductor resonant sensor circuit is periodically detected to obtain detection frequencies corresponding to at least two consecutive periods, the method further includes: performing temperature detection on the device to be detected to obtain an ambient temperature corresponding to the device to be detected; obtaining a temperature difference value between the ambient temperature corresponding to the device to be detected and a preset temperature threshold; determining a frequency compensation value corresponding to the detection frequency based on the temperature difference value; and calibrating the detection frequency based on the frequency compensation value.
[0012] In another example embodiment, the frequency compensation value corresponding to the detection frequency is determined according to the temperature difference value, so as to calibrate the detection frequency based on the frequency compensation value, comprising: matching the frequency compensation value corresponding to the temperature difference value from a preset database; wherein the preset database stores the corresponding relationship between the temperature difference value and the frequency compensation value; and taking the sum of the detection frequency and the frequency compensation value as the calibrated detection frequency.
[0013] According to an aspect of the embodiments of the present application, a magnetic field interference detection device is provided, comprising: a dual-inductor resonant sensor circuit, configured to output a resonant frequency signal; and a magnetic field interference detection unit, configured to perform the magnetic field interference detection method as described above.
[0014] According to an aspect of the embodiments of the present application, a computer readable storage medium is provided, having computer readable instructions stored thereon, which, when executed by a processor of a computer, cause the computer to perform the magnetic field interference detection method as described above.
[0015] In the technical solutions provided by the embodiments of the present application, on the one hand, a plurality of continuous periods of detection frequencies are obtained through periodic detection, which can reduce errors caused by single detection, and then the target offset of the detection frequency is calculated with reference to the reference frequency, which can convert the magnetic field interference strength into a quantifiable frequency difference value. Compared with the analog voltage output of the Hall sensor, the frequency signal is more stable and less susceptible to voltage fluctuations, and the detection accuracy is higher. On the other hand, since the offset type can represent the frequency variation law of the detection frequency caused by external magnetic field interference, the magnetic field interference detection is performed based on the target offset combined with the offset type, which can improve the accuracy of the magnetic field interference detection, avoid equipment malfunctions caused by misjudging noise as interference, and realize the magnetic field interference detection without stacking multiple Hall sensors, thereby realizing low-cost and high-precision magnetic field interference detection.
[0016] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS
[0017] The drawings herein are incorporated into the specification and form part of the specification, show embodiments consistent with the present application, and together with the specification serve to explain the principles of the present application. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other drawings from these drawings without creative labor. In the drawings:
[0018] Figure 1is a schematic diagram of an implementation environment related to a magnetic field interference detection method shown in an example embodiment of the present application.
[0019] Figure 2 is a flowchart of a magnetic field interference detection method shown in an example embodiment of the present application.
[0020] Figure 3 is Figure 2 is a flowchart of a method of periodically detecting a resonant frequency signal in step S210 in the embodiment shown.
[0021] Figure 4 is Figure 2 is a flowchart of a method of obtaining a target offset of a detected frequency compared to a reference frequency in step S220 in the embodiment shown.
[0022] Figure 5 is Figure 2 is a flowchart of a method of determining an offset type based on the target offset in step S230 in the embodiment shown.
[0023] Figure 6 is a flowchart of a magnetic field interference detection method shown in another example embodiment of the present application.
[0024] Figure 7 is a structural schematic diagram of a dual-inductor resonant sensor circuit shown in an example embodiment of the present application.
[0025] Figure 8 is a structural schematic diagram of a dual-inductor resonant sensor circuit shown in another example embodiment of the present application.
[0026] Figure 9 is a flowchart of a magnetic field interference detection method shown in another example embodiment of the present application. DETAILED DESCRIPTION
[0027] The example embodiments will be described in detail herein with specific reference to the attached drawings. Descriptions of well-known structures and functions can be omitted so as not to obscure the disclosure. The following detailed description is presented in terms of a number of example embodiments, herein presented with reference to attached drawings. These embodiments are described in detail for the purposes of enabling those skilled in the art to implement the example embodiments and are not intended to limit the scope of the disclosure. The description is presented in terms of example embodiments and applications, with reference to a number of individual figures. After considering this discussion, those skilled in the art will be able to employ the example embodiments described herein, in its applications to various embodiments and modifications thereof. There are a number of examples of devices and methods that have been described throughout the present specification in relation to the subject matter of the present application.
[0028] The block diagrams shown in the drawings are merely functional entities and do not necessarily have to correspond to physically independent entities. That is, the functional entities can be implemented in the form of application programs, or in one or more hardware modules or integrated circuits, or in different models and / or processor devices and / or microcontroller devices.
[0029] The flowcharts shown in the drawings are merely exemplary illustrations and do not necessarily include all contents and operations / steps, nor are they necessarily executed in the order described. For example, some operations / steps can be further decomposed, and some operations / steps can be combined or partially combined, so the actual execution order can be changed according to actual conditions.
[0030] It should be noted that "multiple" referred to in the present application means two or more. The association relationship of "and / or" describes the associated objects, which means that there can be three relationships, for example, A and / or B can represent the three cases of A alone, A and B together, and B alone. The character " / " generally represents that the associated objects before and after are in an "or" relationship.
[0031] To facilitate understanding of the magnetic field interference detection method provided by the embodiments of the present application, the magnetic field interference detection scenario will be introduced below in conjunction with an implementation environment shown in Figure 1 The implementation environment is specifically a magnetic field interference detection system, as shown in Figure 1 The magnetic field interference detection system includes a terminal 110 and a server 120. The terminal 110 and the server 120 can be directly or indirectly connected in communication through wired or wireless means. The embodiments of the present application do not limit the connection mode between the terminal and the server.
[0032] The terminal 110 refers to a to-be-detected device provided with a dual-inductance resonant sensor circuit in the embodiments of the present application. The to-be-detected device can include but is not limited to: a metering electric meter, a leakage protector, and a safety monitoring device, etc.
[0033] The server 120 can include but is not limited to: a data processing server, a Web server, an application server, and other devices with complex computing capabilities. The server can be a standalone physical server, or a server cluster or distributed system composed of multiple physical servers. Different services (such as acquisition services and recommendation services) can be deployed on the same server, or on different servers.
[0034] In some embodiments, the device to be detected in the present application can be a meter for preventing electricity theft. Among the existing electricity theft methods, magnetic field electricity theft is particularly prominent. This electricity theft method can affect the measurement accuracy of the meter through a direct current magnetic field or an alternating current magnetic field, resulting in inaccurate electricity measurement. In the present application, a double-inductor resonant sensor circuit is provided in the device to be detected. In the absence of external magnetic field interference, a fixed resonant frequency signal is output. If there is external magnetic field interference, the resonant frequency output by the double-inductor resonant sensor circuit will be affected. The control unit in the device to be detected periodically detects the resonant frequency output by the double-inductor resonant sensor circuit, obtains the detection frequency corresponding to at least two consecutive periods respectively, and then judges the detection frequency. If the detection frequency is outside the preset frequency range, the target offset of the detection frequency relative to the reference frequency is obtained. Based on the target offset, the offset type is determined. According to the target offset of the detection frequency and the offset type, magnetic field interference detection is performed to obtain a magnetic field interference detection result. In this way, without stacking multiple Hall sensors, low-cost and high-precision magnetic field interference detection can be achieved, and the power operator can be reminded in the presence of external magnetic field interference to effectively prevent electricity theft.
[0035] The magnetic field interference detection method provided by the embodiments of the present application will be described in detail below.
[0036] Please continue to refer to Figure 2 , Figure 2 is a flowchart of the magnetic field interference detection method according to an exemplary embodiment of the present application. The method can be applied to the implementation environment shown in Figure 1 , for example, can be executed by the terminal 110 or the server 120 in the implementation environment shown in Figure 1 , or jointly executed by the terminal 110 and the server 120, which is not limited herein. Of course, the method can also be applied to other implementation environments and executed by the terminal or server in other implementation environments, or jointly executed by the terminal and server in other implementation environments, and the present embodiment also does not limit this.
[0037] As shown in Figure 2 , in an exemplary embodiment, the magnetic field interference detection method is applied to a device to be detected. The device to be detected is provided with a double-inductor resonant sensor circuit, and the double-inductor resonant sensor circuit is used to output a resonant frequency signal. The method includes at least steps S210 to S240, which are described in detail as follows:
[0038] Step S210, periodically detecting the resonant frequency signal output by the double-inductor resonant sensor circuit to obtain the detection frequency corresponding to at least two consecutive periods respectively.
[0039] In the embodiments of the present application, the dual-inductor resonant sensor circuit is arranged in the device to be detected. If there is no external interference magnetic field, the dual-inductor resonant sensor circuit outputs a fixed resonant frequency signal, for example, a 10 kHz sine wave signal. If there is an external interference magnetic field, the output resonant frequency signal will be affected and changed. Different types of interference magnetic fields will cause different changes in the output resonant frequency signal. Therefore, by periodically detecting the resonant frequency signal output by the dual-inductor resonant sensor circuit, at least two continuous periods of detection frequency are obtained, accidental errors (such as frequency fluctuations caused by transient noise) caused by single detection are avoided, and by consistency judgment of multi-period data, false positives caused by abnormal data are reduced, providing more accurate basic frequency data for subsequent analysis of the type and size of the interference magnetic field.
[0040] In some embodiments, each period in the periodic detection in the embodiments of the present application can be a power frequency period, that is, a period corresponding to the power frequency. The power frequency refers to the standard frequency of alternating current in a power system (for example, 50 Hz). That is, 50 cycles of period change are completed per second, so the period corresponding to the power frequency is 1 / 50 = 0.02 s, and a power frequency period can be 0.02 s. For example, the periodic detection can be periodic detection in a set time window, for example, the set time window is 0.1 s, and 0.1 s includes 5 power frequency periods, so the detection frequency corresponding to the continuous 5 power frequency periods can be obtained.
[0041] In step S220, if the detection frequency is outside the preset frequency range, the target offset of the detection frequency compared with the reference frequency is obtained.
[0042] It can be understood that even if the environment where the device to be detected is located does not have an external interference magnetic field, due to the inherent device bias in the dual-inductor resonant sensor circuit, for example, the manufacturing tolerance and temperature coefficient of inductors, capacitors and other components will cause a slight shift in the resonant frequency, and environmental noise coupling, for example, signal crosstalk or electromagnetic radiation noise, will superimpose on the resonant signal, causing frequency jitter. Therefore, the resonant frequency signal output by the dual-inductor resonant sensor circuit will not be a fixed value set in advance, but will fluctuate within a certain range around a reference frequency (for example, 10 kHz). In order to distinguish between normal fluctuations and real magnetic field interference, a preset frequency range can be set, for example, 10 kHz ± 1%, which is used as the threshold for normal frequency fluctuations. Only when the detection frequency exceeds this range, it is determined that there is magnetic field interference, which can improve the accuracy of magnetic field interference detection.
[0043] In the embodiments of the present application, by taking the reference frequency as a reference, the target offset of the detection frequency compared with the reference frequency is obtained, so as to convert the magnetic field strength of the external interference magnetic field into a quantifiable frequency difference value. Compared with the analog voltage output of the Hall sensor, the frequency signal is more stable and less affected by voltage fluctuations, and the detection accuracy is higher, so as to further improve the accuracy of the magnetic interference detection.
[0044] In step S230, the offset type is determined based on the target offset; wherein the offset type is used to represent the frequency variation law of the detection frequency caused by the external magnetic field interference.
[0045] Since different types of external interference magnetic fields will have different effects on the detection frequency, by analyzing the offset, the frequency variation law of the detection frequency caused by the external magnetic field interference is obtained, and then the type of the external interference magnetic field at this time can be accurately distinguished.
[0046] In some embodiments, the offset type includes fixed offset and periodic offset.
[0047] The fixed offset means that the detection frequency will be stable around a new constant different from the reference frequency, that is, the frequency difference (i.e. offset) between the detection frequency and the reference frequency is a same fixed value.
[0048] For example, the two consecutive periods include a first period and a second period, the detection frequencies of the two periods are both 10.9 kHz, and the offsets between the detection frequencies and the reference frequency 10 kHz are both 0.9 kHz, which is a same fixed value, so it can be considered as a fixed offset.
[0049] The periodic offset means that the detection frequency will periodically fluctuate around a certain center value (for example, the reference frequency).
[0050] For example, the two consecutive periods include a first period and a second period, the detection frequencies of the two periods are 10.9 kHz and 9.1 kHz respectively, and the offsets between the detection frequencies and the reference frequency 10 kHz are ±0.5 kHz, which is a regular change repeated with the period, so it can be considered as a periodic offset.
[0051] In step S240, the magnetic field interference detection is performed according to the target offset corresponding to the detection frequency and the offset type, and a magnetic field interference detection result is obtained.
[0052] Since the Hall sensor is susceptible to environmental noise (such as power grid harmonics, equipment electromagnetic interference) in low-frequency (for example, 50Hz) alternating magnetic field detection in the prior art, it cannot effectively detect low-frequency alternating magnetic fields. Compared with this, since the offset type in the embodiment of the application can represent the frequency variation law caused by the interference of external magnetic fields on the detection frequency, by combining the magnetic field interference detection based on the target offset amount with the offset type, not only can different types of external interference magnetic fields be identified, but also the accuracy of the magnetic field interference detection can be improved, avoiding equipment malfunctions caused by misjudging noise as interference, and without stacking multiple Hall sensors, more accurate magnetic field interference detection can be achieved, thereby realizing low-cost and high-precision magnetic field interference detection.
[0053] Exemplarily, the magnetic field interference detection in the embodiment of the application can be performed through the following flow, comprising:
[0054] Step S241, matching the interference magnetic field type corresponding to the offset type from the preset database; wherein the preset database stores the correspondence between the offset type and the interference magnetic field type;
[0055] Step S242, querying the interference magnetic field size corresponding to the target offset amount in the database corresponding to the magnetic field interference type;
[0056] Step S243, taking the interference magnetic field type and the interference magnetic field size as the magnetic field interference detection result.
[0057] In the embodiment of the application, the correspondence between multiple groups of different target offset amounts and different interference magnetic field sizes under different magnetic field interference type scenarios can be pre-collected and stored in the corresponding database, which facilitates direct data matching, thereby improving the detection efficiency and detection accuracy.
[0058] In another embodiment, after the magnetic field interference detection is performed according to the target offset amount and the offset type corresponding to the detection frequency, the magnetic field interference detection result is obtained, and further comprising: if multiple interference magnetic field sizes detected within a preset period of time all exceed a preset threshold, reporting an exception to the operator of the device to be detected.
[0059] In this way, when the device to be detected is a meter, if external magnetic field interference is detected and exceeds the preset threshold for a long time, it is considered that there may be electricity stealing behavior at this time, and by reporting an exception to the operator, electricity stealing behavior can be effectively prevented. When the device to be detected is other security monitoring equipment, it can also be reported in time in the case of magnetic field interference exception, thereby playing a safety warning role.
[0060] In another embodiment, in combination with Figure 3 as shown, Figure 3 is Figure 2The step S210 in the embodiment shown is a flowchart of a method of periodically detecting a resonance frequency signal, which includes at least steps S310 to S340 in an exemplary embodiment, and is described in detail as follows:
[0061] In step S310, a resonance frequency signal output by the dual-inductor resonance sensor circuit in a preset time period is collected.
[0062] The preset time period includes at least two continuous periods, and the resonance frequency signal output by the dual-inductor resonance sensor circuit is a sine wave signal.
[0063] In step S320, the resonance frequency signal in the preset time period is subjected to interference signal filtering and shaping to obtain a preset waveform signal.
[0064] In the embodiment of the application, the preset low-pass filter can be used to filter out interference signals (such as high-frequency electromagnetic interference, power supply noise, component noise, etc.). In some embodiments, the cutoff frequency of the low-pass filter is 12 kHz, so that high-frequency signals higher than 12 kHz can be filtered out to prevent aliasing. Then, the waveform is shaped by the buffer to output the preset waveform signal, so that the original characteristics of the waveform can be restored. In some embodiments, the preset waveform signal is a standard square wave signal.
[0065] In step S330, other signals higher than the reference frequency and different from the preset waveform signal are filtered out from the preset waveform signal to obtain a target waveform signal.
[0066] In the embodiment of the application, the control unit (MCU) can be used to perform secondary filtering according to the pre-set filtering algorithm to filter out other signals higher than the reference frequency and different from the preset waveform signal from the preset waveform signal, so that the software low-pass filtering effect can be achieved to prevent the harmonic components during resonance from interfering with the result and improve the reliability.
[0067] In step S340, the detection frequencies corresponding to the at least two continuous periods are obtained based on the target waveform signal.
[0068] As described above, in the embodiment of the application, the interference signals are filtered out twice and the waveform is shaped, which can effectively reduce the influence of environmental noise on the output resonance frequency signal, thereby suppressing common-mode interference, so that a more accurate detection frequency can be calculated based on the target waveform signal, and the signal-to-noise ratio can be improved by more than 80%.
[0069] In some embodiments, the detection frequencies corresponding to the two continuous periods can be obtained based on the target waveform signal in the application by the following flowchart, which includes:
[0070] Step S341: Analyze the target waveform signal to obtain the edge count value and edge type coefficient of the target waveform signal in each cycle.
[0071] In this embodiment, a preset voltage threshold can be set, and then statistics can be performed on the target waveform signal. When the signal exceeds the preset voltage threshold, it is considered a rising edge; when it is below the preset voltage threshold, it is considered a falling edge, thus obtaining the edge count value in each cycle. In this embodiment, the edge type coefficient refers to the number of zero crossings in one cycle, which can be preset to 2. For example, for a square wave, there are two zero crossings in one cycle, namely one rising edge and one falling edge.
[0072] Step S342: Calculate the frequency based on the edge count value and the edge type coefficient to obtain the detection frequency corresponding to each cycle.
[0073] In some embodiments, by calculation Obtain the detection frequency corresponding to each cycle; where f i Let N be the detection frequency corresponding to the i-th period. i Let n be the total number of edges detected in the i-th period. i The number of zero crossings detected in the i-th cycle (n when triggered by both edges) i =2, n when triggered by a single edge i =1), where Δt is the length of the periodic time window.
[0074] For example, if 100 double-edge triggers are detected within 1 second, the calculated detection frequency is f = 100 / (2×1) = 10kHz.
[0075] In another embodiment, combined Figure 4 As shown, Figure 4 yes Figure 2 The flowchart of step S220 in the illustrated embodiment, which describes a method for obtaining the target offset of the detection frequency relative to the reference frequency in an exemplary embodiment, includes at least steps S410 to S420, as detailed below:
[0076] Step S410: Obtain the offset between each detection frequency and the reference frequency.
[0077] Step S420: The extreme value in the offset is taken as the target offset of the detection frequency relative to the reference frequency.
[0078] It can be understood that the external interference magnetic field is not always stable, and there can be instantaneous strong interference (such as pulse magnetic field when industrial equipment starts and stops) or phased strong interference (such as magnetic field fluctuation when power line load suddenly increases), which is often the core cause of device parameter deviation and data distortion. If the average offset or a random single offset is used as the basis for evaluation, the strong interference signal can be diluted by weak interference data, resulting in the weakening or even covering of the influence of strong interference. The extreme value of the offset is used as the target offset, which can directly lock the maximum influence of the magnetic field interference on the frequency in the detection period, ensuring that all significant interferences that can cause device abnormalities can be accurately identified, and avoiding the missed judgment of interference due to insufficient data representation.
[0079] For example, if the collected detection frequencies include two consecutive periods corresponding to detection frequencies, such as 10.9 kHz in the first period and 10.8 kHz in the second period, and the reference frequency is 10 kHz. The extreme values of the offset include the maximum value: the offset between the detection frequency 10.9 kHz in the first period and the reference frequency 10 kHz is 0.9 kHz, and the minimum value: the offset between the detection frequency 10.8 kHz in the second period and the reference frequency 10 kHz is 0.8 kHz. The extreme value of the offset 0.9 kHz and the extreme value of the offset 0.8 kHz are used as the target offset of the detection frequency compared with the reference frequency.
[0080] For example, if the collected detection frequencies include two consecutive periods corresponding to detection frequencies, such as 10.9 kHz in the first period and 9.1 kHz in the second period, and the reference frequency is 10 kHz. The extreme values of the offset include the maximum value: the offset between the detection frequency 10.9 kHz in the first period and the reference frequency 10 kHz is 0.9 kHz, and the minimum value: the offset between the detection frequency 9.1 kHz in the second period and the reference frequency 10 kHz is -0.9 kHz. The extreme value of the offset 0.9 kHz and the extreme value of the offset -0.9 kHz are used as the target offset of the detection frequency compared with the reference frequency.
[0081] In some embodiments, in combination with Figure 5 As shown in the figure, Figure 5 is Figure 2 The step S230 in the embodiment shown is a flowchart of a method for determining the offset type based on the target offset in an exemplary embodiment, which at least includes steps S510 to S520, which are described in detail as follows:
[0082] Step S510, if the target offset corresponding to at least two consecutive periods is the same fixed value, and is within the preset offset range, the offset type is determined as fixed offset.
[0083] For example, the preset offset range is 0.8-1.0 kHz, if the target offset values corresponding to the two continuous periods are 0.9 kHz and 0.89 kHz respectively, both of which are within the preset offset range, then the offset type is determined as fixed offset.
[0084] Step S520, if the target offset values corresponding to the at least two continuous periods change regularly and repeatedly with the period, then the offset type is determined as period offset.
[0085] For example, if the target offset values corresponding to the two continuous periods are +0.9 kHz and -0.9 kHz, it can be seen that the target offset values corresponding to the two continuous periods change regularly and repeatedly with the period, then the offset type is determined as period offset. For another example, if the target offset values corresponding to the four continuous periods are +0.9 kHz, -0.9 kHz, +0.9 kHz, -0.9 kHz, then the target offset values corresponding to the four continuous periods change regularly and repeatedly with the period, then the offset type is determined as period offset.
[0086] It should be noted that the step content related in the embodiments of the present application is consistent with the corresponding step content recorded in the foregoing embodiments, therefore, the detailed description of these steps is described in the foregoing embodiments, and the embodiments of the present application will not be described again.
[0087] In another embodiment, in combination with Figure 6 shown, Figure 6 is a flow chart of a magnetic field interference detection method shown in another exemplary embodiment of the present application, after step 210 in the embodiment shown in Figure 2 the embodiment, at least further comprising steps S610-S630, which are described in detail as follows:
[0088] Step S610, temperature detection is performed on the to-be-detected device to obtain the ambient temperature corresponding to the to-be-detected device.
[0089] Step S620, the temperature difference value between the ambient temperature corresponding to the to-be-detected device and the preset temperature threshold value is obtained.
[0090] Step S630, the frequency compensation value corresponding to the detection frequency is determined according to the temperature difference value, so as to calibrate the detection frequency based on the frequency compensation value.
[0091] In the embodiments of the present application, considering that the environmental temperature will also affect the components in the dual-inductor resonant sensor circuit, thereby affecting the output resonant frequency signal, by analyzing the temperature difference between the environmental temperature and the preset temperature threshold, the frequency compensation value under different temperature difference conditions is determined, the detection frequency is calibrated based on the frequency compensation value, the periodic zero point drift is corrected, the temperature drift error is reduced to ±0.2% / °C, the error caused by long-term temperature drift accumulation is eliminated, the interference of temperature fluctuation on the circuit output is reduced, the stability of the output signal under different temperature conditions is ensured, thereby improving the reliability and consistency of the overall system, and without external isolation power supply or high-precision reference source, the cost of single-chip solution is reduced by 60%.
[0092] The frequency compensation value corresponding to the detection frequency can be determined according to the temperature difference value through the following process to calibrate the detection frequency based on the frequency compensation value, comprising:
[0093] Step S631, matching the frequency compensation value corresponding to the temperature difference value from the preset database; wherein the preset database stores the corresponding relationship between the temperature difference value and the frequency compensation value;
[0094] Step S632, taking the sum of the detection frequency and the frequency compensation value as the calibrated detection frequency.
[0095] In the embodiments of the present application, the corresponding relationship between the temperature difference value and the frequency compensation value under different temperature conditions can be pre-acquired and stored in the database, so that in subsequent use, direct mapping instead of complex calculation can be used, and the frequency compensation value corresponding to the temperature difference value can be directly found from the database, thereby improving the efficiency.
[0096] Please continue to refer to Figure 7 and Figure 8 , combined with Figure 7 shown, Figure 7 is a structural schematic diagram of a dual-inductor resonant sensor circuit according to an exemplary embodiment of the present application. Figure 7The dual-inductor resonant sensor circuit includes a resonant circuit 701, a bias circuit 702, a second capacitor C2, and a fifth capacitor C5. The resonant circuit 701 consists of a first capacitor C1, a third capacitor C3, a fourth capacitor C4, and symmetrically arranged first inductors PL1 and second inductors PL2. The resonant circuit 701 generates a resonant frequency signal. The bias circuit 702 consists of a first resistor R1, a second resistor R2, a third resistor R3, a fourth resistor R4, and a transistor Q1. The first resistor R1, second resistor R2, third resistor R3, and fourth resistor R4 provide a fixed bias, ensuring that the transistor Q1 operates stably in either the cutoff or conduction state, preventing it from entering the linear amplification region. The second capacitor C2 samples the signal from the resonant circuit and feeds it back to the transistor Q1, maintaining self-oscillation. The fifth capacitor C5 prevents power supply noise from interfering with the pure sine wave generated by the resonant circuit, ensuring voltage stability and waveform integrity. In this embodiment of the application, by setting two symmetrically arranged first inductors PL1 and second inductors PL2, the symmetrical physical structure can make the coupling amount of common-mode noise consistent in each channel or wire, thereby achieving a differential effect, suppressing common-mode noise in the environment, and improving the signal-to-noise ratio by more than 80%.
[0097] Combination Figure 8 As shown, Figure 8 This is a schematic diagram of the structure of a dual-inductor resonant sensor circuit, as shown in another exemplary embodiment of this application. Figure 8 In Figure 7 The circuit shown is based on a dual-inductor resonant sensor circuit, with the addition of a low-pass filter 801 and a buffer 802. The low-pass filter 801, composed of a fifth resistor R5 and a sixth capacitor C6, filters out high-frequency noise in the resonant frequency signal output by the dual-inductor resonant sensor circuit, preventing aliasing and reducing noise interference. The buffer 802 shapes the signal waveform obtained after filtering by the low-pass filter 801, making the output signal waveform a square wave, facilitating high-speed GPIO detection of the square wave by the control unit (MCU) to obtain the detection frequency. Thus, in this embodiment, by setting up symmetrically arranged dual inductors and a low-pass filter, the risk of the effective signal being submerged due to the susceptibility of Hall sensors in low-frequency magnetic fields to environmental noise (such as power grid harmonics and equipment electromagnetic interference) in the prior art can be avoided. The symmetrical arrangement of dual inductors in this application combines differential structure with digital filtering, significantly suppressing environmental noise interference.
[0098] In another embodiment, combined Figure 9 As shown, Figure 9 This is a flowchart illustrating a magnetic field interference detection method in another exemplary embodiment of this application, which includes at least steps S910 to S990, detailed below:
[0099] In step S910, a resonance frequency signal output by the dual-inductor resonance circuit in a preset time period is collected; the preset time period includes at least two continuous periods.
[0100] In step S920, the resonance frequency signal in the preset time period is filtered and shaped to obtain a preset waveform signal.
[0101] In step S930, other signals higher than the reference frequency and different from the preset waveform signal are filtered from the preset waveform signal to obtain a target waveform signal.
[0102] In step S940, a detection frequency corresponding to each of the at least two continuous periods is obtained based on the target waveform signal.
[0103] In step S950, it is determined whether the detection frequency is within a preset frequency range; if not, step S960 is performed, and if yes, step S990 is performed.
[0104] In step S960, it is determined whether a target offset of the detection frequency relative to the reference frequency corresponds to a period offset; if yes, step S970 is performed, and if no, step S980 is performed.
[0105] In step S970, it is determined that the interference magnetic field type is an alternating magnetic field interference, and an interference magnetic field size corresponding to the target offset is queried from a corresponding database. Then the process ends.
[0106] In step S980, it is determined that the interference magnetic field type is a direct-current magnetic field interference, and an interference magnetic field size corresponding to the target offset is queried from a corresponding database. Then the process ends.
[0107] In step S990, it is determined that there is no external magnetic field interference at this time. Then the process ends.
[0108] In the embodiments of the present application, on the one hand, the detection frequencies of multiple continuous periods are obtained through periodic detection, which can reduce errors caused by single detection, and then the target offset of the detection frequency is calculated with reference to the reference frequency, which can convert the magnetic field interference strength into a quantifiable frequency difference. Compared with the analog voltage output of the Hall sensor, the frequency signal is more stable and less affected by voltage fluctuations, and the detection accuracy is higher. On the other hand, since the offset type can represent the frequency variation law of the detection frequency caused by external magnetic field interference, the magnetic field interference detection can be improved by combining the offset type based on the target offset, which can avoid equipment malfunctions caused by misjudging noise as interference, and the magnetic field interference detection can be realized without stacking multiple Hall sensors, thereby realizing low-cost and high-precision magnetic field interference detection.
[0109] It should be noted that the step content related in the embodiments of the present application is consistent with the corresponding step content described in the foregoing embodiments, therefore, the detailed description of these steps is described in the foregoing embodiments, and the embodiments of the present application will not be described again.
[0110] The embodiments of the present application also provide a magnetic field interference detection device, comprising: a dual-inductor resonant sensor circuit and a magnetic field interference detection unit. The dual-inductor resonant sensor circuit is configured to output a resonant frequency signal; and the magnetic field interference detection unit is configured to perform the magnetic field interference detection method as described above.
[0111] Exemplarily, the magnetic field interference detection device can include, but is not limited to, an electromagnetic detector, a magnetometer, and the like.
[0112] For example, when the magnetic field interference detection is performed on the to-be-detected device, the magnetic field interference detection device can be placed within a preset range from the to-be-detected device, if there is an external interference magnetic field at this time, the fixed frequency output by the dual-inductor resonant sensor circuit in the magnetic field interference detection device will be disturbed, thereby fluctuating, the magnetic field interference detection unit in the magnetic field interference detection device detects the resonant frequency output by the dual-inductor resonant sensor circuit periodically, obtains the detection frequency corresponding to at least two continuous periods respectively, and then judges the detection frequency, if the detection frequency is outside the preset frequency range, the target offset of the detection frequency compared with the reference frequency is obtained; the offset type is determined based on the target offset; and the magnetic field interference detection is performed according to the target offset of the detection frequency and the offset type, and the magnetic field interference detection result is obtained. In this way, without stacking multiple Hall sensors, the magnetic field interference detection with low cost and high precision can be realized.
[0113] Another aspect of the present application also provides a computer readable storage medium having a computer program stored thereon, the computer program is executed by a processor to implement the magnetic field interference detection method as described above. The computer readable storage medium can be included in the to-be-detected device or the magnetic field interference detection device described in the above embodiments, or can exist separately and not be assembled into the to-be-detected device or the magnetic field interference detection device.
[0114] The above is only a preferred exemplary embodiment of the present application, not for limiting the implementation of the present application, and those skilled in the art can easily make corresponding modifications or modifications according to the main idea and spirit of the present application, therefore, the protection scope of the present application should be subject to the protection scope required by the claims.
Claims
1. A method for detecting magnetic field interference, characterized in that, The method is applied to a device under test, wherein the device under test is equipped with a dual-inductor resonant sensor circuit, the dual-inductor resonant sensor circuit being used to output a resonant frequency signal, the method comprising: The resonant frequency signal output by the dual-inductor resonant sensor circuit is periodically detected to obtain the detection frequencies corresponding to at least two consecutive cycles. If the detection frequency is outside the preset frequency range, then the target offset of the detection frequency relative to the reference frequency is obtained; The offset type is determined based on the target offset; wherein, the offset type is used to characterize the frequency change pattern caused by external magnetic field interference of the detection frequency; Magnetic field interference detection is performed based on the target offset corresponding to the detection frequency and the offset type to obtain the magnetic field interference detection result.
2. The method according to claim 1, characterized in that, The step of obtaining the target offset of the detection frequency relative to the reference frequency includes: Obtain the offset between each detection frequency and the reference frequency; The extreme value in the offset is taken as the target offset of the detection frequency relative to the reference frequency.
3. The method according to claim 2, characterized in that, Determining the offset type based on the target offset includes: If the target offset corresponding to at least two consecutive cycles is the same fixed value and both are within a preset offset range, then the offset type is determined to be a fixed offset. If the target offset corresponding to at least two consecutive cycles changes regularly with the cycle, then the offset type is determined to be a periodic offset.
4. The method according to claim 1, characterized in that, The step of performing magnetic field interference detection based on the target offset corresponding to the detection frequency and the offset type to obtain magnetic field interference detection results includes: The interference magnetic field type corresponding to the offset type is matched from the preset database; wherein, the preset database stores the correspondence between offset types and interference magnetic field types; In the database corresponding to the type of magnetic field interference, query the magnitude of the interfering magnetic field corresponding to the target offset; The type and magnitude of the interfering magnetic field are used as the results of the magnetic field interference detection.
5. The method according to claim 1, characterized in that, The step of periodically detecting the resonant frequency signal output by the dual-inductor resonant sensor circuit to obtain the detection frequencies corresponding to at least two consecutive periods includes: The resonant frequency signal output by the dual-inductor resonant sensor circuit is acquired within a preset time period; wherein the preset time period includes at least two consecutive cycles; The resonant frequency signal within the preset time period is subjected to interference signal filtering and shaping to obtain a preset waveform signal; The target waveform signal is obtained by filtering out signals higher than the reference frequency and signals different from the preset waveform signal from the preset waveform signal. The detection frequencies corresponding to at least two consecutive cycles are obtained based on the target waveform signal.
6. The method according to claim 5, characterized in that, The step of obtaining the detection frequencies corresponding to at least two consecutive cycles based on the target waveform signal includes: The target waveform signal is analyzed to obtain the edge count value and edge type coefficient of the target waveform signal in each cycle; Frequency is calculated based on the edge count value and the edge type coefficient to obtain the detection frequency corresponding to each cycle.
7. The method according to claim 1 or 5, characterized in that, After periodically detecting the resonant frequency signal output by the dual-inductor resonant sensor circuit to obtain the detection frequencies corresponding to at least two consecutive periods, the method further includes: Temperature detection is performed on the device under test to obtain the ambient temperature corresponding to the device under test; Obtain the temperature difference between the ambient temperature of the device under test and a preset temperature threshold. The frequency compensation value corresponding to the detection frequency is determined based on the temperature difference value, and the detection frequency is calibrated based on the frequency compensation value.
8. The method according to claim 1, characterized in that, The step of determining the frequency compensation value corresponding to the detection frequency based on the temperature difference value, and calibrating the detection frequency based on the frequency compensation value, includes: The frequency compensation value corresponding to the temperature difference value is matched from the preset database; wherein, the preset database stores the correspondence between temperature difference values and frequency compensation values; The sum of the detection frequency and the frequency compensation value is taken as the calibrated detection frequency.
9. A magnetic field interference detection device, characterized in that, include: A dual-inductor resonant sensor circuit, wherein the dual-inductor resonant sensor circuit is used to output a resonant frequency signal; as well as, A magnetic field interference detection unit, the magnetic field interference detection unit being configured to perform the magnetic field interference detection method as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, It stores computer-readable instructions, which, when executed by the processor of a computer, cause the computer to perform the magnetic field interference detection method according to any one of claims 1 to 8.