TIME SYNCHRONIZATION METHOD FOR WIRELESS LOAD TESTING SYSTEM

20250159629 ยท 2025-05-15

    Inventors

    Cpc classification

    International classification

    Abstract

    A time synchronization method for a wireless load testing system includes two stages: a stage of constructing a wireless sensor network system and a stage of suppressing communication delay to achieve precise network-wide time synchronization. The method employs a relative skew estimator based on Bayesian estimation theory to suppress the effect of time delay in wireless communication, thereby enhancing the estimation accuracy of the relative skew estimator while reducing memory requirements. By applying the average consensus protocol, high-precision network-wide time synchronization is achieved, and the overall method enhances the robustness to time delay and has higher accuracy. The method solves the problems of reduced time synchronization accuracy and time synchronization failure of partial sub-nodes due to time delay of the traditional time synchronization algorithms in complex spatial layout.

    Claims

    1. A time synchronization method for a wireless load testing system, comprising the following steps: S1, constructing a network model based on a consensus algorithm for updating virtual logic clocks of nodes; S2, constructing a node virtual logic clock updating model based on a timestamp exchange mechanism based on a pseudo-periodic communication scheme; S3, constructing a relative skew estimator based on Bayesian theory, and estimating undetermined parameters in the updating the virtual logic clocks of the nodes, such that the logic clocks of each sensor node approximate a common clock; and S4, updating logical skew compensation and offset compensation of the nodes.

    2. The method according to claim 1, wherein the network model based on the consensus algorithm in step S1 comprises: assuming communication topology is an undirected graph G=(N,) in a wireless network, where N={1, 2, . . . , N}represents a set of sensor nodes, and .Math.NN represents a set of effective communication links; and .sub.ij represents a non-empty adjacency element, and if and only if there is a directed link in G, a set of direct neighbor nodes of a sub-node i is expressed as N.sub.i={j|(i,j)}, where (i,j) represents that the node i communicate with a node j in one hop, for the state of a certain sub-node i, the consensus algorithm is adopted to construct the following linear model: x i ( k + 1 ) = x i ( k ) + .Math. j N i a ij [ x j ( k ) - x i ( k ) ] ; where k is the number of iterations; and x.sub.i(k) represents the linear model obtained after k iterations of the node i. if the linear model based on the consensus algorithm is applied to a clock update equation, the clocks of the nodes are driven to a common clock.

    3. The method according to claim 1, wherein the step S2 specifically comprises: S21, constructing a clock model; wherein, each sensor node having a local hardware clock whose first-order dynamic function is expressed as: c i ( t ) = i t + i ; wherein c.sub.i(t) is the hardware clock reading at absolute reference time t, and .sub.i and .sub.i are local hardware clock skew and offset, respectively; the clock model is established as follows by using hardware clock data of any two nodes to obtain indirect information of the nodes: c j ( t ) = j i c j ( t ) + ( j - j i i ) = ij c j ( t ) + ij ; wherein , ij = j i , ij = j - j i i ; since the local hardware clock cannot be manually modified, it is proposed that the node maintains a virtual logic clock to represent the synchronization time, the model is as follows: c ^ j ( t ) = i c i ( t ) + i = i i ( t ) + i i + i ; wherein, .sub.i and .sub.i represent skew compensation and offset compensation, respectively, and .sub.i=i.sub.i and .sub.i=i.sub.i+.sub.i are defined as virtual logical clock skew and offset, respectively; and S22, updating compensation parameters of virtual logical clocks of nodes; wherein, the compensation parameters of the virtual logic clock model are updated periodically and iteratively, such that the logic clocks of each sensor node approximate a common clock, c(t)=t+; the compensation parameters of the virtual logic clocks of the nodes are updated, such that (.sub.i,.sub.i) satisfies: { lim k .fwdarw. i ( k ) i = lim k .fwdarw. i ( k ) i + i ( k ) = ; wherein, c(t) represents the common clock, and and represent the updated compensation parameters of the virtual logic clocks of the nodes; and S23, proposing a timestamp exchange mechanism based on a pseudo-periodic communication scheme; wherein, each node broadcasts time information with a media access control (MAC) layer timestamp to neighbor nodes in each synchronization period T, the neighbor nodes record local clocks immediately after receiving the information; assuming a k-th broadcast of the node i with communication delay to a neighbor node j, c.sub.i(t.sub.k.sup.i)=kT represents the k-th transmission time of the node i, where t.sub.k.sup.i represents the transmission instant at the corresponding absolute moment, and assuming the node j obtains the k-th message at its local time c.sub.j(t.sub.k.sup.ij), where t.sub.k.sup.i represents the instant time at which the node j receives the message within the absolute time, so t.sub.k.sup.ij>t.sub.k.sup.i, and t k ij = t k i + d ij ( t k ij ) = t k i + d ij r ( t k ij ) + d ij f , k = 1 , 2 , .Math. ; where, d.sub.ij(t.sub.k.sup.ij) represents the communication delay, and is composed of random delay d.sub.ij.sup.r(t.sub.k.sup.ij) and fixed delay d.sub.ij.sup.f; and based on the communication delay, it is assumed that for any communication link between any two nodes, the delay exists as a positive and bounded independent random variable, 0<d.sub.ij(t.sub.k.sup.ij)M.sub.d, where M.sub.d is a positive real constant; in addition, it is assumed that each node neither updates the virtual logical clock of the node nor obtains the time information sent by the neighbor nodes of the node until a time duration is greater than M.sub.d.

    4. The method according to claim 3, wherein step S3 comprises: assuming each node i periodically broadcasts time information to its neighbor node j, where the time information includes a node identification (ID), an information transmission sequence number, a current hardware clock value, a logical skew compensation value and an offset compensation value; considering that the communication delay includes random delay and fixed delay, the time information exchanged between the node i and the node j is reconstructed as: c j ( t k ij ) = ij c i ( t k i ) + ij + d ij r ( t k ij ) + d ij f ; analyzing the effect of other unknown parameters of relative skew by subtracting the time information, to obtain the following formula: c j ( t k ij ) - c j ( t k - 1 ij ) = ij ( c i ( t k i ) - c i ( t k - 1 i ) ) + ( d ij r ( t k ij ) - d ij r ( t k - 1 ij ) ) ; in the actual time synchronization process, when a message from the node i is not received by the neighbor node j within the time duration M.sub.d, the synchronization message will be considered as discarded; and based on Bayesian estimation theory, an error function of the to-be-estimated parameter .sub.ij is expressed as e=.sub.ij.sub.ij; and then a quadratic function is defined as C(e)=e.sup.2=(.sub.ij.sub.ij).sup.2; the relative skew is estimated by a Bayesian mean square error R=E(C(e))=E((.sub.ij.sub.ij).sup.2); by applying the relative skew to a probability density function p(c.sub.j(n),.sub.ij), according to Bayesian principle, it is obtained that p ( c j ( n ) , ij ) = p ( ij .Math. c j ( n ) p c j ( n ) ) ; and B mse ( ij ) = ( ( ij - ij ) 2 p ( ij .Math. c j ( n ) d ( ij ) ) p ( c j ( n ) ) d ( ( c j ( n ) ) ; since p(c.sub.j(n))0 holds for all c.sub.j(n), if the integral in parentheses is minimized for each c.sub.j(n), then B.sub.mse will be minimized, and the estimator of minimizing B.sub.mse is the average of the posterior joint conditions of ij = E ( ij .Math. c j ( n ) ) ; ij = E ( ij .Math. c j ( n ) ) = ij 2 T ( N - 1 ) T 2 ij 2 + 2 2 .Math. n = 1 N - 1 c j ( n ) + 2 2 ij T ( N - 1 ) T 2 ij 2 + 2 2 ; an equivalent recursive solution to the above formula is as follows: ij ( n ) = ij ( n - 1 ) - ij 2 T 2 ( n - 1 ) T 2 ij 2 + 2 2 ( ij ( n - 1 ) - c j ( n - 1 ) T .

    5. The method according to claim 4, wherein step S4 specifically comprises: when the node j obtains the n-th synchronization packet from the node i, the node j performs the n-th skew and offset compensation update at t.sub.n.sup.ij using the following update rules: j ( t + ) = ( 1 - a ( n ) a ) j ( t ) + a ( n ) a ij - 1 ( n ) i ( t ) ; and j ( t + ) = j ( t ) + a ( n ) 0 [ c i ^ ( t n i ) - c j ( t n ij ) ] , i N j , t = t n ij ; where, .sub.(0,1) and .sub.0(0,1) are tuning parameters, (n)(n-1).sup.u is an attenuation factor, where u(0,1), is .sub.j the skew compensation of the node i at t, and the initial condition for any node jN is set to .sub.j(0)=1 and .sub.j(0)=1.

    Description

    BRIEF DESCRIPTION OF THE DRAWINGS

    [0009] The foregoing and other objects, features, and advantages of the present disclosure will become more apparent from the following detailed description of exemplary embodiments of the present disclosure taken in conjunction with the accompanying drawings, in which like reference numerals generally refer to the same parts throughout the exemplary embodiments of the present disclosure.

    [0010] FIG. 1 is a flowchart of an exemplary embodiment of the present disclosure;

    [0011] FIG. 2 is an exemplary wireless network node distribution diagram; and

    [0012] FIG. 3A is a block diagram of a stage of constructing a wireless sensor network system.

    [0013] FIG. 3B is a block diagram of a stage of suppressing communication delay to achieve precise network-wide time synchronization.

    [0014] FIG. 4 is a structure diagram of a time synchronization method for wireless load testing in the present application.

    DETAILED DESCRIPTION OF THE EMBODIMENTS

    [0015] The technical solutions in the embodiments of the present disclosure will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only a part of the embodiments of the present disclosure rather than all of them. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work shall fall within the scope of protection of the present disclosure.

    [0016] Preferred embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While preferred embodiments of the present disclosure are illustrated in the accompanying drawings, it should be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

    [0017] The present disclosure provides a time synchronization method for a wireless load testing system. A flowchart of an exemplary embodiment is shown in FIG. 1. An exemplary wireless load testing system includes a central node and 12 sub-nodes, and transmits load data to an upper computer through wireless communication, as shown in FIG. 2.

    [0018] The method according to the present disclosure mainly includes two stages: a stage of constructing a wireless sensor system, and a stage of suppressing communication delay to achieve precise network-wide time synchronization. A flowchart of each stage is shown in FIG. 3.

    [0019] The stage of constructing the wireless sensor system includes: constructing a network model based on a consensus algorithm, constructing a clock model, updating compensation parameters of virtual logical clocks of nodes, and proposing a timestamp exchange mechanism based on a pseudo-periodic communication scheme.

    [0020] The steps of the stage of constructing the wireless sensor system are as follows:

    [0021] S1, constructing the network model based on the consensus algorithm.

    [0022] Assuming communication topology is an undirected graph G=(N,) in a wireless network, where N={1, 2, . . . , N}represents a set of sensor nodes, and .Math.NN represents a set of effective communication links. .sub.ij represents a non-empty adjacency element, and if and only if there is a directed link in G, a set of direct neighbor nodes of a sub-node i can be expressed as N.sub.i={j|(i,j)}, where (i,j) represents that the node i can communicate with a node j in one hop. For the state of a certain sub-node i, the consensus algorithm can be adopted to construct the following linear model:

    [00001] x i ( k + 1 ) = x i ( k ) + .Math. j N i ij [ x j ( k ) - x i ( k ) ] ; [0023] where k is the number of iterations; and x.sub.i(k) represents the linear model obtained after k iterations of the node i. if the linear model based on the consensus algorithm is applied to a clock update equation, the clocks of the nodes can be driven to a common clock.

    [0024] S2, constructing a node virtual logic clock updating model based on a timestamp exchange mechanism based on a pseudo-periodic communication scheme.

    [0025] S21, constructing a clock model.

    [0026] Each sensor node has a local hardware clock whose first-order dynamic function is expressed as:

    [00002] C i ( t ) = i t + i ; [0027] where c.sub.i(t) is the hardware clock reading at absolute reference time t, and .sub.i and .sub.i are local hardware clock skew and offset, respectively; the clock model is established as follows by using hardware clock data of any two nodes to obtain indirect information of the nodes:

    [00003] C j ( t ) = j i c j ( t ) + ( j - j i i ) = ij c j ( t ) + ij ; where , ij = j i , ij = j - j i i .

    [0028] Since the local hardware clock cannot be manually modified, it is proposed that the node maintains a virtual logic clock to represent the synchronization time. The model is as follows:

    [00004] c ^ j ( t ) = i c i ( t ) + i = i i ( t ) + i i + i ; [0029] where, .sub.i and .sub.i represent skew compensation and offset compensation, respectively, and .sub.i=i.sub.i and .sub.i=i.sub.1+.sub.i are defined as virtual logical clock skew and offset, respectively.

    [0030] S22, updating compensation parameters of virtual logical clocks of nodes.

    [0031] The compensation parameters of the virtual logic clock model are updated periodically and iteratively, such that the logic clocks of each sensor node approximate a common clock, c(t)=t+.

    [0032] The compensation parameters of the virtual logic clocks of the nodes are updated, such that (i,.sub.i) satisfies:

    [00005] { lim k .fwdarw. i ( k ) i = lim k .fwdarw. i ( k ) i + i ( k ) = ; [0033] wherein, c(t) represents the common clock, and and represent the updated compensation parameters of the virtual logic clocks of the nodes.

    [0034] S23, proposing a timestamp exchange mechanism based on a pseudo-periodic communication scheme.

    [0035] Each node broadcasts time information with an MAC layer timestamp to neighbor nodes in each synchronization period T. The neighbor nodes record local clocks immediately after receiving the information. Assuming a k-th broadcast of the node i with communication delay to a neighbor node j, c.sub.i(t.sub.k.sup.i)=kT represents the k-th transmission time of the node i, where represents the transmission instant at the corresponding absolute moment, and assuming the node j obtains the k-th message at its local time c.sub.j(t.sub.k.sup.ij), where t.sub.k.sup.i represents the instant time at which the node j receives the message within the absolute time, so t.sub.k.sup.ij>t.sub.k.sup.i, and

    [00006] t k ij = t k i + d ij ( t k ij ) = t k i + d ij r ( t k ij ) + d ij f , k = 1 , 2 , .Math. ; [0036] where, d.sub.ij(t.sub.k.sup.ij) represents the communication delay, and is composed of random delay d.sub.ij.sup.r(t.sub.k.sup.ij) and fixed delay d.sub.ij.sup.f.

    [0037] Based on the communication delay, it is assumed that for any communication link between any two nodes, the delay exists as a positive and bounded independent random variable, i.e., 0<d.sub.ij(t.sub.k.sup.ij)M.sub.d, where M.sub.d is a positive real constant; in addition, it is assumed that each node neither updates the virtual logical clock of the node nor obtains the time information sent by the neighbor nodes of the node until a time duration is greater than M.sub.d.

    [0038] S3, constructing a relative skew estimator based on Bayesian theory, and estimating undetermined parameters in the updating the virtual logic clocks of the nodes, such that the logic clocks of each sensor node approximate a common clock.

    [0039] Including performing relative skew estimation, and performing skew and offset compensation.

    [0040] In order to offset the effect of delay, a relative skew estimation method based on Bayesian theory is proposed.

    [0041] Assuming each node i periodically broadcasts time information to its neighbor node j, where the time information includes a node ID, an information transmission sequence number, a current hardware clock value, a logical skew compensation value and an offset compensation value. Considering that the communication delay includes random delay and fixed delay, the time information exchanged between the node i and the node j is reconstructed as:

    [00007] c j ( t k ij ) = ij c i ( t k i ) + ij + d ij r ( t k ij ) + d ij f .

    [0042] Analyzing the effect of other unknown parameters of relative skew by subtracting the time information, to obtain the following formula:

    [00008] c j ( t k ij ) - c j ( t k - 1 ij ) = ij ( c i ( t k i ) - c i ( t k - 1 i ) ) + ( d ij r ( t k ij ) - d ij r ( t k - 1 ij ) ) .

    [0043] In the actual time synchronization process, when a message from the node i is not received by the neighbor node j within the time duration M.sub.d, the synchronization message will be considered as discarded.

    [0044] Based on Bayesian estimation theory, an error function of the to-be-estimated parameter .sub.ij is expressed as e=.sub.ij.sub.ij.

    [0045] And then a quadratic function is defined as C(e)=e.sup.2=(.sub.ij.sub.ij).sup.2.

    [0046] The relative skew is estimated by a Bayesian mean square error R=E(C(e))=E((.sub.ij.sub.ij).sup.2).

    [0047] By applying the relative skew to a probability density function p(c.sub.j(n),.sub.ij), according to Bayesian principle, it can be obtained that p(c.sub.j (n), .sub.ij)=p(.sub.ij|c.sub.j(n)pc.sub.j(n)).

    [0048] So,

    [00009] B mse ( ij ) = ( ( ij - ij ) 2 p ( ij | c j ( n ) d ( ij ) ) p ( c j ( n ) ) d ( ( c j ( n ) ) .

    [0049] Since p(c.sub.j(n))0 holds for all c.sub.j(n), if the integral in parentheses can be minimized for each c.sub.j(n), then B.sub.mse will be minimized, and the estimator of minimizing B.sub.mse is the average of the posterior joint conditions of .sub.ij=E(.sub.ij|c.sub.j(n)).

    [00010] ij = E ( ij | c j ( n ) ) = ij 2 T ( N - 1 ) T 2 ij 2 + 2 2 .Math. n = 1 N - 1 c j ( n ) + 2 2 ij T ( N - 1 ) T 2 ij 2 + 2 2 .

    [0050] The equivalent recursive solution to the above formula is as follows:

    [00011] ij ( n ) = ij ( n - 1 ) - ij 2 T 2 ( n - 1 ) T 2 ij 2 + 2 2 ( ij ( n - 1 ) - c j ( n - 1 ) T .

    [0051] In the case of bounded delay, the bounded convergence of the time synchronization algorithm depends on the convergence rate and attenuation rate of the relative skew estimation error. The convergence and convergence rate of the above formula are analyzed to determine the effectiveness of the relative skew estimation. The analysis method is as follows:

    [00012] ij ( n ) = ij 2 T 2 [ c j ( t n ij ) - c j ( t n - 1 ij ) + .Math. + c j ( t 2 ij ) - c j ( t 1 ij ) ] ( n - 1 ) T 2 ij 2 + 2 2 + 2 2 ij ( n - 1 ) T 2 ij 2 + 2 2 .

    [0052] After the hardware local time c.sub.j(t.sub.k.sup.ij) of the k-th data packet received by the node j is substituted into the above formula, it can be obtained that .sub.ij(n)=.sub.ij(1+.sub.ij(n)). [0053] when,

    [00013] ij ( n ) = ij 2 T 2 [ d ij r ( t n ij ) - d ij r ( t 1 ij ) ] + 2 2 ij ( ( n - 1 ) T 2 ij 2 + 2 2 ) ij + 2 2 ( n - 1 ) T 2 ij 2 + 2 2 ; [0054] to obtain,

    [00014] ij ( n ) .Math. "\[LeftBracketingBar]" 2 ij 2 T 2 M d + 2 2 ij ij ( n - 1 ) T 2 ij 2 .Math. "\[RightBracketingBar]" .

    [0055] Therefore, for any nN.sup.+,

    [00015] ij ( n ) .Math. "\[LeftBracketingBar]" 2 ij 2 T 2 M d + 2 2 ij ij ( n - 1 ) T 2 ij 2 .Math. "\[RightBracketingBar]" .

    [0056] The convergence speed of .sub.ij(n) is equal to O(1/(n-1)), so lim.sub.n.fwdarw.{circumflex over ()}.sub.ij(n)=.sub.ij, which proves the effectiveness of the relative skew estimator.

    [0057] S4, updating logical skew compensation and offset compensation of the nodes.

    [0058] When the node j obtains the n-th synchronization packet from the node i, the node j performs the n-th skew and offset compensation update at t.sub.n.sup.ij using the following update rules.

    [00016] j ( t + ) = ( 1 - a ( n ) a ) j ( t ) + a ( n ) a ij - 1 ( n ) i ( t ) ; and j ( t + ) = j ( t ) + a ( n ) 0 [ c i ( t n i ) - c j ( t n ij ) ] , i N j , t = t n ij ; [0059] where, .sub.(0,1) and .sub.0(0,1) are tuning parameters, (n)(n-1).sup.u is an attenuation factor, where u(0,1), is .sub.j the skew compensation of the node i at t, and the initial condition for any node jN is set to .sub.j(0)=1 and .sub.j(0)=1. The introduction of a(n) into the above formula is to further weaken the adverse effect of the relative skew estimation error, so as to ensure the consistency of logical skew under communication delay.

    [0060] The time synchronization method for wireless load testing system is processed by a time synchronization equipment for wireless load testing system.

    [0061] As shown in FIG. 4, the time synchronization equipment for wireless load testing system includes: a processor 1001 (such as Central Processing Unit, CPU), a communication bus 1002, an input port 1003, an output port 1004, and a memory 1005. Among them, the communication bus 1002 is used to achieve connection communication between these components; the input port 1003 is used for data input; and the output port 1004 is used for data output, and the memory 1005 can be high-speed RAM memory or non volatile memory, such as disk memory, non-transitory computer-readable storage medium. Optionally, memory 1005 is a storage device independent of the aforementioned processor 1001.

    [0062] The memory 1005, as a non-volatile readable storage medium, may include an operating system, network communication module, application program module, and a time synchronization equipment for wireless load testing system. The network communication module is mainly used to connect to servers and communicate data with them; And processor 1001 is used to call the program to process the method stored in memory 1005, and execute all steps of the time synchronization method for wireless load testing system mentioned above.

    [0063] The above technical solutions are only exemplary embodiments of the present disclosure. For those skilled in the art, various modifications and variations can be made to the disclosed methods and principles of the present disclosure, and are not limited to the methods described in the above specific embodiments of the present disclosure. Accordingly, the foregoing description is intended to be illustrative only and not to be taken in a limiting sense.