Magnetic sensing encoding switch communication method and system combined with edge computing

By processing the sine and cosine signals of the magnetically coded switch through edge computing, and dynamically adjusting the transmission path and link, the problem of insufficient communication link stability of the magnetically coded switch is solved, and the signal accuracy and stability are improved.

CN122457480APending Publication Date: 2026-07-24DIFENG HONGYANG ELECTRONICS (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
DIFENG HONGYANG ELECTRONICS (SHENZHEN) CO LTD
Filing Date
2026-04-28
Publication Date
2026-07-24

Smart Images

  • Figure CN122457480A_ABST
    Figure CN122457480A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of switch communication, and discloses a magnetic sensing coding switch communication method and system combined with edge calculation. The method comprises the following steps: collecting a sine and cosine signal, calculating an amplitude and a phase difference value to obtain smooth signal data; if a signal-to-noise ratio exceeds a threshold value, the signal is weighted and judged to determine reference signal data, and a peak value and a period characteristic are extracted from the reference signal data to calculate an initial angle; the initial angle is compared with historical data to match a degree, if the degree exceeds a threshold value, the data capacity is adjusted and recalculated to obtain an adaptive angle; the execution accuracy and real-time performance of a command are checked, if the command does not reach the standard, the algorithm parameters and the transmission rate are adjusted, the command is generated and executed, the feedback signal and the link stability are recorded, if the link jitter exceeds a threshold value, the feedback signal is filtered, the frequency is monitored, if the frequency is abnormal, a standby link is distributed to generate a communication link adjustment scheme; the transmission path is dynamically updated according to the scheme, the feedback index is extracted, and the communication chain configuration is obtained. The method can solve the problem of insufficient communication link stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of switch communication technology, and in particular to a magnetically encoded switch communication method and system that incorporates edge computing. Background Technology

[0002] In the field of industrial automation, switch communication technology based on smart sensors directly affects the accuracy and response speed of equipment control, ensuring the safety and efficiency of the production process.

[0003] In one existing technology, a three-layer centralized processing architecture is adopted, and a single traditional fieldbus is used to realize the serial transmission of signals. The host industrial control computer is used as the core processing unit to uniformly receive the original signals of all magnetically coded switches in the entire production line, and complete signal analysis, error calculation, switch status / position discrimination, protocol parsing and control command issuance.

[0004] However, all sine and cosine signals need to be remotely transmitted to an industrial control computer for analysis, and control commands are then transmitted back to the field, resulting in a long and complex transmission path. Polling transmission from multiple devices further exacerbates the latency, and signal errors are not corrected locally. This, combined with incompatibility issues with multiple protocols, leads to a significant increase in the probability of signal packet loss, misinterpretation, and communication interruption. In industrial environments with strong electromagnetic fields and temperature variations, the error amplification effect is even more pronounced, resulting in extremely poor stability of the entire communication link. In summary, existing technologies suffer from insufficient communication link stability. Summary of the Invention

[0005] This invention provides a magnetically coded switch communication method and system that combines edge computing to solve the problem of insufficient communication link stability in the prior art.

[0006] In a first aspect, to solve the above-mentioned technical problems, the present invention provides a magnetically coded switch communication method combining edge computing, comprising: Acquire the sine and cosine signals from the sensor, and smooth the sine and cosine signals to obtain smoothed signal data; Calculate the signal-to-noise ratio (SNR) of the smoothed signal data. If the SNR does not exceed a preset SNR threshold, then perform a weighted judgment on the smoothed signal data to determine the reference signal data. Based on the reference signal data, the arctangent is calculated to obtain preliminary angle data; Verify the degree of matching between the preliminary angle data and the historical angle data in the pre-established reference library. If the degree of matching is greater than the preset degree threshold, remove redundant interference from the reference library and recalculate the degree of matching to determine the suitable angle data. Analyze the accuracy and real-time performance of the adaptive angle data. If the accuracy and real-time performance do not meet the preset threshold requirements, adjust the angle output parameters and data transmission rate in the control system to obtain optimized control commands. The feedback signal and communication link stability are recorded according to the optimized control command, and the real-time monitoring frequency is monitored. A backup link is allocated according to the real-time monitoring frequency to obtain a communication link adjustment scheme. Based on the communication link adjustment scheme, the transmission path is dynamically updated, and the feedback indicators of the transmission path are extracted to obtain the communication link configuration.

[0007] In a second aspect, the present invention provides a magnetically coded switch communication system incorporating edge computing, comprising: The data acquisition module is used to acquire the sine and cosine signals from the sensor, and to smooth the sine and cosine signals to obtain smoothed signal data. The signal smoothing module is used to calculate the signal-to-noise ratio of the smoothed signal data. If the signal-to-noise ratio does not exceed a preset signal-to-noise ratio threshold, the smoothed signal data is weighted and a reference signal data is determined. The feature extraction module is used to perform arctangent calculation based on the reference signal data to obtain preliminary angle data; An angle matching module is used to verify the degree of matching between the preliminary angle data and the historical angle data in the pre-established reference library. If the degree of matching is greater than a preset threshold, redundant interference is removed from the reference library and the degree of matching is recalculated to determine the suitable angle data. The instruction generation module is used to analyze the accuracy and real-time response of the adaptive angle data. If the accuracy and real-time response do not meet the preset threshold requirements, the angle output parameters and data transmission rate in the control system are adjusted to obtain optimized control instructions. The link adjustment module is used to record feedback signals and communication link stability according to the optimization control command, monitor the real-time monitoring frequency, allocate backup links according to the real-time monitoring frequency, and obtain a communication link adjustment scheme. The link update module is used to dynamically update the transmission path according to the communication link adjustment scheme, extract the feedback indicators of the transmission path, and obtain the communication link configuration.

[0008] Compared with the prior art, the present invention has the following beneficial effects: (1) This invention achieves cross-verification of dual-channel signals by acquiring sine and cosine signals and calculating amplitude and phase differences; combined with signal-to-noise ratio determination and weighted judgment processing, secondary high-precision smoothing is only initiated when the signal-to-noise ratio exceeds the threshold; compared with the existing technical solutions that only use single-stage simple filtering, which cannot distinguish between noise and effective signals and are easily affected by noise interference, resulting in signal distortion and drift, this invention suppresses noise, signal drift and waveform distortion from the source, and improves signal accuracy, stability and consistency.

[0009] (2) This invention monitors the stability of the communication link in real time and dynamically allocates backup links according to the monitoring frequency; it dynamically updates the transmission path according to the communication link adjustment plan and extracts feedback indicators for closed-loop optimization; it realizes automatic switching of primary and backup links, dynamic optimization of transmission paths, and closed-loop guarantee of link stability; compared with the existing technical solutions where the communication link is fixed, there is no redundant backup, no dynamic update, no stability monitoring, and it is easily interrupted by interference, this invention solves the defects of "fixed link, easy interruption, no redundancy, and poor anti-interference ability", and the communication stability, reliability, and anti-interference ability are greatly improved.

[0010] (3) This invention constructs a closed-loop system for the entire process of signal processing, angle calculation, matching verification, control optimization, communication scheduling, feedback acquisition and closed-loop iteration; all links can automatically provide feedback, automatically iterate and automatically optimize; compared with the existing technical solution of signal acquisition → angle calculation → control output → communication transmission, which is a one-way open-loop process without feedback, iteration and self-optimization, this invention can automatically suppress error accumulation, automatically correct system drift and automatically adapt to changes in working conditions during long-term operation, thereby improving the long-term stability and self-adaptability of the system. Attached Figure Description

[0011] Figure 1 This is a schematic diagram of the magnetic induction coding switch communication method combined with edge computing provided in the first embodiment of the present invention; Figure 2 This is a schematic diagram of the magnetic induction coding switch communication system structure combined with edge computing provided in the second embodiment of the present invention. Detailed Implementation

[0012] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0013] Reference Figure 1 The first embodiment of the present invention provides a magnetically coded switch communication method combining edge computing, comprising the following steps: S11, acquire the sine and cosine signals from the sensor, and smooth the sine and cosine signals to obtain smoothed signal data; S12, calculate the signal-to-noise ratio of the smoothed signal data; if the signal-to-noise ratio does not exceed a preset signal-to-noise ratio threshold, then perform a weighted judgment on the smoothed signal data to determine the reference signal data. S13, Perform arctangent calculation based on the reference signal data to obtain preliminary angle data; S14, verify the degree of matching between the preliminary angle data and the historical angle data in the pre-established reference library. If the degree of matching is greater than the preset degree threshold, remove redundant interference from the reference library and recalculate the degree of matching to determine the suitable angle data. S15, analyze the accuracy and real-time response of the adapted angle data. If the accuracy and real-time response do not meet the preset threshold requirements, adjust the angle output parameters and data transmission rate in the control system to obtain optimized control commands. S16, record feedback signals and communication link stability according to the optimization control command, monitor the real-time monitoring frequency, allocate backup links according to the real-time monitoring frequency, and obtain a communication link adjustment scheme; S17. According to the communication link adjustment scheme, the transmission path is dynamically updated, the feedback indicators of the transmission path are extracted, and the communication link configuration is obtained.

[0014] In step S11, acquiring the sine and cosine signals from the sensor, and smoothing the sine and cosine signals to obtain smoothed signal data, includes: The maximum and minimum values ​​of the sine and cosine signals are iterated over, and the amplitude is calculated based on the maximum and minimum values. Extract the zero-point crossover time of the sine signal and the cosine signal respectively, calculate the difference between the zero-point crossover times, and obtain the phase difference value; Based on the amplitude and the phase difference, distortion signals in the sine and cosine signals are removed to obtain calibration signal data; The calibration signal data is divided into segments using a preset sampling window size, and the calibration signal data within each window is smoothed and filtered to obtain smoothed signal data.

[0015] It should be noted that the edge computing node collects the sine and cosine signals output by the magnetic induction coded switch at a fixed sampling rate of 1000Hz; it performs a global traversal on the continuous sampling points of the sine and cosine signals, records the sampling amplitude point by point, and extracts the maximum and minimum values ​​of each signal; it subtracts the minimum value from the maximum value of a single signal to obtain the peak-to-peak value of that signal, and then divides the peak-to-peak value by 2 to obtain the final amplitude of that signal.

[0016] Edge computing nodes compare the sampling amplitude of sine and cosine signals with the zero amplitude point by point to accurately capture the positive zero-point crossover time, that is, the moment when the signal crosses the zero amplitude from the negative amplitude to the positive amplitude. The positive zero-point crossover time of the sine and cosine signals is recorded respectively. First, the absolute difference of the positive zero-point crossover time of the two signals is calculated. Then, the single-cycle duration of the signal is determined according to the sampling rate. The absolute difference of time is divided by the single-cycle duration to obtain the cycle proportion. Finally, the cycle proportion is multiplied by 360° to obtain the phase difference between the sine and cosine signals.

[0017] The edge computing node compares the calculated signal amplitude and phase difference with the standard signal parameter threshold of the magnetic encoder switch. Sampling points whose amplitude exceeds the preset normal range or whose phase difference deviates beyond the allowable error range are judged as distorted signals and directly discarded. Valid sampling points whose amplitude and phase difference both meet the standard are retained and reassembled according to the original acquisition sequence to obtain distortion-free calibration signal data. The preset normal range is 0.9V to 1.0V, which is the core electrical parameter calibrated by the sensor at the factory. The allowable error range for the phase difference is ±5°, which is the theoretical standard phase difference of 90° for the magnetic encoder switch. The general allowable range for phase error of magnetic encoder position sensors in industrial automation is ±5°. Exceeding this range will lead to excessive angle calculation deviation and position resolution failure.

[0018] The edge computing node uses a 5-point sampling window, a standard feature in industrial magnetic signal preprocessing, as the preset window size. Sine and cosine signals are sequentially divided into sliding windows, with 4 sampling points overlapping between windows to ensure signal timing continuity and prevent data loss. A moving average smoothing filter is applied to the data in each window. The 5 sample amplitudes within a single window are summed, and the sum is divided by the number of sampling points in the window to obtain the filtered mean value for that window. This mean value is used as the filtered output value at the center sampling point of the window. After completing the filtering calculation window by window, all filtered sampling points are arranged sequentially according to the original acquisition timing to obtain stable and purified smooth signal data.

[0019] In step S12, the calculation of the signal-to-noise ratio (SNR) of the smoothed signal data, and if the SNR does not exceed a preset SNR threshold, the smoothed signal data is weighted to determine the reference signal data, including: Calculate the signal-to-noise ratio (SNR) of the smoothed signal data. If the SNR does not exceed a preset SNR threshold, adjust the sampling window size and perform weighted processing on the data in each window to obtain a weighted signal. The weighted mean and weighted standard deviation of the weighted signal are calculated. If the weighted mean and weighted standard deviation meet the preset benchmark standard, the weighted signal is set as the benchmark signal data.

[0020] It should be noted that the edge computing node calculates the signal-to-noise ratio (SNR) based on the smoothed signal data output by S11, using general logic for industrial sensor signals. First, the power of the effective signal component is extracted from the smoothed signal data, then the power of the ambient noise component is extracted. The effective signal power is divided by the noise power to obtain the power ratio. This ratio is then logarithmically calculated to base 10 and multiplied by 10 to obtain the final SNR value. This solution, considering the signal characteristics of industrial magnetic induction coded switches, presets a SNR threshold of 30dB. This threshold is the minimum acceptable standard for stable resolution of industrial magnetic sensor signals. If the calculated SNR is higher than 30dB, it indicates that the signal noise meets the requirements, and the current smoothed signal data is directly used as the baseline signal data. If the SNR is lower than or equal to 30dB, it indicates that residual noise exceeds the standard, triggering a weighted judgment process.

[0021] When the signal-to-noise ratio of the smoothed signal data does not exceed the preset threshold, the edge computing node automatically adjusts the sampling window size, expanding the 5-point basic sampling window in S11 into a 7-point weighted sampling window. This window size is the optimal specification for secondary noise reduction of industrial magnetic signals. Subsequently, weighted smoothing is performed on all data within the 7-point sampling window. The sampling point at the center of the window is assigned the highest weight of 0.4, the two adjacent sampling points on both sides of the center are assigned weights of 0.2, and the two outermost edge sampling points are assigned weights of 0.1. The sum of all weights is 1. After testing with 500 sets of actual magnetic induction coding switches, the output of the magnetic induction coding switches is a sinusoidal / cosine quadrature signal. The center sampling point corresponds to the true phase of the angle calculation, while the edge points are secondary components with a high proportion of interference. The weights decrease from the center to the adjacent points to the outer edges, which can preserve the phase and amplitude authenticity of the quadrature signal to the greatest extent. This weight distribution can reduce the signal noise after weighted judgment by more than 60%, with an effective signal retention rate of ≥95% and an angle calculation error of <0.1°, which is the optimal weight combination. The weighted output value of the window is obtained by multiplying the value of each sampling point in the window with the corresponding weight and summing the results. The entire smoothed signal data is then traversed segment by segment according to the 7-point window to complete the weighted smoothing process of the entire signal segment, remove the remaining high-frequency noise and interference spikes, and obtain the weighted signal.

[0022] Specifically, the weight allocation of each sampling point in the weighted processing is achieved by collecting magnetic induction coded switch signals under actual working conditions after deploying edge computing nodes; with the goal of minimizing angle calculation error, grid search or optimization algorithms are used to traverse and test the weight combination; finally, the optimal weight combination is selected from more than 500 sets of measured signal data that can simultaneously meet the three indicators of noise reduction of more than 60%, effective signal retention of ≥95%, and angle calculation error <0.1°. This combination has been solidified in the system processing logic.

[0023] Edge computing nodes perform statistical analysis on the weighted smoothed signal, identifying two core features: the weighted mean (summed by dividing the sum of all sampled values ​​by the total number of sampled points) and the weighted standard deviation (calculated by squared the difference between each sampled value and the weighted mean, summing all squared values, dividing by the total number of sampled points, and then taking the square root of the result). This scheme, based on the theoretical characteristics of orthogonal signals from magnetically coded switches, pre-sets a baseline standard: a weighted mean within the range of -0.005V to 0.005V, and a weighted standard deviation less than or equal to 0.01V. If both the weighted mean and standard deviation of the signal meet this baseline standard, it indicates that the signal has no significant deviation and is stable; this weighted signal is then set as the baseline signal data for subsequent angle calculations. If the baseline standard is not met, the weighting and smoothing process is repeated until the statistical features meet the criteria, ensuring the stability of the baseline signal data. The pre-set baseline... The standard is set based on the following: the theoretical mean of the sinusoidal / cosine quadrature signal output by an ideal magnetic induction encoder switch is 0; however, slight zero drift exists in actual engineering. Statistical analysis of stable signals from multiple batches of magnetic induction encoder switches under different operating conditions shows that the weighted mean of qualified stable signals falls within the range of -0.005V to 0.005V. Therefore, the weighted mean is limited to -0.005V to 0.005V, approximating the theoretical zero value, to ensure that the signal has no systematic deviation; the weighted standard deviation is ≤0.01V, which is the minimum qualified standard for stable analysis of industrial magnetic sensing signals.

[0024] In step S13, the process of performing arctangent calculation based on the reference signal data to obtain preliminary angle data includes: Extract the instantaneous values ​​of the sine component and the cosine component from the reference signal data; The initial angle of the switch is calculated using the arctangent function based on the instantaneous values ​​of the sine component and the cosine component. If the tolerance between the initial angle and the preset angle calibration benchmark is less than the preset tolerance threshold, then the initial angle is determined to be a valid angle, and preliminary angle data is obtained.

[0025] It should be noted that the instantaneous values ​​of the sine and cosine components extracted from the reference signal data at the current moment are obtained using the arctangent angle calculation logic commonly used in the magnetic induction switch industry. The instantaneous value of the sine component is divided by the instantaneous value of the cosine component, and the arctangent operation is performed on the calculation result to obtain the initial angle of the switch. The edge computing node calculates the difference between the calculated initial angle and the preset angle calibration benchmark to obtain the angle deviation value. The preset angle calibration benchmark is the theoretical zero position / standard angle of the switch, which is usually 0°; the preset tolerance threshold is ±0.2°. If the absolute value of the angle deviation value is less than the preset tolerance threshold, the initial angle is determined to be valid, and this valid initial angle is used as the preliminary angle data; if the angle deviation value exceeds the tolerance threshold, the reference signal data is re-acquired and the angle calculation is performed until the deviation meets the standard.

[0026] The magnetically coded switch hardware used in this solution has inherent physical precision limitations. The inherent error range of its sensing element, such as angle resolution, zero-point drift, and nonlinearity error, is ±0.2°. In order to cover the unavoidable physical errors of the hardware itself and ensure the validity of the angle calculation results, the tolerance threshold must match the upper limit of the inherent precision of the hardware. Therefore, the threshold is set to ±0.2°.

[0027] In step S14, the verification of the matching degree between the preliminary angle data and the pre-established historical angle data, if the matching degree is greater than a preset threshold, involves removing redundant interference from the reference library and recalculating the matching degree to determine the suitable angle data, including: Statistical analysis is performed on the historical angle data stored in the reference library to calculate the mean and standard deviation of the historical angle data. Using the preliminary angle data as the value to be measured and the mean angle and standard deviation angle as reference benchmarks, the Euclidean distance between the two is calculated, and the Euclidean distance is used as the degree of matching between the preliminary angle data and the historical angle data. If the matching degree is greater than the preset degree threshold, the sample size of historical data involved in the calculation in the pre-established reference library is adjusted, and statistical analysis and Euclidean distance calculation are re-executed to obtain the recalculated matching degree. If the recalculated matching degree is still greater than the preset degree threshold, then the duplicate samples, abnormal deviation samples and invalid samples in the historical angle data are cleaned, and the matching degree calculation is performed again until the recalculated matching degree is less than the preset degree threshold. Based on the historical angle data after cleaning, the average angle is recalculated as the updated angle, and the adapted angle data is output.

[0028] The edge computing node reads historical angle data for angle calibration from a pre-established reference library stored locally. This historical angle data consists of valid angle records generated by the magnetically coded switch during its historical normal operation. The edge computing node performs statistical operations on the historical angle data, summing all historical angle data and dividing by the total number of historical data samples to obtain the angle mean. The difference between each historical angle data point and the angle mean is squared, summed, divided by the total number of samples, and then squared to obtain the angle standard deviation.

[0029] The data source for the preset reference library consists of real, valid, fault-free, interference-free, and abnormally deviating angle data generated by the magnetically coded switch under historical normal operating conditions. This includes stable output angles under normal operating conditions; clean angle samples free from electromagnetic interference, temperature drift, and vibration interference; final adapted angle data from edge computing nodes that have been calibrated; angle data collected from switches within their stable operating range; stable samples with fluctuations not exceeding ±0.1° for more than 100 consecutive data sets; and invalid samples that have undergone single abrupt changes, exceeded their physical range, or exhibited abnormal jumps. The cleaned and valid historical angle data is stored in the local database of the edge computing node, forming a structured preset reference library containing historical angle values; collection timestamps; operating condition labels; data validity identifiers; and sample serial numbers.

[0030] Edge computing nodes use preliminary angle data as the object to be tested, and the mean angle and standard deviation angle as historical reference benchmarks. The matching degree is calculated using the Euclidean distance formula. The difference between the preliminary angle data and the mean angle is calculated, the square of the difference is added to the square of the standard deviation angle, and the square root of the sum is taken. The resulting value is the Euclidean distance. The Euclidean distance is directly used as the matching degree between the preliminary angle data and the historical angle data. The smaller the matching degree value, the higher the angle consistency.

[0031] It should be noted that when the initial angle is exactly equal to the historical angle average, the smallest positive value of the Euclidean distance calculation result is the historical angle standard deviation. Since the historical angle standard deviation of the magnetically coded switch under stable operating conditions is usually less than 0.05 degrees, which is far below the preset threshold of 0.2 degrees, it will not cause false triggering. In engineering practice, this formula can accurately reflect the actual degree of angle deviation and is simple to calculate, making it suitable for the lightweight deployment requirements of edge computing nodes.

[0032] The edge computing node compares the matching degree with a preset degree threshold. If the matching degree is greater than the preset degree threshold, it indicates that the current historical data sample size participating in the calculation is unreasonable and there is redundant sample interference. Then, the historical data sample size in the pre-established reference library is adjusted, redundant historical samples exceeding the effective time window are removed, and only the effective historical angle data closest to the current working condition is retained. After adjustment, the mean angle and standard deviation of the historical angle data are recalculated, and the matching degree is recalculated to obtain the recalculated matching degree. The preset degree threshold, based on statistical analysis of hundreds of sets of industrial field measured samples, shows that when the matching degree is within ±0.2°, the angle consistency is above 99.5%; when it exceeds ±0.2°, the consistency decreases significantly; therefore, ±0.2° is the optimal critical threshold.

[0033] If the recalculated matching degree is still greater than the preset threshold, the edge computing node automatically starts the historical angle data cleaning process, sequentially removing duplicate samples, abnormal deviation samples, and invalid samples that are outside the normal working range from the historical angle data; after each cleaning is completed, the recalculated matching degree is recalculated, forming a loop mechanism of cleaning, calculation, and judgment, until the recalculated matching degree is less than the preset threshold.

[0034] When the recalculation matching degree is less than the preset degree threshold, the edge computing node stops looping and uses the cleaned effective historical angle data as a benchmark; it recalculates the mean angle of the effective historical angle data and uses this mean angle as the updated angle; the updated angle is determined as the final calibration result, and the adapted angle data is output.

[0035] In step S15, the accuracy and real-time performance of the adapted angle data are analyzed. If the accuracy and real-time performance do not meet the preset threshold requirements, the angle output parameters and data transmission rate in the control system are adjusted to obtain optimized control commands, including: The adaptation angle data is input into the control system for execution, and the execution angle and response time delay of the obtained command are recorded. Calculate the absolute deviation between the adaptation angle data and the execution angle. If the absolute deviation exceeds a preset absolute deviation threshold, adjust the angle output control parameters in the control system to generate a preliminary control sequence. Determine whether the preliminary control sequence meets the preset real-time requirements. If not, adjust the data transmission rate to obtain optimized control instructions.

[0036] It should be noted that the edge computing node inputs the adaptation angle data obtained in the aforementioned steps into the magnetically coded switch control system for execution, driving the switch to complete the angle positioning action. During execution, the actual output execution angle of the switch and the response time delay from receiving the adaptation angle data to completing the action are collected and recorded in real time. The absolute deviation between the adaptation angle data and the execution angle is calculated, and this absolute deviation is used as the instruction execution accuracy index; the response time delay is used as the instruction execution real-time performance index. The accuracy index is compared with a preset absolute deviation threshold to determine whether it meets the system's preset requirements.

[0037] The preset absolute deviation threshold is used to determine whether the instruction execution accuracy meets the standard. This solution sets it to ±0.2°, based on the inherent accuracy constraints of the magnetic encoder switch hardware. The magnetic sensitive element of the magnetic encoder switch has inherent physical errors such as angular resolution, zero-point temperature drift, nonlinear distortion, and installation eccentricity. The inherent accuracy range of the hardware is ±0.1°~±0.2°. The threshold needs to cover the physical limit error of the hardware to ensure that the judgment result matches the actual capability of the equipment.

[0038] If the absolute deviation exceeds a preset absolute deviation threshold, it indicates that the command execution accuracy is not up to standard. The edge computing node then adjusts the parameters of the built-in angle output control algorithm in the system, including adjusting at least one of the algorithm's proportional coefficient, integral coefficient, filtering coefficient, and output limiting parameters. The adjusted algorithm parameters are then substituted into the system for recalculation to generate a preliminary control sequence. It is determined whether the response time delay corresponding to the preliminary control sequence meets the preset real-time requirements. If it still does not meet the requirements, it indicates that the data transmission link is causing excessive delay. The edge computing node then optimizes the system's current data transmission rate by increasing or decreasing it to eliminate the transmission bottleneck. Based on the adjusted transmission rate and algorithm parameters, the control command is regenerated and encapsulated to obtain the optimized control command.

[0039] The preset real-time requirement is that the execution delay of the initial control sequence is ≤1.0ms, which is the standard for judging the real-time performance of the initial control sequence. The basis for setting it is that the real-time task scheduling cycle of the edge computing node is 1ms. The real-time requirement matches the edge scheduling performance to ensure that the control sequence is executed in a timely manner.

[0040] In step S16, the process of recording feedback signals and communication link stability according to the optimized control command, monitoring the real-time monitoring frequency, allocating backup links according to the real-time monitoring frequency, and obtaining a communication link adjustment scheme includes: The optimized control command is input into the control system, and the feedback signal and communication link stability are recorded. The stability of the communication link is input into a pre-trained signal strength attenuation model to analyze link jitter and obtain jitter values; If the jitter value exceeds the preset jitter threshold, the feedback signal is filtered, and the real-time monitoring frequency during the filtering process is detected. Calculate the frequency deviation between the real-time monitoring frequency and a preset frequency threshold. If the frequency deviation exceeds the preset frequency deviation threshold, predict and evaluate the future average frequency. If the average frequency is lower than the frequency threshold, some data will be transmitted using a backup link to obtain a communication link adjustment scheme.

[0041] It should be noted that the optimized control commands generated by the edge computing nodes are input into the magnetic induction switch communication control system for execution. During command execution, the system collects and records two key signals in real time: a feedback signal output by the magnetic induction switch, used to characterize the switch action execution status; and communication link stability, collected in real time by the link monitoring unit, used to characterize the signal transmission quality of the current main communication link. The communication link stability is represented by real-time signal strength values.

[0042] The real-time collected communication link stability data is input into a pre-trained signal strength attenuation model. This model calculates the sliding variance of the communication link stability over multiple consecutive frames, analyzes the fluctuation amplitude of the communication link within a preset time window, and outputs the link jitter value. The preset time window is a standard industrial communication setting, with a value of 100 milliseconds. The link jitter value is a dimensionless numerical value used to characterize the severity of communication link fluctuations.

[0043] The signal strength attenuation model is a lightweight link fluctuation analysis model deployed locally on the edge computing node. It is used to calculate link jitter values ​​based on communication link stability (real-time signal strength). Specifically, the signal strength attenuation model is a linear regression model. Its input is the signal strength sequence of the past N sampling times, and its output is the predicted signal attenuation trend index at the current time. The model is trained using data from historical normal communication periods, aiming to minimize the error between the predicted index and the actual signal fluctuation variance. The predicted index output by the model is normalized and used as the link jitter value. Under normal and stable communication conditions of the magnetic induction coded switch, the edge computing node continuously collects real-time signal strength data of the main communication link for a duration of no less than 30 minutes and a sampling interval of 10ms. After collection, invalid samples with signal interruptions, abnormal jumps, or exceeding the normal signal strength range of industrial communication (-80dBm to -50dBm) are removed, and clean and valid training data are retained. The input is the communication link stability (real-time signal strength) of multiple consecutive frames within a preset time window (100ms); the output is the link jitter value (dimensionless, representing the severity of communication link fluctuations). The model is trained using a sliding variance statistical learning algorithm commonly used in industrial communications. A 100ms time window is used to calculate the sliding variance of the signal strength data within that window. This sliding variance is then normalized and mapped to link jitter values ​​in the 0-1 range. The normalization mapping coefficients are iteratively adjusted using a gradient descent optimization algorithm to ensure the model's output jitter values ​​perfectly match the actual link fluctuations. The trained model is validated using an independent test dataset, simulating three operating conditions in an industrial setting: weak interference, strong interference, and link fluctuations. The accuracy of the model's output jitter values ​​is verified. Training is stopped and the model is calibrated when the model's jitter value judgment accuracy reaches 99% or higher.

[0044] The system compares the link jitter value with a preset jitter threshold, which is a standard industrial communication setting with a value of 0.8. If the link jitter value exceeds the preset jitter threshold, it indicates significant fluctuations in the current communication link, with high-frequency noise mixed into the feedback signal. The system automatically initiates filtering to perform low-pass filtering on the feedback signal, removing noise interference. During the filtering process, the system continuously monitors the current real-time monitoring frequency through the frequency monitoring unit.

[0045] The preset jitter threshold is determined by long-term monitoring of signal strength fluctuations in the communication link in a typical industrial environment and recording the corresponding communication bit error rate or packet loss events. Through statistical analysis, it is determined that when the jitter value calculated by the sliding variance exceeds 0.8, the link bit error rate begins to rise significantly and the communication reliability decreases. Therefore, 0.8 is set as the threshold for triggering link status assessment and filtering operations.

[0046] It should be noted that the real-time monitoring frequency refers to the sampling frequency, measured in Hertz, used by the frequency monitoring unit in the edge computing node to periodically detect the status of the main communication link. The monitoring unit collects parameters such as signal strength and jitter value of the link at fixed time intervals, and the reciprocal of the sampling interval is the real-time monitoring frequency. During the filtering process, the frequency monitoring unit continuously outputs the current real-time monitoring frequency value. The preset frequency threshold is 10 Hertz, which is the minimum monitoring sampling frequency required by the system to ensure link stability. When the real-time monitoring frequency is lower than or equal to this threshold, it indicates that the link's monitoring capability is about to be insufficient.

[0047] The system compares the real-time monitoring frequency with a preset frequency threshold, which is the minimum monitoring frequency required for normal system operation and is set to 10Hz. The system calculates the frequency deviation between the real-time monitoring frequency and the preset frequency threshold using a numerical difference method. The system then compares this frequency deviation with a preset frequency deviation threshold of 2Hz. Based on 100 sets of data measured in industrial settings, a monitoring frequency deviation ≤ 2Hz indicates a communication link stability compliance rate of 99.5%; a deviation exceeding 2Hz indicates a rapid increase in link failure rate, with 2Hz being the optimal warning threshold. If the frequency deviation exceeds the preset frequency deviation threshold, it indicates a continuous downward trend in the current monitoring frequency. Based on historical continuous multi-frame monitoring frequency data, the system predicts the average monitoring frequency within a preset time window using a moving average prediction method. The preset time window is 5 seconds. Based on 100 sets of data measured, a window < 5 seconds results in a prediction accuracy of less than 85%, while a window > 5 seconds exhibits increased prediction lag. 5 seconds represents the optimal balance between prediction accuracy and response speed.

[0048] The system compares the aforementioned future average monitoring frequency with a preset frequency threshold. If the future average monitoring frequency is lower than the preset frequency threshold, it indicates that the main link monitoring capability is about to become insufficient. The system automatically executes a link switching strategy, switching the non-critical data portion of the current data stream to a backup communication link for transmission, ensuring that critical data is still transmitted on the main link. Based on the above filtering, frequency monitoring, and backup link switching operations, the system integrates and generates a communication link adjustment plan. This plan includes complete information such as filtering parameter configuration, real-time monitoring frequency records, link switching data types, and backup link transmission parameters, used to guide the system in stable communication.

[0049] In step S17, the transmission path is dynamically updated according to the communication link adjustment scheme, and the feedback indicators of the transmission path are extracted to obtain the communication link configuration.

[0050] It should be noted that the edge computing node reads the communication link adjustment scheme generated in step S16, and dynamically updates and reconstructs the current data transmission path according to the main link transmission rules, backup link activation conditions and data diversion strategies specified in the scheme, and determines the routing nodes, transmission bandwidth and data distribution priority of the updated main transmission path and backup transmission path.

[0051] After the updated transmission path is put into operation, feedback indicators of the transmission path are collected in real time. These indicators include transmission latency, data packet loss rate, link signal-to-noise ratio, link stability value, and signal response delay. Each extracted feedback indicator is compared with a preset threshold. If all feedback indicators are within a preset normal range, the current transmission path is determined to meet the stable transmission requirements. The verified transmission path topology, transmission parameters, link switching rules, and feedback indicator constraints are integrated to generate a communication chain configuration. This communication chain configuration guides the stable transmission and real-time monitoring of subsequent magnetic switch signals and serves as the basis for communication execution by edge computing nodes.

[0052] It should be further explained that the dynamic update of the transmission path specifically involves the edge computing node continuously monitoring the real-time performance indicators of the primary and backup links, including latency, packet loss rate, and signal strength. When the backup link needs to be activated according to the communication link adjustment plan, the system dynamically calculates the optimal data diversion ratio based on a preset cost function, such as minimizing the weighted sum of latency and packet loss rate. At the same time, based on the network topology and real-time load information, the system updates the routing nodes of the data packets using the shortest path or minimum cost routing algorithm. The bandwidth allocation and data distribution priority are dynamically adjusted according to the urgency of the data type, such as high priority for control commands and low priority for status data, as well as the current link quality.

[0053] It is worth noting that the communication link configuration is not only used to guide subsequent signal transmission, but also includes feedback indicators such as transmission delay and packet loss rate, which are fed back to the system's signal smoothing module and link adjustment module in real time. For example, when the feedback indicators show that the link quality continues to deteriorate, the system can adaptively adjust the strength of the signal smoothing filter or trigger a more aggressive backup link switching strategy in advance, thereby forming a closed-loop optimization process from communication quality perception to adaptive adjustment of front-end processing parameters.

[0054] In summary, this invention achieves cross-verification of dual-channel signals by acquiring both sine and cosine signals and calculating amplitude and phase differences. Combined with signal-to-noise ratio (SNR) determination and weighted processing, secondary high-precision smoothing is only initiated when the SNR exceeds a threshold. Compared to existing technologies that rely on simple single-stage filtering, failing to distinguish between noise and valid signals and susceptible to noise interference leading to signal distortion and drift, this invention suppresses noise, signal drift, and waveform distortion at the source, improving signal accuracy, stability, and consistency. Furthermore, this invention monitors communication link stability in real-time and dynamically allocates backup links based on the monitoring frequency. It dynamically updates the transmission path according to the communication link adjustment plan and extracts feedback indicators for closed-loop optimization. This achieves automatic switching between primary and backup links, dynamic optimization of transmission paths, and closed-loop assurance of link stability. Compared to existing technologies with fixed communication links, lack of redundancy backup, dynamic updates, and stability monitoring, and susceptibility to interference and interruption, this invention solves the defects of "fixed links, easy interruption, lack of redundancy, and poor anti-interference capability," significantly improving communication stability, reliability, and anti-interference capability. This invention constructs a closed-loop system encompassing signal processing, angle calculation, matching verification, control optimization, communication scheduling, feedback acquisition, and closed-loop iteration. All stages feature automatic feedback, iteration, and optimization. In contrast, existing technologies involving signal acquisition, angle calculation, control output, and communication transmission constitute a unidirectional open-loop process with no feedback, iteration, or self-optimization. This invention, during long-term operation, automatically suppresses error accumulation, corrects system drift, and adapts to changing operating conditions, thereby improving long-term system stability and self-adaptability.

[0055] Reference Figure 2 The second embodiment of the present invention provides a magnetically coded switch communication system incorporating edge computing, comprising: The data acquisition module is used to acquire the sine and cosine signals from the sensor, and to smooth the sine and cosine signals to obtain smoothed signal data. The signal smoothing module is used to calculate the signal-to-noise ratio of the smoothed signal data. If the signal-to-noise ratio does not exceed a preset signal-to-noise ratio threshold, the smoothed signal data is weighted and a reference signal data is determined. The feature extraction module is used to perform arctangent calculation based on the reference signal data to obtain preliminary angle data; An angle matching module is used to verify the degree of matching between the preliminary angle data and the historical angle data in the pre-established reference library. If the degree of matching is greater than a preset threshold, redundant interference is removed from the reference library and the degree of matching is recalculated to determine the suitable angle data. The instruction generation module is used to analyze the accuracy and real-time response of the adaptive angle data. If the accuracy and real-time response do not meet the preset threshold requirements, the angle output parameters and data transmission rate in the control system are adjusted to obtain optimized control instructions. The link adjustment module is used to record feedback signals and communication link stability according to the optimization control command, monitor the real-time monitoring frequency, allocate backup links according to the real-time monitoring frequency, and obtain a communication link adjustment scheme. The link update module is used to dynamically update the transmission path according to the communication link adjustment scheme, extract the feedback indicators of the transmission path, and obtain the communication link configuration.

[0056] It should be noted that the magnetic induction coding switch communication system combined with edge computing provided in this embodiment of the invention is used to execute all the process steps of the magnetic induction coding switch communication method combined with edge computing in the above embodiment. The working principle and beneficial effect of the two are one-to-one, so they will not be described again.

[0057] It should be noted that the system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the system embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0058] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.

Claims

1. A magnetically coded switch communication method combining edge computing, characterized in that, include: Acquire the sine and cosine signals from the sensor, and smooth the sine and cosine signals to obtain smoothed signal data; Calculate the signal-to-noise ratio (SNR) of the smoothed signal data. If the SNR does not exceed a preset SNR threshold, then perform a weighted judgment on the smoothed signal data to determine the reference signal data. Based on the reference signal data, the arctangent is calculated to obtain preliminary angle data; Verify the degree of matching between the preliminary angle data and the historical angle data in the pre-established reference library. If the degree of matching is greater than the preset degree threshold, remove redundant interference from the reference library and recalculate the degree of matching to determine the suitable angle data. Analyze the accuracy and real-time performance of the adaptive angle data. If the accuracy and real-time performance do not meet the preset threshold requirements, adjust the angle output parameters and data transmission rate in the control system to obtain optimized control commands. The feedback signal and communication link stability are recorded according to the optimized control command, and the real-time monitoring frequency is monitored. A backup link is allocated according to the real-time monitoring frequency to obtain a communication link adjustment scheme. Based on the communication link adjustment scheme, the transmission path is dynamically updated, and the feedback indicators of the transmission path are extracted to obtain the communication link configuration.

2. The magnetic induction coded switch communication method combined with edge computing according to claim 1, characterized in that, The process of acquiring the sine and cosine signals from the sensor, and smoothing the sine and cosine signals to obtain smoothed signal data includes: The maximum and minimum values ​​of the sine and cosine signals are iterated over, and the amplitude is calculated based on the maximum and minimum values. Extract the zero-point crossover time of the sine signal and the cosine signal respectively, calculate the difference between the zero-point crossover times, and obtain the phase difference value; Based on the amplitude and the phase difference, distortion signals in the sine and cosine signals are removed to obtain calibration signal data; The calibration signal data is divided into segments using a preset sampling window size, and the calibration signal data within each window is smoothed and filtered to obtain smoothed signal data.

3. The magnetically coded switch communication method combining edge computing according to claim 2, characterized in that, The step of calculating the signal-to-noise ratio (SNR) of the smoothed signal data, and if the SNR does not exceed a preset SNR threshold, then weighting the smoothed signal data to determine the reference signal data, includes: Calculate the signal-to-noise ratio (SNR) of the smoothed signal data. If the SNR does not exceed a preset SNR threshold, adjust the sampling window size and perform weighted processing on the data in each window to obtain a weighted signal. The weighted mean and weighted standard deviation of the weighted signal are calculated. If the weighted mean and weighted standard deviation meet the preset benchmark standard, the weighted signal is set as the benchmark signal data.

4. The magnetically coded switch communication method combining edge computing according to claim 1, characterized in that, The step of performing arctangent calculation based on the reference signal data to obtain preliminary angle data includes: Extract the instantaneous values ​​of the sine component and the cosine component from the reference signal data; The initial angle of the switch is calculated using the arctangent function based on the instantaneous values ​​of the sine component and the cosine component. If the tolerance between the initial angle and the preset angle calibration benchmark is less than the preset tolerance threshold, then the initial angle is determined to be a valid angle, and preliminary angle data is obtained.

5. The magnetically coded switch communication method combining edge computing according to claim 1, characterized in that, The step of verifying the matching degree between the preliminary angle data and historical angle data in a pre-established reference library, and if the matching degree is greater than a preset threshold, involves removing redundant interference from the reference library and recalculating the matching degree to determine the suitable angle data, including: Statistical analysis is performed on the historical angle data stored in the reference library to calculate the mean and standard deviation of the historical angle data. Using the preliminary angle data as the value to be measured and the mean angle and standard deviation angle as reference benchmarks, the Euclidean distance between the two is calculated, and the Euclidean distance is used as the degree of matching between the preliminary angle data and the historical angle data. If the matching degree is greater than the preset degree threshold, the sample size of historical data participating in the calculation in the pre-established reference library is adjusted, and statistical analysis and Euclidean distance calculation are re-executed to obtain the recalculated matching degree. If the recalculated matching degree is still greater than the preset degree threshold, then the duplicate samples, abnormal deviation samples and invalid samples in the historical angle data are cleaned, and the matching degree calculation is performed again until the recalculated matching degree is less than the preset degree threshold. Based on the historical angle data after cleaning, the average angle is recalculated as the updated angle, and the adapted angle data is output.

6. The magnetically coded switch communication method combining edge computing according to claim 1, characterized in that, The analysis examines the accuracy and real-time performance of the adapted angle data. If the accuracy and real-time performance do not meet preset threshold requirements, the angle output parameters and data transmission rate in the control system are adjusted to obtain optimized control commands, including: The adaptation angle data is input into the control system for execution, and the execution angle and response time delay of the obtained command are recorded. Calculate the absolute deviation between the adaptation angle data and the execution angle. If the absolute deviation exceeds a preset absolute deviation threshold, adjust the angle output control parameters in the control system to generate a preliminary control sequence. Determine whether the preliminary control sequence meets the preset real-time requirements. If not, adjust the data transmission rate to obtain optimized control instructions.

7. The magnetically coded switch communication method combining edge computing according to claim 6, characterized in that, The process of recording feedback signals and communication link stability according to the optimized control instructions, monitoring the real-time monitoring frequency, allocating backup links according to the real-time monitoring frequency, and obtaining a communication link adjustment scheme includes: The optimized control command is input into the control system, and the feedback signal and communication link stability are recorded. The stability of the communication link is input into a pre-trained signal strength attenuation model to analyze link jitter and obtain jitter values; If the jitter value exceeds the preset jitter threshold, the feedback signal is filtered, and the real-time monitoring frequency during the filtering process is detected. Calculate the frequency deviation between the real-time monitoring frequency and a preset frequency threshold. If the frequency deviation exceeds the preset frequency deviation threshold, predict and evaluate the future average frequency. If the average frequency is lower than the frequency threshold, some data will be transmitted using a backup link to obtain a communication link adjustment scheme.

8. A magnetically coded switch communication system incorporating edge computing, characterized in that, include: The data acquisition module is used to acquire the sine and cosine signals from the sensor, and to smooth the sine and cosine signals to obtain smoothed signal data. The signal smoothing module is used to calculate the signal-to-noise ratio of the smoothed signal data. If the signal-to-noise ratio does not exceed a preset signal-to-noise ratio threshold, the smoothed signal data is weighted and a reference signal data is determined. The feature extraction module is used to perform arctangent calculation based on the reference signal data to obtain preliminary angle data; An angle matching module is used to verify the degree of matching between the preliminary angle data and the historical angle data in the pre-established reference library. If the degree of matching is greater than a preset threshold, redundant interference is removed from the reference library and the degree of matching is recalculated to determine the suitable angle data. The instruction generation module is used to analyze the accuracy and real-time performance of the adaptive angle data. If the accuracy and real-time performance do not meet the preset threshold requirements, the angle output parameters and data transmission rate in the control system are adjusted to obtain optimized control instructions. The link adjustment module is used to record feedback signals and communication link stability according to the optimization control command, monitor the real-time monitoring frequency, allocate backup links according to the real-time monitoring frequency, and obtain a communication link adjustment scheme. The link update module is used to dynamically update the transmission path according to the communication link adjustment scheme, extract the feedback indicators of the transmission path, and obtain the communication link configuration.