Method and system for measuring signal frequency precision

By calculating the phase adjustment amount and actual phase of the target device during the PPS signal cycle, the problem of local clock signal frequency accuracy measurement in PTP clock synchronization is solved, and low-cost and high-flexible signal frequency accuracy measurement is achieved, suitable for the need for specialized pin scenario.

CN119172025APending Publication Date: 2024-12-20SHENZHEN PANGO MICROSYST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411110612.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

In the field of Precision Time Protocol (PTP) clock synchronization, prior art has difficulty directly measuring the frequency accuracy of local clock signals, especially when local clock signals cannot be output through device pins, limiting measurement flexibility and cost-effectiveness.

Method used

By calculating the phase adjustment amount during the PPS signal period generated by the target device, the actual phase of the two PPS signals is obtained, the frequency deviation of the local clock signal is calculated using these data, and the measurement is implemented using software algorithms to avoid the setting of special pins.

Benefits of technology

The cost reduction and flexibility of signal frequency accuracy measurement are achieved, and high-precision measurements can be performed without setting special pins to achieve 1ppb accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119172025A_ABST
    Figure CN119172025A_ABST
Patent Text Reader

Abstract

The invention provides a signal frequency precision measurement method and system, and the method comprises the steps: calculating the phase adjustment amount of a local clock signal generated by target equipment for any period of a PPS signal generated by the target equipment; if the phase adjustment amount is smaller than the period value of the PPS signals, acquiring two PPS signals associated with any period, and acquiring a first actual phase and a second actual phase of local clock signals corresponding to the two PPS signals respectively; and calculating the frequency deviation of the local clock signal according to the first actual phase, the second actual phase and the periodic value of the PPS signal. The embodiment of the invention mainly aims at reducing the cost of the signal frequency precision measurement method and enabling the measurement scene to be more flexible.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a method and system for measuring signal frequency accuracy. Background Art

[0002] In the field of Precision Time Protocol (PTP) clock synchronization, the master device (MasterDevice) periodically sends synchronization messages (Sync Messages) and records the precise sending timestamp when sending; after receiving the synchronization message, the slave device (Slave Device) records the receiving timestamp.

[0003] Among them, phase accuracy and frequency accuracy are two important indicators for evaluating the quality of local clock signals. In the prior art, a wire needs to be led out from the pin of the device to connect to a high-end oscilloscope, and the phase accuracy of the local clock signal can be measured using the high-end oscilloscope. However, in many cases, the local clock signal cannot be directly led out through the pin, and its accuracy cannot be measured by an instrument. Summary of the invention

[0004] The present invention provides a signal frequency accuracy measurement method and system, the main purpose of which is to reduce the cost of the signal frequency accuracy measurement method and make the measurement scenario more flexible.

[0005] In a first aspect, an embodiment of the present invention provides a method for measuring signal frequency accuracy, comprising:

[0006] For any period of the PPS signal generated by the target device, calculate the phase adjustment amount of the local clock signal generated by the target device;

[0007] If the phase adjustment amount is less than the period value of the PPS signal, then obtaining the two PPS signals associated with any one period, and obtaining the first actual phase and the second actual phase of the local clock signals respectively corresponding to the two PPS signals;

[0008] The frequency deviation of the local clock signal is calculated according to the first actual phase, the second actual phase, and the period value of the PPS signal.

[0009] Furthermore, the two PPS signals are respectively a first PPS signal and a second PPS signal, and the obtaining of the two PPS signals associated with any one cycle, and obtaining a first actual phase and a second actual phase of a local clock signal respectively corresponding to the two PPS signals, includes:

[0010] Acquire a first time corresponding to the first PPS signal and a first actual phase corresponding to the local clock signal at the first time;

[0011] A second time corresponding to the second PPS signal and a second actual phase corresponding to the local clock signal at the second time are obtained.

[0012] Further, calculating the frequency deviation of the local clock signal according to the first actual phase, the second actual phase, and the period value of the PPS signal includes:

[0013] Calculating an actual phase deviation according to the first actual phase and the second actual phase;

[0014] The frequency deviation is calculated according to the actual phase deviation and the period value.

[0015] Further, the frequency deviation of the local clock signal is calculated according to the first actual phase, the second actual phase, and the period value of the PPS signal, and is obtained by the following formula:

[0016] δ=(T n -T n-1 )*T;

[0017] Wherein, δ represents the frequency deviation, T n represents the first actual phase, T n-1 represents the second actual phase, and T represents the period value.

[0018] Further, the calculating the phase adjustment amount of the local clock signal generated by the target device includes:

[0019] Receive a time synchronization message periodically sent by a master device, and record a first timestamp of receiving the time synchronization message;

[0020] The phase adjustment amount is calculated according to a preset algorithm based on the first timestamp and a second timestamp when the master device sends the time synchronization message.

[0021] Furthermore, the preset algorithm includes PTP protocol, Kalman filter algorithm and least squares method.

[0022] Furthermore, it also includes:

[0023] The phase deviation of the local clock signal is calculated according to the frequency deviation.

[0024] In a second aspect, an embodiment of the present invention provides a signal frequency accuracy measurement system, comprising:

[0025] An adjustment module, configured to calculate a phase adjustment amount of a local clock signal generated by the target device for any period of a PPS signal generated by the target device;

[0026] A phase module, configured to obtain the two PPS signals associated with any one period if the phase adjustment amount is less than the period value of the PPS signal, and obtain a first actual phase and a second actual phase of the local clock signal respectively corresponding to the two PPS signals;

[0027] A calculation module is used to calculate the frequency deviation of the local clock signal according to the first actual phase, the second actual phase, and the period value of the PPS signal.

[0028] In a third aspect, an embodiment of the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned method for measuring signal frequency accuracy when executing the computer program.

[0029] In a fourth aspect, an embodiment of the present invention provides a computer storage medium, wherein the computer storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned method for measuring signal frequency accuracy are implemented.

[0030] The present invention proposes a method and system for measuring signal frequency accuracy. In a PPS signal generated by a target device, if in a certain PPS signal period, the phase adjustment amount of a local clock signal is less than the period value of the PPS signal, in this case, two PPS signals associated with the period are obtained, and the first actual phase and the second actual phase of the local clock signal respectively corresponding to the two PPS signals are obtained; then, according to the first actual phase and the second actual phase, combined with the period value of the PPS signal, the frequency deviation of the local clock signal is calculated. The signal frequency accuracy measurement method provided by an embodiment of the present invention only needs to obtain the first actual phase and the second actual phase of the local clock signal. Compared with the existing instrument measurement method, it only needs to be implemented through a software algorithm, which is lower in cost; in addition, it only needs to use the PPS signal generated by the target device, and there is no need to set a special pin, so that the use scenario of the measurement method is more flexible. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 A flow chart of a method for measuring signal frequency accuracy provided by an embodiment of the present invention;

[0032] Figure 2 A schematic diagram of a local clock signal and a PPS signal provided by an embodiment of the present invention;

[0033] Figure 3 A schematic diagram of the structure of a signal frequency accuracy measurement system provided by an embodiment of the present invention.

[0034] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0035] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.

[0036] In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.

[0037] In the embodiments of the present application, at least one refers to one or more; multiple refers to two or more. In the description of the present application, words such as "first", "second", "third", etc. are only used to distinguish the purpose of description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order. In addition, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0038] References to "one embodiment" or "some embodiments" etc. described in this specification mean that one or more embodiments of the present application include a particular feature, structure or characteristic described in conjunction with the embodiment. Thus, in this specification, the terms "include", "comprises", "has" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.

[0039] It should be noted that in the embodiments of the present application, "connection" can be understood as electrical connection, and the connection between two electrical components can be a direct or indirect connection between the two electrical components. For example, the connection between A and B can be either a direct connection between A and B or an indirect connection between A and B through one or more other electrical components.

[0040] Figure 1 A flow chart of a method for measuring signal frequency accuracy provided by an embodiment of the present invention, such as Figure 1 As shown, the method includes:

[0041] An embodiment of the present invention provides a method for measuring signal frequency accuracy. The method involves a hardware basis of a master device and a slave device. When the master device and the slave device perform clock synchronization, the master device periodically sends a message to the slave device and records an accurate sending timestamp when sending; after the slave device receives the message, it records a receiving timestamp, and the slave device calculates the phase deviation and frequency deviation based on the sending timestamp and the receiving timestamp, as well as a predetermined phase accuracy calculation method.

[0042] In the embodiment of the present invention, the target device can be a slave device or a master device, which can be determined according to actual conditions, and the embodiment of the present invention does not specifically limit this. In the embodiment of the present invention, the target device is described as a slave device.

[0043] It should be noted that the target device generates a clock signal and a PPS (Pulse Per Second) signal. The clock signal is also called a local clock signal, which can be understood as a clock signal generated inside the target device, such as a clock signal generated by a crystal oscillator, or a clock signal output after processing the clock signal generated by a crystal oscillator; the theoretical frequency of the local clock signal is pre-set. The PPS signal is a precise time signal, and the period of the PPS signal can be determined according to actual conditions, such as 1S, 2S, 3S, etc. Usually, the period value is 1S, that is, a PPS signal is generated per second.

[0044] S110, for any period of the PPS signal generated by the target device, calculating a phase adjustment amount of a local clock signal generated by the target device;

[0045] During the clock synchronization process between the target device and the master device, in any cycle of the PPS signal generated by the target device, the target device calculates the phase adjustment amount of the local clock signal of the target device according to the timestamp.

[0046] S120, if the phase adjustment amount is less than the period value of the PPS signal, obtaining two PPS signals associated with any one period, and obtaining a first actual phase and a second actual phase of local clock signals respectively corresponding to the two PPS signals;

[0047] In the embodiment of the present invention, after the phase adjustment amount is calculated, the phase adjustment amount is compared with the period value of the PPS signal, and the period value is preset. If the phase adjustment amount is smaller than the period value of the PPS signal, it means that the phase adjustment amount is small, and the phase adjustment amount is ignored. It can be considered that only the frequency of the local clock signal is adjusted during the clock synchronization process within the period.

[0048] When the condition is met, two PPS signals associated with the period of the PPS signal are acquired, and then a first actual phase and a second actual phase of local clock signals respectively corresponding to the two PPS signals are acquired.

[0049] S130: Calculate the frequency deviation of the local clock signal according to the first actual phase, the second actual phase, and the period value of the PPS signal.

[0050] Then, the frequency deviation of the local clock signal is calculated according to the first actual phase, the second actual phase, and the period value of the PPS signal.

[0051] The present invention proposes a method for measuring signal frequency accuracy. In a PPS signal generated by a target device, if in a certain PPS signal period, the phase adjustment amount of a local clock signal is less than the period value of the PPS signal, in this case, two PPS signals associated with the period are obtained, and the first actual phase and the second actual phase of the local clock signal respectively corresponding to the two PPS signals are obtained; then, according to the first actual phase and the second actual phase, combined with the period value of the PPS signal, the frequency deviation of the local clock signal is calculated. The signal frequency accuracy measurement method provided by an embodiment of the present invention only needs to obtain the first actual phase and the second actual phase of the local clock signal. Compared with the existing instrument measurement method, it only needs to be implemented through a software algorithm, which is lower in cost; in addition, it only needs to use the PPS signal generated by the target device, and does not need to set a special pin, so that the use scenario of the measurement method is more flexible.

[0052] As an implementation manner, the two PPS signals are respectively a first PPS signal and a second PPS signal, and the obtaining of the two PPS signals associated with any one cycle, and obtaining a first actual phase and a second actual phase of a local clock signal respectively corresponding to the two PPS signals, includes:

[0053] Acquire a first time corresponding to the first PPS signal and a first actual phase corresponding to the local clock signal at the first time;

[0054] A second time corresponding to the second PPS signal and a second actual phase corresponding to the local clock signal at the second time are obtained.

[0055] Figure 2 A schematic diagram of a local clock signal and a PPS signal provided by an embodiment of the present invention, such as Figure 2As shown, any period is the T period in the figure, and the two adjacent PPS signals associated with any period are the first PPS signal and the second PPS signal. The one earlier in time is called the first PPS signal, and the one later in time is called the second PPS signal. The time of the second PPS signal minus the time of the first PPS signal is the period value.

[0056] First, obtain the first time corresponding to the first PPS signal, and based on the first time, obtain the first actual phase of the local clock signal at this time; then obtain the second time corresponding to the second PPS signal, and based on the second time, obtain the second actual phase of the local clock signal at this time.

[0057] Among them, the first actual phase and the second actual phase can be read through the target device. Usually, the target device includes a central processing unit chip, such as a single-chip microcomputer, FPGA, etc. The central processing unit obtains the local clock signal at the first moment and reads the phase of the local clock signal, which is the first actual phase; obtains the local clock signal at the second moment, and reads the phase of the local clock signal, which is the second actual phase.

[0058] In the figure, the first actual phase is represented by Tn-1, and the second actual frequency is represented by Tn.

[0059] As an example, calculating the frequency deviation of the local clock signal according to the first actual phase, the second actual phase, and the period value of the PPS signal includes:

[0060] Calculating an actual phase deviation according to the first actual phase and the second actual phase;

[0061] The frequency deviation is calculated according to the actual phase deviation and the period value.

[0062] In an embodiment of the present invention, the target device communicates with the master device via the 1588 protocol. When the target device acts as a slave device, assuming that within the cycle time, the phase adjustment value of the local clock signal is less than the cycle value of the PPS signal, it can be considered that the local clock signal has not undergone a significant phase adjustment. It can be considered that within the cycle, the local clock signal has simply adjusted the signal frequency, and the phase has not changed.

[0063] Assuming that within the PPS period, the phase adjustment value of the local clock is ΔT, the frequency offset of the corresponding signal is Δf, the PPS signal period is T, and the frequency of the local clock is f, the following formula is satisfied:

[0064] ΔT / T=Δf / f;(1)

[0065] The frequency deviation δ of the local clock signal satisfies the relationship:

[0066] δ=Δf / f;(2)

[0067] Assuming that the time point of the previous pulse trigger of PPS is Tn-1, and the time point of the next pulse trigger is Tn, the following relationship is satisfied:

[0068] ΔT=Tn–Tn-1;(3)

[0069] Combining the above formulas, we can get:

[0070] δ=Δf / f=ΔT / T=(Tn–Tn-1) / T; (4)

[0071] Based on the above principle, the frequency of the local clock signal can be determined by measuring the rate of change of the phase per unit time.

[0072] As an implementation manner, the calculating the phase adjustment amount of the local clock signal generated by the target device includes:

[0073] Receive a time synchronization message periodically sent by a master device, and record a first timestamp of receiving the time synchronization message;

[0074] The phase adjustment amount is calculated according to a preset algorithm based on the first timestamp and a second timestamp when the master device sends the time synchronization message.

[0075] In an embodiment of the present invention, a master device periodically sends a time synchronization message to a slave device and records a first timestamp of the time synchronization message; the slave device receives the time synchronization message and the first timestamp, and the slave device also records a second timestamp of receiving the time synchronization message, and calculates a phase adjustment amount of a local clock signal based on the first timestamp, the second timestamp, and a preset algorithm.

[0076] For example, in the embodiment of the present invention, the master device and the target device comply with the IEEE 1588v2 protocol. The IEEE 1588v2 protocol defines a precision time protocol (PTP), which is also used for clock synchronization. In the 1588 master-slave synchronization system, the processing process of the time synchronization message is roughly as follows:

[0077] (1) The master device sends a "sync" message to the slave device and records the sending time t1 into the register. t1 is the second timestamp.

[0078] (2) The slave device receives the "sync" message and records the receiving time t2, which is the first timestamp. The "sync" message is the time synchronization message.

[0079] (3) The master device sends a "follow_up" message to the slave device, embedding the time t1 into the follow_up message.

[0080] (4) The slave device sends a "delay_req" message to the master device and embeds the timestamp t3.

[0081] (5) The master device receives the "delay_req" message and remembers the time t4.

[0082] (6) The master device embeds t4 into the "delay_resp" message and sends it to the slave device.

[0083] The slave device receives the t1 and t3 timestamps carried in the sync message and delay_req message sent by the master device, and calculates the phase adjustment amount in combination with the locally recorded t2 and t4 timestamps and a preset algorithm. In the embodiment of the present invention, the target device can calculate the delay and time offset between the slave device and the master device based on these four timestamps, thereby correcting the local clock signal of the slave device to achieve synchronization.

[0084] By way of example, the preset algorithms include PTP protocol, Kalman filter algorithm and least squares method.

[0085] In the embodiment of the present invention, the first timestamp and the second timestamp are acquired, and then the phase adjustment amount of the PPS signal is calculated according to any one of the PTP protocol, Kalman filtering and the least square method.

[0086] Among them, the PTP protocol: by exchanging time synchronization messages between the master and slave devices and recording the time when the time synchronization messages are sent, the network transmission delay and the deviation of the clocks between the master and slave devices are calculated. The master device periodically sends time synchronization messages, and then sends follow_up messages to record the actual sending time; after receiving the time synchronization message, the slave clock records the time and sends a delay_req message. After receiving the message, the master clock records the time and sends a delay_resp message. The slave clock adjusts the local clock according to the measurement results of the network round-trip delay and clock deviation.

[0087] Kalman filter algorithm: In clock synchronization, the phase deviation or frequency deviation of the clock can be used to estimate the system state. By performing Kalman filtering on the measured time difference data, the phase adjustment amount can be estimated more accurately while taking into account the measurement noise and the dynamic characteristics of the system.

[0088] Least squares method: can be used to fit data to find the best linear relationship. In clock synchronization, the least squares method can be used to fit the phase relationship between the master and slave clocks based on multiple timestamp measurements, thereby calculating the phase adjustment.

[0089] The signal frequency accuracy measurement method provided in the embodiment of the present invention only needs to obtain the first actual phase and the second actual phase of the local clock signal. Compared with the existing instrument measurement method, it only needs to be implemented through a software algorithm, which is lower in cost. In addition, it only needs to use the PPS signal generated by the target device, and there is no need to set a special pin, which makes the use scenario of the measurement method more flexible. Finally, the embodiment of the present invention has a higher accuracy, which can reach 1ppb.

[0090] Figure 3 A schematic diagram of the structure of a signal frequency accuracy measurement system provided by an embodiment of the present invention, such as Figure 3 As shown, the system includes:

[0091] An adjustment module 310, configured to calculate a phase adjustment amount of a local clock signal generated by a target device for any period of a PPS signal generated by the target device;

[0092] A phase module 320 is configured to obtain the two PPS signals associated with any one period if the phase adjustment amount is less than the period value of the PPS signal, and obtain a first actual phase and a second actual phase of the local clock signal respectively corresponding to the two PPS signals;

[0093] The calculation module 330 is used to calculate the frequency deviation of the local clock signal according to the first actual phase, the second actual phase, and the period value of the PPS signal.

[0094] This embodiment is a system embodiment corresponding to the above method embodiment, and its implementation process is the same as that of the above method embodiment. For details, please refer to the above method embodiment, and this system embodiment does not make specific limitations on this.

[0095] Each module in the above-mentioned signal frequency accuracy measurement system can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0096] An embodiment of the present invention provides a computer device, which may be a server. The computer device includes a processor, a memory, a network interface, and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a computer storage medium and an internal memory. The computer storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the computer storage medium. The database of the computer device is used to store data generated or obtained during the execution of a method for measuring the frequency accuracy of a signal. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for measuring the frequency accuracy of a signal is implemented.

[0097] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of a signal frequency accuracy measurement method in the above embodiment when executing the computer program. Alternatively, the processor implements the functions of each module / unit in the embodiment of a signal frequency accuracy measurement system when executing the computer program.

[0098] In one embodiment, a computer storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of a signal frequency accuracy measurement method in the above embodiment are implemented. Alternatively, when the computer program is executed by a processor, the functions of each module / unit in the above embodiment of a signal frequency accuracy measurement system are implemented.

[0099] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0100] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0101] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A method for measuring signal frequency accuracy, characterized in that: include: For any period of the PPS signal generated by the target device, calculate the phase adjustment amount of the local clock signal generated by the target device; If the phase adjustment amount is less than the period value of the PPS signal, then obtaining the two PPS signals associated with any one period, and obtaining the first actual phase and the second actual phase of the local clock signals respectively corresponding to the two PPS signals; The frequency deviation of the local clock signal is calculated according to the first actual phase, the second actual phase, and the period value of the PPS signal.

2. The method for measuring signal frequency accuracy according to claim 1, characterized in that: The two PPS signals are respectively a first PPS signal and a second PPS signal, and the obtaining of the two PPS signals associated with any one cycle, and obtaining a first actual phase and a second actual phase of a local clock signal respectively corresponding to the two PPS signals, comprises: Acquire a first time corresponding to the first PPS signal and a first actual phase corresponding to the local clock signal at the first time; A second time corresponding to the second PPS signal and a second actual phase corresponding to the local clock signal at the second time are obtained.

3. The method for measuring signal frequency accuracy according to claim 1, characterized in that: The calculating the frequency deviation of the local clock signal according to the first actual phase, the second actual phase, and the period value of the PPS signal includes: Calculating an actual phase deviation according to the first actual phase and the second actual phase; The frequency deviation is calculated according to the actual phase deviation and the period value.

4. The method for measuring signal frequency accuracy according to claim 3, characterized in that: The frequency deviation of the local clock signal is calculated according to the first actual phase, the second actual phase, and the period value of the PPS signal, and is obtained by the following formula: δ=(T n -T n-1 )*T; Wherein, δ represents the frequency deviation, T n represents the first actual phase, T n-1 represents the second actual phase, and T represents the period value.

5. The method for measuring signal frequency accuracy according to claim 1, characterized in that: The calculating the phase adjustment amount of the local clock signal generated by the target device includes: Receive a time synchronization message periodically sent by a master device, and record a first timestamp of receiving the time synchronization message; The phase adjustment amount is calculated according to a preset algorithm based on the first timestamp and a second timestamp when the master device sends the time synchronization message.

6. The method for measuring signal frequency accuracy according to claim 5, characterized in that: The preset algorithms include PTP protocol, Kalman filter algorithm and least squares method.

7. The method for measuring signal frequency accuracy according to claim 1, characterized in that: Also includes: The phase deviation of the local clock signal is calculated according to the frequency deviation.

8. A signal frequency accuracy measurement system, characterized in that: include: An adjustment module, configured to calculate a phase adjustment amount of a local clock signal generated by the target device for any period of a PPS signal generated by the target device; A phase module, configured to obtain the two PPS signals associated with any one period if the phase adjustment amount is less than the period value of the PPS signal, and obtain a first actual phase and a second actual phase of the local clock signals respectively corresponding to the two PPS signals; A calculation module is used to calculate the frequency deviation of the local clock signal according to the first actual phase, the second actual phase, and the period value of the PPS signal.

9. A computer 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, the steps of the method for measuring signal frequency accuracy according to any one of claims 1 to 7 are implemented.

10. A computer storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for measuring signal frequency accuracy according to any one of claims 1 to 7 are implemented.