CN111130673B - Vehicle-mounted terminal time synchronization method and system - Google Patents
Vehicle-mounted terminal time synchronization method and system Download PDFInfo
- Publication number
- CN111130673B CN111130673B CN201811296770.XA CN201811296770A CN111130673B CN 111130673 B CN111130673 B CN 111130673B CN 201811296770 A CN201811296770 A CN 201811296770A CN 111130673 B CN111130673 B CN 111130673B
- Authority
- CN
- China
- Prior art keywords
- time
- source
- vehicle
- synchronization
- mounted terminal
- 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.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04J—MULTIPLEX COMMUNICATION
- H04J3/00—Time-division multiplex systems
- H04J3/02—Details
- H04J3/06—Synchronising arrangements
- H04J3/0635—Clock or time synchronisation in a network
- H04J3/0638—Clock or time synchronisation among nodes; Internode synchronisation
- H04J3/0641—Change of the master or reference, e.g. take-over or failure of the master
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04J—MULTIPLEX COMMUNICATION
- H04J3/00—Time-division multiplex systems
- H04J3/02—Details
- H04J3/06—Synchronising arrangements
- H04J3/0635—Clock or time synchronisation in a network
- H04J3/0685—Clock or time synchronisation in a node; Intranode synchronisation
- H04J3/0688—Change of the master or reference, e.g. take-over or failure of the master
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Electric Clocks (AREA)
- Synchronisation In Digital Transmission Systems (AREA)
Abstract
The invention discloses a vehicle-mounted terminal time synchronization method and a system, which comprises the steps of obtaining system time generated by a timing module; acquiring time source time and judging the validity of the time source time; if the time source time is valid, the time source time is used as the synchronous time, otherwise, the system time is used as the synchronous time, so that the problem that the time validity of a positioning satellite or an internet server cannot be judged in the prior art due to the fact that the time information is obtained wrongly because the data communication is not smooth in some special conditions such as cloud, fog, rain and snow weather or when a vehicle enters or exits a tunnel is solved, and the stability of the data communication of the vehicle system and the safety of vehicle driving are improved.
Description
Technical Field
The embodiment of the disclosure relates to the technical field of vehicle networking communication, in particular to a vehicle-mounted terminal time synchronization method and system.
Background
With the rapid development of vehicle-mounted network communication technology, entertainment systems, intelligent driving systems and other systems are increasingly applied to vehicles, and most of the systems need to perform real-time data transmission with an internet server or a satellite, so that the requirement on the time synchronization of a vehicle-mounted terminal and the time synchronization of the internet server or the satellite positioning system is higher and higher.
In the prior art, generally, a vehicle-mounted terminal and a satellite positioning system or an internet server perform data transmission and simultaneously acquire time source time of the satellite positioning system or the internet server to update system time of the vehicle-mounted terminal, so that system time of the vehicle-mounted terminal and time synchronization of the satellite positioning system or the internet server are realized. Under some special environments, such as cloud, fog, rain and snow weather or when a vehicle passes in and out of a tunnel, the situation that data communication is not smooth and time information is obtained wrongly may occur, but the existing time synchronization method has the defect that the validity of the time source time of a positioning satellite positioning system or an internet server cannot be judged, and in extreme cases, the invalid time source time is synchronized with the vehicle system time, so that data communication failure may be caused or an intelligent vehicle driving system is influenced, and potential safety hazards are generated.
Disclosure of Invention
In order to solve the defect that the communication stability and the driving safety of a vehicle are influenced by taking invalid time source time as synchronization time in the prior art, the invention provides a time synchronization method of a vehicle-mounted terminal, which comprises the following steps:
acquiring system time generated by a timing module;
acquiring time source time and judging the validity of the time source time;
and if the time source time is valid, taking the time source time as synchronous time, otherwise, taking the system time as synchronous time.
Preferably, the step of obtaining the time source time and judging the validity of the time source time includes:
recording the system time as system recording time while acquiring the time source time, and obtaining a difference time by taking a difference value between the time source time and the system recording time;
if the difference time is smaller than a preset threshold value, the time source time is judged to be valid, otherwise, the time source time is judged to be invalid.
Preferably, the threshold is a theoretical error of the timing module.
Preferably, before the acquiring the time source time, the method further includes: and taking the system time as a synchronization time. The invention also provides a time synchronization system of the vehicle-mounted terminal, which comprises:
the timing module is used for generating and acquiring system time;
the time source module is used for acquiring the time source time and judging the validity of the time source time;
and the first synchronization module is used for taking the time source time as the synchronization time when the time source time is effective, and taking the system time as the synchronization time otherwise.
Preferably, the time source time judging module includes:
the computing module is used for obtaining a difference value by taking a difference value between the time source time and the system recording time;
and the judging module is used for judging that the time source time is valid if the difference time is smaller than a preset threshold, and otherwise, the time source time is invalid.
Preferably, the vehicle-mounted terminal time synchronization system further includes:
and the second synchronization module is used for taking the system time as the synchronization time before the time source time is acquired.
The present invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps described in a vehicle-mounted terminal time synchronization method as provided by the present invention.
The method can effectively judge the validity of the time for the vehicle system to acquire the positioning satellite or the internet server, prevent the potential hazards that the data communication is failed or the vehicle-mounted intelligent driving system is influenced due to the fact that the time information is obtained wrongly when the vehicle passes through a tunnel, a mountain area or in cloud, fog, rain and snow weather, and improve the stability of the data communication between the vehicle system and the outside and the safety of vehicle driving.
Drawings
For better clarity of technical solutions of the embodiments of the present disclosure, the drawings that are required to be used in the description of the embodiments of the present disclosure will be briefly described below, and it is obvious that the drawings described below are only some embodiments of the present disclosure, and those skilled in the art can also obtain other drawings based on the drawings without inventive labor.
FIG. 1 is a flow chart diagram of a method for time synchronization of a vehicle-mounted terminal;
FIG. 2 is a schematic diagram of a preferred embodiment of a time synchronization method for a vehicle-mounted terminal;
FIG. 3 is a schematic diagram of a vehicle terminal time synchronization system;
FIG. 4 is a schematic diagram of a timing module in the vehicle terminal time synchronization system;
FIG. 5 is a schematic diagram of a time source module in the time synchronization system of the vehicle-mounted terminal;
FIG. 6 is a schematic diagram of a time source determination module in the time synchronization system of the vehicle-mounted terminal;
fig. 7 is a schematic diagram of a preferred embodiment of the time synchronization system of the vehicle-mounted terminal.
Detailed Description
In order to further explain the time synchronization method of the vehicle-mounted terminal provided by the present invention, the embodiment is described in detail with reference to fig. 1.
Step S1: and acquiring the system time recorded by the timing module.
The vehicle-mounted terminal provided in this embodiment includes, but is not limited to, vehicle-mounted terminals such as a vehicle instrument system, a multimedia system, a navigation system, an intelligent (auxiliary) driving system, and an internet of vehicles system. The time source may be a satellite positioning system (GPS, beidou, etc.) or an internet server. After the vehicle-mounted terminal is powered on, the vehicle-mounted terminal starts to operate, message data, operation state data and the like are generated during operation, and the system recorded data carry time information so as to be used as a judgment requirement for keeping information synchronization between the vehicle-mounted terminal and a satellite positioning system or an internet server and analyze the vehicle-mounted terminal recorded data in the future.
The vehicle-mounted terminal is provided with a timing module, and the timing module can record the system time T1 in real time during the power-off or power-on period of the vehicle-mounted terminal. The timing module may be a timing program written in the vehicle-mounted terminal, or may be a system timer embedded in the vehicle-mounted terminal, such as a timing clock.
Step S2: and acquiring time source time and judging the validity of the time source time.
It is understood that the acquisition time source time may be the time source time T2 directly acquired by the vehicle-mounted terminal directly requesting the satellite positioning system or the internet server, or may be time information extracted from real-time communication data of the satellite positioning system or the internet server and the vehicle-mounted terminal as the time source time T2.
Since the situation that the time is not acquired smoothly due to data communication is wrong may exist when the vehicle passes through a tunnel, in a mountain area or in cloud, fog, rain and snow weather, if wrong time information is synchronized into the vehicle-mounted terminal, hidden dangers that data communication fails or the vehicle-mounted intelligent driving system is affected may be generated, the validity of the time source time needs to be judged firstly after the time source time is acquired from the satellite positioning system or the internet server, and other operations such as time synchronization are adopted after the time source time is ensured to be valid. The specific process of judging the validity of the time source time is that the timing module of the vehicle-mounted terminal records the system recording time T3 generated by the system timer when the time source module acquires the time source time T2. The time source module then calculates the difference between the time source time T2 and the system recording time T3 to obtain the difference time T1.
If the difference time T1 is smaller than a preset threshold, the time source time T2 is determined to be valid, and if the difference time T1 is larger than the preset threshold, the time source time T2 is determined to be invalid. The threshold is the same as the theoretical error of the timing module, or may be another value set according to the actual use condition, for example, in the automatic driving stage of the vehicle, the requirement for the accuracy of time synchronization is high, and in this case, a certain value smaller than the theoretical error of the timing module may be set as the threshold according to the specific design requirement, so as to improve the judgment standard of the time validity of the time source.
Step S3: and if the time source time is valid, taking the time source time as the synchronous time, and otherwise, taking the system time as the synchronous time.
It can be understood that if the time source time T2 is valid, the synchronization time T4 is updated based on the time source time T2 and serves as a uniform time for the vehicle-mounted terminal, so as to ensure that the time of each functional module of the vehicle-mounted terminal is consistent during data processing or interaction with the satellite positioning system or the internet server. If the time source time T2 is invalid, the synchronization time T4 is updated to the system time T1.
For some special cases, for example, when a vehicle is started for the first time and the vehicle-mounted terminal is powered on, each functional module in the vehicle-mounted terminal may have a time synchronization requirement to ensure that data recording time of each functional module is consistent when data is exchanged, but at this time, the time of the vehicle-mounted terminal is not required to be highly consistent with that of the satellite positioning system or the internet server, and no time source time is required to be acquired, or when the vehicle enters a tunnel, a mountain area, or in some extreme weather, the vehicle-mounted terminal has a requirement to acquire the time source time, but the vehicle-mounted terminal cannot establish communication with the satellite positioning system or the internet server, and cannot acquire the time source time, in this special case, in order to ensure that each functional module of the vehicle-mounted terminal can still maintain time consistency, the embodiment further provides an optimal scheme, as shown in fig. 2, that is before the vehicle-mounted terminal acquires the time, the system time is taken as the synchronization time. It should be noted that, whether the vehicle-mounted terminal has a need to acquire the time source time and whether the vehicle-mounted terminal can successfully establish communication with the satellite positioning system or the internet server can be obtained through conventional technical means or common knowledge by those skilled in the art, and details are not described herein again.
It is understood that the time information in the system recording data generated when the in-vehicle terminal operates in the time period from the power-on to the acquisition of the time source time is provided by the timing module, that is, the timing module records the system time T1 corresponding to the time when the in-vehicle terminal recording data is generated. The synchronization module updates the system time T1 recorded by the timing module to each vehicle-mounted system as the synchronization time T4, so that the time of each functional module of the vehicle-mounted system is kept consistent. The optimal time synchronization method of the vehicle-mounted terminal comprises the following steps:
step S11: acquiring system time generated by a timing module;
step S21: before the time source time is obtained, taking the system time as the synchronization time;
step S31: acquiring time source time and judging the validity of the time source time;
step S41: and if the time source time is valid, taking the time source time as the synchronous time, and otherwise, taking the system time as the synchronous time.
The embodiment further discloses a vehicle-mounted terminal time synchronization system 100, as shown in fig. 3, the vehicle-mounted terminal time synchronization system 100 includes:
the timing module 101 is used for acquiring system time T1;
the time source module 102 is configured to obtain a time source time T2 and determine validity of the time source time T2;
a first synchronization module 103 for updating the synchronization time T4 to the time source time T2 when the time source time T2 is valid; when the time source time T2 is invalid, the synchronization time T4 is updated to the system time T1.
In some embodiments, as shown in fig. 4, the timing module 101 includes:
a system timer 1011 for recording the system time T1 in real time;
a system time recording module 1012, configured to record the system time generated by the system timer 1011 as a system recording time T3 while the time source module 102 obtains the time source time T2.
In some embodiments, as shown in fig. 5, the time source module 102 includes:
a time source obtaining module 1021, configured to obtain a time source time T2;
the time source determining module 1022 is configured to determine validity of the time source time.
In some embodiments, as shown in fig. 6, the time source determining module 1022 includes:
the calculating module 1023 is used for obtaining a difference value time T1 by taking the difference value between the time source time T2 and the system recording time T3;
the determining module 1024 is configured to determine that the time source time T2 is valid if the difference time T1 is smaller than a preset threshold, and otherwise, the time source time T2 is invalid.
As shown in fig. 7, preferably, the vehicle-mounted terminal time synchronization system further includes:
and a second synchronization module 104, configured to take the system time as the synchronization time before acquiring the time source time.
The time synchronization system of the vehicle-mounted terminal provided in the embodiment of the present disclosure may be configured to perform the steps of the time synchronization method of the vehicle-mounted terminal described in any one of the above, and the related concepts and the specific implementation manners may refer to the description of the time synchronization method of the vehicle-mounted terminal described in any one of the above, which are not described herein again.
The embodiment of the present disclosure further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the time synchronization method for a vehicle-mounted terminal are implemented, and the same technical effects can be achieved, and in order to avoid repetition, the details are not repeated here. The computer-readable storage medium includes, but is not limited to, a Read-Only Memory (ROM), a Random Access Memory (RAM), a usb disk, a removable hard disk, or an optical disk.
In the present invention, the term "comprises" is not an exclusive inclusion, i.e. includes not only the listed technical contents for implementing the technical solution of the present invention, but also the technical contents which are not explicitly listed for assisting the implementation of the technical solution of the present invention, which can be obtained by the conventional technical means or common general knowledge by those skilled in the art, and will not be described herein again.
The above is only a preferred embodiment of the present invention, and it should be noted that the above preferred embodiment should not be considered as limiting the present invention, and the protection scope of the present invention should be subject to the scope defined by the claims. It will be apparent to those skilled in the art that various substitutions and modifications can be made without departing from the spirit and scope of the invention, and these substitutions and modifications should also be construed as within the scope of the invention.
Claims (6)
1. A time synchronization method for a vehicle-mounted terminal is characterized by comprising the following steps:
acquiring system time generated by a timing module;
acquiring time source time and judging the validity of the time source time;
if the time source time is valid, taking the time source time as synchronous time, otherwise, taking the system time as synchronous time;
the step of obtaining the time source time and judging the validity of the time source time comprises the following steps:
recording the system time as system recording time while acquiring the time source time, and obtaining a difference time by taking a difference value between the time source time and the system recording time;
if the difference time is smaller than a preset threshold value, the time source time is judged to be valid, otherwise, the time source time is judged to be invalid.
2. The time synchronization method for vehicle-mounted terminals according to claim 1, wherein the threshold is a theoretical error of the timing module.
3. The time synchronization method for the vehicle-mounted terminal according to claim 1, wherein before the time source time is acquired, the method further comprises: and taking the system time as a synchronization time.
4. A vehicle-mounted terminal time synchronization system is characterized by comprising:
the timing module is used for generating and acquiring system time;
the time source module is used for acquiring time source time and judging the validity of the time source time;
the first synchronization module is used for taking the time source time as synchronization time when the time source time is effective, and taking the system time as synchronization time otherwise;
the time source judging module comprises:
the calculation module is used for recording the system time as the system recording time while acquiring the time source time, and obtaining a difference value time by taking a difference value between the time source time and the system recording time;
and the judging module is used for judging that the time source time is valid if the difference time is smaller than a preset threshold, and otherwise, the time source time is invalid.
5. The vehicle terminal time synchronization system according to claim 4, further comprising:
and the second synchronization module is used for taking the system time as the synchronization time before the time source time is acquired.
6. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the in-vehicle terminal time synchronization method according to any one of claims 1 to 3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811296770.XA CN111130673B (en) | 2018-11-01 | 2018-11-01 | Vehicle-mounted terminal time synchronization method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811296770.XA CN111130673B (en) | 2018-11-01 | 2018-11-01 | Vehicle-mounted terminal time synchronization method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111130673A CN111130673A (en) | 2020-05-08 |
CN111130673B true CN111130673B (en) | 2021-03-09 |
Family
ID=70494966
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811296770.XA Active CN111130673B (en) | 2018-11-01 | 2018-11-01 | Vehicle-mounted terminal time synchronization method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111130673B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112468172B (en) * | 2020-11-17 | 2021-06-04 | 常州仁千电气科技股份有限公司 | Vehicle-mounted network terminal TBOX |
CN112911700A (en) * | 2021-01-15 | 2021-06-04 | 新石器慧义知行智驰(北京)科技有限公司 | Vehicle time synchronization method, device and system |
CN114826463A (en) * | 2021-01-28 | 2022-07-29 | 华为技术有限公司 | Time synchronization method and vehicle-mounted equipment |
CN113242105B (en) * | 2021-05-11 | 2022-04-15 | 广州文远知行科技有限公司 | Clock control method, device, equipment and storage medium for mobile equipment |
CN118488447A (en) * | 2023-02-13 | 2024-08-13 | 华为技术有限公司 | Tamper-resistant protection method, tamper-resistant protection device and carrier |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102790703A (en) * | 2011-05-19 | 2012-11-21 | 中兴通讯股份有限公司 | Method and system for monitoring time faults |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103399484B (en) * | 2013-07-23 | 2016-06-22 | 深圳市元征科技股份有限公司 | A kind of local clock calibration steps and mobile unit |
CN103684733B (en) * | 2013-09-28 | 2017-01-25 | 国家电网公司 | Automatic verification method and special-purpose equipment for clock synchronization |
US9813173B2 (en) * | 2014-10-06 | 2017-11-07 | Schweitzer Engineering Laboratories, Inc. | Time signal verification and distribution |
CN107026702A (en) * | 2017-04-20 | 2017-08-08 | 中国南方电网有限责任公司电网技术研究中心 | High-precision time keeping method and device |
-
2018
- 2018-11-01 CN CN201811296770.XA patent/CN111130673B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102790703A (en) * | 2011-05-19 | 2012-11-21 | 中兴通讯股份有限公司 | Method and system for monitoring time faults |
Also Published As
Publication number | Publication date |
---|---|
CN111130673A (en) | 2020-05-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111130673B (en) | Vehicle-mounted terminal time synchronization method and system | |
US20190250902A1 (en) | On-board update system, on-board update device, and communication device update method | |
US10820292B1 (en) | Time synchronization for sensor data recording devices | |
CN110830141A (en) | Time synchronization method, system, storage medium and processor | |
CN112732857B (en) | Road network processing method, road network processing device, electronic equipment and storage medium | |
CN112256315A (en) | Upgrading method, device, equipment and storage medium | |
CN111782234A (en) | Vehicle-mounted software flashing method, control device, central processing unit and automobile | |
US20170371810A1 (en) | Data Transmission Method and System | |
CN112769517B (en) | T-BOX time synchronization method and device | |
CN108924461A (en) | Method of video image processing and device | |
CN114894214A (en) | Fusion positioning method and device for automatic driving vehicle and electronic equipment | |
CN114199274B (en) | Vehicle travel determination method, device, equipment and readable storage medium | |
KR101583136B1 (en) | Method and Apparatus for Time Synchronization of Car Black Box or Car Electronic Equipment | |
CN112988880B (en) | Data synchronization method, device, electronic equipment and computer storage medium | |
CN111292138B (en) | Vehicle-mounted advertisement updating method and device, electronic equipment and storage medium | |
CN110609555B (en) | Method, apparatus, electronic device, and computer-readable storage medium for signal control | |
CN112835978A (en) | Data storage method and device and computer equipment | |
CN116015523A (en) | Time synchronization method and device and electronic equipment | |
CN110995857B (en) | Real-time high-concurrency long-connection timeout fast processing method | |
CN106155911B (en) | A kind of method and apparatus for requesting long-distance inner | |
CN113984074A (en) | Method, device, equipment and medium for identifying target vehicle navigation route yaw | |
CN109272602B (en) | Unmanned vehicle data recording method, device, equipment and storage medium | |
CN110636118A (en) | Storage processing method and device of vehicle state information and readable storage medium | |
CN118018172B (en) | Domain controller time synchronization system | |
CN114553353B (en) | Timing method and device and vehicle-mounted wireless communication box |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |