Time synchronization method, system and device based on 1588 protocol and medium

Through the time synchronization method based on the 1588 protocol, the time stamp is generated using the precise time signal of the clock source and the preset clock frequency calculation, which solves the problems of high maintenance costs, insufficient security, limited synchronization accuracy and stability in the prior art. , achieving high precision and stable time synchronization.

CN119402123APending Publication Date: 2025-02-07深圳市三旺通信股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411538669.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

The existing time synchronization technology solutions have high maintenance costs, insufficient security, and limited synchronization accuracy and stability.

Method used

The time synchronization method based on the 1588 protocol is adopted, by receiving the precise time signal from the clock source, analyzing the UTC time information, and combining the preset clock frequency calculation to generate the time stamp to achieve high-precision time synchronization. At the same time, identify the message type and execute the corresponding processing policy to ensure reliable transmission of messages.

Benefits of technology

High precision and stable time synchronization are achieved, reducing maintenance costs, improving safety, and reducing equipment costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119402123A_ABST
    Figure CN119402123A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of time synchronization, and discloses a time synchronization method, system and device based on a 1588 protocol and a medium, the time synchronization method based on the 1588 protocol comprises the following steps: firstly, analyzing standard UTC time information by receiving a precise time signal from a clock source; and accurately calculating a timestamp by utilizing the UTC time information and combining a preset clock frequency so as to realize high-precision time synchronization. When the message transmitted by the CPU is received, the type of the message can be identified immediately, and a corresponding processing strategy is executed according to the type, so that the message is ensured to be reliably transmitted to a physical link layer. According to the time synchronization method based on the 1588 protocol, through nanosecond-level timestamp calculation, highly accurate and stable time synchronization can be achieved, and strict precision requirements are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of time synchronization technology, and in particular to a time synchronization method, system, device and medium based on 1588 protocol. Background Art

[0002] With the rapid development of network measurement, industrial control, wireless communication and other fields, the time synchronization problem in distributed networks has become increasingly prominent. As an efficient and accurate time synchronization technology solution, the Precision Time Protocol (PTP) defined by IEEE1588 has gradually become the mainstream choice in these fields. The PTP protocol establishes a clock hierarchy structure in the network to achieve synchronization of different devices on a unified network time base, significantly improving the system's time synchronization performance.

[0003] However, due to the high complexity of the field of time synchronization technology, traditional time synchronization solutions often involve complex network topologies, resulting in high system maintenance costs and low efficiency. At the same time, with the increasing severity of security threats such as network attacks and data tampering, traditional solutions have obvious deficiencies in security. In addition, high-precision time synchronization equipment is expensive, which increases the overall cost of the system and limits the application of these devices in some cost-sensitive fields.

[0004] Therefore, for example, how to reduce maintenance costs, improve safety and reduce equipment costs while ensuring synchronization accuracy has become an important issue that needs to be solved urgently. Summary of the invention

[0005] In view of this, the embodiments of the present application provide a time synchronization method, system, industrial switch and medium based on the 1588 protocol, which can effectively solve the problems of high maintenance cost, insufficient security, limited synchronization accuracy and stability of existing time synchronization technical solutions.

[0006] In a first aspect, an embodiment of the present application provides a time synchronization method based on the 1588 protocol, including:

[0007] Obtaining a time signal from a clock source, parsing the time signal, and obtaining UTC time information;

[0008] Using the UTC time information and a preset clock frequency, a timestamp is calculated and generated to achieve time synchronization;

[0009] When a message sent by the CPU is received, the message type is determined, and a corresponding processing strategy is executed based on the message type to send the message to the physical link.

[0010] In some embodiments, acquiring a time signal from a clock source, parsing the time signal, and obtaining UTC time information includes:

[0011] The time signal is parsed to obtain UTC second time information.

[0012] In some embodiments, the using of the UTC time information in combination with a preset clock frequency to calculate and generate a timestamp to achieve time synchronization includes:

[0013] Using the UTC second time information and the preset clock frequency, a nanosecond level timestamp is calculated and generated to achieve high-precision time synchronization;

[0014] The preset clock frequency ranges from 125 MHz to 156.25 MHz.

[0015] In some embodiments, executing a corresponding processing strategy based on the message type includes:

[0016] When the message is a SYNC message, executing a first processing strategy;

[0017] When the message is a common type message, the second processing strategy is executed.

[0018] In some embodiments, when the message is a SYNC message, executing a first processing strategy includes:

[0019] When the message type is a SYNC message, obtaining a current real-time timestamp and obtaining an execution time of writing the real-time timestamp into the SYNC message and updating a CRC check value;

[0020] The real-time timestamp plus the execution time is used as a sending timestamp and written into the SYNC message.

[0021] In some embodiments, when the message is a common message, executing the second processing strategy includes:

[0022] The common type message is directly sent to the physical link.

[0023] In some embodiments, after adding the execution time to the real-time timestamp as the sending timestamp and writing the timestamp into the SYNC message, the method further includes:

[0024] The CRC check value in the SYNC message is updated, and after the updating is completed, the updated SYNC message is sent to the physical link.

[0025] In a second aspect, an embodiment of the present application provides a time synchronization system based on the 1588 protocol, including:

[0026] PHY module, clock source module, CPU module;

[0027] The PHY module is used to obtain the time signal from the clock source module, parse the time signal, and obtain UTC time information;

[0028] And, using the UTC time information in combination with a preset clock frequency, a timestamp is calculated and generated to achieve time synchronization;

[0029] The CPU module is used to send messages to the PHY module;

[0030] The PHY module is further configured to determine a message type of the message and execute a corresponding processing strategy based on the message type to send the message to a physical link.

[0031] In a third aspect, an embodiment of the present application provides an industrial switch, the industrial switch comprising a processor and a memory, the memory storing a computer program, the processor being used to execute the computer program to implement the time synchronization method based on the 1588 protocol of the first aspect.

[0032] In a fourth aspect, an embodiment of the present application provides a computer-readable medium, and when the computer program is executed on a processor, the time synchronization method based on the 1588 protocol of the above-mentioned first aspect is implemented.

[0033] The embodiments of the present application have, for example, the following beneficial effects:

[0034] The present application discloses a time synchronization method, system, industrial switch and medium based on the 1588 protocol. First, by receiving the precise time signal from the clock source, the standard UTC time information is parsed. Using the UTC time information, combined with the preset clock frequency, the timestamp is accurately calculated to achieve high-precision time synchronization. When a message from the CPU is received, the message type can be instantly identified, and the corresponding processing strategy is executed according to the type to ensure that the message is reliably transmitted to the physical link layer. The time synchronization method based on the 1588 protocol proposed in the present application can achieve highly accurate and stable time synchronization through nanosecond-level timestamp calculation, meeting strict accuracy requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0036] Figure 1 A flow chart of a time synchronization method based on the 1588 protocol according to an embodiment of the present application is shown;

[0037] Figure 2 Another flow chart of a time synchronization method based on 1588 protocol according to an embodiment of the present application is shown;

[0038] Figure 3 Another flow chart of a time synchronization method based on 1588 protocol according to an embodiment of the present application is shown;

[0039] Figure 4 A schematic diagram of the structure of a time synchronization system based on the 1588 protocol according to an embodiment of the present application is shown;

[0040] Figure 5 Another structural schematic diagram of a time synchronization system based on the 1588 protocol according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0041] The technical solutions in the embodiments of the present application will be described clearly and completely 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.

[0042] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0043] Hereinafter, the terms "including", "having" and their cognates that can be used in various embodiments of the present application are intended only to indicate specific features, numbers, steps, operations, elements, components or a combination of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or a combination of the foregoing items or increasing the possibility of one or more features, numbers, steps, operations, elements, components or a combination of the foregoing items. In addition, the terms "first", "second", "third" and the like are only used to distinguish descriptions and cannot be understood as indicating or implying relative importance.

[0044] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as, for example, terms defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.

[0045] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0046] Taking into account the problems of high maintenance cost, insufficient security, limited synchronization accuracy and stability of existing time synchronization technical solutions, a time synchronization method based on the 1588 protocol is proposed. First, by receiving the precise time signal from the clock source, the standard UTC time information is parsed. Using the UTC time information, combined with the preset clock frequency, the timestamp is accurately calculated to achieve high-precision time synchronization. When a message from the CPU is received, the message type can be instantly identified, and the corresponding processing strategy is executed according to the type to ensure that the message is reliably transmitted to the physical link layer. The time synchronization method based on the 1588 protocol proposed in this application can achieve highly accurate and stable time synchronization through nanosecond-level timestamp calculation, meeting strict accuracy requirements.

[0047] Figure 1 A flow chart of a time synchronization method based on the 1588 protocol in an embodiment of the present application is shown. The time synchronization method based on the 1588 protocol includes the following steps:

[0048] Step S100, obtaining a time signal from a clock source, parsing the time signal, and obtaining UTC time information.

[0049] Exemplarily, high-precision time signals are obtained from the clock source, including but not limited to 1PPS signal (one pulse per second) and TOD (time and date information). The acquired 1PPS signal and TOD signal are parsed using the PHY chip, such as signal decoding, format conversion, error correction and other operations. Through parsing, the standard time that conforms to the Coordinated Universal Time (UTC) is obtained, such as the current second and other accurate time reference information. UTC is a global standard time that is widely used in various application scenarios such as computer network synchronization, financial market timestamp recording, and satellite communications.

[0050] Exemplarily, the clock source can be a device such as a GPS receiver, a network time protocol (NTP) server or an atomic clock, which is used to provide a high-precision time signal to mark the time with a precise frequency. The time signal refers to a 1PPS signal and a TOD signal, wherein the 1PPS signal (1Pulse Per Second) provides the starting point of each second, and marks the beginning of each second by a pulse to ensure the accuracy of synchronization; the TOD signal (Time Of Day) provides specific time information, including the current UTC time information of hours, minutes and seconds, and is usually transmitted in a serial data stream or a data packet format in a specific format.

[0051] In an optional embodiment, in step S100, obtaining a time parameter signal from a clock source, parsing the time signal, and obtaining UTC time information includes:

[0052] Parse the time signal and obtain UTC seconds time information.

[0053] For example, parsing the 1PPS signal can determine the start time of each second, and parsing the TOD signal can obtain specific UTC time data (hours, minutes, seconds). By combining the 1PPS and TOD signal information, the system can obtain accurate UTC seconds.

[0054] Step S200, using UTC time information in combination with a preset clock frequency, a timestamp is calculated and generated to achieve time synchronization.

[0055] Exemplarily, the clock frequency is used to provide a high-precision time reference. The PHY chip uses the UTC time information and the preset clock frequency to calculate the precise timestamp of the current time. The generated timestamp is used for time synchronization operations. That is, accurate time synchronization between devices is achieved through the calculated timestamp.

[0056] In an optional embodiment, in step S200, using UTC time information in combination with a preset clock frequency, a timestamp is calculated and generated to achieve time synchronization, including:

[0057] Using UTC second time information and a preset clock frequency, a nanosecond level timestamp is calculated and generated to achieve high-precision time synchronization; for example, the preset clock frequency range is 125 MHz or 156.25 MHz.

[0058] Demonstratively, the UTC second time information parsed by the PHY chip can be used to calculate the number of nanoseconds in the current UTC second time according to the preset clock frequency, thereby generating a nanosecond-level timestamp. It is worth noting that the clock frequency directly affects the accuracy of the calculation. For example, the clock frequency corresponding to the 1G network port is 125Mhz. Therefore, when the 125MHz clock frequency is input, the calculated nanosecond accuracy can reach 8 nanoseconds; the clock frequency corresponding to the 10G network port is 156.25Mhz. Therefore, when the 156.25MHz clock frequency is input, the accuracy can reach 6.4 nanoseconds. The generated nanosecond timestamp is used to achieve high-precision time synchronization, ensuring that all devices maintain a highly consistent time base. This synchronization is critical for application scenarios that require extremely high time accuracy.

[0059] Step S300, when receiving a message sent by the CPU, determining the type of the message, and executing a processing strategy corresponding to the message type based on the type of the message, so as to send the message to the physical link.

[0060] Exemplarily, when the PHY chip receives a message sent by the CPU, it first detects and determines the type of the received message. For example, it determines whether it is a SYNC message for time synchronization or another type of message. According to the message type, the chip executes a corresponding processing strategy, for example, for a SYNC message, a first processing strategy is executed; for a normal type of message, a second processing strategy is executed. After the processing is completed, the message is sent to the physical link.

[0061] In an optional embodiment, for example, Figure 2 As shown, in step S300, when a message sent by the CPU is received, the type of the message is determined, and a processing strategy corresponding to the message type is executed based on the type of the message to send the message to the physical link, including:

[0062] Step S310: When the message is a SYNC message, execute the first processing strategy.

[0063] Exemplarily, when the PHY chip receives a message sent by the CPU, it first detects and determines the message type, for example, whether it is a SYNC message for time synchronization or another type of message (for example, a FOLLOW_UP following message). For example, if the message is a SYNC message, the first processing strategy is executed. The strategy generally includes steps such as calculating and writing a sending timestamp, updating a CRC check value of the message, and sending the SYNC message to the physical link after the processing is completed.

[0064] Step S310: When the message is a common type message, execute the second processing strategy.

[0065] Exemplarily, if the received message is of a common type, the second processing strategy is executed. The second processing strategy usually includes a simplified processing logic, for example, directly sending the message to the physical link without additional timestamp or verification processing.

[0066] In an optional embodiment, for example, Figure 3 As shown, in step S310, when the message is a SYNC message, a first processing strategy is executed, including:

[0067] Step S311, when the message type is a SYNC message, obtain the current real-time timestamp and the execution time of writing the real-time timestamp into the SYNC message and updating the CRC check value.

[0068] Exemplarily, the real-time timestamp is used to record the UTC time reference when the message arrives, which is important time data. When the message type is a SYNC message, the system obtains the current real-time timestamp and writes it into the SYNC message, while updating the CRC check value. The execution time of writing the timestamp and updating the CRC is usually related to the clock frequency of the PHY chip. For example, at a frequency of 125MHz, each clock cycle is 8 nanoseconds; at 156.25MHz, each cycle is 6.4 nanoseconds. Therefore, the execution time of timestamp writing and CRC updating is determined by a fixed clock cycle and does not change over time.

[0069] Step S312: The real-time timestamp plus the execution time is used as the sending timestamp and written into the SYNC message.

[0070] Exemplarily, first, the accurate send timestamp is calculated by adding the current real-time timestamp to the time of writing the SYNC message and updating the CRC check value. This send timestamp represents the expected time point when the message is sent on the physical link. The calculation process takes into account the operation delay to ensure that the send timestamp reflects the actual sending time of the message as accurately as possible. Next, the obtained send timestamp is written into the relevant field of the SYNC message for the receiving end to use for subsequent time synchronization processing.

[0071] In an optional embodiment, in step S320, when the message is a common message, executing a second processing strategy includes:

[0072] Sends normal type messages to the physical link.

[0073] Exemplarily, when the PHY chip receives a normal type message sent by the CPU, it will directly send the message to the physical link without additional processing steps, such as timestamp addition or CRC update. This direct transmission method is suitable for normal messages that do not involve time synchronization or other special processing requirements, thereby reducing processing delays and improving the efficiency of message transmission. Normal type messages are usually used to transmit regular data or control information, and do not rely on accurate timestamp information, so fast transmission can be achieved through this simplified process.

[0074] In an optional embodiment, in step S300, the real-time timestamp plus the execution time is used as the sending timestamp and written into the SYNC message, and then includes:

[0075] Update the CRC check value in the SYNC message, and after the update is completed, send the updated SYNC message to the physical link.

[0076] Exemplarily, CRC (Cyclic Redundancy Check) is an algorithm used to detect data transmission errors. It generates and verifies specific check values ​​to ensure that the message has not been damaged or tampered with during transmission. After the CRC check value in the SYNC message is updated, the message contains the latest timestamp information and the updated CRC check value, indicating that the message content is ready for reliable transmission. At this time, the updated SYNC message is sent to the physical link. The physical link is responsible for the actual transmission process, transmitting the message from the sender to the receiver, and confirming the integrity of the message by verifying the CRC check value at the receiver, thereby achieving accurate and reliable time synchronization.

[0077] The time synchronization method based on the 1588 protocol of the embodiment of the present application, first, parses the standard UTC time information by receiving the accurate time signal from the clock source. Using the UTC time information, combined with the preset clock frequency, the timestamp is accurately calculated to achieve high-precision time synchronization. When a message from the CPU is received, the message type is instantly identified, and the corresponding processing strategy is executed according to the type to ensure that the message is reliably transmitted to the physical link layer. The time synchronization method based on the 1588 protocol proposed in the present application can achieve highly accurate and stable time synchronization through nanosecond-level timestamp calculation, meeting strict accuracy requirements.

[0078] It is worth noting that the values ​​of the above parameters are only examples and can be adaptively adjusted according to specific circumstances.

[0079] This application also proposes a time synchronization system based on the 1588 protocol, such as Figure 4 As shown, the time synchronization system includes: a PHY module, a clock source module, and a CPU module;

[0080] The PHY module is used to obtain the time signal from the clock source module, parse the time signal, and obtain UTC time information;

[0081] and, using the UTC time information in combination with a preset clock frequency, calculating and generating a timestamp to achieve time synchronization;

[0082] The CPU module is used to send messages to the PHY module;

[0083] The PHY module is also used to determine the message type of the message and execute a corresponding processing strategy based on the message type to send the message to the physical link.

[0084] Exemplarily, corresponding to the above method embodiment, as Figure 5 As shown, in an embodiment of the present application, the PHY module has a built-in PHY chip and an integrated time synchronization interface, so that the PHY chip can obtain time signals from an external high-precision clock source through the time synchronization interface, such as 1PPS signals and TOD signals, which enable the PHY chip to obtain the global UTC time reference. To achieve nanosecond time synchronization, the PHY chip will parse the 1PPS signal and TOD signal and extract the UTC second information. Then, combined with the preset clock frequency provided by the high-precision clock source, for example, 125MHz or 156.25MHz, a nanosecond timestamp is generated within each UTC second.

[0085] When the PHY chip receives a message sent by the CPU, it selects a processing strategy based on the message type. For example, for a SYNC message, the PHY chip obtains the real-time timestamp when it arrives and calculates the execution time required to write the timestamp and update the CRC check value. Then, the real-time timestamp is added to the execution time to generate a sending timestamp and write it into the SYNC message. After completion, the CRC check value is updated and the updated SYNC message is sent to the physical link.

[0086] For ordinary messages, the PHY chip directly sends them to the physical link without additional processing. The time synchronization system based on the 1588 protocol in this application achieves nanosecond-level time synchronization accuracy at a relatively low cost, effectively ensuring the high accuracy and stability of time synchronization.

[0087] It can be understood that the time synchronization system of this embodiment corresponds to a time synchronization method based on the 1588 protocol in the above embodiment, and the options in the above embodiment are also applicable to this embodiment, so they will not be described repeatedly here.

[0088] The present application also provides an industrial switch. Exemplarily, the industrial switch includes a processor and a memory, wherein the memory stores a computer program, and the processor runs the computer program to enable the terminal device to execute the above-mentioned time synchronization method based on the 1588 protocol or the functions of each module in the above-mentioned time synchronization method based on the 1588 protocol.

[0089] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU) and a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or at least one of other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.

[0090] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The memory is used to store a computer program, and the processor may execute the computer program accordingly after receiving an execution instruction.

[0091] The present application also provides a computer-readable medium for storing the computer program used in the above-mentioned terminal device. For example, the computer-readable medium may include but is not limited to: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0092] In several embodiments provided in the present application, it should be understood that the disclosed system and method can also be implemented in other ways. The system embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0093] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0094] The functions, for example, if implemented in the form of software function modules and sold or used as independent products, can be stored in a computer-readable medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a medium and includes several instructions for enabling an industrial switch (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application.

[0095] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.

Claims

1. A time synchronization method based on 1588 protocol, characterized in that: The method comprises: Obtaining a time signal from a clock source, parsing the time signal, and obtaining UTC time information; Using the UTC time information and a preset clock frequency, a timestamp is calculated and generated to achieve time synchronization; When a message sent by the CPU is received, the message type is determined, and a corresponding processing strategy is executed based on the message type to send the message to the physical link.

2. The time synchronization method based on 1588 protocol according to claim 1, characterized in that: The step of acquiring a time signal from a clock source, parsing the time signal, and obtaining UTC time information includes: The time signal is parsed to obtain UTC seconds time information.

3. The time synchronization method based on 1588 protocol according to claim 2 is characterized in that: The using of the UTC time information in combination with a preset clock frequency to calculate and generate a timestamp to achieve time synchronization includes: Using the UTC second time information and the preset clock frequency, a nanosecond level timestamp is calculated and generated to achieve high-precision time synchronization; The preset clock frequency ranges from 125 MHz to 156.25 MHz.

4. The time synchronization method based on 1588 protocol according to claim 1, characterized in that: The executing a corresponding processing strategy based on the message type includes: When the message is a SYNC message, executing a first processing strategy; When the message is a common type message, the second processing strategy is executed.

5. The time synchronization method based on 1588 protocol according to claim 4, characterized in that: When the message is a SYNC message, executing a first processing strategy includes: When the message type is a SYNC message, obtaining a current real-time timestamp and obtaining an execution time of writing the real-time timestamp into the SYNC message and updating a CRC check value; The real-time timestamp plus the execution time is used as a sending timestamp and written into the SYNC message.

6. The time synchronization method based on 1588 protocol according to claim 4, characterized in that: When the message is a common message, executing the second processing strategy includes: The common type message is directly sent to the physical link.

7. The time synchronization method based on 1588 protocol according to claim 5, characterized in that: After adding the execution time to the real-time timestamp as the sending timestamp and writing the timestamp into the SYNC message, the method further includes: The CRC check value in the SYNC message is updated, and after the updating is completed, the updated SYNC message is sent to the physical link.

8. A time synchronization system based on 1588 protocol, characterized in that: The system comprises: a PHY module, a clock source module, and a CPU module; The PHY module is used to obtain the time signal from the clock source module, parse the time signal, and obtain UTC time information; And, using the UTC time information in combination with a preset clock frequency, a timestamp is calculated and generated to achieve time synchronization; The CPU module is used to send messages to the PHY module; The PHY module is further configured to determine a message type of the message and execute a corresponding processing strategy based on the message type to send the message to a physical link.

9. An industrial switch, characterized in that: The industrial switch comprises a processor and a memory, wherein the memory stores a computer program, and the processor is configured to execute the computer program to implement the 1588 protocol-based time synchronization method according to any one of claims 1 to 7.

10. A computer-readable medium, characterized in that The device stores a computer program, which, when executed on a processor, implements the 1588 protocol-based time synchronization method according to any one of claims 1-7.