Vehicle time service method and apparatus, vehicle, and storage medium

By acquiring time from multiple external clock sources and applying preset time synchronization rules to correct the local clock source, the problem of low time accuracy of in-vehicle equipment is solved, and high-precision time synchronization is achieved.

CN116318512BActive Publication Date: 2025-11-21GREAT WALL MOTOR CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310270358.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-20
Publication Date
2025-11-21
Estimated Expiration
2043-03-20

AI Technical Summary

Technical Problem

The time displayed by the vehicle-mounted equipment has low accuracy, especially when the satellite signal is weak or when the local clock source has been used for a long time and the time deviates significantly from the actual time.

Method used

By acquiring time from multiple external clock sources, applying preset time synchronization rules to determine the validity and error of the time, determining the target time synchronization result, and using it for time synchronization to correct the time of the local clock source.

Benefits of technology

It improves the accuracy of the time displayed by the vehicle system, avoids time deviations caused by long-term use, and ensures time synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116318512B_ABST
    Figure CN116318512B_ABST
Patent Text Reader

Abstract

Embodiments of the present application are suitable for the vehicle technical field, and provide a vehicle time time service method, device, vehicle and storage medium, the method comprises: obtaining a first time to be served from a vehicle-mounted system at a current time, and obtaining a first time from a plurality of external clock sources; for any external clock source corresponding to the first time, according to the preset time correction rule corresponding to the external clock source, the first time to be served and the first time are processed to obtain the time correction result; the preset time correction rule is used to determine the validity of the first time and the error result of the first time to be served relative to the first time; from all time correction results, determine the first time effective and the error result is the target time correction result with error; the first time corresponding to the target time correction result is used to serve the first time to be served of the vehicle-mounted system. The above method can improve the time accuracy of the first time to be served of the vehicle-mounted system.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of vehicles, and particularly relates to a vehicle time timekeeping method and device, a vehicle and a storage medium. BACKGROUND

[0002] With the development of network communication technology, the vehicle-mounted equipment in a vehicle needs to perform real-time data transmission with a satellite according to an Internet function to meet various functions of the vehicle, such as positioning, external communication or automatic driving. Therefore, the synchronization of the vehicle-mounted system time displayed by the vehicle-mounted equipment and the time of the satellite has a high requirement.

[0003] At present, the time of the vehicle-mounted equipment is usually obtained from a clock source in a Global Navigation Satellite System (GNSS) or a local clock source (Real-Time Clock, RTC) set by the vehicle-mounted equipment itself.

[0004] However, in the case that the satellite signal is weak and the output time of the local clock source deviates from the actual time more and more with the extension of the use time, the accuracy of the vehicle-mounted system time displayed by the vehicle-mounted equipment is low. SUMMARY

[0005] The application embodiment provides a vehicle time timekeeping method, device, vehicle and storage medium, which can solve the problem of low accuracy of the vehicle-mounted system time displayed by the vehicle.

[0006] In a first aspect, the application embodiment provides a vehicle time timekeeping method, which comprises:

[0007] obtaining a first time-to-be-timekept at a current time from a vehicle-mounted system, and obtaining a first time from a plurality of external clock sources respectively;

[0008] for the first time corresponding to any external clock source, processing the first time-to-be-timekept and the first time according to a preset time correction rule corresponding to the external clock source to obtain a time correction result; the preset time correction rule is used to determine the validity of the first time and an error result of the first time-to-be-timekept relative to the first time;

[0009] from all the time correction results, determining a target time correction result with a valid first time and an error result;

[0010] using the first time corresponding to the target time correction result to timekeep the first time-to-be-timekept of the vehicle-mounted system.

[0011] In a second aspect, the application embodiment provides a vehicle time timekeeping device, which comprises:

[0012] a time acquisition module, configured to acquire a first time to be time-synchronized at a current time from a vehicle-mounted system, and acquire a first time from each of a plurality of external clock sources;

[0013] a time correction module, configured to, for the first time corresponding to any external clock source, process the first time to be time-synchronized and the first time according to a preset time correction rule corresponding to the external clock source, to obtain a time correction result; the preset time correction rule is used to determine validity of the first time and an error result of the first time to be time-synchronized relative to the first time;

[0014] a target time correction result determination module, configured to, from all the time correction results, determine a target time correction result with valid first time and error result with error;

[0015] a first time-synchronization module, configured to time-synchronize the first time to be time-synchronized of the vehicle-mounted system by using the first time corresponding to the target time correction result.

[0016] In a third aspect, an embodiment of the present application provides a vehicle, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the method in the first aspect when executing the computer program.

[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and the computer program is executable by a processor to implement the method in the first aspect.

[0018] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a vehicle, causes the vehicle to perform the method in the first aspect.

[0019] The beneficial effects of the embodiments of the present application compared with the prior art are that the time service device can first acquire a first to-be-serviced time at a current time from the vehicle-mounted system, and acquire the first time from a plurality of external clock sources respectively. Then, for the first time corresponding to each external clock source, the first to-be-serviced time and the first time are processed according to a preset time correction rule corresponding to the external clock source, to determine the validity of the first time and an error result of the first to-be-serviced time relative to the first time. Then, the time service device can determine a valid first time and a target time correction result that the first to-be-serviced time has an error relative to the first time from all time correction results. Finally, the first to-be-serviced time of the local clock source is time-serviced by the first time corresponding to the target time correction result. Based on this, the time service device can directly time-service the first to-be-serviced time of the vehicle-mounted system by the first time of the target time correction result, to correct the time displayed by the vehicle-mounted system. In this way, the deviation between the to-be-serviced time displayed by the vehicle-mounted system and the actual time can be avoided to be more and more large as the use time of the vehicle-mounted system is prolonged. In this way, the time precision of the display can be improved when the vehicle displays the time on the display screen based on only the first to-be-serviced time of the vehicle-mounted system. BRIEF DESCRIPTION OF DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort.

[0021] Figure 1 is an implementation flowchart of a vehicle time time-service method provided by an embodiment of the present application;

[0022] Figure 2 is an application scenario schematic diagram of acquiring the first time in a vehicle time time-service method provided by an embodiment of the present application;

[0023] Figure 3 is an implementation flowchart of acquiring the time correction result in a vehicle time time-service method provided by an embodiment of the present application;

[0024] Figure 4 is an implementation flowchart of acquiring the time correction result in a vehicle time time-service method provided by another embodiment of the present application;

[0025] Figure 5 is a structural schematic diagram of a vehicle time time-service device provided by an embodiment of the present application;

[0026] Figure 6 is a structural schematic diagram of a vehicle provided by an embodiment of the present application. DETAILED DESCRIPTION

[0027] In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular vehicle system architectures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application can be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known vehicle systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.

[0028] It should be understood that the term "comprises" when used in this specification and the appended claims, specifies the presence of stated features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0029] In addition, in the description of the specification and the appended claims, the terms "first", "second", "third", etc. are used only to distinguish descriptions, and cannot be understood as indicating or implying relative importance.

[0030] With the development of network communication technology, the vehicle-mounted device in the vehicle needs to perform real-time data transmission with the satellite according to the Internet function, so as to meet various functions of the vehicle, such as positioning, external communication, or automatic driving. Therefore, the synchronization of the vehicle-mounted system time displayed by the vehicle-mounted device and the time of the satellite has a high requirement.

[0031] At present, the time displayed by the vehicle-mounted device is usually obtained from a clock source in a Global Navigation Satellite System (GNSS), or a local clock source (Real-Time Clock, RTC) set by the vehicle-mounted device itself, or a clock source in a Global Positioning System (GPS).

[0032] However, in a weak satellite signal scenario, data communication is prone to be poor, so that the obtained time information has a certain error. For example, the vehicle is located in a scenario without GNSS signal coverage or with very weak GNSS signal coverage. For example, when the vehicle is in a tunnel, or in cloudy, foggy, rainy, and snowy weather, or in an underground parking lot, etc., the vehicle usually cannot obtain time from the clock source in the GNSS; or the time obtained from the clock source in the GNSS has a delay, so that the time service accuracy is not high.

[0033] In addition, the time information output by the RTC clock source usually has lower precision than the time information output by the GNSS clock source, and thus, as time goes by, the time information output by the RTC clock source will deviate from the actual time more and more, resulting in a large deviation between the time displayed by the vehicle-mounted device and the actual time.

[0034] Therefore, to improve the accuracy of the time displayed by the vehicle-mounted device, the embodiments of the present application provide a vehicle time timekeeping method, which is applied to a vehicle time timekeeping device.

[0035] Referring to Figure 1 , Figure 1 An implementation flowchart of a vehicle time timekeeping method provided by the embodiments of the present application is shown, which includes the following steps:

[0036] S101, obtaining a first time to be time kept at the current time from a vehicle-mounted system, and obtaining a first time from a plurality of external clock sources.

[0037] In an embodiment, the vehicle-mounted system can be a software vehicle-mounted system, or a software-hardware combined vehicle-mounted system, and the first time to be time kept obtained from the vehicle-mounted system can be the time displayed on the display interface of the vehicle-mounted system at the current time, or the local time obtained from the local clock source of the vehicle-mounted system, and the embodiments of the present application are not limited in this regard.

[0038] In an embodiment, the vehicle-mounted system can be the operating system of the vehicle, which refers to a program set that controls and manages the hardware and software resources of the entire computing vehicle-mounted system, and reasonably organizes and schedules the work and resources of the computer to provide an interface and environment for the user and other software to communicate. Specifically, in the field of intelligent network-connected vehicles, the system that carries the comprehensive body of artificial intelligence, big data and cloud computing technology can be considered as an operating system.

[0039] In an embodiment, the local clock source can be an RTC clock source. The RTC, as the clock source integrated inside the vehicle-mounted system, responds to the speed of the vehicle-mounted system faster than the external clock source, and is more stable. For example, the external clock source is limited by the scene in which the vehicle is located, so that the clock signal obtained from the external clock source is unstable. Therefore, the time displayed by the vehicle-mounted system is usually the local time obtained from the local clock source.

[0040] In an embodiment, the external clock source includes, but is not limited to, a GNSS clock source, a clock source in a Telematics Service Provider (TSP) or a clock source in a base station, without limitation.

[0041] Specifically, referring to Figure 2 , Figure 2 is a schematic diagram of an application scenario for acquiring a first time in a vehicle time service method according to an embodiment of the present application. The T-BOX vehicle time service device is composed of a MicroControl Unit (MCU) and a System On Chip (SOC) and the like inside. Figure 2 It can be seen that the time service device can also acquire the first time from the TSP, the GNSS and the base station based on the Internet function.

[0042] The MCU is a chip that integrates the central processing unit, random access memory, read-only memory, timing counter and various I / O interfaces in a computer; the SOC is a chip that integrates the microprocessor, analog IP core, digital IP core and memory (or off-chip memory control interface). The SOC can interact with the MCU to acquire the vehicle system time from the RTC clock source set inside the MCU. In addition, other controllers in the vehicle can also interact with the MCU to acquire the vehicle system time, and then verify the validity of the communication instruction according to the vehicle system time to maintain the normal operation of the vehicle system. The communication mode includes, but is not limited to, Ethernet communication, Controller Area Network (CAN) communication and the like. The other controller can be an Electronic Control Unit (ECU).

[0043] It should be noted that when the vehicle time service method needs to be executed, the time service device can execute the vehicle time service method in real time or once every preset time interval, without limitation.

[0044] It can be understood that since the time service device can execute the vehicle time service method once every preset time interval, the time displayed by the vehicle system is usually acquired from the local clock source within the time interval.

[0045] Based on this, in the embodiment, when the vehicle time timekeeping method is performed, the timekeeping device can mainly obtain the first time to be timekept from the local clock source, and timekeep the local clock source according to the first time of the external clock source, so as to correct the deviation between the local time and the actual time caused by the long-time operation of the local clock source. In this way, after the local time of the local clock source is corrected each time, the time obtained and displayed from the local clock source has higher accuracy within the preset timekeeping interval.

[0046] In another embodiment, the vehicle-mounted system can also be restarted, so that the first time to be timekept obtained from the vehicle-mounted system is abnormal. At this time, the obtained first time to be timekept can be different from the actual time. For example, when the timekeeping device determines that the state of the local clock source during the restart of the vehicle-mounted system is the power-on state, it can be considered that the local clock source is in normal operation during the restart, and therefore the first time to be timekept obtained from the local clock source of the vehicle-mounted system can be the same as the actual time. However, when the state of the local clock source is the power-off state, it can be considered that the local clock source has not been operated for a long time. That is, the first time to be timekept obtained from the local clock source of the vehicle-mounted system after the restart usually has an error. Based on this, the timekeeping device can determine the preset time to be timekept as the first time to be timekept.

[0047] Based on the above description, when it is determined that the state of the local clock source during the restart of the vehicle-mounted system is the power-on state, the first time to be timekept can be the same as the actual time, and therefore the timekeeping device can perform the vehicle time timekeeping method once every preset timekeeping interval. However, if it is determined that the state of the local clock source during the restart of the vehicle-mounted system is the power-off state, the timekeeping device can immediately perform the vehicle time timekeeping method once, and then perform the vehicle time timekeeping method once every preset timekeeping interval, so as to ensure the accuracy of the time displayed by the vehicle-mounted system.

[0048] S102, for any first time corresponding to an external clock source, processing the first time to be timekept and the first time according to a preset time correction rule corresponding to the external clock source to obtain a time correction result; the preset time correction rule is used to determine the validity of the first time and the error result of the first time to be timekept relative to the first time.

[0049] In an embodiment, the different external clock sources can have the same preset time correction rule, or can have different preset time correction rules, which are not limited herein. The first time is the time obtained from the external clock source at the current time.

[0050] Specifically, when the external clock source includes a satellite clock source, it can be obtained according to the time of the satellite clock source at the current time, and the time correction rule can be a time correction rule for correcting the error between the time of the satellite clock source at the current time and the actual time. Figure 3The S301-S305 shown determines the validity of the first time, and the error result of the first time-to-be-granted relative to the first time. Details are as follows:

[0051] S301, acquire a time sequence; the time sequence includes a plurality of second times acquired from a satellite clock source continuously in a first preset time length.

[0052] In an embodiment, the above-mentioned satellite clock source can be the above-mentioned GNSS clock source and GPS clock source, which will not be described again. Wherein, the above-mentioned first preset time length can be set according to actual conditions, which is not limited. It should be noted that for different first clock sources, the corresponding first preset time length can be different.

[0053] In an embodiment, the number of the above-mentioned first time can be determined according to a first receiving period of the time-to-be-granted device acquiring the second time from the first clock source. Specifically, the time-to-be-granted device can determine the ratio of the first preset time length to the first receiving period as the number of the second time received in the first preset time length.

[0054] Wherein, the above-mentioned first time sequence should include the second time received every first receiving period before the current time. Wherein, when the current time becomes the next time, the first time at this time will become the second time, and the time acquired from the first clock source at the next time will be the first time. That is, the "first" in the first time is only used to distinguish that the time acquired by the first time is the current time.

[0055] It should be noted that if no second time is acquired from the first clock source for a long time, or the vehicle-mounted system is restarted, there is no second time in the time sequence at this time. Based on this, the second time at this time can be initialized as a preset time. For example, 00:00:00 participates in the subsequent step processing.

[0056] It can be understood that in the time sequence, because the first preset time length is certain, and the first receiving period of receiving the second time from the first clock source is fixed, therefore, the number of the second time in the time sequence is also certain. Based on this, with the passage of time, the second time in the time sequence will usually change. Wherein, the first preset time length should be greater than the first receiving period, otherwise, there is no multiple second time in the time sequence.

[0057] For example, the first preset time length can be 1s, and the first receiving period can be 100ms. That is, the second time is acquired from the first clock source once every 100ms.

[0058] In an embodiment, n second times can be fixedly stored in the time sequence, where Tn can be considered as the nth acquired second time; T1 is the earliest acquired first time in the time sequence. When the current time changes, the first time Tn+1 received by the time service device will be used as the second time to replace Tn in the time sequence and become the new second time; and the time sequence is replaced in turn until the earliest acquired second time T1 is replaced by T2 to form a new time sequence.

[0059] S302, determine a first time difference between the first time and the earliest acquired second time in the time sequence and the first preset time length.

[0060] S303, determine a second time difference between the first time and the first time to be served.

[0061] In an embodiment, the first time difference is the time difference obtained by subtracting the second time and the first preset time length from the first time of the current time. The second time difference is the time difference obtained by subtracting the first time to be served from the first time.

[0062] It should be noted that in the calculation process, the first time difference and the second time difference should be taken as absolute values to participate in subsequent processing.

[0063] S304, determine a time jump result between any two adjacent acquired second times.

[0064] In an embodiment, the time jump result includes two results of no jump and jump. Specifically, if in any two adjacent acquired first times, the second time acquired later is later than the second time acquired earlier, it is determined that the time jump result is no jump; if in any two adjacent acquired second times, the second time acquired later is earlier than or equal to the second time acquired earlier, it can be determined that the time jump result is jump.

[0065] It can be understood that the time service device continuously acquires the second time from the first clock source, so that under normal circumstances, the second time acquired later should be earlier than the second time acquired earlier. Under normal circumstances, it should be one first receiving period earlier.

[0066] Based on this, when the second time acquired later is later than the second time acquired earlier, it can be determined that the time jump result is no jump; for example, Ti is later than Ti-1; otherwise, it can be determined that the time jump result is jump. That is, Ti is earlier than Ti-1. Wherein, 1≤i≤n.

[0067] It should be noted that, when the second time in the time sequence has a time jump, although the first time may not have a time jump, the second time with a time jump may have an impact on the subsequent second time received in the time sequence. Therefore, in order to improve the time service accuracy, when the time jump result is a time jump, it can be considered that the first time received at this time is invalid.

[0068] It should be added that, when the time jump result is determined to be a time jump, in order to make the time jump result not affect the validity judgment of the next obtained target first time, the second time obtained earlier and the previously obtained second time should be deleted from the time sequence to form a new time sequence.

[0069] Specifically, when Ti is earlier than Ti-1, the second times between T1 and Ti-1 can be deleted, at this time, Ti is reas T1 in the time sequence, and forms a new time sequence with the subsequently continuously obtained multiple second times.

[0070] S305, determining a time service result of the first time according to the first time difference, the second time difference and the time jump result.

[0071] In an embodiment, the above-mentioned preset time service rule is used to determine the validity of the first time and the error result of the first time to be time-served time relative to the first time. Based on this, the time service device can determine that the first time is valid when the first time difference is less than the first preset time length and the time jump result is not a time jump; and determine that the first time is invalid when the first time difference is greater than or equal to the first preset time length and / or the time jump result is a time jump. And, when the second time difference is greater than the first preset time length, it is determined that the error result has an error; and when the second time difference is less than or equal to the first preset time length, it is determined that the error result does not have an error.

[0072] Specifically, because the above-mentioned time sequence includes multiple second times continuously obtained from the external first clock source within the first preset time length, under normal circumstances, the first time and the earliest obtained second time in the time sequence should be separated by the first preset time length. That is, after subtracting the earliest obtained second time in the time sequence from the first time and subtracting the first preset time length, the first time difference is usually 0.

[0073] Based on this, when determining whether the first time is valid based on the first time difference, the time service device can directly determine that the first time is invalid when it is determined that the first time difference is greater than or equal to the first preset time length, that is, the time interval between the first time and the earliest obtained second time in the time sequence is greater than or equal to two first preset time lengths.

[0074] However, when the first time difference is determined to be less than the first preset time length, further determination needs to be made in combination with the time jump result. For example, when the time jump result is no jump, it is determined that the first time length is valid. In this way, the invalid first time can be avoided to be used as the first to-be-time-provisioned time of the vehicle-mounted system, the problems of clock backflow and clock jump of the external clock source in the time-provisioning process can be solved, and the time-provisioning accuracy of the vehicle-mounted system can be improved.

[0075] In another embodiment, the external clock source can also include a cloud clock source of the vehicle-mounted system. In this case, different external clock sources can have different preset time correction rules. Therefore, the manner in which the time-provisioning device corrects the first time of the cloud clock source is generally different from the steps S301-S305 described above. Specifically, the time-provisioning device can determine the validity of the first time and the error result of the first to-be-time-provisioned time relative to the first time according to S401-S403 as shown in the following. Figure 4

[0076] S401, determine the interval time length of the last time when the second to-be-time-provisioned time in the vehicle-mounted system is time-provisioned.

[0077] In an embodiment, the interval time length is the current time, and the time when the first to-be-time-provisioned time of the vehicle-mounted system is time-provisioned by using the target time correction result corresponding to the last time.

[0078] It can be understood that, in order to improve the time-provisioning accuracy, the manner in which the time-provisioning device obtains the first time from the multiple external clock sources should be different. In this way, when an abnormal situation occurs in a certain external clock source, the time-provisioning device can still perform the vehicle time-provisioning method described above.

[0079] For example, the manner in which the first time is obtained from the external clock source in the steps S301-S305 described above can rely on satellite signals, and the manner in which the first time is obtained from the external clock source in the steps S401-S403 can rely on network communication or broadcast message functions. For example, the cloud clock source can be a TSP clock source or a clock source in a base station.

[0080] Specifically, when the vehicle is in a special scenario (for example, in a scenario where the satellite signal is weak) and cannot obtain the first time from the satellite clock source (GNSS clock source or GPS clock source), in order to improve the time-provisioning accuracy, the time-provisioning device can also obtain the first time from the cloud clock source (TSP clock source or clock source in a base station) to time-provision the first to-be-time-provisioned time.

[0081] S402, determine the third time difference between the first time and the first to-be-time-provisioned time.

[0082] ​In an embodiment, the third time difference is a time difference between the first time and the first time to be time-synchronized, and when performing the subsequent steps, the absolute value of the third time difference can be used for processing.

[0083] S403, determining a time-synchronized result of the first time according to the interval duration and the third time difference.

[0084] Specifically, when the interval duration is greater than the preset interval duration, the time-synchronized device can determine that the first time is valid; when the interval duration is less than or equal to the preset interval duration, the time-synchronized device can determine that the first time is invalid. In addition, when the third time difference is greater than the second preset duration, the time-synchronized device can determine that the error result has an error; when the third time difference is less than or equal to the second preset duration, the time-synchronized device can determine that the error result does not have an error.

[0085] The preset interval duration and the second preset duration can be set according to actual conditions, and are not limited. For example, the preset interval duration can be 24 hours.

[0086] S103, determining a target time-synchronized result from all time-synchronized results, in which the first time is valid and the error result has an error.

[0087] In an embodiment, the target time-synchronized result is that the first time is valid, and the first time to be time-synchronized has an error relative to the valid first time.

[0088] It should be noted that when performing the above S102 step, there is usually only one target time-synchronized result in the plurality of time-synchronized results. However, when there are multiple target time-synchronized results in which the first time is valid and the first time to be time-synchronized has an error relative to the valid first time, the time-synchronized device can use the first time corresponding to the target time-synchronized result with the highest priority to time-synchronize the first time to be time-synchronized according to the priority of the external clock source corresponding to the target time-synchronized result, so as to further improve the accuracy of time-synchronizing the first time to be time-synchronized.

[0089] For example, the time accuracy of the GNSS external clock source is usually higher than that of the TSP external clock source, and therefore, the priority of the GNSS external clock source can be set to be higher than that of the TSP external clock source.

[0090] In another embodiment, when performing the preset time-synchronized rule, the time-synchronized device can be provided with a plurality of modules to perform each preset time-synchronized rule in parallel. Therefore, when performing the S102 step, the time-synchronized device can also use the first time corresponding to the first target time-synchronized result obtained first to time-synchronize the first time to be time-synchronized, so as to further improve the efficiency of time-synchronizing the first time to be time-synchronized.

[0091] Specifically, the time service device can have two independent modules to perform the method of S101-S104 to determine the target time correction result, and to time the first time to be time-served according to the target time correction result. In this way, the coupling degree of the programming process can be reduced, and a flexible, scalable or changeable clock source can be realized. For example, when the second clock source needs to be changed, only the independent module of the second clock source needs to be programmed.

[0092] S104, time the first time to be time-served of the vehicle-mounted system according to the first time corresponding to the target time correction result.

[0093] In an embodiment, the first time to be time-served in S101 can be the time displayed on the display interface of the vehicle-mounted system at the current time, or can be the local time obtained from the local clock source of the vehicle-mounted system. Moreover, when the vehicle time service method is not executed, the time displayed on the display interface of the vehicle-mounted system is usually the local time obtained from the local clock source.

[0094] Based on this, when the first time to be time-served is timed, the local time of the local clock source can be directly timed. Furthermore, the time service device can correct the local clock source which has been running for a long time, so that the deviation between the local time and the actual time becomes larger and larger. In this way, within a preset time interval, the accuracy of the time obtained and displayed by the vehicle-mounted system from the local clock source can be improved.

[0095] It should be particularly noted that from the above explanations of S102 and S103, it can be known that the time service device can obtain time from the local clock source and the first clock source respectively. However, if the first time is determined to be valid every time, i.e., the S104 step is executed, the frequency of time service performed by the time service device can be relatively high. Based on this, the purpose of timing the first time corresponding to the target time correction result is to reduce the time service frequency on the basis of ensuring that the accuracy of the first time to be time-served in the vehicle-mounted system is relatively high. That is, when the first time is determined to be valid, the time service device also needs to determine the time correction result according to the error result between the first time and the first time to be time-served in the vehicle-mounted system. Then, when the error result is determined to be that the first time to be time-served in the vehicle-mounted system has an error, and the first time is valid, the first time is timed as the first time to be time-served in the vehicle-mounted system. Otherwise, when the error result is determined to be that the time of the vehicle-mounted system does not have an error, the first time to be time-served in the vehicle-mounted system is still maintained.

[0096] In the embodiment, the time service device can first acquire the first to-be-serviced time at the current time from the vehicle-mounted system, and acquire the first time from the plurality of external clock sources respectively. Then, for the first time corresponding to any external clock source, the first to-be-serviced time and the first time are processed according to the preset time service rule corresponding to the external clock source, to determine the validity of the first time and the error result of the first to-be-serviced time relative to the first time. Then, the time service device can determine the target time service result of the valid first time and the first to-be-serviced time relative to the first time from all the time service results. Finally, the first to-be-serviced time of the local clock source is time-serviced by the first time corresponding to the target time service result. Based on this, the time service device can directly time-service the first to-be-serviced time of the vehicle-mounted system by the first time of the target time service result, to correct the time displayed by the vehicle-mounted system. In this way, the deviation between the to-be-serviced time displayed by the vehicle-mounted system and the actual time can be avoided to be more and more large as the use time of the vehicle-mounted system is prolonged. In this way, the time precision of the displayed time can be improved when the vehicle displays the time on the display screen based on only the first to-be-serviced time of the vehicle-mounted system.

[0097] Please refer to Figure 5 , Figure 5 is a structural block diagram of a vehicle time time-service device provided by the embodiment. The vehicle time time-service device in the embodiment includes various modules for executing various steps in the embodiments of Figure 1 、 Figure 3 and Figure 4 . For details, please refer to the related descriptions in the embodiments of Figure 1 、 Figure 3 and Figure 4 , and Figure 1 、 Figure 3 and Figure 4 . For the convenience of description, only the parts related to the embodiment are shown. Please refer to Figure 5 , the vehicle time time-service device 500 can include a time acquisition module 510, a time service module 520, a target time service result determination module 530, and a first time service module 540, wherein:

[0098] The time acquisition module 510 is configured to acquire the first to-be-serviced time at the current time from the vehicle-mounted system, and acquire the first time from the plurality of external clock sources respectively.

[0099] The time service module 520 is configured to, for the first time corresponding to any external clock source, process the first to-be-serviced time and the first time according to the preset time service rule corresponding to the external clock source, to obtain a time service result; the preset time service rule is used to determine the validity of the first time and the error result of the first to-be-serviced time relative to the first time.

[0100] The target time correction result determination module 530 is configured to determine, from all the time correction results, a first time correction result as the target time correction result, which is valid and has an error.

[0101] The first time service module 540 is configured to perform time service on a first to-be-served time of the vehicle-mounted system by using a first time corresponding to the target time correction result.

[0102] In an embodiment, the external clock source comprises a satellite clock source; and the time correction module 520 is further configured to:

[0103] acquire a time sequence, the time sequence comprising a plurality of second times successively acquired from the satellite clock source within a first preset time length; determine a first time, a first time difference between the earliest acquired second time in the time sequence and the first time; determine a second time difference between the first time and the first to-be-served time; determine a time jump result between any two adjacent acquired second times; and determine the time correction result of the first time according to the first time difference, the second time difference and the time jump result.

[0104] In an embodiment, the time correction module 520 is further configured to:

[0105] If the second time acquired later than the second time acquired earlier among any two adjacent acquired second times is later than the second time acquired earlier, it is determined that the time jump result is no jump; and if the second time acquired later than the second time acquired earlier among any two adjacent acquired second times is earlier than or equal to the second time acquired earlier, it is determined that the time jump result is jump.

[0106] In an embodiment, the time correction module 520 is further configured to:

[0107] If the first time difference is less than the first preset time length and the time jump result is no jump, it is determined that the first time is valid; if the first time difference is greater than or equal to the first preset time length and / or the time jump result is jump, it is determined that the first time is invalid; if the second time difference is greater than the first preset time length, it is determined that the error result has error; and if the second time difference is less than or equal to the first preset time length, it is determined that the error result has no error.

[0108] In an embodiment, the external clock source comprises a cloud clock source of the vehicle-mounted system; and the time correction module 520 is further configured to:

[0109] determine an interval time length of the last time of performing time service on a second to-be-served time in the local clock source; determine a third time difference between the first time and the first to-be-served time; and determine the time correction result of the first time according to the interval time length and the third time difference.

[0110] In an embodiment, the time correction module 520 is further configured to:

[0111] If the interval duration is greater than the preset interval duration, it is determined that the first time is valid; if the interval duration is less than or equal to the preset interval duration, it is determined that the first time is invalid; if the third time difference is greater than the second preset duration, it is determined that the error result has an error; if the interval duration is less than or equal to the preset interval duration, it is determined that the error result has no error.

[0112] In an embodiment, the vehicle time timekeeping device 500 further comprises:

[0113] A clock state determining module is configured to determine a clock state of the local clock source during the restart process of the vehicle-mounted system.

[0114] A second timekeeping module is configured to, if the clock state is the power-on state, determine the to-be-timekept time of the local clock source at the current time as the first to-be-timekept time, and perform the step of timekeeping the first to-be-timekept time of the vehicle-mounted system by the first time corresponding to the target time correction result according to the preset timekeeping interval duration.

[0115] A third timekeeping module is configured to, if the clock state is the power-off state, determine the initialized preset to-be-timekept time as the first to-be-timekept time, and perform the step of timekeeping the first to-be-timekept time of the vehicle-mounted system by the first time corresponding to the target time correction result.

[0116] It is understood that, Figure 5 The structure block diagram of the vehicle time timekeeping device is shown, each module is configured to perform Figure 1 the steps in the corresponding embodiments, and for Figure 1 the steps in the corresponding embodiments have been explained in detail in the above embodiments, please refer to Figure 1 , Figure 3 and Figure 4 , and Figure 1 , Figure 3 and Figure 4 corresponding embodiments for relevant description, which will not be repeated here.

[0117] Figure 6 is a structure block diagram of a vehicle provided by an embodiment of the present application. As Figure 6 shown, the vehicle 600 of the embodiment comprises a processor 610, a memory 620, and a computer program 630 stored in the memory 620 and executable by the processor 610, such as a program of a vehicle time timekeeping method. The processor 610 implements the steps in each embodiment of the vehicle time timekeeping method described above when executing the computer program 630, such as Figure 1 S101 to S104 shown. Alternatively, the processor 610 implements the functions of each module in the corresponding embodiment described above when executing the computer program 630, such as Figure 5 , for example, Figure 5The functions of the illustrated modules 510-540 are described in detail in the Figure 5 The relevant descriptions in the corresponding embodiments.

[0118] For example, the computer program 630 can be divided into one or more modules, which are stored in the memory 620 and executed by the processor 610 to implement the vehicle time service method provided by the embodiments of the present application. One or more modules can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program 630 in the vehicle 600. For example, the computer program 630 can implement the vehicle time service method provided by the embodiments of the present application.

[0119] The vehicle 600 can include, but is not limited to, a processor 610, a memory 620. Those skilled in the art can understand that the vehicle 600 can also include other components required for the vehicle 600 to perform the vehicle time service method provided by the embodiments of the present application, and these components will not be described in detail herein. Figure 6 The vehicle 600 is only an example and does not constitute a limitation on the vehicle 600, and can include more or fewer components than the illustrated components, or combine certain components, or different components, for example, the vehicle can also include an input / output device, a network access device, a bus, etc.

[0120] The processor 610 can be a central processing unit, and can also be other general-purpose processors, digital signal processors, application-specific integrated circuits, ready programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0121] The memory 620 can be an internal storage unit of the vehicle 600, for example, a hard disk or a memory of the vehicle 600. The memory 620 can also be an external storage device of the vehicle 600, for example, a plug-in hard disk, a smart memory card, a flash memory card, etc. equipped on the vehicle 600. Further, the memory 620 can include both the internal storage unit and the external storage device of the vehicle 600.

[0122] The embodiments of the present application provide a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to perform the vehicle time service method in each of the above embodiments.

[0123] The embodiments of the present application provide a computer program product, which, when running on a vehicle, causes the vehicle to perform the vehicle time service method in each of the above embodiments.

[0124] The above examples are only used to illustrate the technical solutions of the present application, but not limit the same; although the present application has been described in detail with reference to the foregoing examples, those skilled in the art should understand that the technical solutions recorded in the foregoing examples can be modified, or some technical features can be replaced by equivalent ones; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. A vehicle timekeeping method, characterized by, The method comprises: obtaining a first time to be timed from a vehicle-mounted system at a current time, and obtaining a first time from a plurality of external clock sources respectively; the external clock sources include satellite clock sources; for any first time corresponding to an external clock source, processing the first time to be timed and the first time according to a preset time correction rule corresponding to the external clock source to obtain a time correction result; the preset time correction rule is used to determine the validity of the first time and an error result of the first time to be timed relative to the first time; from all the time correction results, determining a target time correction result in which the first time is valid and the error result has an error; using the first time corresponding to the target time correction result to time the first time to be timed of the vehicle-mounted system; the processing of the first time to be timed and the first time according to the preset time correction rule corresponding to the external clock source to obtain a time correction result comprises: obtaining a time sequence; the time sequence includes a plurality of second times continuously obtained from the satellite clock source within a first preset time length; determining a first time difference; the first time difference is a time difference obtained by subtracting the second time from the first time at the current time and the first preset time length; determining a second time difference between the first time and the first time to be timed; determining a time jump result between any two adjacent second times obtained; determining the time correction result of the first time according to the first time difference, the second time difference and the time jump result; the determination of the time jump result between any two adjacent second times obtained comprises: if the second time obtained later is later than the second time obtained earlier in any two adjacent second times obtained, it is determined that the time jump result is not jumping; if the second time obtained later is earlier than or equal to the second time obtained earlier in any two adjacent second times obtained, it is determined that the time jump result is jumping.

2. The method of claim 1, wherein, the determination of the time correction result of the first time according to the first time difference, the second time difference and the time jump result comprises: if the first time difference is less than the first preset time length, and the time jump result is not jumping, it is determined that the first time is valid; if the first time difference is greater than or equal to the first preset time length, and / or the time jump result is jumping, it is determined that the first time is invalid; if the second time difference is greater than the first preset time length, it is determined that the error result has an error; if the second time difference is less than or equal to the first preset time length, it is determined that the error result does not have an error.

3. The method of claim 1, wherein, The method further comprises: determining the clock state of a local clock source during the restart process of the vehicle-mounted system; if the clock state is a power-on state, the time to be timed of the local clock source at the current time is determined as the first time to be timed, and the step of using the first time corresponding to the target time correction result to time the first time to be timed of the vehicle-mounted system is performed according to a preset time interval. If the clock state is the powered-off state, the preset standby time to be set is determined as the first time to be set, and the step of setting the first time to be set of the vehicle-mounted system by the first time corresponding to the target time correction result is performed.

4. A vehicle timekeeping method, characterized by, The method comprises: acquiring a first time to be set at a current time from a vehicle-mounted system, and acquiring a first time from a plurality of external clock sources respectively; the external clock sources include a cloud clock source of the vehicle-mounted system; for any first time corresponding to an external clock source, processing the first time to be set and the first time according to a preset time correction rule corresponding to the external clock source to obtain a time correction result; the preset time correction rule is used to determine the validity of the first time and an error result of the first time to be set relative to the first time; from all the time correction results, determining the first time to be valid and the error result to be the target time correction result with error; setting the first time to be set of the vehicle-mounted system by the first time corresponding to the target time correction result; the processing of the first time to be set and the first time according to the preset time correction rule corresponding to the external clock source to obtain the time correction result further comprises: determining an interval duration; the interval duration is the duration between the current time and the time when the first time to be set of the vehicle-mounted system is set by the first time corresponding to the target time correction result last time; determining a third time difference between the first time and the first time to be set; determining the time correction result of the first time according to the interval duration and the third time difference; the determination of the time correction result of the first time according to the interval duration and the third time difference comprises: if the interval duration is greater than a preset interval duration, the first time is determined to be valid; if the interval duration is less than or equal to the preset interval duration, the first time is determined to be invalid; if the third time difference is greater than a second preset duration, the error result is determined to have error; if the third time difference is less than or equal to the second preset duration, the error result is determined to have no error.

5. The method of claim 4, wherein, The method further comprises: determining the clock state of the local clock source during the restart process of the vehicle-mounted system; if the clock state is the powered-on state, the time to be set of the local clock source at the current time is determined as the first time to be set, and the step of setting the first time to be set of the vehicle-mounted system by the first time corresponding to the target time correction result is performed according to the preset time interval; if the clock state is the powered-off state, the preset standby time to be set is determined as the first time to be set, and the step of setting the first time to be set of the vehicle-mounted system by the first time corresponding to the target time correction result is performed.

6. A vehicle timekeeping device characterized by The device comprises: a time acquisition module for acquiring a first time to be set at a current time from a vehicle-mounted system, and acquiring a first time from a plurality of external clock sources respectively; the external clock sources include a satellite clock source; The time correction module is configured to, for a first time corresponding to any of the external clock sources, process the first time to be corrected and the first time according to a preset time correction rule corresponding to the external clock source, to obtain a time correction result; the preset time correction rule is used to determine validity of the first time and an error result of the first time to be corrected relative to the first time; The target time correction result determination module is configured to determine, from all the time correction results, the first time that is valid and the error result that has an error as a target time correction result; The first time correction module is configured to correct the first time to be corrected of the vehicle-mounted system by using a first time corresponding to the target time correction result. The time correction module is further configured to: obtain a time sequence; the time sequence includes a plurality of second times that are continuously obtained from the satellite clock source within a first preset time length; determine a first time difference; the first time difference is a time difference obtained by subtracting the second time from the first time at the current time and the first preset time length; determine a second time difference between the first time and the first time to be corrected; determine a time jump result between any two adjacent second times obtained; determine a time correction result of the first time according to the first time difference, the second time difference, and the time jump result; The time correction module is further configured to: if, in any two adjacent second times obtained, the second time obtained later is later than the second time obtained earlier, it is determined that the time jump result is no jump; if, in any two adjacent second times obtained, the second time obtained later is earlier than or equal to the second time obtained earlier, it is determined that the time jump result is jump.

7. A vehicle comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the method of any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, the computer-readable storage medium comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 7. The computer program is executed by the processor to implement the method of any one of claims 1 to 5.

Citation Information

Patent Citations

  • Time synchronization method and time synchronization system of vehicle and vehicle

    CN112398563A

  • Multi-clock-source time service method, device, equipment and medium

    CN115567141A