CN112804021A - Time synchronization method, device, vehicle and medium - Google Patents

Time synchronization method, device, vehicle and medium Download PDF

Info

Publication number
CN112804021A
CN112804021A CN202011642015.XA CN202011642015A CN112804021A CN 112804021 A CN112804021 A CN 112804021A CN 202011642015 A CN202011642015 A CN 202011642015A CN 112804021 A CN112804021 A CN 112804021A
Authority
CN
China
Prior art keywords
time
clock node
master clock
order
value
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
CN202011642015.XA
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.)
Beijing New Energy Vehicle Technology Innovation Center Co Ltd
Original Assignee
Beijing New Energy Vehicle Technology Innovation Center 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 Beijing New Energy Vehicle Technology Innovation Center Co Ltd filed Critical Beijing New Energy Vehicle Technology Innovation Center Co Ltd
Priority to CN202011642015.XA priority Critical patent/CN112804021A/en
Publication of CN112804021A publication Critical patent/CN112804021A/en
Pending legal-status Critical Current

Links

Classifications

    • 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
    • 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/0641Change of the master or reference, e.g. take-over or failure of the master
    • 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/0682Clock or time synchronisation in a network by delay compensation, e.g. by compensation of propagation delay or variations thereof, by ranging

Abstract

The invention relates to the technical field of time synchronization, in particular to a time synchronization method, a device, a vehicle and a medium, wherein the method comprises the steps of selecting a master clock node in a competitive mode, broadcasting time messages periodically by the master clock node, correcting the time messages by the rest nodes through the calculated transmission delay on the received time messages, and correcting a local clock of the vehicle according to the corrected time messages; the master clock node broadcasts the high-order timing command through the successful competition, the slave node inquires the transmission delay, calculates the accurate timing time and corrects the local time value, and then the master clock node broadcasts and sends the low-order timing command to reduce the bus communication load, so that the best clock node can be selected in a real-time self-adaptive manner, and the time synchronization among all domain controllers in the system is ensured.

Description

Time synchronization method, device, vehicle and medium
Technical Field
The invention relates to the technical field of time synchronization, in particular to a time synchronization method.
Background
The intelligent networked automobile is mainly composed of a plurality of domain controllers and gateways (or switches), and the controllers of all domains work cooperatively, so that high-precision synchronization among the controllers of all domains in a system needs to be ensured under a unified time standard. The general method is that the automatic driving domain has a GPS signal, and time synchronization is carried out by taking the automatic driving domain as a reference, but when the GPS signal is lost or the automatic driving domain node fails, the time synchronization between domain controllers cannot be ensured.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: a time synchronization method is provided to solve the background art problems.
In order to solve the above technical problems, a first technical solution adopted by the present invention is:
a time synchronization method includes that a main clock node is selected out in a competition mode, the main clock node broadcasts time messages periodically, the other nodes correct the received time messages through calculated transmission delay, and the local clock of the other nodes is corrected according to the corrected time messages.
Preferably, if the master clock node fails or the external input requirement or condition changes, a new master clock node is newly elected.
Preferably, the contention resolution master clock node includes:
and (3) building a master control clock node competition model, inputting information of each domain controller and each gateway, which is strongly related to time, and external input manual control selection data into the model for training, and outputting the optimal master clock node in real time according to actual conditions.
Preferably, the time message includes a high-order timing command and a low-order timing command;
when the master clock node successfully competes and a new node accesses the system bus, the master clock node broadcasts a high-order timing command to finish high-order time value correction of other nodes;
and after the master clock node finishes sending the high-order timing command, periodically broadcasting a low-order timing command, and correcting the time value at a low order.
Preferably, the two timing commands, namely the high-order timing command and the low-order timing command, are used by the control word to indicate the time information message; the high 5 bits of the command word are used for indicating the number of the master clock node, the low 3 bits are used for indicating different timing commands, the '000' is a low-order timing command which indicates that the broadcasted time precision reaches ns level, and the '001' is a high-order timing command which indicates that the broadcasted time precision reaches s level time value; the time value is 31 bits in total, when the time value is a low-order time correction command, the time value carried by the time information message is a ms value of 10 bits, a us value of 10 bits and an ns value of 8 bits, other bits are filled with 0, and when the time value is a high-order time correction command, the time information message only has a current second value.
Preferably, the transmission delay includes a line transmission delay, a coding delay, a circuit delay and a protocol transmission delay between nodes.
Preferably, the nodes transmit data through the SOMEIP protocol.
In order to solve the above technical problem, the second technical solution adopted by the present invention is:
a time synchronizer includes
A memory for storing one or more programs;
a processor;
the one or more programs, when executed by the processor, implement the time synchronization method of any of claims 1-7;
the device adaptively changes the master clock node according to the actual situation.
In order to solve the above technical problems, the third technical solution adopted by the present invention is:
a vehicle comprises the time synchronization device.
In order to solve the above technical problem, a fourth technical solution adopted by the present invention is:
a medium on which a computer program is stored which, when being executed by a processor, realizes the time synchronization method as described above.
The invention has the beneficial effects that: the method and the device can adaptively select the optimal clock node in real time, and ensure that time synchronization is kept among all domain controllers in the system; the master clock node which successfully competes broadcasts a high-order timing command, the slave node inquires transmission Delay, calculates accurate timing time and corrects a local time value, and then the master clock node broadcasts and sends a low-order timing command to reduce the bus communication load; and if a new node is added or the system has a problem, the master clock node competition is carried out again.
Detailed Description
In order to explain the technical content, the objects and the effects of the present invention in detail, the following description will be given with reference to the embodiments.
Example one
A time synchronization method, competition chooses the master clock node, the master clock node broadcasts the time message periodically, the other nodes revise the time message through the transmission delay calculated to the time message received, correct one's own local clock according to the time message after revising; and if the master clock node fails or the external input requirement or condition changes, newly selecting a new master clock node.
The contention resolution master clock node includes:
establishing a master control clock node competition model, and carrying out strong time-related information on each domain controller and gateway (switch), such as whether the automatic driving domain has a GPS signal and the credibility of the GPS signal, the accuracy of the time value of the GPS signal, and the influence of different road conditions and different weather conditions; whether the central gateway has a 4G/5G signal to acquire time information or not, whether the intelligent cabin domain has Bluetooth Wifi or not, whether credible time information can be acquired or not, and whether external input is artificially controlled to select a data input model for training, and the optimal master clock node is output in real time according to actual conditions.
The time message comprises a high-order timing command (timing command 1) and a low-order timing command (timing command 0);
when the master clock node successfully competes and a new node accesses the system bus, the master clock node broadcasts a high-order timing command to finish high-order time value correction of other nodes;
and after the master clock node finishes sending the high-order timing command, periodically broadcasting a low-order timing command, and correcting the time value at a low order.
The high-order timing command and the low-order timing command consist of control words, command words and time values;
the control word is used for indicating a time information message; command words-where the upper 5 bits are used to indicate the master clock node number and the lower 3 bits are used to indicate different timing commands, "000" is a low order timing command indicating that the broadcasted time precision is to ns level and "001" is a high order timing command indicating that the broadcasted time precision is to s level time value; the time value is 31 bits in total, when the time value is a low-order time correction command (namely when the time correction command is 0), the time value carried by the time information message is an ms value of 10 bits, an us value of 10 bits and an ns value of 8 bits, other bits are filled with 0, and when the time value is a high-order time correction command (namely when the time correction command is 1), the time information message only has the current second value.
The transmission delay includes line transmission delay, coding delay, circuit delay and protocol transmission delay among nodes.
And data transmission is carried out between the nodes through the SOMEIP protocol.
Example two
A time synchronization method includes that a master clock node is selected in a competition mode, the master clock node which succeeds in competition broadcasts a timing command 1, when a slave node inquires a transmission Delay, accurate correction time is calculated and correction of a local time value is conducted, then the master clock node broadcasts a timing command 0, and bus communication load is reduced. And if a new node is added or the system has a problem, the master clock node competition is carried out again.
EXAMPLE III
A time synchronizer includes
A memory for storing one or more programs;
a processor;
when the one or more programs are executed by the processor, implementing the time synchronization method as recited in claim one or two embodiments;
the device adaptively changes the master clock node according to the actual situation.
Example four
A vehicle comprising the time synchronization apparatus according to the third embodiment.
EXAMPLE five
A medium, on which a computer program is stored, which, when being executed by a processor, implements the time synchronization method according to the first or second embodiment.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent modifications made by the present invention in the specification or directly or indirectly applied to the related technical field are included in the scope of the present invention.

Claims (10)

1. A time synchronization method is characterized in that a master clock node is selected in a competition mode, the master clock node broadcasts time messages periodically, other nodes correct the received time messages through calculated transmission delay, and the local clock of the other nodes is corrected according to the corrected time messages.
2. The method according to claim 1, wherein if the master clock node fails or the external input requirement or condition changes, a new master clock node is re-elected.
3. The method of time synchronization of claim 1, wherein said contending for picking a master clock node comprises:
and (3) building a master control clock node competition model, inputting information of each domain controller and each gateway, which is strongly related to time, and external input manual control selection data into the model for training, and outputting the optimal master clock node in real time according to actual conditions.
4. The time synchronization method according to claim 1, wherein the time message includes a higher order timing command and a lower order timing command;
when the master clock node successfully competes and a new node accesses the system bus, the master clock node broadcasts a high-order timing command to finish high-order time value correction of other nodes;
and after the master clock node finishes sending the high-order timing command, periodically broadcasting a low-order timing command, and correcting the time value at a low order.
5. The time synchronization method according to claim 4, wherein the timing commands of the high order timing command and the low order timing command are used by a control word to indicate a time information message; the high 5 bits of the command word are used for indicating the number of the master clock node, the low 3 bits are used for indicating different timing commands, the '000' is a low-order timing command which indicates that the broadcasted time precision reaches ns level, and the '001' is a high-order timing command which indicates that the broadcasted time precision reaches s level time value; the time value is 31 bits in total, when the time value is a low-order time correction command, the time value carried by the time information message is a ms value of 10 bits, a us value of 10 bits and an ns value of 8 bits, other bits are filled with 0, and when the time value is a high-order time correction command, the time information message only has a current second value.
6. The method according to any one of claims 1 to 5, wherein the transmission delay includes a line transmission delay, a coding delay, a circuit delay, and a protocol transmission delay between nodes.
7. The time synchronization method according to any one of claims 1 to 5, wherein the nodes transmit data therebetween via the SOMEIP protocol.
8. A time synchronizer, comprising
A memory for storing one or more programs;
a processor;
the one or more programs, when executed by the processor, implement the time synchronization method of any of claims 1-7;
the device adaptively changes the master clock node according to the actual situation.
9. A vehicle characterized by comprising the time synchronization device of claim 8.
10. A medium on which a computer program is stored which, when being executed by a processor, carries out the method for time synchronization according to any one of claims 1-7.
CN202011642015.XA 2020-12-31 2020-12-31 Time synchronization method, device, vehicle and medium Pending CN112804021A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011642015.XA CN112804021A (en) 2020-12-31 2020-12-31 Time synchronization method, device, vehicle and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011642015.XA CN112804021A (en) 2020-12-31 2020-12-31 Time synchronization method, device, vehicle and medium

Publications (1)

Publication Number Publication Date
CN112804021A true CN112804021A (en) 2021-05-14

Family

ID=75809236

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011642015.XA Pending CN112804021A (en) 2020-12-31 2020-12-31 Time synchronization method, device, vehicle and medium

Country Status (1)

Country Link
CN (1) CN112804021A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114785474A (en) * 2022-03-31 2022-07-22 上海赫千电子科技有限公司 In-vehicle SOME/IP transmission method and device based on TSN time sensitive network
CN116506096A (en) * 2023-06-26 2023-07-28 北京象帝先计算技术有限公司 Clock synchronization method, system, component and equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103988453A (en) * 2011-11-30 2014-08-13 大陆汽车有限责任公司 Method for synchronizing clocks in nodes of a vehicle network and node designed to perform the method
CN104850526A (en) * 2015-06-10 2015-08-19 首都师范大学 Method for time synchronization in dynamically reconfigurable high-speed serial bus
CN105634636A (en) * 2014-11-26 2016-06-01 现代自动车株式会社 Method and apparatus for providing time synchronization in in-vehicle ethernet communication network
US20170359789A1 (en) * 2016-06-10 2017-12-14 Bluwireless Technology Limited Clock synchronisation in wireless mesh communications networks
CN108563501A (en) * 2018-06-25 2018-09-21 首都师范大学 The interrupt requests method and device of dynamic reconfigurable high-speed serial bus
CN110138490A (en) * 2019-05-14 2019-08-16 浙江国利网安科技有限公司 A kind of method and apparatus of clock competition

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103988453A (en) * 2011-11-30 2014-08-13 大陆汽车有限责任公司 Method for synchronizing clocks in nodes of a vehicle network and node designed to perform the method
CN105634636A (en) * 2014-11-26 2016-06-01 现代自动车株式会社 Method and apparatus for providing time synchronization in in-vehicle ethernet communication network
CN104850526A (en) * 2015-06-10 2015-08-19 首都师范大学 Method for time synchronization in dynamically reconfigurable high-speed serial bus
US20170359789A1 (en) * 2016-06-10 2017-12-14 Bluwireless Technology Limited Clock synchronisation in wireless mesh communications networks
CN108563501A (en) * 2018-06-25 2018-09-21 首都师范大学 The interrupt requests method and device of dynamic reconfigurable high-speed serial bus
CN110138490A (en) * 2019-05-14 2019-08-16 浙江国利网安科技有限公司 A kind of method and apparatus of clock competition

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王姗等: "基于动态可重构总线的新型时间同步方法", 《微电子学与计算机》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114785474A (en) * 2022-03-31 2022-07-22 上海赫千电子科技有限公司 In-vehicle SOME/IP transmission method and device based on TSN time sensitive network
CN114785474B (en) * 2022-03-31 2024-02-20 上海赫千电子科技有限公司 In-vehicle SOME/IP transmission method and device based on TSN time-sensitive network
CN116506096A (en) * 2023-06-26 2023-07-28 北京象帝先计算技术有限公司 Clock synchronization method, system, component and equipment
CN116506096B (en) * 2023-06-26 2023-10-20 北京象帝先计算技术有限公司 Clock synchronization method, system, component and equipment

Similar Documents

Publication Publication Date Title
CN112804021A (en) Time synchronization method, device, vehicle and medium
CN110036601B (en) Parallel processing device and computer-readable non-transitory storage medium
EP3160199A1 (en) Synchronization control method within wireless network, wireless network and smart home device
CN105119793B (en) A kind of identifier allocation method of sensor network CAN bus frame format
CN110674565A (en) On-loop simulation method and platform of vehicle-road cooperative system
CN110990034B (en) ECU upgrading method, system, electronic equipment and storage medium
CN112600606B (en) Method for quick access of inter-satellite link nodes
CN109089308B (en) Method for updating timing advance information, terminal, base station and readable storage medium
US10334536B2 (en) Method for dynamic adaptation of a data rate
CN106953800B (en) Self-adaptive vertical routing method and routing unit based on network on chip
CN111010352B (en) Automobile CAN message sending method
CN106789506B (en) BC switching method based on hybrid structure of optical fiber bus and 1553B bus
CN113870588B (en) Traffic light control method based on deep Q network, terminal and storage medium
CN102045834A (en) Method and device for allocating TA list
CN113055261A (en) MBUS-based signal transmission method and device and communication system
CN103051548B (en) Based on hierarchical organization method and the organization system of communication delay
CN112968725B (en) Satellite link switching method and device
US7508783B2 (en) Method for selecting a transmission channel with a TDMA (time division multiple access) and communication system using such a method
KR20220079937A (en) Resource selection method and terminal
CN112817904A (en) MilCAN bus dynamic data time sequence alignment method
CN113119117A (en) Robot control method, controller, robot and control system
CN111736560A (en) Method and system for transmitting fault data of automation equipment of intelligent factory in real time
CN110460531A (en) A kind of area's recognition methods of efficient HPLC platform and system based on routing
CN108737266B (en) Dynamic routing method based on double estimators
CN113992279B (en) Interaction method of antenna calibration signaling, radio frequency unit, baseband processing unit and base station

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
CB02 Change of applicant information

Address after: 100176 floor 10, building 1, zone 2, yard 9, Taihe 3rd Street, Beijing Economic and Technological Development Zone, Daxing District, Beijing

Applicant after: Beijing National New Energy Vehicle Technology Innovation Center Co.,Ltd.

Address before: 100089 1705 100176, block a, building 1, No. 10, Ronghua Middle Road, Beijing Economic and Technological Development Zone, Daxing District, Beijing

Applicant before: BEIJING NEW ENERGY VEHICLE TECHNOLOGY INNOVATION CENTER Co.,Ltd.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20210514

RJ01 Rejection of invention patent application after publication