Method, apparatus, storage medium and electronic device for determining phase difference
By sending and receiving messages carrying time slot lengths and offset values in a large-scale deterministic IP network, the problem of obtaining phase differences between upstream and downstream nodes is solved, enabling accurate end-to-end delay and jitter calculations and ensuring the optimization of deterministic service paths.
Patent Information
- Application Number
- CN202211182887.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-27
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2042-09-27
AI Technical Summary
In large-scale deterministic IP networks, existing technologies cannot accurately obtain the phase difference corresponding to the same periodic template supported by upstream and downstream nodes, which affects the planning of deterministic service paths.
By sending a first message carrying the target time slot length to the downstream node at the first start time of the predetermined target period template window, and receiving a second message carrying the first deviation value returned by the downstream node at the second start time of the target period template window, the phase difference between the upstream and downstream nodes is determined based on the target time slot length, the first deviation value, and the second deviation value.
It enables accurate calculation of end-to-end latency and jitter, and determination of the optimal deterministic service path, even in the absence of precise link latency information.
Smart Images

Figure CN117834511B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communications, and more specifically, to a method, apparatus, storage medium, and electronic device for determining phase difference. Background Technology
[0002] With the rapid development of network communication technology, determinism is becoming an important indicator and key technology for future networks. Therefore, the IETF (The Internet Engineering Task Force) DetNet (deterministic networking) working group proposed the Large-scale deterministic network (LDN) technology. However, in large-scale networks, frequency synchronization is often sufficient, but it is difficult to achieve network-wide time synchronization.
[0003] In related technologies, within the LDN domain, nodes employ time-slot circular queue scheduling technology, potentially supporting one or multiple periodic templates. If upstream and downstream nodes support periodic templates of the same time-slot length, a certain deviation, termed phase difference Δ, may exist between time slots of the same template on upstream and downstream nodes after device startup. If upstream and downstream nodes simultaneously support multiple periodic templates, a phase difference exists for the time slots of each periodic template, and the phase difference values may differ between periodic templates. Typically, Figure 1 This is a schematic diagram of the phase difference of multi-cycle template time slots in upstream and downstream nodes in related technologies, such as... Figure 1 As shown, upstream and downstream nodes simultaneously support three periodic templates A, B, and C, with time slot lengths configured as T, 2T, and 4T, respectively. T is called the base time slot length or cycle length. The phase differences corresponding to the three periodic templates are ΔA, ΔB, and ΔC, respectively. When performing deterministic service path planning, it is necessary to calculate the precise end-to-end latency and jitter for each periodic template to select the optimal path. This may require obtaining the time slot phase difference for each identical periodic template between upstream and downstream nodes, but LDN technology cannot obtain the precise time slot phase difference.
[0004] There is currently no effective solution to the problem that it is impossible to accurately obtain the phase difference corresponding to the same periodic template supported by upstream and downstream nodes in related technologies. Summary of the Invention
[0005] This invention provides a method, apparatus, storage medium, and electronic device for determining phase difference, to at least solve the problem in related technologies that it is impossible to accurately obtain the phase difference corresponding to the same period template supported by upstream and downstream nodes.
[0006] According to an embodiment of the present invention, a method for determining a phase difference is provided, applied to an upstream node, comprising: sending a first message to a downstream node at a first start time of a predetermined target periodic template window, wherein the first message carries a target time slot length of the target periodic template; receiving a second message returned by the downstream node at a second start time of the target periodic template window, wherein the second message carries a first deviation value, the first deviation value being used to indicate the deviation of the receiving time of the downstream node receiving the first message within the target periodic template, wherein the downstream node determines the target periodic template based on the target time slot length; determining the phase difference between the target periodic template used by the upstream node and the target periodic template used by the downstream node based on the target time slot length, the first deviation value, and the second deviation value, wherein the second deviation value is used to indicate the deviation of the receiving time of the upstream node receiving the second message within the target periodic template.
[0007] According to another embodiment of the present invention, an apparatus for determining a phase difference is provided, applied to an upstream node, comprising: a sending module, configured to send a first message to a downstream node at a first start time of a predetermined target period template window, wherein the first message carries a target time slot length of the target period template; a receiving module, configured to receive a second message returned by the downstream node at a second start time of the target period template window, wherein the second message carries a first deviation value, the first deviation value being used to indicate the deviation of the receiving time of the downstream node receiving the first message within the target period template, wherein the downstream node determines the target period template based on the target time slot length; and a determining module, configured to determine the phase difference between the target period template used by the upstream node and the target period template used by the downstream node based on the target time slot length, the first deviation value, and the second deviation value, wherein the second deviation value is used to indicate the deviation of the receiving time of the upstream node receiving the second message within the target period template.
[0008] According to yet another embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed.
[0009] According to yet another embodiment of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0010] Through this invention, a first message carrying the target time slot length of the target period template can be sent to a downstream node at a first start time of a predetermined target period template window. Upon receiving a second message from the downstream node at a second start time of the target period template window, carrying a first deviation value indicating the deviation of the downstream node's reception time of receiving the first message within the target period template, the phase difference between the target period template used by the upstream node and the target period template used by the downstream node can be determined based on the target time slot length, the first deviation value, and the second deviation value indicating the deviation of the upstream node's reception time of receiving the second message within the target period template. The method of this invention determines the phase difference between the target period template used by the upstream node and the target period template used by the downstream node by obtaining the time slot deviation generated by the downstream node receiving the first message sent by the upstream node within the same target period template, the time slot deviation generated by the upstream node receiving the second message sent by the downstream node, and the target time slot length of the target period template. This achieves the goal of determining the phase difference corresponding to the same period template supported by upstream and downstream nodes in the absence of accurate link delay information, and solves the problem in related technologies that it is impossible to accurately obtain the phase difference corresponding to the same period template supported by upstream and downstream nodes. It achieves the effect of accurately calculating end-to-end delay and jitter through time slot phase difference to determine the optimal deterministic service path. Attached Figure Description
[0011] Figure 1 This is a schematic diagram of the phase difference of the time slot of the multi-cycle template in the upstream and downstream nodes in the related technology;
[0012] Figure 2 This is a hardware structure block diagram of a mobile terminal for a method of determining phase difference according to an embodiment of the present invention.
[0013] Figure 3 This is a flowchart of a method for determining a phase difference according to an embodiment of the present invention;
[0014] Figure 4 This is a flowchart illustrating the overall process of phase difference measurement according to a specific embodiment of the present invention;
[0015] Figure 5 This is a schematic diagram of measurement message transmission according to a specific embodiment of the present invention;
[0016] Figure 6 This is a flowchart of measuring the phase difference corresponding to the periodic template T between N1 and N2 according to a specific embodiment of the present invention. Figure 1 ;
[0017] Figure 7 This is an example of the phase difference calculation principle according to a specific embodiment of the present invention. Figure 1 ;
[0018] Figure 8 This is a flowchart of measuring the phase difference corresponding to the periodic template T between N1 and N2 according to a specific embodiment of the present invention. Figure 2 ;
[0019] Figure 9 This is an example of the phase difference calculation principle according to a specific embodiment of the present invention. Figure 2 ;
[0020] Figure 10 This is a schematic diagram of a sub-TLV encapsulation format according to a specific embodiment of the present invention;
[0021] Figure 11 This is a structural block diagram of a device for determining phase difference according to an embodiment of the present invention. Detailed Implementation
[0022] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings and examples.
[0023] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0024] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 2 This is a hardware structure block diagram of a mobile terminal for a method of determining phase difference according to an embodiment of the present invention. Figure 2 As shown, a mobile terminal may include one or more ( Figure 2 Only one is shown in the diagram. A processor 202 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 204 for storing data are also shown. The mobile terminal may further include a transmission device 206 for communication functions and an input / output device 208. Those skilled in the art will understand that... Figure 2 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 2 The more or fewer components shown, or having the same Figure 2 The different configurations shown.
[0025] The memory 204 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the method for determining phase difference in this embodiment of the invention. The processor 202 executes various functional applications and data processing by running the computer program stored in the memory 204, thereby implementing the aforementioned method. The memory 204 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 204 may further include memory remotely located relative to the processor 202, and these remote memories can be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0026] The transmission device 206 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the mobile terminal's communication provider. In one example, the transmission device 206 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 206 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0027] This embodiment provides a method for determining the phase difference. Figure 3 This is a flowchart of a method for determining phase difference according to an embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps:
[0028] Step S302: At the first start time of the predetermined target period template window, a first message is sent to the downstream node, wherein the first message carries the target time slot length of the target period template.
[0029] Step S304: Receive a second message returned by the downstream node at the second start time of the target period template window, wherein the second message carries a first deviation value, the first deviation value is used to indicate the deviation of the receiving time of the downstream node receiving the first message within the target period template, and the downstream node determines the target period template based on the target time slot length;
[0030] Step S306: Determine the phase difference between the target periodic template used by the upstream node and the target periodic template used by the downstream node based on the target time slot length, the first deviation value, and the second deviation value, wherein the second deviation value is used to indicate the deviation of the receiving time of the upstream node receiving the second message within the target periodic template.
[0031] The entities that perform the above steps can be network nodes, such as upstream network nodes, or network devices, such as network switches and routers, or units or terminals capable of sending, receiving, and processing information.
[0032] In the above embodiments, the first message may carry the time slot lengths corresponding to the target periodic templates with different target time slot lengths. For example, the first message may carry three target periodic templates, namely target periodic template A, target periodic template B, and target periodic template C, where the target time slot length of target periodic template A is T, the target time slot length of target periodic template B is 2T, and the target time slot length of target periodic template C is 4T. This allows for the random determination of the phase difference corresponding to each target periodic template between upstream and downstream nodes. Furthermore, the phase difference can be determined according to the priority of the three target periodic templates. For example, when the three target periodic templates have different target time slot lengths, the phase difference can be determined according to the priority of the three target periodic templates. When the priority of the target periodic template is target periodic template A > target periodic template B > target periodic template C, the phase difference corresponding to target periodic template A between upstream and downstream nodes can be determined first, then the phase difference corresponding to target periodic template B, and finally the phase difference corresponding to target periodic template C. Of course, the phase differences corresponding to target periodic template A, target periodic template B, and target periodic template C between upstream and downstream nodes can also be determined simultaneously. It should also be noted that the above examples of target periodic templates with different target time slot lengths are only exemplary embodiments, and target periodic templates with different target time slot lengths are not limited to the above examples.
[0033] In the above embodiments, the corresponding interactions between multiple upstream and downstream nodes may also be included. For example, when there are nodes 1, 2, 3, and 4, and node 2 is a downstream node of node 1 and an upstream node of node 3, and node 3 is a downstream node of node 2 and an upstream node of node 4, the phase difference corresponding to the same target periodic template between node 1 and node 2, between node 2 and node 3, and between node 3 and node 4 needs to be determined. Then, the corresponding phase difference can be determined according to the priority of the requirement to determine the phase difference of the target periodic template between the multiple nodes. For example, when the priority of the requirement to determine the phase difference is node 1 and node 2 > node 2 and node 3 > node 3 and node 4, the phase difference corresponding to the same target periodic template between node 1 and node 2 can be determined first, then the phase difference corresponding to the same target periodic template between node 2 and node 3 can be determined, and finally the phase difference corresponding to the same target periodic template between node 3 and node 4 can be determined. It should also be noted that the above examples of upstream and downstream nodes are only exemplary embodiments, and upstream and downstream nodes are not limited to the above examples.
[0034] In the above embodiments, a first message carrying the target time slot length of the target period template can be sent to the downstream node at the first start time of a predetermined target period template window. If a second message carrying a first deviation value indicating the deviation of the receiving time of the downstream node receiving the first message within the target period template is received at the second start time of the target period template window, the phase difference between the target period template used by the upstream node and the target period template used by the downstream node is determined based on the target time slot length, the first deviation value, and the second deviation value indicating the deviation of the receiving time of the upstream node receiving the second message within the target period template. The method of this invention determines the phase difference between the target period template used by the upstream node and the target period template used by the downstream node by obtaining the time slot deviation generated by the downstream node receiving the first message sent by the upstream node within the same target period template, the time slot deviation generated by the upstream node receiving the second message sent by the downstream node, and the target time slot length of the target period template. This achieves the goal of determining the phase difference corresponding to the same period template supported by upstream and downstream nodes in the absence of accurate link delay information, and solves the problem in related technologies that it is impossible to accurately obtain the phase difference corresponding to the same period template supported by upstream and downstream nodes. It achieves the effect of accurately calculating end-to-end delay and jitter through time slot phase difference to determine the optimal deterministic service path.
[0035] In an exemplary embodiment, determining the phase difference between the target cycle template used by the upstream node and the target cycle template used by the downstream node based on the target time slot length, the first deviation value, and the second deviation value includes: determining a second relationship between the phase difference, the target time slot length, the first deviation value, and the second deviation value based on a first relationship between the first deviation value and the second deviation value; when it is determined that there are multiple values for the phase difference based on the second relationship, respectively determining the ranges of the link delays corresponding to each value of the phase difference to obtain multiple link delay ranges, where the link delay is the link delay between the upstream node and the downstream node; determining the unique value of the phase difference based on a third relationship between the estimated delay obtained by pre-estimating the link delay and each link delay range. In this embodiment, when the target time slot length is T, and the values of the phase difference are Δ1 and Δ2, if it is determined that the delay range corresponding to Δ1 is [0, T / 5] and the delay range corresponding to Δ2 is [T / 3, T], and the range within which the estimated delay can deviate can be [0, T / 4] (it can also be [0, T / 5], [T / 6, T / 5], [T / 5, T / 4], etc.), when the estimated delay is T / 4, it means that the estimated delay is neither within the delay range corresponding to Δ1 nor within the delay range corresponding to Δ2. At this time, a value can be taken from the range within which the estimated delay can deviate and added to the estimated delay to determine the phase difference. For example, taking the value T / 5 from the range within which the estimated delay can deviate, adding T / 5 to T / 4 gives 9T / 20, and T / 5 < T / 3 < 9T / 20, that is, the phase difference Δ2 between the target cycle template used by the upstream node and the target cycle template used by the downstream node. It should also be noted that the above examples of the target time slot length, the phase difference, the delay range corresponding to the phase difference, and the estimated delay are only exemplary embodiments, and the target time slot length, the phase difference, the delay range corresponding to the phase difference, and the estimated delay are not limited to the above examples.
[0036] In an exemplary embodiment, determining the second relationship between the phase difference, the target time slot length, the first deviation value, and the second deviation value based on the first relationship between the first deviation value and the second deviation value includes at least one of the following:
[0037] When the first relationship is used to indicate that the first deviation value is less than or equal to the second deviation value, determining that the second relationship satisfies the following formula:
[0038] Δ=(a2 + T - a1) / 2 or, Δ=(a2 - a1) / 2;
[0039] When the first relation is used to indicate that the first deviation value is greater than the second deviation value, the second relation is determined to satisfy the following formula:
[0040] Δ = (a2 + T - a1) / 2 or Δ = (a2 + 2T - a1) / 2;
[0041] Wherein, Δ is the phase difference, T is the target time slot length, a1 is the first deviation value, and a2 is the second deviation value. In the above embodiment, when a1 is T / 4 and a2 is T / 2, substituting into the formula yields Δ as 5T / 8 or T / 8; when a1 is T / 2 and a2 is T / 4, substituting into the formula yields Δ as 3T / 8 or 7T / 8. That is, two phase differences can be obtained through the first deviation value, the second deviation value, and the above formula. At this time, a unique value can be determined from the two phase differences by using the delay range corresponding to the two phase differences and the estimated delay obtained by pre-estimating the link delay. In addition, the actual link delay can be deduced from the first deviation value and the two phase differences, and the estimated delay should be small compared with the actual link delay.
[0042] In an exemplary embodiment, determining the range of link delay corresponding to each value of the phase difference includes at least one of the following:
[0043] Given the phase difference Δ = (a2 - a1) / 2, the range of the link delay is determined as follows:
[0044] When the first relationship indicates that the first deviation value is less than or equal to the second deviation value, and the phase difference Δ = (a2 + T - a1) / 2, the range of the link delay is determined to be...
[0045] When the first relationship indicates that the first deviation value is greater than the second deviation value, and the phase difference Δ = (a2 + T - a1) / 2, the range of the link delay is determined to be...
[0046] Given the phase difference Δ = (a2 + 2T - a1) / 2, the range of the link delay is determined to be as follows:
[0047] Where n is an integer. In the above embodiment, n is an integer that is being tried. For example, when T = 10 μs, a1 = 1 μs, and a2 = 3 μs, if one phase difference (a2 - a1) / 2 is 1 μs and another phase difference (a2 + T - a1) / 2 is 6 μs, the range of link delay corresponding to Δ = 1 μs is n * T + 2 ± 2.5 μs, and the range of link delay corresponding to Δ = 6 μs is n * T + 7 ± 2.5 μs. When the estimated link delay is 23 μs, the link delay range can be expressed as 2 * 10 + 2 + 1 μs, that is, Δ = 1 μs is the final phase value. When T = 20 μs, a1 = 15 μs, a2 = 3 μs, and a1 = 10 μs, the range of link delay is n * T + 2 ± 2.5 μs. When Δ = 5μs, with one phase difference (a2+T-a1) / 2 being 5μs and another phase difference (a2+2T-a1) / 2 being 15μs, the range of link delay corresponding to Δ = 5μs is n*T+20±5μs, and the range of link delay corresponding to Δ = 15μs is n*T+10±5μs. When the estimated link delay is 83μs, the link delay range can be expressed as 3*20+20+3μs, that is, Δ = 5μs is the final phase value. It should also be noted that the above method of determining n and the above phase value is only an exemplary embodiment, and the method of determining n and the phase value is not limited to the above example.
[0048] In an exemplary embodiment, determining the unique value of the phase difference based on a third relationship between the estimated delay obtained by pre-estimating the link delay and each of the link delay ranges includes: determining a target link delay range from a plurality of link delay ranges based on the third relationship, wherein the target link delay range is the range in which the estimated delay falls; and determining the unique value of the phase difference corresponding to the target link delay range. In this embodiment, when there are three link delay ranges, namely link delay range 1, link delay range 2, and link delay range 3, if the estimated delay falls within the range of link delay range 1 based on the estimated delay and the range that the estimated delay can deviate from, then link delay range 1 is determined as the target link delay range, meaning the phase difference corresponding to link delay range 1 is a unique value. If the estimated delay falls within the range of link delay range 2 based on the estimated delay and the range that the estimated delay can deviate from, then link delay range 2 is determined as the target link delay range, meaning the phase difference corresponding to link delay range 2 is a unique value. If the estimated delay falls within the range of link delay range 3 based on the estimated delay and the range that the estimated delay can deviate from, then link delay range 3 is determined as the target link delay range, meaning the phase difference corresponding to link delay range 3 is a unique value, and so on. It should be noted that the above example of the target link delay range is only an exemplary embodiment, and the target link delay range is not limited to the above example.
[0049] In one exemplary embodiment, the first message includes a first type field and a first length field, wherein the first type field indicates that the first message is for measuring the phase difference, and the first length field indicates the target time slot length. In the above embodiment, the first message may also include a field indicating the length of the first message, etc.
[0050] In one exemplary embodiment, the second message includes a second type field, a second length field, and a compensation field. The second type field indicates that the second message is for measuring the phase difference; the second length field indicates the target time slot length; and the compensation field indicates the first deviation value. In the above embodiment, the second message may further include a field indicating the length of the second message, a field carrying the first deviation value, and a field carrying the second deviation value, etc., wherein the second deviation value may not be carried in the message.
[0051] In an exemplary embodiment, after determining the phase difference between the target periodic template used by the upstream node and the target periodic template used by the downstream node based on the target time slot length, the first deviation value, and the second deviation value, the method further includes at least one of the following: saving the phase difference locally to the upstream node; and announcing the phase difference to other network nodes. In the above embodiment, after saving the phase difference locally to the upstream node, when subsequent upstream and downstream nodes use the periodic template again, they can directly call the phase difference corresponding to the periodic template locally from the upstream node. After announcing the phase difference corresponding to the target periodic template to other network nodes, other network nodes can save the phase difference corresponding to the periodic template and directly call the phase difference corresponding to the periodic template when they need to use the periodic template.
[0052] Obviously, the embodiments described above are only some embodiments of the present invention, and not all embodiments.
[0053] The present invention will be described in detail below with reference to specific embodiments:
[0054] This invention provides a flowchart of a phase difference measurement method. Figure 4 This is a general flowchart of phase difference measurement according to a specific embodiment of the present invention, such as... Figure 4 As shown, the process includes the following steps:
[0055] S402, Begin;
[0056] S404, upstream and downstream nodes enable the phase difference measurement function described in this invention and specify the period template T (corresponding to the target period template mentioned above);
[0057] S406, the upstream node constructs a measurement message, encapsulates the measurement message with a periodic template T, and sends the measurement message (corresponding to the first message) downstream at the start time of the periodic template window (corresponding to the target periodic template window).
[0058] S408, the downstream node receives the measurement message, records the time t1 when the measurement message lands locally (corresponding to the time when the downstream node receives the first message), and extracts the periodic window T;
[0059] S410, perform the first judgment to determine whether the downstream node supports the periodic template T;
[0060] S412, If the result of the first judgment above is negative, the process ends;
[0061] S414, if the first judgment result is yes, calculate the deviation value a1 within the period window (corresponding to the first deviation value) based on t1;
[0062] S416, the downstream node encapsulates the deviation value a1 within the period into a measurement message, and sends the measurement message back to the upstream at the start time of the period template T window (corresponding to the second start time mentioned above);
[0063] S418, the upstream node receives the measurement message, records the time t2 when the measurement message lands locally (corresponding to the time when the upstream node receives the second message), and calculates the deviation value a2 within the periodic window T (corresponding to the second deviation value).
[0064] S420, the upstream node calculates two phase difference values based on the period template T, the period deviation values a1 and a2, and selects the phase difference Δ based on the rough value of the link delay (corresponding to the estimated delay mentioned above), and executes step S412.
[0065] In step S408, the downstream node extracts the periodic template window value T carried in the measurement message. If it finds that the local node does not support the periodic template (i.e., the local node does not have the periodic template), it will not perform subsequent calculations and the measurement ends.
[0066] In step S420, Figure 5 This is a schematic diagram of measurement message transmission according to a specific embodiment of the present invention, such as... Figure 5 As shown, the principle of phase difference calculation, based on the period template T and the measured deviation values a1 and a2 within the period, assuming the link time delay is L (unknown), has the following relationship:
[0067]
[0068] Among them, % is used to represent the modulo operation. For example, 17 % 10 = 7, -3 % 10 = 7, and Δ is the phase difference.
[0069] In the above formula, subtracting ① from ② gives:
[0070] (2Δ - T) % T = a2 - a1,
[0071] Since 0 ≤ a1, a2 < T, the above formula is equivalent to:
[0072]
[0073] For the above formula to hold, 2Δ - T - a2 + a1 = m * T, and by transformation, we get:
[0074] where m is an integer.
[0075] Since 0 ≤ Δ < T, when a2 ≥ a1, the possible values of m are -1 and 0. When m < -1, Δ < 0. When m > 0, Δ > T, which does not meet the requirements. When a2 < a1, the possible values of m are 0 and 1. Similarly, m > 1 and m < 0 do not meet the requirements and will not be elaborated.
[0076] After arrangement, the calculation formula for the phase difference between upstream and downstream nodes can be obtained:
[0077]
[0078] For each pair of measured values a1 and a2, according to Formula 1, two possible phase difference values can be obtained. Further, the rough value of the link delay L between upstream and downstream nodes can be used to determine which value to select as the final phase difference calculation result.
[0079] Based on the two calculated phase difference values and a1, the theoretical actual value of the corresponding L can be deduced. Therefore, in order to infer Δ based on the measured value of L, the measured value of L should be near the theoretical value. Since the interval between the two phase difference values is T / 2, when the deviation of the measured value of L from the theoretical value is not greater than T / 4, one of the phase difference values can be uniquely determined. Therefore, the allowable deviation range of the measured value of L is [0, T / 4), and we have:
[0080] When a2 > a1, if the measured value range of L is then the phase difference value is (Criterion 1). When the value range of L is then the phase difference value is (Criterion 2);
[0081] When a2 ≤ a1, if the measured value range of L is the phase difference value is (Criterion 3). If the value range of L is Phase difference value (Criterion 4). Where n is an integer.
[0082] In summary, using this method, it is not necessary to obtain the precise value of the link delay L between upstream and downstream nodes. Only a rough value of L is needed, with an allowable error range of [0, T / 4), to obtain the precise value of the phase difference. For example, if the time slot length of the periodic template is T = 10 μs, the required measurement accuracy of L is approximately ±2.5 μs; if the time slot length of the periodic template is T = 40 μs, the required measurement accuracy of L is approximately ±10 μs, which significantly reduces the requirement for link delay accuracy. After measuring the phase difference, it can be saved locally or announced to other nodes in the network.
[0083] The invention will now be illustrated with a few specific examples:
[0084] Example 1:
[0085] In this example, assume there are two network devices, N1 and N2, which are frequency-synchronized but time-synchronized. In the service direction N1->N2, N1 is the upstream device node, and N2 is the downstream device node. Both N1 and N2 support a periodic template T = 10µs. The approximate link latency measured between N1 and N2 is approximately 23µs. Figure 6 This is a flowchart of measuring the phase difference corresponding to the periodic template T between N1 and N2 according to a specific embodiment of the present invention. Figure 1 ,like Figure 6 As shown, the process includes the following steps:
[0086] S602, Begin;
[0087] S604, start the phase difference measurement function of N1 and N2, and specify the measurement period template T = 10us;
[0088] S606, N1 constructs a phase difference measurement message, carrying a period template T = 10us, and sends the measurement message to N2 at the beginning of the period template T window;
[0089] S608, N2 receives the measurement message, records the message reception time, extracts the period template T = 10us according to the measurement type, and calculates the deviation of the measurement message reception time within the period template as a1 = 1us;
[0090] S610, N2 encapsulates the deviation value within the periodic template T window into a measurement message, and sends the measurement message to N1 at the beginning of the periodic template T window;
[0091] S612, N1 receives the measurement message, records the message reception time, extracts the period template T = 10us according to the measurement type, and calculates the deviation of the measurement message reception time within the period template as a2 = 3us.
[0092] S614,N1 calculates the phase difference value as Δ = 1us based on the periodic template T, a1 and a2 values;
[0093] S616, End.
[0094] The specific steps for determining the phase difference are explained below:
[0095] Figure 7 This is an example of the phase difference calculation principle according to a specific embodiment of the present invention. Figure 1 ,like Figure 7 As shown, since a2>a1, according to Formula 1, Δ may take the value of (a2-a1) / 2=1us or (a2-a1+T) / 2=6us.
[0096] Furthermore, it can be seen that the range of L corresponding to Δ = 1us is n*T+2±2.5us (criterion 1), and the range of L corresponding to Δ = 6us is n*T+7±2.5us (criterion 2). Since the measured rough value of L is about 23us, L can be expressed as 2*10+2+1us, which is within the range of n*T+2±2.5us. Therefore, the final value of Δ is 1us.
[0097] Example 2:
[0098] In this example, assume there are two network devices, N1 and N2, which are frequency-synchronized but time-synchronized. In the service direction N1->N2, N1 is the upstream device node, and N2 is the downstream device node. Both N1 and N2 support a periodic template T = 20µs. The approximate link latency measured between N1 and N2 is approximately 83µs. Figure 8 This is a flowchart of measuring the phase difference corresponding to the periodic template T between N1 and N2 according to a specific embodiment of the present invention. Figure 2 ,like Figure 8 As shown, the process includes the following steps:
[0099] S802, Start;
[0100] S804, start the phase difference measurement function of N1 and N2, and specify the measurement period template T = 20us;
[0101] S806, N1 constructs a phase difference measurement message, carrying a period template T = 20us, and sends the measurement message to N2 at the beginning of the period template T window;
[0102] S808. N2 receives a measurement message, records the message reception time, extracts the cycle template T = 20 us according to the measurement type, and calculates that the deviation of the measurement message reception time within this cycle template is a1 = 15 us.
[0103] S810. N2 encapsulates the deviation value within the cycle template T window into the measurement message and sends the measurement message to N1 at the start time of the cycle template T window.
[0104] S812. N1 receives the measurement message, records the message reception time, extracts the cycle template T = 20 us according to the measurement type, and calculates that the deviation of the measurement message reception time within this cycle template is a2 = 5 us.
[0105] S814. N1 calculates the phase difference value as Δ = 5 us based on the cycle template T, a1, and a2 values.
[0106] S816. End.
[0107] The specific steps for determining the phase difference are described as follows:
[0108] Figure 9 It is an example of the phase difference calculation principle according to the specific embodiment of the present invention Figure 2 , such as Figure 9 shown. Since a2 < a1, according to Formula 1, the possible values of Δ are (a2 - a1 + T) / 2 = 5 us or (a2 - a1 + 2T) / 2 = 15 us.
[0109] Furthermore, it can be known that the L value range corresponding to Δ = 5 us is n*T + 20 ± 5 us (Criterion 3), and the L value range corresponding to Δ = 15 us is n*T + 10 ± 5 us (Criterion 4). Since the roughly measured L value is about 83 us, and L can be expressed as 3*20 + 20 + 3 us, which is within the range of n*T + 20 ± 5 us, so the final value of Δ is 5 us.
[0110] Example 3:
[0111] In this example, an encapsulation example of a phase difference measurement message is proposed. For example, a new sub-TLV called phase-measurement sub-TLV (phase measurement sub-type length value) can be added to the performance measurement message of an OAM (Operations Administration and Maintenance) protocol that supports sub-TLV (sub-type-length-value) extension to carry the information required for the measurement phase difference message. For example, based on the G-Ach OAM performance measurement protocol, this application does not limit the specific measurement protocol used.
[0112] Figure 10 This is a schematic diagram of a sub-TLV encapsulation format according to a specific embodiment of the present invention, such as... Figure 10 As shown, the `type` field indicates that this sub-TLV is for measuring phase difference; the specific value is yet to be determined. The `length` field represents the length of the sub-TLV in octets (8-bit bytes), with a value of 12. The `cycle-length` field specifies the time slot length of the cycle template to be measured, in microseconds. For example, 10 indicates measuring the deviation over a 10µs cycle, occupying 4 octets. `offset-a1` represents the deviation value `a1` within the cycle received by the downstream node in the measurement message, occupying 4 octets. `offset-a2` represents the deviation measurement value `a2` within the cycle received by the upstream node in the returned measurement message, occupying 4 octets. `a2` can also be omitted from the message; in this case, the length field is 8 octets long.
[0113] As can be seen from the analysis of the foregoing embodiments, the method for determining phase difference proposed in this application can conveniently measure phase difference even in the absence of accurate link delay information. At the start of the periodic window, the upstream node sends a measurement message to the downstream node. The downstream node records the position of the measurement message within the periodic window, encapsulates the deviation value a1 into the measurement message, and sends the measurement message back to the upstream node at the start of the periodic window. The upstream node also records the position of the measurement message within the periodic window. Then, the upstream node can calculate the phase difference value based on the data recorded and carried in the measurement message using a certain calculation method.
[0114] It should also be noted that the phase difference measurement process and message encapsulation format listed in the above embodiments are merely illustrative examples and are not intended to limit this application.
[0115] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0116] This embodiment also provides a device for determining the phase difference, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0117] Figure 11 This is a structural block diagram of a device for determining phase difference according to an embodiment of the present invention, such as... Figure 11 As shown, the device includes:
[0118] Sending module 1102 is used to send a first message to a downstream node at the first start time of a predetermined target period template window, wherein the first message carries the target time slot length of the target period template.
[0119] The receiving module 1104 is used to receive a second message returned by the downstream node at the second start time of the target period template window, wherein the second message carries a first deviation value, the first deviation value is used to indicate the deviation of the receiving time of the downstream node in receiving the first message within the target period template, and the downstream node determines the target period template based on the target time slot length;
[0120] The determining module 1106 is used to determine the phase difference between the target period template used by the upstream node and the target period template used by the downstream node based on the target time slot length, the first deviation value and the second deviation value, wherein the second deviation value is used to indicate the deviation of the receiving time of the upstream node receiving the second message within the target period template.
[0121] In one exemplary embodiment, the determining module 1106 includes:
[0122] The first determining submodule is used to determine a second relationship between the phase difference and the target time slot length, the first deviation value and the second deviation value, based on a first relationship between the first deviation value and the second deviation value;
[0123] The second determining submodule is used to determine the range of link delay corresponding to each value of the phase difference when multiple values of the phase difference are determined based on the second relationship, thereby obtaining multiple link delay ranges, wherein the link delay is the link delay between the upstream node and the downstream node;
[0124] The third determining submodule is used to determine a unique value of the phase difference based on a third relationship between the estimated delay obtained by pre-estimating the link delay and each of the link delay ranges.
[0125] In one exemplary embodiment, the first determining submodule described above includes at least one of the following:
[0126] The first determining unit is configured to determine, when the first relationship indicates that the first deviation value is less than or equal to the second deviation value, that the second relationship satisfies the following formula: Δ=(a2+T-a1) / 2 or Δ=(a2-a1) / 2;
[0127] The second determining unit is configured to determine, when the first relationship indicates that the first deviation value is greater than the second deviation value, that the second relationship satisfies the following formula: Δ = (a2 + T - a1) / 2 or Δ = (a2 + 2T - a1) / 2; where Δ is the phase difference, T is the target time slot length, a1 is the first deviation value, and a2 is the second deviation value.
[0128] In an exemplary embodiment, the second determining submodule is configured to determine the range of link delay corresponding to each value of the phase difference by at least one of the following methods:
[0129] Given the phase difference Δ = (a2 - a1) / 2, the range of the link delay is determined as follows:
[0130] When the first relationship indicates that the first deviation value is less than or equal to the second deviation value, and the phase difference Δ = (a2 + T - a1) / 2, the range of the link delay is determined to be...
[0131] When the first relationship indicates that the first deviation value is greater than the second deviation value, and the phase difference Δ = (a2 + T - a1) / 2, the range of the link delay is determined to be...
[0132] Given the phase difference Δ = (a2 + 2T - a1) / 2, the range of the link delay is determined to be as follows:
[0133] Where n is an integer.
[0134] In one exemplary embodiment, the third determining submodule includes:
[0135] The third determining unit is used to determine a target link delay range from multiple link delay ranges based on the third relationship, wherein the target link delay range is the range into which the estimated delay falls;
[0136] The fourth determining unit is used to determine a unique value of the phase difference corresponding to the target link delay range.
[0137] In an exemplary embodiment, the first message includes a first type field and a first length field, wherein the first type field is used to indicate that the type of the first message is for measuring the phase difference, and the first length field is used to indicate the target time slot length.
[0138] In an exemplary embodiment, the second message includes a second type field, a second length field, and a compensation field, wherein the second type field is used to indicate that the type of the second message is for measuring the phase difference, the second length field is used to indicate the target time slot length, and the compensation field is used to indicate the first deviation value.
[0139] In one exemplary embodiment, the above-described apparatus further includes at least one of the following:
[0140] The storage module is used to store the phase difference to the local storage of the upstream node after determining the phase difference between the target period template used by the upstream node and the target period template used by the downstream node based on the target time slot length, the first deviation value, and the second deviation value.
[0141] The notification module is used to notify other network nodes of the phase difference after determining the phase difference between the target periodic template used by the upstream node and the target periodic template used by the downstream node based on the target time slot length, the first deviation value, and the second deviation value.
[0142] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0143] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed.
[0144] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0145] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.
[0146] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0147] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0148] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0149] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for determining phase difference, characterized in that, Applied to upstream nodes, including: At the first start time of the predetermined target period template window, a first message is sent to the downstream node, wherein the first message carries the target time slot length of the target period template; The downstream node receives a second message returned at the second start time of the target period template window. The second message carries a first deviation value, which is used to indicate the deviation of the receiving time of the downstream node in receiving the first message within the target period template. The downstream node determines the target period template based on the target time slot length. The phase difference between the target periodic template used by the upstream node and the target periodic template used by the downstream node is determined based on the target time slot length, the first deviation value, and the second deviation value, wherein the second deviation value is used to indicate the deviation of the receiving time of the upstream node receiving the second message within the target periodic template.
2. The method according to claim 1, characterized in that, Determining the phase difference between the target period template used by the upstream node and the target period template used by the downstream node based on the target time slot length, the first deviation value, and the second deviation value includes: A second relationship is determined based on a first relationship between the first deviation value and the second deviation value, and between the phase difference and the target time slot length, the first deviation value and the second deviation value; When multiple values of the phase difference are determined based on the second relationship, the range of link delay corresponding to each value of the phase difference is determined to obtain multiple link delay ranges, wherein the link delay is the link delay between the upstream node and the downstream node; The unique value of the phase difference is determined based on a third relationship between the estimated delay obtained by pre-estimating the link delay and each of the link delay ranges.
3. The method according to claim 2, characterized in that, The second relationship between the phase difference and the target time slot length, and between the first deviation value and the second deviation value, determined based on the first relationship between the first deviation value and the second deviation value, includes at least one of the following: When the first relationship is used to indicate that the first deviation value is less than or equal to the second deviation value, the second relationship is determined to satisfy the following formula: Δ=(a2+T-a1) / 2 or Δ=(a2-a1) / 2; When the first relationship is used to indicate that the first deviation value is greater than the second deviation value, the second relationship is determined to satisfy the following formula: Δ=(a2+T-a1) / 2 or Δ=(a2+2T-a1) / 2; Wherein, Δ is the phase difference, T is the target time slot length, a1 is the first deviation value, and a2 is the second deviation value.
4. The method according to claim 3, characterized in that, Determining the range of link delay corresponding to each value of the phase difference includes at least one of the following: Given the phase difference Δ = (a2 - a1) / 2, the range of the link delay is determined as follows: When the first relationship indicates that the first deviation value is less than or equal to the second deviation value, and the phase difference Δ = (a2 + T - a1) / 2, the range of the link delay is determined to be... When the first relationship indicates that the first deviation value is greater than the second deviation value, and the phase difference Δ = (a2 + T - a1) / 2, the range of the link delay is determined to be... Given the phase difference Δ = (a2 + 2T - a1) / 2, the range of the link delay is determined to be as follows: Where n is an integer.
5. The method according to claim 2, characterized in that, The unique value of the phase difference is determined based on a third relationship between the estimated delay obtained from a prior estimation of the link delay and each of the link delay ranges, including: Based on the third relationship, a target link delay range is determined from multiple link delay ranges, wherein the target link delay range is the range into which the estimated delay falls; A unique value for the phase difference corresponding to the target link delay range is determined.
6. The method according to claim 1, characterized in that, The first message includes a first type field and a first length field, wherein the first type field is used to indicate that the first message is of the type used to measure the phase difference, and the first length field is used to indicate the target time slot length.
7. The method according to claim 1, characterized in that, The second message includes a second type field, a second length field, and a compensation field. The second type field indicates that the second message is for measuring the phase difference, the second length field indicates the target time slot length, and the compensation field indicates the first deviation value.
8. The method according to claim 1, characterized in that, After determining the phase difference between the target period template used by the upstream node and the target period template used by the downstream node based on the target time slot length, the first deviation value, and the second deviation value, the method further includes at least one of the following: The phase difference is saved locally to the upstream node; The phase difference is then communicated to other network nodes.
9. A device for determining a phase difference, characterized in that, Applied to upstream nodes, including: The sending module is used to send a first message to the downstream node at the first start time of a predetermined target period template window, wherein the first message carries the target time slot length of the target period template. The receiving module is configured to receive a second message returned by the downstream node at the second start time of the target period template window, wherein the second message carries a first deviation value, the first deviation value being used to indicate the deviation of the receiving time of the downstream node in receiving the first message within the target period template, and the target period template being determined by the downstream node based on the target time slot length; The determining module is used to determine the phase difference between the target period template used by the upstream node and the target period template used by the downstream node based on the target time slot length, the first deviation value, and the second deviation value, wherein the second deviation value is used to indicate the deviation of the receiving time of the upstream node receiving the second message within the target period template.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in any one of claims 1 to 8.
11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1 to 8.
Citation Information
Patent Citations
Time synchronization precision determination method and system and electronic equipment
CN114221731A
Message forwarding method, forwarding equipment and computer readable medium
CN114430401A