Neural network based magnetic sensor array anti-interference current measurement method and system
By constructing a training dataset and optimizing the network structure using a neural network-based magnetic sensor array, the anti-interference problem of magnetic sensors in complex environments was solved, and high-precision current measurement was achieved.
Patent Information
- Application Number
- CN202411211684.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2044-08-30
AI Technical Summary
Existing magnetic sensors are unable to effectively resist multi-factor magnetic field interference in complex environments, leading to a decrease in current measurement accuracy.
A neural network-based magnetic sensor array is used to construct a training dataset by collecting sample vectors of magnetic field detection values under different environments. A multi-input single-output feedforward neural network model is then used to establish a mapping relationship between magnetic field detection values and conductor current, and the network structure is optimized to resist interference.
It improves the accuracy and anti-interference ability of current measurement, simplifies the sensor structure, and reduces costs.
Smart Images

Figure CN119310326B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of magnetic sensors, in particular to a magnetic sensor array anti-interference current measurement method and system based on a neural network. BACKGROUND
[0002] Current sensors are important devices for measuring current in power systems, and their accuracy and reliability are directly related to the stability and safety of the power grid. Magnetoresistance (MR) magnetic sensors have the advantages of small size and low power consumption, and are the research focus of today's magnetic sensors. Among them, TMR current sensors are new types of magnetoresistance effect sensors in recent years, which use the tunnel magnetoresistance effect of magnetic multilayer film materials to sense magnetic fields. Compared with AMR and GMR current sensors, TMR current sensors have higher temperature stability, sensitivity and linear range, and also have the characteristics of small size and low overall cost. They have very important advantages in intelligent electric metering, magnetic random storage and other fields. However, in complex external environment or strong interference magnetic field conditions, the performance of current sensors will be greatly reduced, limiting their practical application. Existing interference resistance schemes are mostly aimed at single-phase interference current and cannot resist magnetic field interference caused by multiple factors in complex environments. SUMMARY
[0003] The technical problem to be solved by the present application is to provide a magnetic sensor array anti-interference current measurement method and system based on a neural network to solve the above problems of the prior art. The present application aims to provide a current measurement technical solution that can effectively resist external interference in response to the weak resistance of current sensors to external interference and the demand for high-performance sensor development.
[0004] To solve the above technical problems, the technical scheme adopted by the present application is:
[0005] A magnetic sensor array anti-interference current measurement method based on a neural network, comprising:
[0006] S101, respectively collecting magnetic field detection value sample vectors of the magnetic sensor array under different wire currents, wire eccentricities, crosstalk current interference, stray magnetic field interference and external temperature and humidity changes;
[0007] S102, constructing a training data set with wire current as label data of the magnetic field detection value sample vector;
[0008] S103, standardizing the training data set and dividing the training set and the test set according to a preset proportion;
[0009] S104, construct a machine learning model for magnetic sensor array anti-interference current measurement, use the training set and test set, combine a preset loss function and an optimization algorithm to train the machine learning model to establish a mapping relationship between the magnetic field detection value sample vector and the wire current;
[0010] S105, input the magnetic field detection value sample vector detected by the magnetic sensor array on the measured wire into the trained machine learning model to obtain the wire current of the measured wire.
[0011] Optionally, when the magnetic field detection value sample vectors of the magnetic sensor array under different wire currents, wire eccentricities, crosstalk current interference, stray magnetic field interference and external temperature and humidity changes are collected respectively in step S101, the selection of different wire currents comprises: dividing the wire current value range into several intervals, and the width of each interval is , wherein is the resolution of the magnetic sensor array, and different wire currents are uniformly distributed in the wire current value range with a step size of , and the number of different wire currents is:
[0012] ,
[0013] In the above formula, is the number of wire currents, is the downward rounding of .
[0014] Optionally, when the magnetic field detection value sample vectors of the magnetic sensor array under different wire currents, wire eccentricities, crosstalk current interference, stray magnetic field interference and external temperature and humidity changes are collected respectively in step S101, it comprises setting sampling points for each kind of wire current, combining the wire eccentricity, crosstalk current interference and stray magnetic field interference into different interference configurations, repeating sampling under different environmental conditions to obtain M groups of P-dimensional magnetic field detection value sample vector matrices, and the function expression is as follows:
[0015] ,
[0016] In the above formula, is the magnetic field detection value sample vector matrix, ~ is the magnetic field detection value sample vector obtained by sampling the M sampling points under the first kind of wire current, ~ is the magnetic field detection value sample vector obtained by sampling the M sampling points under the second kind of wire current, ~ is the magnetic field detection value sample vector obtained by sampling the M sampling points under the third kind of wire current, ~ is the magnetic field detection value sample vector obtained by sampling the M sampling points under the fourth kind of wire current, and ~ The function expression of the magnetic field detection value sample vector obtained by sampling M sampling points under the wire current is:
[0017] ,
[0018] In the above formula, is the magnetic field detection value sample vector in the i-th row and j-th column of the magnetic field detection value sample vector matrix , The magnetic field detection value samples detected by the N magnetic sensors of the magnetic sensor array are respectively.
[0019] Optionally, step S102 comprises:
[0020] S201, randomly rearranging the magnetic field detection value sample vectors of the magnetic sensor array under different wire currents, wire eccentricities, crosstalk current interference, stray magnetic field interference and external temperature and humidity changes;
[0021] S202, converting the magnetic field detection value sample vectors after the random rearrangement into a distribution with a mean of 0 and a standard deviation of 1 according to the following formula:
[0022]
[0023] In the above formula, is the standardization processing result of the magnetic field detection value sample , is the mean of the magnetic field detection value sample , is the standard deviation of the magnetic field detection value sample ;
[0024] S203, constructing a training data set by taking each magnetic field detection value sample vector corresponding to the wire current as the label data of the standardized magnetic field detection value sample vector.
[0025] Optionally, the machine learning model constructed in step S104 is a multi-input, single-output feedforward neural network model, the input of which is the magnetic field detection value sample vector and the output of which is the wire current, and the feedforward neural network model comprises an input layer, two hidden layers and an output layer connected in sequence, each layer of network comprises a linear layer and an activation unit, and the calculation function expression of the linear layer output value of any i-th layer of network is:
[0026] ,
[0027] In the above formula, is the i-th layer of network. The weight matrix of the layer network, For the first Input to the layer network, For the first The bias vector of the layer network, and any _th_ layer Input values of layer network For the first Activation unit output value of layer network And there are:
[0028] ,
[0029] In the above formula, This is the activation unit.
[0030] Optionally, the function expression of the preset loss function in step S104 is:
[0031] ,
[0032] In the above formula, Let N be the loss function, and N represent the number of samples. For the first The predicted conductor current corresponding to each sample of magnetic field detection values For the first The actual conductor current corresponding to each sample of magnetic field detection values.
[0033] Optionally, the magnetic sensor array includes a circular base for being fitted onto the conductor under test. The circular base has a coaxial circumferential array, which includes magnetic sensors distributed on the circumference of the circular base. The sensitive axis of the magnetic sensors is coaxial with the direction of the annular magnetic field generated by the conductor under test.
[0034] Furthermore, the present invention also provides a neural network-based magnetic sensor array anti-interference current measurement system, including a microprocessor and a memory interconnected thereto, wherein the microprocessor is programmed or configured to execute the neural network-based magnetic sensor array anti-interference current measurement method.
[0035] Furthermore, the present invention also provides a computer-readable storage medium storing a computer program or instructions that are programmed or configured to execute the neural network-based magnetic sensor array anti-interference current measurement method by a processor.
[0036] Furthermore, the present invention also provides a computer program product, including a computer program or instructions, which are programmed or configured to execute the neural network-based magnetic sensor array anti-interference current measurement method by a processor.
[0037] Compared with the prior art, the present application has the following advantages:
[0038] 1、The magnetic sensor array anti-interference current measurement structure based on artificial neural network adopted by the present application can train the neural network through a data set, optimize the network structure by adjusting parameters, so that the current sensor can adapt to various complex measurement environments, can effectively resist external interference, and improve the current measurement precision.
[0039] 2、The present application can establish a neural network for different numbers of magnetic sensors, and through the analysis of the loss function and the adjustment of the network structure, a better expected value can be obtained under the condition of using fewer sensor numbers, so that the sensor structure can be simplified and the cost can be reduced. BRIEF DESCRIPTION OF DRAWINGS
[0040] Figure 1 It is a basic flowchart of the embodiment method of the present application.
[0041] Figure 2 It is a feedforward neural network structure diagram in the embodiment of the present application.
[0042] Figure 3 It is a flowchart of optimizing the neural network based on the Adam algorithm in the embodiment of the present application.
[0043] Figure 4 It is a structure diagram of the current measurement device based on artificial neural network in the embodiment of the present application.
[0044] Figure 5 It is a schematic diagram of the current measurement result influenced by multiple factors in the embodiment of the present application. DETAILED DESCRIPTION
[0045] As shown in the figure, the magnetic sensor array anti-interference current measurement method based on neural network of the present embodiment includes: Figure 1
[0046] S101, respectively collecting the magnetic field detection value sample vectors of the magnetic sensor array under different wire currents, wire eccentricities, crosstalk current interference, stray magnetic field interference and external temperature and humidity changes;
[0047] S102, constructing a training data set by taking the wire current as the label data of the magnetic field detection value sample vector;
[0048] S103, standardizing the training data set and dividing the training set and the test set according to a preset proportion;
[0049] S104, Construct a machine learning model for anti-interference current measurement of magnetic sensor array, using the training set and test set, combined with a preset loss function and optimization algorithm to train the machine learning model to establish a mapping relationship between magnetic field detection value sample vector and conductor current;
[0050] S105, input the sample vector of magnetic field detection values obtained by the magnetic sensor array on the conductor under test into the trained machine learning model to obtain the conductor current of the conductor under test.
[0051] In step S101 of this embodiment, when collecting sample vectors of magnetic field detection values of the magnetic sensor array under different conductor currents, conductor eccentricity, crosstalk current interference, stray magnetic field interference, and changes in external temperature and humidity, the selection for different conductor currents includes: setting the range of conductor current values... It is evenly divided into several intervals, each interval having a width of . ,in To improve the resolution of the magnetic sensor array, different wire currents... For The step size is evenly distributed across the range of conductor current values. Between, and the number of different conductor currents is:
[0052] ,
[0053] In the above formula, The quantity of current in the conductor. for Rounding down.
[0054] In step S101 of this embodiment, when collecting sample vectors of magnetic field detection values of the magnetic sensor array under different conductor currents, conductor eccentricity, crosstalk current interference, stray magnetic field interference, and changes in external temperature and humidity, this includes setting parameters for each type of conductor current. Sampling points are used to combine conductor eccentricity, crosstalk current interference, and stray magnetic field interference into different interference configurations. Sampling is repeated under different environmental conditions to obtain M sets of P-dimensional magnetic field detection value sample vector matrices (containing...). The function expression for the sample set of sampling points is as follows:
[0055] ,
[0056] In the above formula, This is the sample vector matrix of magnetic field detection values. ~ This is a sample vector of magnetic field detection values obtained from M sampling points under the first type of conductor current. ~ This is a sample vector of magnetic field detection values obtained from M sampling points under the second type of conductor current. ~ For the first A sample vector of magnetic field detection values obtained from M sampling points under a certain conductor current.
[0057] The functional expression for the magnetic field detection value sample vector is:
[0058] ,
[0059] In the above formula, The magnetic field detection value sample vector matrix The magnetic field detection value sample vector in the i-th row and j-th column (representing the i-th...) When the controllable current value is reached, the first... (Magnetic field sample vector collected by the sensor array corresponding to each sampling point). ~ These are samples of magnetic field detection values obtained from N magnetic sensors in the magnetic sensor array.
[0060] Step S102 in this embodiment includes:
[0061] S201, randomly shuffle the sample vectors of magnetic field detection values of the magnetic sensor array under different conductor currents, conductor eccentricity, crosstalk current interference, stray magnetic field interference and changes in external temperature and humidity.
[0062] S202, the randomly shuffled magnetic field detection value sample vector is standardized using the following formula to convert it into a distribution with a mean of 0 and a standard deviation of 1:
[0063]
[0064] In the above formula, Sample of magnetic field detection values The standardized processing results Sample of magnetic field detection values The mean, Sample of magnetic field detection values Standard deviation;
[0065] S203, construct a training dataset by using the conductor current corresponding to each magnetic field detection value sample vector as the label data of the standardized magnetic field detection value sample vector.
[0066] like Figure 2As shown, the machine learning model constructed in step S104 in this embodiment is a multi-input, single-output feedforward neural network model, the input of which is the magnetic field detection value sample vector, and the output of which is the wire current. The feedforward neural network model comprises an input layer, two hidden layers and an output layer connected in sequence. Each layer of the network comprises a linear layer and an activation unit. The output value of the linear layer of any i-th layer of the network is denoted as The output value of the linear layer of any i-th layer of the network The calculation function expression of the linear layer of any i-th layer of the network is:
[0067] ,
[0068] In the above formula, is the weight matrix of the i-th layer of the network, is the input of the i-th layer of the network, is the bias vector of the i-th layer of the network, and the input value of any i-th layer of the network is denoted as The output value of the activation unit of any i-th layer of the network is denoted as , and has:
[0069] ,
[0070] In the above formula, is the activation unit.
[0071] As shown in FIG. 1, in step S104 in this embodiment, the neural network learning model is trained using the training set and the test set, in combination with a preset loss function and an optimization algorithm, to establish a mapping relationship between the magnetic field detection value sample vector and the wire current, including: Figure 3 Step 1: Network parameter initialization is performed on the feedforward neural network model. The initialized network parameters include: the weight matrix of any i-th layer of the network
[0072] and the bias vector of the i-th layer of the network ; Step 2: The samples in the test set are input into the feedforward neural network model for forward propagation. Step 3: The loss function is calculated. In this embodiment, the function expression of the preset loss function is:
[0073]
[0074] ,
[0075] In the above formula, is the loss function, N represents the number of samples, is the i-th layer of the network, and the input value of any i-th layer of the network is denoted as
[0076] a predicted conductor current corresponding to the magnetic field detection value sample, is the true conductor current corresponding to the magnetic field detection value sample;
[0077] Step 4, back propagation is performed, the first-order matrix estimate and the second-order matrix estimate are calculated respectively by using the Adam algorithm, then the bias correction is calculated, and the network parameters of the feedforward neural network model are updated according to the calculation result of the bias correction, including: the weight matrix of any layer network and the bias vector of the layer network ;
[0078] Step 5, it is judged whether the loop termination condition is met, if the iteration number is equal to the preset threshold, it is determined that the loop termination condition is met, and the network parameters of the optimal feedforward neural network model are reserved, including: the weight matrix of any layer network and the bias vector of the layer network ; otherwise, step 2 is jumped to.
[0079] As an optional implementation, as shown in Figure 4 and Figure 5 , the magnetic sensor array in the embodiment includes a circular base 2 for sleeving on the measured conductor 1, and a coaxial circumferential array is arranged on the circular base 2, the coaxial circumferential array includes magnetic sensors 3 distributed on the circumference of the circular base 2, and the sensitive axis direction of the magnetic sensor 3 is coaxial with the direction of the annular magnetic field generated by the measured conductor 1. As shown in Figure 4 , the circular base 2 in the embodiment includes a connector 4 and two semi-annular circuit boards, the two semi-annular circuit boards are connected by the detachable connector 4 to form a circular structure, the FPC board can be disassembled and combined through the connector 4, (the circular array is split into two semi-circumferences to fix the conductor) can meet various measurement conditions when the current conductor is inconvenient to move, so as to measure the current under the condition that the measured current conductor 1 is fixed. In the embodiment, the circuit board is an FPC flexible circuit board, the FPC flexible circuit board material can provide excellent electrical performance, meet the design needs of smaller and higher density installation, and can reduce assembly process and enhance reliability. In the embodiment, the magnetic sensor 3 can be required according to needs, for example, as an optional implementation, the magnetic sensor 3 in the embodiment is a TMR magnetic sensor. As shown in Figure 5As shown, in the current sensor operation, especially in complex environments, when facing stray magnetic field interference such as wire eccentricity, crosstalk current interference, geomagnetic field, etc., the magnetic field size sensed by each magnetic sensor chip will change accordingly according to its spatial position, thereby causing the output voltage value to change and resulting in measurement error. The traditional coaxial array type magnetic resistance current sensor usually selects to increase the number of magnetic sensing chips to reduce the error caused by wire eccentricity and reduce the geomagnetic field interference, but for the external strong magnetic field interference caused by crosstalk current, only the distance between the crosstalk current wire and the measured current wire or the number of magnetic sensing chips can be increased to reduce the impact. However, in actual application, the distance between the crosstalk current wire and the measured current wire is generally fixed and difficult to change, and when the distance between the crosstalk current wire and the measured current wire is close, even if the number of magnetic sensing chips is increased, it is still difficult to reduce the measurement error to an acceptable range, and the volume and cost are also increased. Referring to Figure 5 , the magnetic sensor 3 of the coaxial circumferential array is disturbed by wire eccentricity, crosstalk current interference, stray magnetic field interference and external temperature and humidity changes, but the magnetic sensor array anti-interference current measurement method based on the neural network of the embodiment can effectively eliminate the disturbance of wire eccentricity, crosstalk current interference, stray magnetic field interference and external temperature and humidity changes.
[0080] In step S101 of the embodiment, the magnetic field detection value sample vector of the magnetic sensor array under different wire currents, wire eccentricity, crosstalk current interference, stray magnetic field interference and external temperature and humidity changes is collected respectively, including first fitting the circular ring base 2 on the controllable current wire. Because the spatial magnetic field generated by different current values is different, the interference source simulates different types and intensities of electromagnetic interference, the magnetic sensor array is installed on the circular ring base, the magnetic sensor array senses the spatial magnetic field and outputs an electrical signal, which is read out and stored synchronously by the data acquisition system. The data acquisition system includes a high-precision data acquisition card and a PC, which ensures that the sampling data is collected and stored in time.
[0081] In step S102 of the embodiment, when the wire current is selected as the label data of the magnetic field detection value sample vector to construct the training data set, the experimental site is selected to be consistent with the final measurement site to avoid errors caused by geomagnetic field changes; in the actual operation environment, different experimental conditions are set, including the setting of wire eccentricity position and crosstalk current intensity, covering various interference situations to ensure the diversity of the sample set. Randomly collect samples under different interference conditions for each controllable current value. Repeat the above experiment in different time periods and record the environmental conditions such as temperature, humidity, etc. in each experiment. First, according to the range of the measured current and the resolution of the current sensor , a plurality of controllable current values are selected as label values by uniform sampling method. The entire measured current range It is evenly divided into several intervals, with an interval width of . ,in To improve the resolution of the current sensor, the controllable current value by The step size is evenly distributed within the range of the current to be measured. Between. Then, magnetic field samples are collected using a time-division random sampling method for each controllable current value. ,set up At multiple sampling points, under different time periods and environmental conditions, a magnetic sensor array was used to collect data under different interference configurations. A set of spatial magnetic field data. The dimension of the sample vector is equal to the number of magnetic sensors, denoted as N. The final controllable current value... This results in M sets of N-dimensional magnetic field sample vectors, each set of magnetic field sample vectors corresponding to a label value. .
[0082] In step S103 of this embodiment, when standardizing the training dataset and dividing it into training and test sets according to a preset ratio, this includes preprocessing all sample data. Data shuffling, by randomizing the sample order, scrambles the interference dataset collected in chronological order, preventing the neural network model from forgetting and also preventing the neural network model from learning irrelevant order dependencies, thereby improving the model's generalization ability and avoiding overfitting. The data standardization function expression used in this embodiment is:
[0083] ,
[0084] In the above formula, for The results obtained from data standardization The mean, The standard deviation is used to standardize the data, transforming it into a distribution with a mean of 0 and a standard deviation of 1. This reduces the dimensional differences in the data, preventing features with large numerical ranges from dominating the training process and allowing the optimization algorithm to converge faster. Finally, the samples are divided into training and test sets in a 4:1 ratio. The neural network model is trained on the training set and evaluated on the test set.
[0085] In step S104 of this embodiment, the following is included: establishing... Figure 2 The multi-input, single-output feedforward neural network model shown converts the magnetic field sample vectors of the sampling points into... As input, ~ Given N magnetic field samples, the current value to be measured As output, the training set is used to train the network model, and the test set is used as input to evaluate the model's prediction accuracy and generalization ability. The network structure and parameters that perform best on the test set are selected as the final neural network model. The activation function of the network is ReLU (Rectified Linear Unit). During forward propagation, since each layer of the network includes a linear layer and activation units, the... The output value of the linear layer of the layer network is:
[0086] ,
[0087] In the above formula, For the first The output value of a linear layer in a layered network. For the first The weight matrix of the layer network, For the first Input to the layer network, Indicates the first The bias vector of the layer network;
[0088] No. The input value of the layer network is the first layer. The activation unit output value of the layer network is:
[0089] ,
[0090] in, For the first The input values of the layer network, For the first The output value of the activation unit of the layer network. In order to activate, hopefully targeting the first The result obtained from the output value of the linear layer of the layered network. Indicates the first The weight matrix of the layer network, Indicates the first The bias vector of the layer network.
[0091] In this embodiment, the function expression of the loss function is:
[0092] ,
[0093] In the above formula, Let N be the loss function, and N represent the number of samples. For the first The predicted conductor current corresponding to each sample of magnetic field detection values For the first The real wire current corresponding to each magnetic field detection value sample is compared with the network prediction value through a loss function, the error is calculated, and the goal of network training is to minimize the loss function value. The loss function in this embodiment is smooth and differentiable, so that the gradient-based optimization algorithm can be effectively applied to model training. The loss function gives higher weights to larger errors by summing the squares of the errors, and the model will tend to reduce large errors. For application scenarios with high current measurement accuracy requirements, the model performance can be better optimized. The optimization algorithm of the network is the Adam algorithm, which combines momentum and adaptive learning rate to accelerate convergence speed and improve training effect. The model is trained using the preprocessed training set data, and the network training process is as shown in Figure 3 The parameters of the neural network are adjusted through back propagation to gradually reduce the loss function value, and the training is stopped after the model converges. In step S105, the magnetic field detection value sample vector detected by the magnetic sensor array on the measured wire is input into the trained machine learning model, and the output obtained after the inference calculation of the neural network model is the wire current of the measured wire.
[0094] In summary, the embodiment discloses a neural network-based magnetic sensor array anti-interference current measurement device and its application method. The anti-interference current measurement device in this embodiment includes a circular base 2 for sleeving on the measured current wire 1, and a coaxial circumferential array is arranged on the circular base 2. The coaxial circumferential array includes magnetic sensors 3 distributed on the circumference of the circular base, and the sensitive direction of the magnetic sensors 3 is the same as the direction of the annular magnetic field generated by the measured current wire. The neural network-based magnetic sensor array anti-interference current measurement method of this embodiment includes: the structure of the neural network is a multi-input, single-output feedforward neural network containing multiple hidden layers; the neural network is trained by collecting a data set containing multiple interference sources in a complex environment to optimize and determine the final network parameters; the network input is the measurement value of the magnetic sensor array, and the network output is the predicted value of the measured current. The device and the neural network are used to realize accurate measurement of the measured current. The neural network-based magnetic sensor array anti-interference current measurement method of this embodiment can solve the problem that current sensors are easily disturbed by external current magnetic fields, leading to a decrease in current measurement accuracy, and provides a current measurement technical solution that effectively resists external magnetic field interference using an artificial neural network.
[0095] In addition, the embodiment also provides a neural network-based magnetic sensor array anti-interference current measurement system, which includes a microprocessor and a memory connected to each other. The microprocessor is programmed or configured to execute the neural network-based magnetic sensor array anti-interference current measurement method.
[0096] In addition, the embodiment further provides a computer readable storage medium, wherein a computer program or instructions are stored, and the computer program or instructions are programmed or configured to execute the neural network-based magnetic sensor array anti-interference current measurement method by using a processor.
[0097] In addition, the embodiment further provides a computer program product, comprising a computer program or instructions, which are programmed or configured to execute the neural network-based magnetic sensor array anti-interference current measurement method by using a processor.
[0098] The above only describes the preferred embodiments of the present application, and the protection scope of the present application is not limited to the above-mentioned embodiments. Any technical solutions falling within the concept of the present application shall fall within the protection scope of the present application. It should be noted that, for ordinary skilled persons in the art, some improvements and refinements without departing from the principles of the present application shall also be considered as the protection scope of the present application.
Claims
1. A neural network based magnetic sensor array anti-interference current measurement method, characterized in that, Comprising: S101, respectively collecting magnetic sensor array in different wire current, wire eccentricity, crosstalk current interference, stray magnetic field interference and external temperature and humidity change under the magnetic field detection value sample vector; S102, the wire current is constructed as the label data of the magnetic field detection value sample vector to construct a training data set; S103, the training data set is standardized and divided into training set and test set according to the preset proportion; S104, constructing a machine learning model for magnetic sensor array anti-interference current measurement, using the training set and test set, combining the preset loss function and optimization algorithm to train the machine learning model to establish the mapping relationship between the magnetic field detection value sample vector and the wire current; S105, the magnetic field detection value sample vector detected by the magnetic sensor array on the measured wire is input into the trained machine learning model to obtain the wire current of the measured wire; In step S101, when acquiring sample vectors of magnetic field detection values of the magnetic sensor array under different conductor currents, conductor eccentricity, crosstalk current interference, stray magnetic field interference, and changes in external temperature and humidity, the selection for different conductor currents includes: setting the range of conductor current values... It is evenly divided into several intervals, each interval having a width of . ,in To improve the resolution of the magnetic sensor array, different wire currents... For The step size is evenly distributed across the range of conductor current values. Between, and the number of different conductor currents is: , In the above formula, is the number of wire currents, is is the floor of n is a positive integer.
2. The neural network based magnetic sensor array anti-interference current measurement method according to claim 1, characterized in that, In step S101, the magnetic sensor array is respectively arranged under different wire currents, wire eccentricities, crosstalk current interferences, stray magnetic field interferences, and external temperature and humidity changes to collect magnetic field detection value sample vectors, including setting one sampling point for each wire current, combining the wire eccentricity, crosstalk current interference, and stray magnetic field interference into different interference configurations, repeatedly sampling under different environmental conditions, obtaining M groups of P-dimensional magnetic field detection value sample vector matrices, and the function expression is as follows: , In the above formula, is a magnetic field detection value sample vector matrix, ~ is a magnetic field detection value sample vector obtained by sampling M sampling points under the first kind of wire current, ~ is a magnetic field detection value sample vector obtained by sampling M sampling points under the second kind of wire current, ~ is a magnetic field detection value sample vector obtained by sampling M sampling points under the first kind of wire current, is a magnetic field detection value sample vector obtained by sampling M sampling points under the first kind of wire current, and a function expression of the magnetic field detection value sample vector is , In the above formula, is a matrix of magnetic field detection value sample vectors is the i-th row and j-th column magnetic field detection value sample vector in the matrix of magnetic field detection value sample vectors are magnetic field detection value samples detected by the N magnetic sensors of the magnetic sensor array, respectively. 3. The neural network based magnetic sensor array anti-interference current measurement method according to claim 1, characterized in that, Step S102 includes: S201, randomly rearranging the magnetic field detection value sample vector of the magnetic sensor array under different wire currents, wire eccentricities, crosstalk current interferences, stray magnetic field interferences and external temperature and humidity changes; S202, the magnetic field detection value sample vector after the random rearrangement is standardized and converted into a distribution with a mean of 0 and a standard deviation of 1 according to the following formula: , In the above formula, is a standardized processing result of the magnetic field detection value sample , is a mean value of the magnetic field detection value sample , is a standard deviation of the magnetic field detection value sample . S203, the wire current corresponding to each magnetic field detection value sample vector is constructed as the label data of the standardized magnetic field detection value sample vector to construct a training data set.
4. The neural network based magnetic sensor array anti-interference current measurement method according to claim 1, characterized in that, The machine learning model constructed in step S104 is a multi-input and single-output feedforward neural network model, the input of which is the magnetic field detection value sample vector, and the output of which is the wire current. The feedforward neural network model comprises an input layer, two hidden layers and an output layer connected in sequence. Each layer of the network comprises a linear layer and an activation unit. The calculation function expression of the linear layer output value of any i-th layer of the network is as follows: The calculation function expression of the linear layer output value of any i-th layer of the network is as follows: The calculation function expression of the linear layer output value of any i-th layer of the network is as follows: , In the above formula, For the first The weight matrix of the layer network, For the first Input to the layer network, For the first The bias vector of the layer network, and any _th_ layer Input values of layer network For the first Activation unit output value of layer network And there are: , In the above formulae, is an activation unit.
5. The neural network based magnetic sensor array anti-interference current measurement method according to claim 1, characterized in that, The function expression of the preset loss function in step S104 is: , In the above formula, is a loss function, N represents the number of samples, is the predicted wire current corresponding to the th magnetic field detection value sample, is the true wire current corresponding to the th magnetic field detection value sample.
6. The neural network based magnetic sensor array anti-interference current measurement method according to claim 1, characterized in that, The magnetic sensor array includes a circular ring base (2) for sleeving on the measured wire (1), and a coaxial circumferential array is arranged on the circular ring base (2). The coaxial circumferential array includes magnetic sensors (3) distributed on the circumference of the circular ring base (2), and the sensitive axis direction of the magnetic sensor (3) is coaxial with the direction of the annular magnetic field generated by the measured wire (1).
7. A neural network based magnetic sensor array anti-interference current measurement system comprising a microprocessor and a memory connected to each other, characterized in that, The microprocessor is programmed or configured to perform the neural network-based magnetic sensor array anti-interference current measurement method of any one of claims 1-6.
8. A computer-readable storage medium having stored therein a computer program or instructions, characterized in that, The computer program or instructions are programmed or configured to execute the neural network-based magnetic sensor array anti-interference current measurement method of any one of claims 1-6 by the processor.
9. A computer program product comprising computer programs or instructions, characterized in that, The computer program or instructions are programmed or configured to execute the neural network-based magnetic sensor array anti-interference current measurement method of any one of claims 1-6 by the processor.
Citation Information
Patent Citations
Magnetic field signal-based current calculation method suitable for multiple scenes
CN113609749A
Iron core-annular array multi-ring magnetosensitive current sensor and current measurement method
WO2023077900A1