# Real-Time Collection of Training Distance of Long-Distance Runners Based on Wireless Sensor Network

Authors: Xin Li
Journal: Security and Communication Networks
 (2021)

---

## Abstract

The real-time and accurate collection of long-distance runners’ training distance can provide real-time scientific basis for long-distance runners’ physical training. Therefore, the real-time collection method of long-distance runners’ training distance based on wireless sensor network is studied in this paper. In this model, the position tracking algorithm of long-distance runners based on wireless sensor network is introduced to collect the training distance of long-distance runners. When collecting the training distance, the energy balanced clustering routing algorithm based on energy and location is used to optimize and balance the energy consumption distribution of nodes and prolong the network life cycle, so that the training distance of long-distance runners can be collected in real time. Through the test, in the straight line and curve training path, this method has significant accuracy in collecting the training distance of single and multiple long-distance runners and can collect the training distance of long-distance runners in real time, which has significant application value.


---

## Body

## 1. Introduction

The rapid development of information technology has had an unprecedented impact on modern competitive sports. The use of information technology to assist athletes in scientific training has become an important symbol of modern competitive sports [1]. In traditional sports training methods, coaches are mainly responsible for observing and recording athletes’ sports data and judging the rationality of sports technology by experience. This kind of qualitative analysis method has some shortcomings, such as strong subjectivity, large error, and ease of being disturbed. The combination of information technology with traditional training methods, experience, and historical training data can timely and effectively obtain the quantitative parameters of athletes’ movement, which can be statistically processed by computer, providing theoretical basis for accurate analysis of sports technology [2]. It is found that the topology of a data communication network plays a role as an important factor in its security robustness against attack. In such networks, by changing the topology, the security robustness against intentional attack that aims at bringing down network nodes may vary. This bringing down is a kind of destruction and interruption threat that attacks the availability of the network (i.e., attack on network resources and links).In recent years, with the rapid development of embedded technology, electronic circuit technology, sensor technology, and wireless communication capabilities, the rapid development of wireless sensor network (WSN) has been promoted. Wireless sensor network (WSN) is a comprehensive measurement and control network, which involves automation control, computer, communication, and artificial intelligence. Because of its high practicability, it widely exists in people’s life, and wireless sensor network has developed into an information technology after the Internet, which greatly affects the way of human life.The scale of wireless sensor network is larger than the Internet, and it contains more cross technology. It realizes the connection of the physical world, the computer world, and human society. The application prospect of wireless sensor network is extremely broad, and it will further go into human daily life. Wireless sensor network is a wireless self-organizing network composed of a large number of cheap sensor nodes. Each sensor node is composed of computing unit, storage unit, sensor unit, and wireless communication unit. Its task is to use sensors to monitor the surrounding environment, collect relevant data, and then send the data to the sink node by using multihop routing through the wireless transceiver device and then transmit the data to the user through the sink node, so as to achieve the goal of monitoring. It integrates computing technology, communication technology, and sensor technology. It can monitor, sense, and collect the information of various environments or monitoring objects in real time through various integrated microsensors. The information is transmitted wirelessly and sent to the user terminal in the form of self-organizing multihop network, so as to realize the connection of the physical world, the computer world, and the ternary world of human society [3]. These architectures profit from important wireless communication technologies such as IEEE 802.15.3 and IEEE 802.15.4 for Wireless Personal Area Network (WPAN), IEEE 802.11g and 802.11n for Wireless Local Area Network (WLAN), and High Speed Downlink Packet Access (HSDPA) and Long-Term Evolution (LTE) for Wireless Wide Area Network (WWAN). In order to enhance application performance, the routing strategies discovering the best path to the destination, the energy-saving methods maximizing the life of sensors, and security protocols guarantying our privacy are the most important techniques used in WSNs.However, there are many difficult issues of wireless sensor network as follows:(1)
Node miniaturization: It is an important research direction to design sensor nodes with microvolume and long life by using current microelectric mechanical and microwireless communication technology. The dust sensor node developed by Berkeley University reduces the size of the sensor to one cubic millimeter, so that the sensor particles can be suspended in the air.(2)
Looking for system energy-saving strategy: When wireless sensor networks are applied in special occasions, the power supply cannot be replaced, so the problem of power consumption is very important. At present, great achievements have been made on the low-power problem of nodes at home and abroad. Some low-power wireless sensor network protocols are proposed, which will make greater progress in the future.(3)
Low cost: Because the number of sensor network nodes is very large, often thousands, in order to make the sensor network practical, the price of each node should be controlled below $1, but now the cost of each sensor node is about $80. If we can effectively reduce the cost of nodes, it will greatly promote the development of sensor networks.(4)
Security and anti-interference problems of sensor networks: Like ordinary networks, sensor networks are also facing the test of security, that is, how to use less energy and less computation to complete data encryption, identity authentication, and so on. It is also an important research topic to complete the task reliably in the case of destruction or interference.The distance of athletes in the sports field is one of the important indexes to evaluate their physical fitness. In the past, the distance measurement of long-distance runners under the condition of training mostly uses the visual method, which has large error and low credibility. Therefore, this paper proposes a training distance measurement method for long-distance runner based on wireless sensor network through another data acquisition method, namely, the application of wireless sensor network, so as to realize the connection of the physical world, the computer world, and the ternary world of human society.The contribution of our method can be described as follows:(1)
The position tracking algorithm is induced to collect the training distance of long-distance runners.(2)
The energy balanced clustering routing algorithm based on energy and location is used to optimize and balance the energy consumption distribution of nodes.(3)
In the straight line and curve training path, this method has significant accuracy in collecting the training distance of single and multiple long-distance runners.This paper is divided into 4 sections. Section2 discusses how we build the wireless sensor networks. Section 3 describes the experimental results. Section 4 concludes this paper with contributions, limitations, and future works.


## 2. Real-Time Collection Method of Training Distance for Long-Distance Runners Based on Wireless Sensor Network

### 2.1. Training Scene Model of Long-Distance Runners Based on Wireless Sensor

The training scene model of long-distance runners based on wireless sensor consists of roadside nodes (nodes with known location), athlete movement nodes, and Sink nodes (Sink node in wireless sensor network is mainly responsible for the connection between sensor network and external network and can be regarded as gateway node). The structure of the model is shown in Figure1. As shown in Figure 1, the square box represents the player who is tested, and the circles are sensors located in many areas to obtain the information of the players.(1)
The roadside node is powered by battery, which has high working intensity and weak storage and processing capacity. After simple data fusion processing, the data is sent to Sink node, and the warning, replacement task, and other information from Sink node are received and processed.(2)
The athlete movement node is a kind of wireless sensor microtransmitter placed on the back of the athlete.(3)
Sink node has the characteristics of large storage capacity and strong computing power. The specific function is to collect the information from the roadside nodes, fuse the data and then transmit it to the roadside nodes within the management and control scope of the monitoring center, and receive various control commands from the monitoring center [4, 5].Figure 1
Training scene model of long-distance runners based on wireless sensor.


### 2.2. Location Tracking Algorithm of Long-Distance Runners Based on Wireless Sensor Network

Wireless sensor network (WSN) is a kind of distributed sensor network. Its terminals are sensors that can sense and check the outside world. Sensors in WSN are communicated through wireless mode, so the network settings are flexible, the location of devices can be changed at any time, and they can also connect with the Internet in wired or wireless mode, forming a multihop self-organizing network through wireless communication [6]. Based on the distance measurement of the sensor itself, the distance between the sensors and the distance measurement of other sensors collected, combined with the dynamic distance model for nonlinear filtering, the distance and distance change rate between the sensor and the long-distance runner are estimated, and the training distance is collected.


#### 2.2.1. Estimation of Distance and Its Rate of Change

Considering the relative motion between wireless sensor and long-distance runner, the state variables of dynamic distance model are as follows:(1)X=d,d˙,θ,where d=d12,d13,d14,d1t,d23,d24,d2t,d34,d3t,d4t means the training distance vector of long-distance runners; d˙=d˙12,d˙13,d˙14,d˙1t,d˙23,d˙24,d˙2t,d˙34,d˙3t,d˙4t means the training distance change rate of long-distance runners; θ=cosθ1,cosθ2,cosθ3,cosθ4,cosθ5,cosθ6,cosθ7,cosθ8 means the angle cosine value vector.The dynamic distance model of long-distance runners is as follows:(2)X=fX+Ωw,where fX is the nonlinear state transfer function (here, we use Gaussian function transfer); Ω is the disturbance gain matrix; w=d˙12,d˙13,d˙14,d˙1t,d˙23,d˙24,d˙2t,d˙34,d˙3t,d˙4t is the disturbance vector, which is caused by the unknown change of the second derivative of the distance. Considering the ranging information and angle cosine value in practical application, the state vector of the model in (2) should meet the following physical constraints:(3)d=Xi≥0,i∈1,2,...,10,−1≤θ=Xi≤1,i∈1,2,...,8.According to the distance measurement and the distance information between sensors, each sensori∈S uses the distance information to form the measurement equation as follows:(4)Z=HX+γ,where Z is the measurement vector of training distance of long-distance runners; H is the measurement matrix of training distance of long-distance runners; γ is the measurement error vector of training distance of long-distance runners.By using the discretization method and sampling equations (2) and (4) at the time interval δ, the dynamic distance model transfer equation Xk and the corresponding measurement equation Z at the k-th sampling time in the discrete-time model are obtained.(5)Xk=fXk−1,Z=HkXk+γk,where Hk and γk are the distance measurement matrix and the distance measurement error vector at the k-th sampling time. Because the state transfer function FXk−1 of training distance of long-distance runners is a nonlinear function with state constraints, the state estimation of dynamic distance model should be obtained by nonlinear filtering method. Here, the state estimation of dynamic distance model can be obtained directly by using UKF filtering algorithm based on uncorrelated transformation and projection.(6)X^k=d^kd˙kθ⌢k,where d^k is the training distance vector of long-distance runners at the k-th sampling time; d˙k is the training distance change rate of long-distance runners at the k-th sampling time; θ⌢k is the angle cosine value vector of long-distance runners at the sampling time k.


#### 2.2.2. Estimation of Target Location

According to the weighted multidimensional scaling method, the relative position matrixPst,k of long-distance runners is constructed.(7)Pst,k=Ps,k−pt,k=p1,k−pt,kp2,k−pt,kp3,k−pt,kp4,k−pt,k,where Ps,k=p1,kp2,kp3,kp4,k is the matrix of the real position of the wireless sensor; pt,k is the distance matrix of detection.Based on the above position matrix, the scalar product matrix is constructed.(8)Bk=Bk,11Bk,12Bk,13Bk,14Bk,21Bk,22Bk,23Bk,24Bk,31Bk,32Bk,33Bk,34Bk,41Bk,42B43Bk,44,where the distance between wireless sensor i and long-distance runner j is dijk=pi,k−pj,kTpi,k−pj,k, pi,k and pj,k are the relative position matrix of wireless sensor i and long-distance runner j, and T is transpose. Since the wireless sensor cannot obtain the true distance to the long-distance runner, the estimated distance d^ijk between the sensor and the long-distance runner can only be obtained through the state estimation result of the dynamic distance model, and then it can get the estimated value Ak of the scalar product matrix Bk by importing dijk into (9)Ak=d^ij,2k2.In addition, the followingAk matrix is defined:(10)Ak=Ak,1Ak,2,where Ak,1 is the first column of Ak and Ak,2 is composed of other columns.Using multidimensional scaling method, it can get the initial position estimationp^t0,k of long-distance runners as follows:(11)p^t0,k=−Ak,1Ak,2−1Ak,1Ak,2.The above calculation does not use the weighting matrix, but in practice, whitening the residual vectorM through the weighting matrix can further improve the training distance positioning accuracy of long-distance runners. Therefore, the weight matrix is calculated as follows:(12)W=M−TQ−1M−1,where Q is the covariance of distance estimation between wireless sensor and long-distance runner. The estimated position of the long-distance runners at time k is as follows:(13)p^t,k=−Ak,1WAk,2−1Ak,1WAk,2.


#### 2.2.3. Estimation of Target Velocity

Combined with the position matrix, the relative speed matrixVst,k of long-distance runners is constructed as follows:(14)Vst,k=v1,k−vt,kv2,k−vt,kv3,k−vt,kv4,k−vt,k,where vt,k is the relative velocity vector.The first derivativeEk of the matrix with respect to time is calculated as follows:(15)Ek=Ek,11Ek,12Ek,13Ek,14Ek,21Ek,22Ek,23Ek,24Ek,31Ek,32Ek,33Ek,34Ek,41Ek,44Ek,34Ek,44.The calculation equation of distance change rate between wireless sensori and long-distance runner j is as follows:(16)Dk==Dk,11Dk,12Dk,13Dk,14Dk,21Dk,22Dk,23Dk,24Dk,31Dk,32Dk,33Dk,34Dk,41Dk,44Dk,34Dk,44.According to the symmetry of the matrixEk and the penalty property of the matrix, the following equation can be deduced:(17)Dk,11Dk,12Dk,13Dk,14Dk,22Dk,23Dk,24Dk,33Dk,34Dk,44︸Uk=2000110010101001020001000101002000110002Pst,kvt,k.The training distance state estimationX^k of the long-distance runners is obtained.(18)X^k=P^t,k,V^t,k,where P^t,k and V^t,k are the relative position and speed of long-distance runners in turn.


### 2.3. Energy Balanced Clustering Routing Algorithm Based on Energy and Location

At present, the routing protocol of wireless sensor network can be divided into two kinds: plane routing protocol and layered routing protocol. In plane routing protocol, all network nodes are equal in status, and there is no difference in level. Routing is generated by local operation and information feedback between each other [7–9]. Typical plane routing algorithms include directed diffusion protocol and SAR.The biggest disadvantages of plane routing are no management node in the network; lack of optimal management of communication resources; complex self-organizing cooperative work algorithm; slow response to network dynamic changes, etc.Typical layered routing protocols include LEACH, TEEN, PEGASIS, and HEED. LEACH is the first layered routing algorithm in wireless sensor networks, and it is also a representative layered routing protocol. Its idea has led to the emergence of many layered routing protocols [6]. After the concept of LEACH clustering protocol is put forward, the energy saving property and network lifetime of network nodes have been greatly improved. However, the application of LEACH protocol in the training distance collection of long-distance runners has its own limitations that cannot be ignored [10]. On the basis of the LEACH protocol, this paper introduces an energy balanced clustering routing algorithm based on energy and location, which fully considers the energy and location factors of nodes in the cluster head election mechanism, avoids the nodes with low residual energy and poor geographical location from being selected as the cluster head node, effectively balances the energy consumption distribution of nodes, prolongs the network life cycle, and optimizes the training distance of long-distance runners from the collection efficiency, so as to realize real-time collection of long-distance athletes’ training distance [11–13].


#### 2.3.1. Selection of Cluster Head Node

Before clustering, Sink node calculates the maximum distanceDmax and minimum distance Dmin of all roadside nodes and broadcasts the whole network. Before each round of cluster reconstruction, all the roadside nodes send their own residual energy Ecurren and the collected training distance parameters to the cluster head node selected from the previous round. The cluster head node simply fuses the received data and sends its own Ecurren to the Sink node. After receiving the data, the Sink node transmits the useful data to the gateway and calculates the average residual energy Eavg of the whole network and sends to the whole network. After receiving the cluster head election command, each node compares Ecurren and Eavg and can participate in the cluster head election only if Ecurren>Eavg. The improved cluster head selection threshold is as follows:(19)Tn=p1−prmod1/pEavgEcurrent+Dmax−dDmax−Dmin,0,others,where p is the proportion of cluster heads in all nodes in WSN; r is the current round r; n is a node; the node set that has not been selected before round r is G; the symbol mod is the modulus operator; the maximum distance between all roadside nodes and Sink nodes is Dmax, and the minimum is Dmin; d is the distance from the roadside node participating in cluster head selection to Sink node.


#### 2.3.2. Routing Establishment within and between Clusters

After the cluster head node is selected, the cluster head node broadcasts the selected cluster head message to the whole network. The message contains its own geographical location information, identity, and CDMA spread spectrum code. Other roadside nodes determine which cluster to join according to the strength of the signal received by the cluster head broadcast message and send the request to join the cluster [14]. After receiving the cluster request, the cluster head adds the roadside node to its own routing table and then allocates a time slice for each roadside node in the cluster and notifies all nodes in the cluster [15–17]. After receiving the broadcast message from other cluster heads, the cluster head node finds its own forward cluster head node according to its own location information. The specific judgment methods are as follows:(1)
The cluster head node calculates the distance from Sink node.(20)Dthis,sink=tx−sx2+ty−sy2,wheretx and ty, sx, and sy are the abscissa and ordinate of the cluster head node “clusteri” and Sink node “Sink,” respectively.(2)
Other cluster heads calculate the distance between themselves and Sink nodes.(21)Dclusteri,sink=cx−sx2+cy−sy2,wherecx and cy, sx, and sy are the abscissa and ordinate of cluster head node clusteri and Sink node “Sink,” respectively.(3)
Select the cluster head node withDthis,sink>Dclusteri,sink and calculate the distance between the cluster head node and itself.(22)Dclusteri,this=cx−tx2+cy−ty2.(4)
If no other node satisfiesDthis,sink>Dclusteri,sink, the next hop of current node is Sink node; otherwise, the minimum value Dminclusteri,this is selected from Dclusteri,this. If Dminclusteri,this<Dthis,sink, the node corresponding to Dminclusteri,this is the next hop cluster head of current cluster head node.In this way, selecting the next hop cluster head can ensure that each cluster head can send the training distance data of long-distance runners with low energy consumption; according to the energy model of sending data between cluster head nodes given above, the cluster head node can send the training distance data of long-distance runners to the nearest cluster head node and forward it, which can ensure that each cluster head node sends out the training distance data of long-distance runners with the lowest energy consumption [18].


#### 2.3.3. Next Round of Cluster Reconstruction

After the establishment of intracluster and intercluster routes, Sink nodes send transmission instructions to the whole network and enter the current round of transmission stage of long-distance runners’ training distance data. All the roadside nodes will transmit the collected training distance data andEcurrent to the cluster head node in their own time slice, and the nodes will enter the sleep state in the rest time slice; the cluster head node will send the training distance data to the next hop cluster head node and finally to the Sink node.Before the next round of communication, Sink node collects the training distance data of long-distance runners, recalculatesEavg of the current network nodes, and sets a dynamic threshold Emin=Eavg/2. Sink node compares the energy of cluster head node with Emin. If Emin<Ecurrent, the current cluster structure will remain unchanged. Otherwise, it will enter the next round of reselection; that is, the node with the highest residual energy in the current cluster will be selected as the cluster head node. Sink nodes broadcast the new cluster head nodes to the whole network, while the nodes in the cluster update their own routes in time, and the cluster head nodes update their next hop nodes in time [19].For each cluster reconstruction, Sink node addscluster-round to 1. When cluster−round>n⋅p⋅25%, Sink node broadcasts to the whole network, reselects the general election in the whole network according to the cluster head selection mechanism, and then updates the intracluster and intercluster routes. Otherwise, it only reselects the cluster head in the cluster, publishes the new cluster head, and updates the intracluster and intercluster routes.In the last three years, many methods are proposed to handle the problem of information collection for the long-run distance players; here, we introduced three outstanding methods such as GNNA [20], RNNA [21], and CNNA [22], which can be used to solve the related works taking different kinds of network structures. GNNA is a graph-based network that builds connections between different risk nodes. And RNNA uses a specific loss structure to keep the similarity of real and predicted crafts design. CNNA is the basic model that needs more computation consuming to obtain the desiring performances. However, these methods have their disadvantages, respectively. GNNA is too slow, RNNA is so complicated, and CNNA also needs more spaces.In this paper we utilize the entropy loss function to build the model for our research problems. It can be defined as follows:lossx,y=∑i=1n−pilog1−pi, where x and y are represented as the real arts and crafts’ score and difficulty and y means the predicted score and difficulty of our proposal. Pi means the probability of them when they are similar. The bigger the value of the loss, the worse our proposal performed. And our proposal is used to train a model that fits the real and predicted arts and crafts, so that the machine can assist the arts and crafts designed. And compared with the three methods, our proposal can deal with the problems easily and we also need a smaller computation space to build our model. However, our model may obtain a relative lower accuracy than others sometimes which may lead to unstable prediction.


## 2.1. Training Scene Model of Long-Distance Runners Based on Wireless Sensor

The training scene model of long-distance runners based on wireless sensor consists of roadside nodes (nodes with known location), athlete movement nodes, and Sink nodes (Sink node in wireless sensor network is mainly responsible for the connection between sensor network and external network and can be regarded as gateway node). The structure of the model is shown in Figure1. As shown in Figure 1, the square box represents the player who is tested, and the circles are sensors located in many areas to obtain the information of the players.(1)
The roadside node is powered by battery, which has high working intensity and weak storage and processing capacity. After simple data fusion processing, the data is sent to Sink node, and the warning, replacement task, and other information from Sink node are received and processed.(2)
The athlete movement node is a kind of wireless sensor microtransmitter placed on the back of the athlete.(3)
Sink node has the characteristics of large storage capacity and strong computing power. The specific function is to collect the information from the roadside nodes, fuse the data and then transmit it to the roadside nodes within the management and control scope of the monitoring center, and receive various control commands from the monitoring center [4, 5].Figure 1
Training scene model of long-distance runners based on wireless sensor.


## 2.2. Location Tracking Algorithm of Long-Distance Runners Based on Wireless Sensor Network

Wireless sensor network (WSN) is a kind of distributed sensor network. Its terminals are sensors that can sense and check the outside world. Sensors in WSN are communicated through wireless mode, so the network settings are flexible, the location of devices can be changed at any time, and they can also connect with the Internet in wired or wireless mode, forming a multihop self-organizing network through wireless communication [6]. Based on the distance measurement of the sensor itself, the distance between the sensors and the distance measurement of other sensors collected, combined with the dynamic distance model for nonlinear filtering, the distance and distance change rate between the sensor and the long-distance runner are estimated, and the training distance is collected.


### 2.2.1. Estimation of Distance and Its Rate of Change

Considering the relative motion between wireless sensor and long-distance runner, the state variables of dynamic distance model are as follows:(1)X=d,d˙,θ,where d=d12,d13,d14,d1t,d23,d24,d2t,d34,d3t,d4t means the training distance vector of long-distance runners; d˙=d˙12,d˙13,d˙14,d˙1t,d˙23,d˙24,d˙2t,d˙34,d˙3t,d˙4t means the training distance change rate of long-distance runners; θ=cosθ1,cosθ2,cosθ3,cosθ4,cosθ5,cosθ6,cosθ7,cosθ8 means the angle cosine value vector.The dynamic distance model of long-distance runners is as follows:(2)X=fX+Ωw,where fX is the nonlinear state transfer function (here, we use Gaussian function transfer); Ω is the disturbance gain matrix; w=d˙12,d˙13,d˙14,d˙1t,d˙23,d˙24,d˙2t,d˙34,d˙3t,d˙4t is the disturbance vector, which is caused by the unknown change of the second derivative of the distance. Considering the ranging information and angle cosine value in practical application, the state vector of the model in (2) should meet the following physical constraints:(3)d=Xi≥0,i∈1,2,...,10,−1≤θ=Xi≤1,i∈1,2,...,8.According to the distance measurement and the distance information between sensors, each sensori∈S uses the distance information to form the measurement equation as follows:(4)Z=HX+γ,where Z is the measurement vector of training distance of long-distance runners; H is the measurement matrix of training distance of long-distance runners; γ is the measurement error vector of training distance of long-distance runners.By using the discretization method and sampling equations (2) and (4) at the time interval δ, the dynamic distance model transfer equation Xk and the corresponding measurement equation Z at the k-th sampling time in the discrete-time model are obtained.(5)Xk=fXk−1,Z=HkXk+γk,where Hk and γk are the distance measurement matrix and the distance measurement error vector at the k-th sampling time. Because the state transfer function FXk−1 of training distance of long-distance runners is a nonlinear function with state constraints, the state estimation of dynamic distance model should be obtained by nonlinear filtering method. Here, the state estimation of dynamic distance model can be obtained directly by using UKF filtering algorithm based on uncorrelated transformation and projection.(6)X^k=d^kd˙kθ⌢k,where d^k is the training distance vector of long-distance runners at the k-th sampling time; d˙k is the training distance change rate of long-distance runners at the k-th sampling time; θ⌢k is the angle cosine value vector of long-distance runners at the sampling time k.


### 2.2.2. Estimation of Target Location

According to the weighted multidimensional scaling method, the relative position matrixPst,k of long-distance runners is constructed.(7)Pst,k=Ps,k−pt,k=p1,k−pt,kp2,k−pt,kp3,k−pt,kp4,k−pt,k,where Ps,k=p1,kp2,kp3,kp4,k is the matrix of the real position of the wireless sensor; pt,k is the distance matrix of detection.Based on the above position matrix, the scalar product matrix is constructed.(8)Bk=Bk,11Bk,12Bk,13Bk,14Bk,21Bk,22Bk,23Bk,24Bk,31Bk,32Bk,33Bk,34Bk,41Bk,42B43Bk,44,where the distance between wireless sensor i and long-distance runner j is dijk=pi,k−pj,kTpi,k−pj,k, pi,k and pj,k are the relative position matrix of wireless sensor i and long-distance runner j, and T is transpose. Since the wireless sensor cannot obtain the true distance to the long-distance runner, the estimated distance d^ijk between the sensor and the long-distance runner can only be obtained through the state estimation result of the dynamic distance model, and then it can get the estimated value Ak of the scalar product matrix Bk by importing dijk into (9)Ak=d^ij,2k2.In addition, the followingAk matrix is defined:(10)Ak=Ak,1Ak,2,where Ak,1 is the first column of Ak and Ak,2 is composed of other columns.Using multidimensional scaling method, it can get the initial position estimationp^t0,k of long-distance runners as follows:(11)p^t0,k=−Ak,1Ak,2−1Ak,1Ak,2.The above calculation does not use the weighting matrix, but in practice, whitening the residual vectorM through the weighting matrix can further improve the training distance positioning accuracy of long-distance runners. Therefore, the weight matrix is calculated as follows:(12)W=M−TQ−1M−1,where Q is the covariance of distance estimation between wireless sensor and long-distance runner. The estimated position of the long-distance runners at time k is as follows:(13)p^t,k=−Ak,1WAk,2−1Ak,1WAk,2.


### 2.2.3. Estimation of Target Velocity

Combined with the position matrix, the relative speed matrixVst,k of long-distance runners is constructed as follows:(14)Vst,k=v1,k−vt,kv2,k−vt,kv3,k−vt,kv4,k−vt,k,where vt,k is the relative velocity vector.The first derivativeEk of the matrix with respect to time is calculated as follows:(15)Ek=Ek,11Ek,12Ek,13Ek,14Ek,21Ek,22Ek,23Ek,24Ek,31Ek,32Ek,33Ek,34Ek,41Ek,44Ek,34Ek,44.The calculation equation of distance change rate between wireless sensori and long-distance runner j is as follows:(16)Dk==Dk,11Dk,12Dk,13Dk,14Dk,21Dk,22Dk,23Dk,24Dk,31Dk,32Dk,33Dk,34Dk,41Dk,44Dk,34Dk,44.According to the symmetry of the matrixEk and the penalty property of the matrix, the following equation can be deduced:(17)Dk,11Dk,12Dk,13Dk,14Dk,22Dk,23Dk,24Dk,33Dk,34Dk,44︸Uk=2000110010101001020001000101002000110002Pst,kvt,k.The training distance state estimationX^k of the long-distance runners is obtained.(18)X^k=P^t,k,V^t,k,where P^t,k and V^t,k are the relative position and speed of long-distance runners in turn.


## 2.2.1. Estimation of Distance and Its Rate of Change

Considering the relative motion between wireless sensor and long-distance runner, the state variables of dynamic distance model are as follows:(1)X=d,d˙,θ,where d=d12,d13,d14,d1t,d23,d24,d2t,d34,d3t,d4t means the training distance vector of long-distance runners; d˙=d˙12,d˙13,d˙14,d˙1t,d˙23,d˙24,d˙2t,d˙34,d˙3t,d˙4t means the training distance change rate of long-distance runners; θ=cosθ1,cosθ2,cosθ3,cosθ4,cosθ5,cosθ6,cosθ7,cosθ8 means the angle cosine value vector.The dynamic distance model of long-distance runners is as follows:(2)X=fX+Ωw,where fX is the nonlinear state transfer function (here, we use Gaussian function transfer); Ω is the disturbance gain matrix; w=d˙12,d˙13,d˙14,d˙1t,d˙23,d˙24,d˙2t,d˙34,d˙3t,d˙4t is the disturbance vector, which is caused by the unknown change of the second derivative of the distance. Considering the ranging information and angle cosine value in practical application, the state vector of the model in (2) should meet the following physical constraints:(3)d=Xi≥0,i∈1,2,...,10,−1≤θ=Xi≤1,i∈1,2,...,8.According to the distance measurement and the distance information between sensors, each sensori∈S uses the distance information to form the measurement equation as follows:(4)Z=HX+γ,where Z is the measurement vector of training distance of long-distance runners; H is the measurement matrix of training distance of long-distance runners; γ is the measurement error vector of training distance of long-distance runners.By using the discretization method and sampling equations (2) and (4) at the time interval δ, the dynamic distance model transfer equation Xk and the corresponding measurement equation Z at the k-th sampling time in the discrete-time model are obtained.(5)Xk=fXk−1,Z=HkXk+γk,where Hk and γk are the distance measurement matrix and the distance measurement error vector at the k-th sampling time. Because the state transfer function FXk−1 of training distance of long-distance runners is a nonlinear function with state constraints, the state estimation of dynamic distance model should be obtained by nonlinear filtering method. Here, the state estimation of dynamic distance model can be obtained directly by using UKF filtering algorithm based on uncorrelated transformation and projection.(6)X^k=d^kd˙kθ⌢k,where d^k is the training distance vector of long-distance runners at the k-th sampling time; d˙k is the training distance change rate of long-distance runners at the k-th sampling time; θ⌢k is the angle cosine value vector of long-distance runners at the sampling time k.


## 2.2.2. Estimation of Target Location

According to the weighted multidimensional scaling method, the relative position matrixPst,k of long-distance runners is constructed.(7)Pst,k=Ps,k−pt,k=p1,k−pt,kp2,k−pt,kp3,k−pt,kp4,k−pt,k,where Ps,k=p1,kp2,kp3,kp4,k is the matrix of the real position of the wireless sensor; pt,k is the distance matrix of detection.Based on the above position matrix, the scalar product matrix is constructed.(8)Bk=Bk,11Bk,12Bk,13Bk,14Bk,21Bk,22Bk,23Bk,24Bk,31Bk,32Bk,33Bk,34Bk,41Bk,42B43Bk,44,where the distance between wireless sensor i and long-distance runner j is dijk=pi,k−pj,kTpi,k−pj,k, pi,k and pj,k are the relative position matrix of wireless sensor i and long-distance runner j, and T is transpose. Since the wireless sensor cannot obtain the true distance to the long-distance runner, the estimated distance d^ijk between the sensor and the long-distance runner can only be obtained through the state estimation result of the dynamic distance model, and then it can get the estimated value Ak of the scalar product matrix Bk by importing dijk into (9)Ak=d^ij,2k2.In addition, the followingAk matrix is defined:(10)Ak=Ak,1Ak,2,where Ak,1 is the first column of Ak and Ak,2 is composed of other columns.Using multidimensional scaling method, it can get the initial position estimationp^t0,k of long-distance runners as follows:(11)p^t0,k=−Ak,1Ak,2−1Ak,1Ak,2.The above calculation does not use the weighting matrix, but in practice, whitening the residual vectorM through the weighting matrix can further improve the training distance positioning accuracy of long-distance runners. Therefore, the weight matrix is calculated as follows:(12)W=M−TQ−1M−1,where Q is the covariance of distance estimation between wireless sensor and long-distance runner. The estimated position of the long-distance runners at time k is as follows:(13)p^t,k=−Ak,1WAk,2−1Ak,1WAk,2.


## 2.2.3. Estimation of Target Velocity

Combined with the position matrix, the relative speed matrixVst,k of long-distance runners is constructed as follows:(14)Vst,k=v1,k−vt,kv2,k−vt,kv3,k−vt,kv4,k−vt,k,where vt,k is the relative velocity vector.The first derivativeEk of the matrix with respect to time is calculated as follows:(15)Ek=Ek,11Ek,12Ek,13Ek,14Ek,21Ek,22Ek,23Ek,24Ek,31Ek,32Ek,33Ek,34Ek,41Ek,44Ek,34Ek,44.The calculation equation of distance change rate between wireless sensori and long-distance runner j is as follows:(16)Dk==Dk,11Dk,12Dk,13Dk,14Dk,21Dk,22Dk,23Dk,24Dk,31Dk,32Dk,33Dk,34Dk,41Dk,44Dk,34Dk,44.According to the symmetry of the matrixEk and the penalty property of the matrix, the following equation can be deduced:(17)Dk,11Dk,12Dk,13Dk,14Dk,22Dk,23Dk,24Dk,33Dk,34Dk,44︸Uk=2000110010101001020001000101002000110002Pst,kvt,k.The training distance state estimationX^k of the long-distance runners is obtained.(18)X^k=P^t,k,V^t,k,where P^t,k and V^t,k are the relative position and speed of long-distance runners in turn.


## 2.3. Energy Balanced Clustering Routing Algorithm Based on Energy and Location

At present, the routing protocol of wireless sensor network can be divided into two kinds: plane routing protocol and layered routing protocol. In plane routing protocol, all network nodes are equal in status, and there is no difference in level. Routing is generated by local operation and information feedback between each other [7–9]. Typical plane routing algorithms include directed diffusion protocol and SAR.The biggest disadvantages of plane routing are no management node in the network; lack of optimal management of communication resources; complex self-organizing cooperative work algorithm; slow response to network dynamic changes, etc.Typical layered routing protocols include LEACH, TEEN, PEGASIS, and HEED. LEACH is the first layered routing algorithm in wireless sensor networks, and it is also a representative layered routing protocol. Its idea has led to the emergence of many layered routing protocols [6]. After the concept of LEACH clustering protocol is put forward, the energy saving property and network lifetime of network nodes have been greatly improved. However, the application of LEACH protocol in the training distance collection of long-distance runners has its own limitations that cannot be ignored [10]. On the basis of the LEACH protocol, this paper introduces an energy balanced clustering routing algorithm based on energy and location, which fully considers the energy and location factors of nodes in the cluster head election mechanism, avoids the nodes with low residual energy and poor geographical location from being selected as the cluster head node, effectively balances the energy consumption distribution of nodes, prolongs the network life cycle, and optimizes the training distance of long-distance runners from the collection efficiency, so as to realize real-time collection of long-distance athletes’ training distance [11–13].


### 2.3.1. Selection of Cluster Head Node

Before clustering, Sink node calculates the maximum distanceDmax and minimum distance Dmin of all roadside nodes and broadcasts the whole network. Before each round of cluster reconstruction, all the roadside nodes send their own residual energy Ecurren and the collected training distance parameters to the cluster head node selected from the previous round. The cluster head node simply fuses the received data and sends its own Ecurren to the Sink node. After receiving the data, the Sink node transmits the useful data to the gateway and calculates the average residual energy Eavg of the whole network and sends to the whole network. After receiving the cluster head election command, each node compares Ecurren and Eavg and can participate in the cluster head election only if Ecurren>Eavg. The improved cluster head selection threshold is as follows:(19)Tn=p1−prmod1/pEavgEcurrent+Dmax−dDmax−Dmin,0,others,where p is the proportion of cluster heads in all nodes in WSN; r is the current round r; n is a node; the node set that has not been selected before round r is G; the symbol mod is the modulus operator; the maximum distance between all roadside nodes and Sink nodes is Dmax, and the minimum is Dmin; d is the distance from the roadside node participating in cluster head selection to Sink node.


### 2.3.2. Routing Establishment within and between Clusters

After the cluster head node is selected, the cluster head node broadcasts the selected cluster head message to the whole network. The message contains its own geographical location information, identity, and CDMA spread spectrum code. Other roadside nodes determine which cluster to join according to the strength of the signal received by the cluster head broadcast message and send the request to join the cluster [14]. After receiving the cluster request, the cluster head adds the roadside node to its own routing table and then allocates a time slice for each roadside node in the cluster and notifies all nodes in the cluster [15–17]. After receiving the broadcast message from other cluster heads, the cluster head node finds its own forward cluster head node according to its own location information. The specific judgment methods are as follows:(1)
The cluster head node calculates the distance from Sink node.(20)Dthis,sink=tx−sx2+ty−sy2,wheretx and ty, sx, and sy are the abscissa and ordinate of the cluster head node “clusteri” and Sink node “Sink,” respectively.(2)
Other cluster heads calculate the distance between themselves and Sink nodes.(21)Dclusteri,sink=cx−sx2+cy−sy2,wherecx and cy, sx, and sy are the abscissa and ordinate of cluster head node clusteri and Sink node “Sink,” respectively.(3)
Select the cluster head node withDthis,sink>Dclusteri,sink and calculate the distance between the cluster head node and itself.(22)Dclusteri,this=cx−tx2+cy−ty2.(4)
If no other node satisfiesDthis,sink>Dclusteri,sink, the next hop of current node is Sink node; otherwise, the minimum value Dminclusteri,this is selected from Dclusteri,this. If Dminclusteri,this<Dthis,sink, the node corresponding to Dminclusteri,this is the next hop cluster head of current cluster head node.In this way, selecting the next hop cluster head can ensure that each cluster head can send the training distance data of long-distance runners with low energy consumption; according to the energy model of sending data between cluster head nodes given above, the cluster head node can send the training distance data of long-distance runners to the nearest cluster head node and forward it, which can ensure that each cluster head node sends out the training distance data of long-distance runners with the lowest energy consumption [18].


### 2.3.3. Next Round of Cluster Reconstruction

After the establishment of intracluster and intercluster routes, Sink nodes send transmission instructions to the whole network and enter the current round of transmission stage of long-distance runners’ training distance data. All the roadside nodes will transmit the collected training distance data andEcurrent to the cluster head node in their own time slice, and the nodes will enter the sleep state in the rest time slice; the cluster head node will send the training distance data to the next hop cluster head node and finally to the Sink node.Before the next round of communication, Sink node collects the training distance data of long-distance runners, recalculatesEavg of the current network nodes, and sets a dynamic threshold Emin=Eavg/2. Sink node compares the energy of cluster head node with Emin. If Emin<Ecurrent, the current cluster structure will remain unchanged. Otherwise, it will enter the next round of reselection; that is, the node with the highest residual energy in the current cluster will be selected as the cluster head node. Sink nodes broadcast the new cluster head nodes to the whole network, while the nodes in the cluster update their own routes in time, and the cluster head nodes update their next hop nodes in time [19].For each cluster reconstruction, Sink node addscluster-round to 1. When cluster−round>n⋅p⋅25%, Sink node broadcasts to the whole network, reselects the general election in the whole network according to the cluster head selection mechanism, and then updates the intracluster and intercluster routes. Otherwise, it only reselects the cluster head in the cluster, publishes the new cluster head, and updates the intracluster and intercluster routes.In the last three years, many methods are proposed to handle the problem of information collection for the long-run distance players; here, we introduced three outstanding methods such as GNNA [20], RNNA [21], and CNNA [22], which can be used to solve the related works taking different kinds of network structures. GNNA is a graph-based network that builds connections between different risk nodes. And RNNA uses a specific loss structure to keep the similarity of real and predicted crafts design. CNNA is the basic model that needs more computation consuming to obtain the desiring performances. However, these methods have their disadvantages, respectively. GNNA is too slow, RNNA is so complicated, and CNNA also needs more spaces.In this paper we utilize the entropy loss function to build the model for our research problems. It can be defined as follows:lossx,y=∑i=1n−pilog1−pi, where x and y are represented as the real arts and crafts’ score and difficulty and y means the predicted score and difficulty of our proposal. Pi means the probability of them when they are similar. The bigger the value of the loss, the worse our proposal performed. And our proposal is used to train a model that fits the real and predicted arts and crafts, so that the machine can assist the arts and crafts designed. And compared with the three methods, our proposal can deal with the problems easily and we also need a smaller computation space to build our model. However, our model may obtain a relative lower accuracy than others sometimes which may lead to unstable prediction.


## 2.3.1. Selection of Cluster Head Node

Before clustering, Sink node calculates the maximum distanceDmax and minimum distance Dmin of all roadside nodes and broadcasts the whole network. Before each round of cluster reconstruction, all the roadside nodes send their own residual energy Ecurren and the collected training distance parameters to the cluster head node selected from the previous round. The cluster head node simply fuses the received data and sends its own Ecurren to the Sink node. After receiving the data, the Sink node transmits the useful data to the gateway and calculates the average residual energy Eavg of the whole network and sends to the whole network. After receiving the cluster head election command, each node compares Ecurren and Eavg and can participate in the cluster head election only if Ecurren>Eavg. The improved cluster head selection threshold is as follows:(19)Tn=p1−prmod1/pEavgEcurrent+Dmax−dDmax−Dmin,0,others,where p is the proportion of cluster heads in all nodes in WSN; r is the current round r; n is a node; the node set that has not been selected before round r is G; the symbol mod is the modulus operator; the maximum distance between all roadside nodes and Sink nodes is Dmax, and the minimum is Dmin; d is the distance from the roadside node participating in cluster head selection to Sink node.


## 2.3.2. Routing Establishment within and between Clusters

After the cluster head node is selected, the cluster head node broadcasts the selected cluster head message to the whole network. The message contains its own geographical location information, identity, and CDMA spread spectrum code. Other roadside nodes determine which cluster to join according to the strength of the signal received by the cluster head broadcast message and send the request to join the cluster [14]. After receiving the cluster request, the cluster head adds the roadside node to its own routing table and then allocates a time slice for each roadside node in the cluster and notifies all nodes in the cluster [15–17]. After receiving the broadcast message from other cluster heads, the cluster head node finds its own forward cluster head node according to its own location information. The specific judgment methods are as follows:(1)
The cluster head node calculates the distance from Sink node.(20)Dthis,sink=tx−sx2+ty−sy2,wheretx and ty, sx, and sy are the abscissa and ordinate of the cluster head node “clusteri” and Sink node “Sink,” respectively.(2)
Other cluster heads calculate the distance between themselves and Sink nodes.(21)Dclusteri,sink=cx−sx2+cy−sy2,wherecx and cy, sx, and sy are the abscissa and ordinate of cluster head node clusteri and Sink node “Sink,” respectively.(3)
Select the cluster head node withDthis,sink>Dclusteri,sink and calculate the distance between the cluster head node and itself.(22)Dclusteri,this=cx−tx2+cy−ty2.(4)
If no other node satisfiesDthis,sink>Dclusteri,sink, the next hop of current node is Sink node; otherwise, the minimum value Dminclusteri,this is selected from Dclusteri,this. If Dminclusteri,this<Dthis,sink, the node corresponding to Dminclusteri,this is the next hop cluster head of current cluster head node.In this way, selecting the next hop cluster head can ensure that each cluster head can send the training distance data of long-distance runners with low energy consumption; according to the energy model of sending data between cluster head nodes given above, the cluster head node can send the training distance data of long-distance runners to the nearest cluster head node and forward it, which can ensure that each cluster head node sends out the training distance data of long-distance runners with the lowest energy consumption [18].


## 2.3.3. Next Round of Cluster Reconstruction

After the establishment of intracluster and intercluster routes, Sink nodes send transmission instructions to the whole network and enter the current round of transmission stage of long-distance runners’ training distance data. All the roadside nodes will transmit the collected training distance data andEcurrent to the cluster head node in their own time slice, and the nodes will enter the sleep state in the rest time slice; the cluster head node will send the training distance data to the next hop cluster head node and finally to the Sink node.Before the next round of communication, Sink node collects the training distance data of long-distance runners, recalculatesEavg of the current network nodes, and sets a dynamic threshold Emin=Eavg/2. Sink node compares the energy of cluster head node with Emin. If Emin<Ecurrent, the current cluster structure will remain unchanged. Otherwise, it will enter the next round of reselection; that is, the node with the highest residual energy in the current cluster will be selected as the cluster head node. Sink nodes broadcast the new cluster head nodes to the whole network, while the nodes in the cluster update their own routes in time, and the cluster head nodes update their next hop nodes in time [19].For each cluster reconstruction, Sink node addscluster-round to 1. When cluster−round>n⋅p⋅25%, Sink node broadcasts to the whole network, reselects the general election in the whole network according to the cluster head selection mechanism, and then updates the intracluster and intercluster routes. Otherwise, it only reselects the cluster head in the cluster, publishes the new cluster head, and updates the intracluster and intercluster routes.In the last three years, many methods are proposed to handle the problem of information collection for the long-run distance players; here, we introduced three outstanding methods such as GNNA [20], RNNA [21], and CNNA [22], which can be used to solve the related works taking different kinds of network structures. GNNA is a graph-based network that builds connections between different risk nodes. And RNNA uses a specific loss structure to keep the similarity of real and predicted crafts design. CNNA is the basic model that needs more computation consuming to obtain the desiring performances. However, these methods have their disadvantages, respectively. GNNA is too slow, RNNA is so complicated, and CNNA also needs more spaces.In this paper we utilize the entropy loss function to build the model for our research problems. It can be defined as follows:lossx,y=∑i=1n−pilog1−pi, where x and y are represented as the real arts and crafts’ score and difficulty and y means the predicted score and difficulty of our proposal. Pi means the probability of them when they are similar. The bigger the value of the loss, the worse our proposal performed. And our proposal is used to train a model that fits the real and predicted arts and crafts, so that the machine can assist the arts and crafts designed. And compared with the three methods, our proposal can deal with the problems easily and we also need a smaller computation space to build our model. However, our model may obtain a relative lower accuracy than others sometimes which may lead to unstable prediction.


## 3. Related Work

In recent years, Internet of Things (IoT) has had great popularity in different aspects of modern life and a huge amount of IoT services are emerging. In the IoT area, user devices generate a large amount of data that can be used to improve the user experience of the intelligence system. However, the extensive users’ data processing from the IoT device brings some privacy problems [23]. As the IoT devices can be deeply involved in users’ private data, the data generated by them will contain privacy-sensitive information [24]. To tackle the privacy challenges and encourage clients to proactively participate in IoT services, federated learning enables training a deep learning model across different participants in a collaborative manner. It provides the privacy of clients to keep their original data training on their own devices, while jointly learning a global model by sharing only local parameters with the server.However, several recent works have shown that the privacy in federated learning is insufficient for protecting the local training data from gradient-based reconstruction attacks [25]. The wide malicious devices in IoT make it vulnerable to these types of attacks based on shared parameters. The first type of attack is GAN-based attacks. Hitaj and Perez-Cruz proposed a GAN-based attack against collaborative deep learning on a malicious client, which infers sensitive information from another client successfully. Based on this work, an improved GAN with a multitask discriminator was proposed to enable a malicious server to discriminate category, reality, and client identity of input samples simultaneously [26]. Another type of gradient-based reconstruction attacks is Deep Leakage from Gradients (DLG), which was proposed by Zhu et al. to reveal the training data from gradients. The main idea of DLG is to generate dummy data and labels via matching the dummy gradients to the shared gradients. It has been used in many following works to perform the privacy leakage attacks on federated learning. The GAN-based attack uses GAN to generate pictures that look similar to the training images, while DLG aims at revealing the complete training data from gradients. These two types of attacks both utilize gradient to reconstruction [27].


## 4. Results

In order to test the effect of the proposed method on training distance collection of long-distance runners, its application effect is tested in MATLAB simulation software. In the MATLAB simulation software, it is assumed that the long-distance runner moves in the two-dimensional plane, and the initial position is (100100)m. Using the wireless sensor as the measuring device, the acquisition period is 2 s, the communication range of the wireless sensor is 40, and the observation distance is 20 m.


### 4.1. Acquisition Effect of Single-Target Training Distance

#### 4.1.1. Mean Square Error

The collection target of the proposed method is set as a single long-distance runner, and the training path of the athlete is straight line and curve, respectively. Under this condition, the collection effect of the single long-distance runner’s training distance is tested. The acquisition effect is mainly described by mean square error (RMSE).(23)RMSE=1n∑k=1nxk−X^k2,where xk and X^k are the actual value and the collected value of the training distance of the long-distance runners at time k, respectively.The acquisition effect of the proposed method for single target training distance is shown in Figures2 and 3.Figure 2
Training distance acquisition accuracy of linear training path.Figure 3
Training distance acquisition accuracy of curve training path.According to the analysis of Figures2 and 3, when the athlete’s training path is straight line and curve, respectively, after collecting the training distance of a single long-distance runner, the mean square error is less than 0.04, and the mean square error is very small, which proves that the method in this paper has high accuracy in collecting the training distance of a single athlete.


#### 4.1.2. Real-Time Acquisition

In order to test the real-time acquisition of the training distance of a single athlete, when the athlete’s training path is a straight line class and a curve class, whether the method can accurately collect the athlete’s training distance with the change of the athlete’s training distance is tested. The results are shown in Tables1 and 2.Table 1
Real-time acquisition of training distance for linear training path.
TimeCoordinates of actual training position of athletes (m)In this paper, the method is used to collect the results (m)8 : 10(100,100)(100,100)8 : 20(200,200)(200,200)8 : 30(300,300)(300,300)8 : 40(400,400)(400,400)8 : 50(500,500)(500,500)9 : 00(600,600)(600,600)9 : 10(650,650)(650,650)9 : 20(700,700)(700,700)9 : 30(750,750)(750,750)9 : 40(800,800)(800,800)Table 2
Real-time acquisition of training distance for curve training path.
TimeCoordinates of actual training position of athletes (m)In this paper, the method is used to collect the results (m)8 : 10(100,100)(100,100)8 : 20(150,100)(150,100)8 : 30(200,250)(200,250)8 : 40(300,350)(300,350)8 : 50(400,450)(400,450)9 : 00(550,650)(550,650)9 : 10(750,750)(750,750)9 : 20(800,860)(800,860)9 : 30(950,1000)(950,1000)9 : 40(1100,1200)(1100,1200)According to the analysis of Tables1 and 2, when the athlete’s training path is straight line and curve, respectively, with the change of time, the proposed method can collect the training position in real time and realize the real-time detection of training distance, and the detection result has no deviation. It can be proved that the proposed method has high real-time performance for acquisition of single target training distance.


### 4.2. Training Distance Acquisition Effect of Multiple Targets

#### 4.2.1. Mean Square Error

In order to test the collection effect of the proposed method on multitarget training distance, the number of long-distance runners to be collected by this method is set in MATLAB simulation software as 5, 10, 15, and 20 in turn. The collection accuracy of this method on multitarget training distance is shown in Figures4 and 5.Figure 4
Training distance acquisition accuracy of linear training path.Figure 5
Training distance acquisition accuracy of curve training path.According to the analysis of Figures4 and 5, when the numbers of athletes are 5, 10, 15, and 20 in turn, and the athletes’ training paths are straight line and curve, respectively. After collecting the training distance of straight line and curve training paths, the mean square error is less than 0.04, and the mean square error is very small, which proves that the method in this paper has high accuracy in collecting the training distance of multiple targets.


#### 4.2.2. Real-Time Acquisition

When multiple athletes’ training paths are straight line and curve, respectively, whether the proposed method can accurately collect multiple athletes’ training distance with the change of athletes’ training distance is tested. The real-time acquisition performance is reflected by the mean square error of the acquisition results, and the results are shown in Tables3 and 4.Table 3
Real-time acquisition of training distance for linear training path.
Time5 athletes10 athletes15 athletes20 athletes8 : 100.010.020.030.038 : 200.010.020.030.038 : 300.010.020.030.038 : 400.010.020.030.038 : 500.010.020.030.039 : 000.010.020.030.039 : 100.010.020.030.039 : 200.010.020.030.039 : 300.010.020.030.039 : 400.010.020.030.03Mean value0.010.020.030.03Table 4
Real-time acquisition of training distance for curve training path.
Time5 athletes10 athletes15 athletes20 athletes8 : 100.020.030.030.038 : 200.020.030.030.038 : 300.020.030.030.038 : 400.020.030.030.038 : 500.020.030.030.039 : 000.020.030.030.039 : 100.020.030.030.039 : 200.020.030.030.039 : 300.020.030.030.039 : 400.020.030.030.03Mean value0.020.030.030.03According to the analysis of Tables3 and 4, when multiple athletes’ training paths are linear, with the change of time, the mean square errors of the training distance of 5, 10, 15, and 20 athletes collected by the proposed method are 0.01, 0.02, 0.03, and 0.04, respectively. After collecting the training distance of 15 and 20 athletes, the mean square errors of the results are 0.02, 0.03, 0.04, and 0.05, respectively. The mean square error is very small, which indicates that the method in this paper can accurately collect the training distance of long-distance runners in real time with the change of time.


### 4.3. In-Depth Test of Application Performance of the Proposed Method

The importance of energy balanced clustering routing algorithm based on energy and location is tested. When the wireless sensor network is used to collect the training distance of long-distance runners, the mean square error and real-time performance of long-distance runners’ training distance collection are tested before and after using the energy and location-based energy balanced clustering routing algorithm. The results are shown in Figure6 and Table 5.Figure 6
Application effect test of energy balanced clustering routing algorithm based on energy and location. (a) Training distance acquisition accuracy of linear training path. (b) Training distance acquisition accuracy of curve training path.
(a)(b)Table 5
Real-time test results of energy balanced clustering routing algorithm based on energy and location before and after use.
TimeBefore useAfter useLine classCurve classLine classCurve class8 : 100.080.080.020.028 : 200.070.090.020.028 : 300.070.090.020.028 : 400.080.090.020.028 : 500.070.090.020.029 : 000.070.090.020.029 : 100.080.090.020.029 : 200.070.090.020.029 : 300.070.090.020.029 : 400.080.090.020.02Mean value0.070.090.020.02As shown in Figure6, when the athletes’ training paths are straight line and curve, respectively, under multiple tests, before and after using the energy balances clustering routing algorithm based on energy and location, the mean square error of the training distance collection results of long-distance runners is quite different, so that the mean square error before use is greater than 0.08, and the mean square error after use is less than 0.04. The use of energy balanced clustering routing algorithm based on energy and location can improve the accuracy of athletes’ training distance collection.As shown in Table5, before and after using the energy balanced clustering routing algorithm based on energy and location, the real-time performance of training distance collection for long-distance runners is quite different. When the athletes' training paths are straight line and curve, respectively, with the change of time, the mean square error of the collection results before use is 0.07 and 0.09, respectively, and the mean square error of the collection results before use is 0.02 and 0.02, respectively. Therefore, the use of energy balanced clustering routing algorithm based on energy and location can improve the real-time collection of athletes’ training distance.In order to investigate the effectiveness of our proposal and other methods, here we take F1-score into account to assess the experiment results, which can be defined as follows:f1−score=2∗precise∗recall/precise+recall, precise=TP/TP+FP, recall=TP/TP+FN. And we also compared three methods proposed in the last three years such as GNNA, RNNA, and CNNA with our proposal to investigate the effectiveness of our methods. And all these methods are introduced in Section 2. The results can be shown in Figure 7. As shown in Figure 7, the yellow bar represents our proposal and on all datasets we can see that our proposal is better than others except D4, where all methods obtain the same results. It indicated that our proposal can perform better than the other three methods.Figure 7
The F1-score of our proposal and other methods.


## 4.1. Acquisition Effect of Single-Target Training Distance

### 4.1.1. Mean Square Error

The collection target of the proposed method is set as a single long-distance runner, and the training path of the athlete is straight line and curve, respectively. Under this condition, the collection effect of the single long-distance runner’s training distance is tested. The acquisition effect is mainly described by mean square error (RMSE).(23)RMSE=1n∑k=1nxk−X^k2,where xk and X^k are the actual value and the collected value of the training distance of the long-distance runners at time k, respectively.The acquisition effect of the proposed method for single target training distance is shown in Figures2 and 3.Figure 2
Training distance acquisition accuracy of linear training path.Figure 3
Training distance acquisition accuracy of curve training path.According to the analysis of Figures2 and 3, when the athlete’s training path is straight line and curve, respectively, after collecting the training distance of a single long-distance runner, the mean square error is less than 0.04, and the mean square error is very small, which proves that the method in this paper has high accuracy in collecting the training distance of a single athlete.


### 4.1.2. Real-Time Acquisition

In order to test the real-time acquisition of the training distance of a single athlete, when the athlete’s training path is a straight line class and a curve class, whether the method can accurately collect the athlete’s training distance with the change of the athlete’s training distance is tested. The results are shown in Tables1 and 2.Table 1
Real-time acquisition of training distance for linear training path.
TimeCoordinates of actual training position of athletes (m)In this paper, the method is used to collect the results (m)8 : 10(100,100)(100,100)8 : 20(200,200)(200,200)8 : 30(300,300)(300,300)8 : 40(400,400)(400,400)8 : 50(500,500)(500,500)9 : 00(600,600)(600,600)9 : 10(650,650)(650,650)9 : 20(700,700)(700,700)9 : 30(750,750)(750,750)9 : 40(800,800)(800,800)Table 2
Real-time acquisition of training distance for curve training path.
TimeCoordinates of actual training position of athletes (m)In this paper, the method is used to collect the results (m)8 : 10(100,100)(100,100)8 : 20(150,100)(150,100)8 : 30(200,250)(200,250)8 : 40(300,350)(300,350)8 : 50(400,450)(400,450)9 : 00(550,650)(550,650)9 : 10(750,750)(750,750)9 : 20(800,860)(800,860)9 : 30(950,1000)(950,1000)9 : 40(1100,1200)(1100,1200)According to the analysis of Tables1 and 2, when the athlete’s training path is straight line and curve, respectively, with the change of time, the proposed method can collect the training position in real time and realize the real-time detection of training distance, and the detection result has no deviation. It can be proved that the proposed method has high real-time performance for acquisition of single target training distance.


## 4.1.1. Mean Square Error

The collection target of the proposed method is set as a single long-distance runner, and the training path of the athlete is straight line and curve, respectively. Under this condition, the collection effect of the single long-distance runner’s training distance is tested. The acquisition effect is mainly described by mean square error (RMSE).(23)RMSE=1n∑k=1nxk−X^k2,where xk and X^k are the actual value and the collected value of the training distance of the long-distance runners at time k, respectively.The acquisition effect of the proposed method for single target training distance is shown in Figures2 and 3.Figure 2
Training distance acquisition accuracy of linear training path.Figure 3
Training distance acquisition accuracy of curve training path.According to the analysis of Figures2 and 3, when the athlete’s training path is straight line and curve, respectively, after collecting the training distance of a single long-distance runner, the mean square error is less than 0.04, and the mean square error is very small, which proves that the method in this paper has high accuracy in collecting the training distance of a single athlete.


## 4.1.2. Real-Time Acquisition

In order to test the real-time acquisition of the training distance of a single athlete, when the athlete’s training path is a straight line class and a curve class, whether the method can accurately collect the athlete’s training distance with the change of the athlete’s training distance is tested. The results are shown in Tables1 and 2.Table 1
Real-time acquisition of training distance for linear training path.
TimeCoordinates of actual training position of athletes (m)In this paper, the method is used to collect the results (m)8 : 10(100,100)(100,100)8 : 20(200,200)(200,200)8 : 30(300,300)(300,300)8 : 40(400,400)(400,400)8 : 50(500,500)(500,500)9 : 00(600,600)(600,600)9 : 10(650,650)(650,650)9 : 20(700,700)(700,700)9 : 30(750,750)(750,750)9 : 40(800,800)(800,800)Table 2
Real-time acquisition of training distance for curve training path.
TimeCoordinates of actual training position of athletes (m)In this paper, the method is used to collect the results (m)8 : 10(100,100)(100,100)8 : 20(150,100)(150,100)8 : 30(200,250)(200,250)8 : 40(300,350)(300,350)8 : 50(400,450)(400,450)9 : 00(550,650)(550,650)9 : 10(750,750)(750,750)9 : 20(800,860)(800,860)9 : 30(950,1000)(950,1000)9 : 40(1100,1200)(1100,1200)According to the analysis of Tables1 and 2, when the athlete’s training path is straight line and curve, respectively, with the change of time, the proposed method can collect the training position in real time and realize the real-time detection of training distance, and the detection result has no deviation. It can be proved that the proposed method has high real-time performance for acquisition of single target training distance.


## 4.2. Training Distance Acquisition Effect of Multiple Targets

### 4.2.1. Mean Square Error

In order to test the collection effect of the proposed method on multitarget training distance, the number of long-distance runners to be collected by this method is set in MATLAB simulation software as 5, 10, 15, and 20 in turn. The collection accuracy of this method on multitarget training distance is shown in Figures4 and 5.Figure 4
Training distance acquisition accuracy of linear training path.Figure 5
Training distance acquisition accuracy of curve training path.According to the analysis of Figures4 and 5, when the numbers of athletes are 5, 10, 15, and 20 in turn, and the athletes’ training paths are straight line and curve, respectively. After collecting the training distance of straight line and curve training paths, the mean square error is less than 0.04, and the mean square error is very small, which proves that the method in this paper has high accuracy in collecting the training distance of multiple targets.


### 4.2.2. Real-Time Acquisition

When multiple athletes’ training paths are straight line and curve, respectively, whether the proposed method can accurately collect multiple athletes’ training distance with the change of athletes’ training distance is tested. The real-time acquisition performance is reflected by the mean square error of the acquisition results, and the results are shown in Tables3 and 4.Table 3
Real-time acquisition of training distance for linear training path.
Time5 athletes10 athletes15 athletes20 athletes8 : 100.010.020.030.038 : 200.010.020.030.038 : 300.010.020.030.038 : 400.010.020.030.038 : 500.010.020.030.039 : 000.010.020.030.039 : 100.010.020.030.039 : 200.010.020.030.039 : 300.010.020.030.039 : 400.010.020.030.03Mean value0.010.020.030.03Table 4
Real-time acquisition of training distance for curve training path.
Time5 athletes10 athletes15 athletes20 athletes8 : 100.020.030.030.038 : 200.020.030.030.038 : 300.020.030.030.038 : 400.020.030.030.038 : 500.020.030.030.039 : 000.020.030.030.039 : 100.020.030.030.039 : 200.020.030.030.039 : 300.020.030.030.039 : 400.020.030.030.03Mean value0.020.030.030.03According to the analysis of Tables3 and 4, when multiple athletes’ training paths are linear, with the change of time, the mean square errors of the training distance of 5, 10, 15, and 20 athletes collected by the proposed method are 0.01, 0.02, 0.03, and 0.04, respectively. After collecting the training distance of 15 and 20 athletes, the mean square errors of the results are 0.02, 0.03, 0.04, and 0.05, respectively. The mean square error is very small, which indicates that the method in this paper can accurately collect the training distance of long-distance runners in real time with the change of time.


## 4.2.1. Mean Square Error

In order to test the collection effect of the proposed method on multitarget training distance, the number of long-distance runners to be collected by this method is set in MATLAB simulation software as 5, 10, 15, and 20 in turn. The collection accuracy of this method on multitarget training distance is shown in Figures4 and 5.Figure 4
Training distance acquisition accuracy of linear training path.Figure 5
Training distance acquisition accuracy of curve training path.According to the analysis of Figures4 and 5, when the numbers of athletes are 5, 10, 15, and 20 in turn, and the athletes’ training paths are straight line and curve, respectively. After collecting the training distance of straight line and curve training paths, the mean square error is less than 0.04, and the mean square error is very small, which proves that the method in this paper has high accuracy in collecting the training distance of multiple targets.


## 4.2.2. Real-Time Acquisition

When multiple athletes’ training paths are straight line and curve, respectively, whether the proposed method can accurately collect multiple athletes’ training distance with the change of athletes’ training distance is tested. The real-time acquisition performance is reflected by the mean square error of the acquisition results, and the results are shown in Tables3 and 4.Table 3
Real-time acquisition of training distance for linear training path.
Time5 athletes10 athletes15 athletes20 athletes8 : 100.010.020.030.038 : 200.010.020.030.038 : 300.010.020.030.038 : 400.010.020.030.038 : 500.010.020.030.039 : 000.010.020.030.039 : 100.010.020.030.039 : 200.010.020.030.039 : 300.010.020.030.039 : 400.010.020.030.03Mean value0.010.020.030.03Table 4
Real-time acquisition of training distance for curve training path.
Time5 athletes10 athletes15 athletes20 athletes8 : 100.020.030.030.038 : 200.020.030.030.038 : 300.020.030.030.038 : 400.020.030.030.038 : 500.020.030.030.039 : 000.020.030.030.039 : 100.020.030.030.039 : 200.020.030.030.039 : 300.020.030.030.039 : 400.020.030.030.03Mean value0.020.030.030.03According to the analysis of Tables3 and 4, when multiple athletes’ training paths are linear, with the change of time, the mean square errors of the training distance of 5, 10, 15, and 20 athletes collected by the proposed method are 0.01, 0.02, 0.03, and 0.04, respectively. After collecting the training distance of 15 and 20 athletes, the mean square errors of the results are 0.02, 0.03, 0.04, and 0.05, respectively. The mean square error is very small, which indicates that the method in this paper can accurately collect the training distance of long-distance runners in real time with the change of time.


## 4.3. In-Depth Test of Application Performance of the Proposed Method

The importance of energy balanced clustering routing algorithm based on energy and location is tested. When the wireless sensor network is used to collect the training distance of long-distance runners, the mean square error and real-time performance of long-distance runners’ training distance collection are tested before and after using the energy and location-based energy balanced clustering routing algorithm. The results are shown in Figure6 and Table 5.Figure 6
Application effect test of energy balanced clustering routing algorithm based on energy and location. (a) Training distance acquisition accuracy of linear training path. (b) Training distance acquisition accuracy of curve training path.
(a)(b)Table 5
Real-time test results of energy balanced clustering routing algorithm based on energy and location before and after use.
TimeBefore useAfter useLine classCurve classLine classCurve class8 : 100.080.080.020.028 : 200.070.090.020.028 : 300.070.090.020.028 : 400.080.090.020.028 : 500.070.090.020.029 : 000.070.090.020.029 : 100.080.090.020.029 : 200.070.090.020.029 : 300.070.090.020.029 : 400.080.090.020.02Mean value0.070.090.020.02As shown in Figure6, when the athletes’ training paths are straight line and curve, respectively, under multiple tests, before and after using the energy balances clustering routing algorithm based on energy and location, the mean square error of the training distance collection results of long-distance runners is quite different, so that the mean square error before use is greater than 0.08, and the mean square error after use is less than 0.04. The use of energy balanced clustering routing algorithm based on energy and location can improve the accuracy of athletes’ training distance collection.As shown in Table5, before and after using the energy balanced clustering routing algorithm based on energy and location, the real-time performance of training distance collection for long-distance runners is quite different. When the athletes' training paths are straight line and curve, respectively, with the change of time, the mean square error of the collection results before use is 0.07 and 0.09, respectively, and the mean square error of the collection results before use is 0.02 and 0.02, respectively. Therefore, the use of energy balanced clustering routing algorithm based on energy and location can improve the real-time collection of athletes’ training distance.In order to investigate the effectiveness of our proposal and other methods, here we take F1-score into account to assess the experiment results, which can be defined as follows:f1−score=2∗precise∗recall/precise+recall, precise=TP/TP+FP, recall=TP/TP+FN. And we also compared three methods proposed in the last three years such as GNNA, RNNA, and CNNA with our proposal to investigate the effectiveness of our methods. And all these methods are introduced in Section 2. The results can be shown in Figure 7. As shown in Figure 7, the yellow bar represents our proposal and on all datasets we can see that our proposal is better than others except D4, where all methods obtain the same results. It indicated that our proposal can perform better than the other three methods.Figure 7
The F1-score of our proposal and other methods.


## 5. Conclusion

Wireless network sensor technology has created a lot of fun for people’s life, and it also plays a certain role in promoting the effective and timely transmission of information. People increasingly rely on wireless sensor network technology to bring comfort and convenience to their lives. Wireless network sensor technology has attracted more and more attention from all walks of life. In this paper, a real-time acquisition method of training distance for long-distance runners based on wireless sensor network is proposed, and its application value is verified in the experiment. We have established a good wireless sensor network to collect data such as distance and energy consumption of long-distance runners, and we used this to guide and analyze the training of athletes. However, due to the data security and latency caused by network bandwidth in wireless sensor networks, the energy consumption and configuration of sensor devices will bring challenges to subsequent data collection. In our experiment, we lost data of a few sensors because of the instability of Internet communication. In the future, we will shift the focus of our work to wireless sensing. The optimization of the network comes up, such as how to efficiently cover the devices and how to reduce the communication delay of different devices. Although our method has achieved good accuracy at present, it is still unable to achieve considerable accuracy in the face of complex environment, and the training time of the model is long. In the future, we will further optimize our model to improve the training speed of the model while ensuring the accuracy.



---

*Source: 9992239-2021-05-21.xml*