## 2 Related Works  
Hysteresis affects the linear range of magnetic sensors and is the main factor for measurement accuracy. The research body on this problem is mainly divided into two categories. One category aims to achieve the purpose by improving the sensor's material structure or hardware circuit, and the other is to model and compensate for hysteresis in order to reduce hysteresis. [PERSON], [PERSON] et al. used IrMn pinning as a detection layer and a reference layer to adjust the sensitivity and linear range of the sensor [23]. [PERSON] and others reduced hysteresis, increased linear range, and improved sensitivity by integrating a biased magnetic field in the detector [24]. The above methods changed the sensor's structure, which requires a significant investment and is only suitable for manufacturers. [PERSON] et al. applied AC-modulated magnetic field in the sensitive direction of TMR to reduce the hysteresis of TMR, and the AC-modulated magnetic field can be adjusted as needed to meet specific applications [25]. [PERSON] et al. used a single coil and produced a pulsedmagnetic field that was much larger than the measured magnetic field to make the sensor function in the main hysteresis loop as much as possible in order to reduce hysteresis [26]. Both methods caused the sensor to function near the main hysteresis loop as much as possible. [PERSON] et al. placed the sensitive element in the middle of a coil. Then, the current of the coil was controlled in a closed-loop to offset the applied magnetic field. This method kept the measurement near the zero point of the sensitive element to avoid the problem of hysteresis and obtained better linearity [27]. Reference [28] used the design of an anti-magnetic field to achieve the same goal and used MCU and the automatic scaling function to optimize performance. Reference [29] designed a GMR sensor with a bias coil to capture a large current from DC to low frequency. Moreover, reference [30] used automatic calibration and adjustments of mixed hardware and software to make the sensor work near point 0 to avoid the problem of hysteresis. These methods all reduce hysteresis and improve performance by adding a bias magnetic field to make the sensitive element work near the main hysteresis loop or 0 points. However, these methods require additional hardware equipment to generate the bias magnetic field. This will increase cost and power consumption. Moreover, the hardware's generation of the bias magnetic field is limited, so its implementation is challenging. The methods of modeling compensation can be roughly divided into two categories. One is the black-box model, which does not explain the input-output relationship but directly fits it. It includes models based on empirical formulas and models based on machine learning. Reference [31] divided the B-H curve into several segments, and each segment was approximated by linear interpolation. [PERSON] [32] approximated the B-H curve using rational polynomials. [PERSON] [33] adopted non-integer exponential polynomials in order to avoid the limitation of rational polynomials and power series when permeability increases. [PERSON] [34] proposed a T(x) model based on the tangent function to solve the reversible problem. [PERSON] [35] replaced the tangent function in a T(x) model with a rational polynomial and implemented it in DSP. [PERSON] [36] used a power series model to fit the BH characteristic curve. Because the hysteresis characteristics are strongly nonlinear and frequency-dependent, the black model based on empirical formula has difficulty in fully expressing the mapping relationship between input and output. Moreover, it usually has good results only in a specific range. Reference [37] used the least mean square-based system to determine the parameters of the hysteresis model. Reference [38] used improved particle swarm optimization to determine the model. These models are more applicable than empirical formulas, but they are difficult to realize and the cost is high. The other is the white-box model.