CN112491491A - Clock synchronization method, device, storage medium and system based on Ethernet cable - Google Patents

Clock synchronization method, device, storage medium and system based on Ethernet cable Download PDF

Info

Publication number
CN112491491A
CN112491491A CN202011471619.2A CN202011471619A CN112491491A CN 112491491 A CN112491491 A CN 112491491A CN 202011471619 A CN202011471619 A CN 202011471619A CN 112491491 A CN112491491 A CN 112491491A
Authority
CN
China
Prior art keywords
network transformer
clock
frequency
terminal
ethernet cable
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011471619.2A
Other languages
Chinese (zh)
Inventor
陈昌明
李志宏
范科伟
明淼晶
林纬园
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Anjili New Technology Co ltd
Original Assignee
Shenzhen Anjili New Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Anjili New Technology Co ltd filed Critical Shenzhen Anjili New Technology Co ltd
Priority to CN202011471619.2A priority Critical patent/CN112491491A/en
Publication of CN112491491A publication Critical patent/CN112491491A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0602Systems characterised by the synchronising information used
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B3/00Line transmission systems
    • H04B3/54Systems for transmission via power distribution lines
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Power Engineering (AREA)
  • Small-Scale Networks (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

The invention provides a clock synchronization method based on an Ethernet cable, wherein a first network transformer and a second network transformer are arranged between two terminals connected through the Ethernet cable, one terminal is connected with the first network transformer through the Ethernet cable, the other terminal is connected with the second network transformer through the Ethernet cable, the first network transformer and the second network transformer are connected through a twisted pair, the terminals and the network transformers are communicated through differential signals, a communication clock between the two terminals is a first frequency, a system clock of the terminals is a second frequency, the second frequency is n times of the first frequency, and n is a positive integer; through a common Ethernet cable and a network transformer, differential signal transmission is utilized, an Ethernet physical interface chip is not needed, cost is saved, clock jitter is reduced, synchronization precision is within a single period of a system clock, and clock synchronization among a plurality of devices is completed.

Description

Clock synchronization method, device, storage medium and system based on Ethernet cable
Technical Field
The present invention relates to the technical field of clock synchronization between different devices, and in particular, to a clock synchronization method, apparatus, storage medium, and system based on an ethernet cable.
Background
At present, the system is synchronous, most of the Ethernet lines are used in IEEE1588 protocol, the protocol needs special Ethernet physical interface (PHY) chip, and the precision is basically us level; these synchronization methods all require PHY of ethernet, which increases the cost of the system, and at the same time, the accuracy cannot reach ns level, so that a clock synchronization method based on ethernet lines is required that does not require an ethernet line physical interface chip.
Disclosure of Invention
The invention provides a clock synchronization method, a clock synchronization device, a clock synchronization storage medium and a clock synchronization system based on an Ethernet cable, and aims to solve the technical problems mentioned in the background technology.
The invention provides a clock synchronization method based on an Ethernet cable, wherein a first network transformer and a second network transformer are arranged between two terminals connected by the Ethernet cable, one terminal is connected with the first network transformer by the Ethernet cable, the other terminal is connected with the second network transformer by the Ethernet cable, the first network transformer and the second network transformer are connected by a twisted pair, the terminals and the network transformers are communicated by differential signals, a communication clock between the two terminals is a first frequency, a system clock of the terminals is a second frequency, the second frequency is n times of the first frequency, and n is a positive integer; the method comprises the following steps:
s100, judging the counting state of the received communication information when the system clock counts every n times, and executing the step S200 if the received communication information is newly counted; if the received communication information is not counted newly, go to step S300;
s200, increasing the system clock for one period;
and S300, reducing the system clock by one period.
Further, the method further comprises: and when the counting error of the system clock and the communication clock exceeds the size of one period of the system clock, the slave system in the terminal compensates.
Further, the first frequency is 12.5Mhz, and the second frequency is 125 Mhz.
Further, the method also comprises a time synchronization step, comprising the following steps: the system will periodically transmit time packets to the devices.
The invention also provides a clock synchronization device based on the Ethernet cable, wherein a first network transformer and a second network transformer are arranged between two terminals connected through the Ethernet cable, one terminal is connected with the first network transformer through the Ethernet cable, the other terminal is connected with the second network transformer through the Ethernet cable, the first network transformer and the second network transformer are connected through a twisted pair, the terminals and the network transformers are communicated through differential signals, a communication clock between the two terminals is a first frequency, a system clock of the terminals is a second frequency, the second frequency is n times of the first frequency, and n is a positive integer; the device comprises:
a determination module configured to: when the system clock counts every n times, judging the counting state of the received communication information, and executing a first execution module if the received communication information is newly counted; if the received communication information is not subjected to new counting, executing a second execution module;
the first execution module is used for increasing the system clock by one cycle;
and the second execution module is used for reducing one cycle of the system clock.
The present invention also provides a storage medium having stored thereon a computer program which, when executed by a processor, implements the ethernet-line-based clock synchronization method described above.
The invention also provides a clock synchronization system based on the Ethernet cable, which comprises a first terminal, a second terminal, a first network transformer and a second network transformer, wherein the first terminal is connected with the first network transformer through the Ethernet cable, the second terminal is connected with the second network transformer through the Ethernet cable, the first network transformer and the second network transformer are connected through a twisted pair, and the terminal is communicated with the network transformer through differential signals.
The invention directly utilizes differential signal transmission through a common Ethernet cable and a network transformer without a physical interface chip of the Ethernet, thereby saving the cost by simplifying the circuit on one hand, and reducing the clock jitter on the other hand, so that the synchronization precision is within a single period of a system clock, thereby completing the clock synchronization among a plurality of devices.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
Fig. 1 is a flowchart illustrating steps of a clock synchronization method based on an ethernet cable according to an embodiment of the present invention.
Fig. 2 is a block diagram of an ethernet cable-based clock synchronization apparatus according to an embodiment of the present invention.
Fig. 3 is an overall schematic diagram of the clock synchronization system based on the ethernet cable according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative only and should not be construed as limiting the invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, or operations, but do not preclude the presence or addition of one or more other features, integers, steps, operations, or groups thereof.
It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
It will be appreciated by those skilled in the art that the terms "application," "application program," "application software," and the like, as used herein, are intended to refer to a computer software product electronically-adapted to be electronically-constructed, from a collection of computer instructions and associated data resources, in accordance with the principles of the present invention. Unless otherwise specified, such nomenclature is not itself limited by the programming language class, level, or operating system or platform upon which it depends. Of course, such concepts are not limited to any type of terminal.
It should be understood by those skilled in the art that the user interface and the display interface referred to in the present invention generally refer to a display interface capable of being used to send the control instruction to the intelligent terminal, and for example, may be an option (or a button, added by the application program, the same applies hereinafter) in a setup page of an Android/IOS/Windows Phone system, an option in a notification bar or an interaction page called from a desktop, or an option in a page constructed by an active component of the application program.
Referring to fig. 1, the present invention first provides a clock synchronization method based on an ethernet cable, wherein a first network transformer and a second network transformer are disposed between two terminals connected by the ethernet cable, one of the terminals is connected to the first network transformer by the ethernet cable, the other terminal is connected to the second network transformer by the ethernet cable, the first network transformer and the second network transformer are connected by a twisted pair, the terminals and the network transformers communicate with each other by differential signals, a communication clock between the two terminals is a first frequency, a system clock of the terminals is a second frequency, the second frequency is n times of the first frequency, and n is a positive integer; the method comprises the following steps:
s100, judging the counting state of the received communication information when the system clock counts every n times, and executing the step S200 if the received communication information is newly counted; if the received communication information is not counted newly, step S300 is executed.
And S200, increasing the system clock by one period.
And S300, reducing the system clock by one period.
In an embodiment of the invention, the method further comprises: and when the counting error of the system clock and the communication clock exceeds the size of one period of the system clock, the slave system in the terminal compensates.
In the embodiment, the error is compensated by increasing or decreasing the period of the system clock, so if the error exceeds one period of the system clock or the error is not equal to an integral multiple of the period of the system clock, the slave system in the terminal compensates and avoids the situation.
In one embodiment of the present invention, the first frequency is 12.5Mhz, and the second frequency is 125 Mhz.
In order to utilize the existing Ethernet system, the communication clock is selected to be 12.5M, and the electrical characteristics of the system can be well adapted to the existing Ethernet cable and the connector assembly; the system clock is chosen to be 125Mhz, and the communication clock is counted once every 10 times the coefficient is passed, assuming synchronization.
Further, in an embodiment of the present invention, the method further includes a time synchronization step, including: the system will periodically transmit time packets to the devices.
In this embodiment, the system may periodically transmit a time packet, where the time packet carries time, and when the time is transmitted to the device, the device obtains the time, thereby implementing time synchronization.
In an embodiment of the present invention, the method for data transmission and coding format between terminals includes:
when the data is 0, the system transmits 01, and when the data is 1, the system transmits 10.
This approach has a transmission efficiency of 50% so that the transmission frequency may be 12.5M or 6.25M, the electrical characteristics of the system may be better adapted to existing ethernet lines and connectors. When the system does not transmit data, … 0101010101 … is always transmitted, the frequency is 12.5M, and when the system transmits data, 1100 may be obtained, and the frequency of the system is 6.25M, that is, there is an error.
The invention also provides a clock synchronization device 100 based on an ethernet cable, wherein a first network transformer and a second network transformer are arranged between two terminals connected by the ethernet cable, one terminal is connected with the first network transformer by the ethernet cable, the other terminal is connected with the second network transformer by the ethernet cable, the first network transformer and the second network transformer are connected by a twisted pair, the terminals and the network transformers communicate by differential signals, a communication clock between the two terminals is a first frequency, a system clock of the terminals is a second frequency, the second frequency is n times of the first frequency, n is a positive integer, the device stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing a clock synchronization method based on the ethernet cable, and the clock synchronization device comprises:
s100, judging the counting state of the received communication information when the system clock counts every n times, and executing the step S200 if the received communication information is newly counted; if the received communication information is not counted newly, step S300 is executed.
And S200, increasing the system clock by one period.
And S300, reducing the system clock by one period.
For convenience of description, the ethernet line based clock synchronization apparatus 100 is split into functional module architectures, as shown in fig. 2, including:
a judging module 10, configured to: when the system clock counts every n times, the counting state of the received communication information is judged, and if the received communication information is counted newly, the first execution module 10 is executed; if the received communication information is not counted newly, the second execution module 20 is executed.
A first execution module 20 for incrementing the system clock by one cycle.
A second execution module 30 for reducing the system clock by one cycle.
The present invention also provides a storage medium having stored thereon a computer program which, when executed by a processor, implements the ethernet-line-based clock synchronization method described above.
Referring to fig. 3, the present invention further provides an ethernet-cable-based clock synchronization system, which includes a first terminal 201, a second terminal 202, a first network transformer 203 and a second network transformer 204, wherein the first terminal 201 is connected to the first network transformer 203 through an ethernet cable, the second terminal 202 is connected to the second network transformer 204 through an ethernet cable, the first network transformer 203 and the second network transformer 204 are connected to each other through a twisted pair 205, and the terminal and the network transformers communicate through differential signals.
The invention directly utilizes differential signal transmission through a common Ethernet cable and a network transformer without a physical interface chip of the Ethernet, thereby saving the cost by simplifying the circuit on one hand, and reducing the clock jitter on the other hand, so that the synchronization precision is within a single period of a system clock, thereby completing the clock synchronization among a plurality of devices.
Throughout the description and claims of this application, the words "comprise/comprises" and the words "have/includes" and variations of these are used to specify the presence of stated features, values, steps or components but do not preclude the presence or addition of one or more other features, values, steps, components or groups thereof.
Some features of the invention, which are, for clarity, described in the context of separate embodiments, may also be provided in combination in a single embodiment. Conversely, certain features of the invention, which are, for brevity, described in the context of a single embodiment, may also be provided separately or in any suitable combination in different embodiments.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (7)

1. A clock synchronization method based on Ethernet cable is characterized in that a first network transformer and a second network transformer are arranged between two terminals connected through Ethernet cable, wherein one terminal is connected with the first network transformer through Ethernet cable, the other terminal is connected with the second network transformer through Ethernet cable, the first network transformer and the second network transformer are connected through twisted pair, the terminals and the network transformers are communicated through differential signal, the communication clock between the two terminals is first frequency, the system clock of the terminals is second frequency, the second frequency is n times of the first frequency, and n is positive integer; the method comprises the following steps:
s100, judging the counting state of the received communication information when the system clock counts every n times, and executing the step S200 if the received communication information is newly counted; if the received communication information is not counted newly, go to step S300;
s200, increasing the system clock for one period;
and S300, reducing the system clock by one period.
2. The method for clock synchronization of claim 1, further comprising: and when the counting error of the system clock and the communication clock exceeds the size of one period of the system clock, the slave system in the terminal compensates.
3. The method of claim 1, wherein the first frequency is 12.5Mhz and the second frequency is 125 Mhz.
4. The clock synchronization method of claim 1, further comprising a time synchronization step comprising: the system will periodically transmit time packets to the devices.
5. A clock synchronization device based on an Ethernet line is characterized in that a first network transformer and a second network transformer are arranged between two terminals connected through the Ethernet line, one terminal is connected with the first network transformer through the Ethernet line, the other terminal is connected with the second network transformer through the Ethernet line, the first network transformer and the second network transformer are connected through a twisted pair, the terminals and the network transformers are communicated through differential signals, a communication clock between the two terminals is a first frequency, a system clock of each terminal is a second frequency, the second frequency is n times of the first frequency, and n is a positive integer; the device comprises:
a determination module configured to: when the system clock counts every n times, judging the counting state of the received communication information, and executing a first execution module if the received communication information is newly counted; if the received communication information is not subjected to new counting, executing a second execution module;
the first execution module is used for increasing the system clock by one cycle;
and the second execution module is used for reducing one cycle of the system clock.
6. A storage medium having stored thereon a computer program, characterized in that the program, when being processed and executed, implements the ethernet cable-based clock synchronization method according to any one of claims 1 to 5.
7. The clock synchronization system based on the Ethernet cable is characterized by comprising a first terminal, a second terminal, a first network transformer and a second network transformer, wherein the first terminal is connected with the first network transformer through the Ethernet cable, the second terminal is connected with the second network transformer through the Ethernet cable, the first network transformer and the second network transformer are connected through a twisted pair, and the terminal is communicated with the network transformer through differential signals.
CN202011471619.2A 2020-12-14 2020-12-14 Clock synchronization method, device, storage medium and system based on Ethernet cable Pending CN112491491A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011471619.2A CN112491491A (en) 2020-12-14 2020-12-14 Clock synchronization method, device, storage medium and system based on Ethernet cable

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011471619.2A CN112491491A (en) 2020-12-14 2020-12-14 Clock synchronization method, device, storage medium and system based on Ethernet cable

Publications (1)

Publication Number Publication Date
CN112491491A true CN112491491A (en) 2021-03-12

Family

ID=74917046

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011471619.2A Pending CN112491491A (en) 2020-12-14 2020-12-14 Clock synchronization method, device, storage medium and system based on Ethernet cable

Country Status (1)

Country Link
CN (1) CN112491491A (en)

Similar Documents

Publication Publication Date Title
CN112003775B (en) Single-level single-wire full-duplex bus communication method and system
CN115296965B (en) Method, system and device for reducing delay and achieving timer balance configuration
US10248611B2 (en) Data transmission method and mobile terminal
US10649947B2 (en) Stack timing adjustment for serial communications
CN114826542A (en) Data transmission method, device, equipment and medium based on asynchronous serial communication
CN113792003A (en) Single bus communication unit, system and method
CN213461779U (en) Clock synchronization device and system based on Ethernet cable
CN113726592A (en) Transmission delay testing method and system of edge server and related components
CN210578638U (en) 5G customer premises equipment
CN112491491A (en) Clock synchronization method, device, storage medium and system based on Ethernet cable
CN111405534A (en) Information transmission method, first terminal and computer storage medium
CN114422614B (en) Method, device, equipment and storage medium for controlling multilink equipment to transmit data
US20240104046A1 (en) Spread spectrum clock negotiation method, and peripheral component interconnect express device and system
CN107911288B (en) Train communication network card and train control management system
US20230246730A1 (en) Data transmission method and apparatus, circuit board, storage medium and electronic apparatus
EP3618317A1 (en) Message sending method and message receiving method and apparatus
WO2017000737A1 (en) Transmission checking method, node, system and computer storage medium
EP2916523B1 (en) Data stream and data packet transmission method and device
CN217428141U (en) Network card, communication equipment and network security system
CN110505038B (en) Data transmission method and related device
CN114817113B (en) Method, system, equipment and storage medium for judging SDA data direction
US10846085B2 (en) Multi-lane data processing circuit and system
CN115695176A (en) Method for configuring physical interface chip and related device
Mun et al. Controller module implementation to reduce interrupt in CNPC uplink
CN117194307A (en) Single-wire communication method based on CamerLink interface

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination