Multi-core controller clock calibration method, device and equipment and storage medium
By obtaining the network connection status in the on-board wireless communication box, determining the external calibration reference time and sending it to the MCU core, the offset problem of processor time calibration and synchronization in the vehicle control system is solved, and the high-precision time synchronization and reliability improvement of the system is achieved.
Patent Information
- Application Number
- CN202411617318.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-03-18
AI Technical Summary
There is a deviation in the time calibration and synchronization of the processor cores of each subsystem in the vehicle control system, which affects the stable and efficient operation of the system.
By obtaining the current network connection status in the on-board wireless communication box, the external calibration reference time is determined, and time calibration information is generated, and sent to the MCU core to complete the main core time calibration. The MCU core transmits the calibrated processor clock synchronization information to the SOC core to realize dual-core time synchronization.
It realizes accurate time calibration and synchronization of the processor cores of each subsystem in the vehicle control system, improves the accuracy and reliability of the system, and ensures the normal operation of the vehicle's remote monitoring, safety functions and data recording functions.
Smart Images

Figure CN119652457A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle technology, and in particular to a multi-core controller clock calibration method, device, equipment and storage medium. Background Art
[0002] With the development of intelligent transportation systems and vehicle networking technology, vehicles not only need to exchange data with external networks, but also need to achieve efficient data synchronization and communication between multiple control units inside the vehicle. The development of this technology has brought higher requirements for the time synchronization accuracy of vehicle control processors to ensure the accuracy of data processing and the reliability of communication.
[0003] Vehicle control systems require precise time synchronization to support various applications such as vehicle positioning, navigation, data logging, and accident analysis when implementing vehicle control and communication functions. These applications rely on accurate timestamps to ensure data consistency and reliability. However, the system time offsets of the processor clocks of different subsystems in the vehicle are different during driving, so the clock calibration of such multi-core controllers has become a key factor affecting whether the vehicle system can operate stably and efficiently.
[0004] Therefore, how to achieve time calibration and synchronization of the processor cores of various subsystems in a vehicle control system is a technical problem that needs to be solved urgently in this field. Summary of the invention
[0005] The main purpose of this application is to provide a multi-core controller clock calibration method, device, equipment and storage medium, aiming to solve the technical problem of how to achieve time calibration and synchronization of the processor cores of each subsystem in a vehicle control system.
[0006] To achieve the above object, the present application provides a multi-core controller clock calibration method, which is applied to a vehicle-mounted wireless communication box, wherein the vehicle-mounted wireless communication box has a built-in real-time clock chip RTC, and the multi-core controller clock calibration method comprises the following steps: Get the current network connection status; Determining an external calibration reference time according to the network connection state; Generate time calibration information according to the external calibration reference time, and send the time calibration information to the MCU core to complete the main core time calibration.
[0007] Optionally, determining a calibration reference time according to the network connection state includes: When the vehicle-mounted wireless communication box is in an online state, obtaining the current network UTC time; Calibrate the local RTC chip according to the network UTC time, and obtain the system time according to the calibrated local RTC chip; The system time of the calibrated local RTC chip is used as the external calibration reference time.
[0008] Optionally, determining the calibration reference time according to the network connection state further includes: When the vehicle-mounted wireless communication box is in an offline state, obtaining the current cumulative offline time; When the offline accumulated time is less than a preset offline calibration threshold, the system time of the local RTC chip is retrieved, and the system time of the local RTC chip is used as the external calibration reference time.
[0009] Optionally, the multi-core controller clock calibration method is applied to an MCU core, the MCU core has a built-in backup real-time clock chip RTC, and the multi-core controller clock calibration method includes: Get the time calibration information sent by the vehicle wireless communication box; Calibrate the local MCU system time according to the time calibration information; Determine processor clock synchronization information based on the calibrated local MCU system time; The processor clock synchronization information is transmitted to the SOC core to complete dual-core time synchronization.
[0010] Optionally, calibrating the local MCU system time according to the time calibration information includes: According to the time calibration information, obtaining the clock calibration history record and the external calibration reference time of the vehicle-mounted wireless communication box; A confidence evaluation result of the external calibration reference time according to the clock calibration history record; Determining a local MCU calibration reference time according to the confidence evaluation result; The backup RTC chip is calibrated according to the local MCU calibration reference time to complete the calibration of the local MCU system time.
[0011] Optionally, the confidence evaluation result of the external calibration reference time according to the clock calibration history record includes: Determining a system clock offset parameter according to the clock calibration history record; According to the system clock offset parameter, the local MCU theoretical time is obtained; A confidence evaluation result of the external calibration reference time is obtained according to the local MCU theoretical time and the real-time local MCU system time.
[0012] Optionally, determining a system clock offset parameter according to the clock calibration history record includes: Obtaining an offline calibration history record according to the clock calibration history record; According to the offline calibration history record, obtain the total offline interval duration and the total calibration time difference; A system time drift coefficient is obtained according to the total duration of the offline interval and the total difference of the calibration time, and the system time drift coefficient is used as the system clock offset parameter.
[0013] In addition, to achieve the above-mentioned purpose, the present application also provides a multi-core controller clock calibration device, the multi-core controller clock calibration device comprising: The network status monitoring module is used to obtain the current network connection status; A data analysis module, used to determine an external calibration reference time according to the network connection state; The time calibration processing module is used to generate time calibration information according to the external calibration reference time, and send the time calibration information to the MCU core to complete the main core time calibration.
[0014] In addition, to achieve the above-mentioned objectives, the present application also provides a multi-core controller clock calibration device, which includes: a memory, a processor, and a multi-core controller clock calibration program stored on the memory and executable on the processor, wherein the multi-core controller clock calibration program is configured to implement the steps of the multi-core controller clock calibration method as described above.
[0015] In addition, to achieve the above-mentioned purpose, the present application also provides a storage medium, on which a multi-core controller clock calibration program is stored. When the multi-core controller clock calibration program is executed by a processor, the steps of the multi-core controller clock calibration method described above are implemented.
[0016] The present application obtains the current network connection status on the vehicle-mounted wireless communication box; determines the external calibration reference time based on the network connection status; generates time calibration information based on the external calibration reference time, and sends the time calibration information to the MCU core to complete the main core time calibration, and then the MCU core transmits the calibrated processor clock synchronization information to the SOC core to complete the dual-core time synchronization.
[0017] In summary, the present application obtains the calibration reference time of the vehicle control processor through the on-board wireless communication box and synchronizes it to the MCU core to achieve accurate time calibration. In the online state, the on-board wireless communication box and the local RTC chip of the MCU are calibrated by obtaining the network UTC time. In the offline state, the calibration reference time called in the RTC chip is analyzed for confidence based on the offline time and the calibration reference time in the current state is determined to complete the clock calibration of the MCU core. After the MCU core completes the calibration, the calibration time is immediately synchronized to the SOC core to complete the multi-core time synchronization in the vehicle controller, ensuring the consistency of the dual-core time, improving the time synchronization accuracy of the vehicle control processor, and enhancing the robustness of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0020] Figure 1 This is a flow chart of the first embodiment of the multi-core controller clock calibration method of the present application; Figure 2 This is a flow chart of a second embodiment of a multi-core controller clock calibration method of the present application; Figure 3 This is a schematic diagram of the functional modules of the multi-core controller clock calibration device of the present application; Figure 4 It is a structural diagram of a terminal device in the hardware operating environment involved in the embodiment of the present application.
[0021] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0022] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0023] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0024] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a multi-core controller clock calibration device, etc. The following takes a multi-core controller clock calibration device as an example to illustrate this embodiment and the following embodiments.
[0025] The present application embodiment provides a multi-core controller clock calibration method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the present application.
[0026] In this embodiment, the multi-core controller clock calibration method is applied to a vehicle-mounted wireless communication box, and the vehicle-mounted wireless communication box has a built-in real-time clock chip RTC. The multi-core controller clock calibration method includes: Step A10: Obtain the current network connection status.
[0027] It should be noted that the vehicle-mounted wireless communication box refers to a vehicle-mounted terminal device, namely TBOX (Telematics Box). It connects the vehicle and the cloud through wireless communication technology to provide intelligent services for car owners. TBOX is a key component in the Internet of Vehicles system. It not only realizes data exchange between the vehicle and the cloud, but also provides a variety of intelligent services. Real-Time Clock (RTC) is a special microchip that can run independently and provide accurate time and date information for computer systems, embedded systems, etc. RTC usually has an independent power supply (such as a battery) to maintain time continuity even when the main system is powered off.
[0028] It is understandable that this TBOX with built-in RTC chip can realize local calibration and online calibration. When TBOX is connected to the Internet, it can obtain accurate time data from the online network, receive network time data from the remote server and perform subsequent calibration on the clocks of various local parts. When it is not connected to the Internet, it can call the local RTC chip time for subsequent calibration. Through the dual guarantee of online calibration and local calibration, TBOX can ensure that it can provide accurate time information under different network conditions.
[0029] It should be understood that the network time is more accurate than the RTC chip time. When connecting to the Internet, the network time is used as the reference time and the local RTC time of TBOX is calibrated. Only after the local calibration is completed will the clocks of the MCU processor core and the SOC processor core be calibrated.
[0030] Step A20: Determine an external calibration reference time according to the network connection status.
[0031] It should be noted that the reference time for subsequent multi-core clock calibration is different depending on the network connection status. When connected to the Internet, TBOX will obtain the latest UTC time from the external network (such as the NTP server). This time is a globally unified time standard, which can ensure that the TBOX clock is synchronized with the international standard time. When not connected to the Internet, the local RTC chip time is used as the external calibration reference time.
[0032] It is understandable that the calibration behavior is repeated at a certain time period. Regardless of the current network status, the calibration behavior is uninterrupted, which helps to reduce clock deviations caused by network instability or long-term offline.
[0033] In one embodiment, determining the calibration reference time according to the network connection status includes: when the vehicle-mounted wireless communication box is in an online state, obtaining the current network UTC time; calibrating the local RTC chip according to the network UTC time, and obtaining the system time according to the calibrated local RTC chip; and using the system time of the calibrated local RTC chip as the external calibration reference time.
[0034] It should be understood that although the time of the RTC chip may not be as accurate as the network time, it can still provide a relatively accurate time reference, especially in a short period of offline state. Due to its high stability, the time information provided by the RTC chip is very close to the real time in accuracy. Combined with the periodic calibration process, the RTC chip deployed in TBOX can meet the calibration reference time requirements of the entire vehicle control system in an offline environment.
[0035] In one embodiment, determining the calibration reference time based on the network connection status also includes: when the vehicle-mounted wireless communication box is in an offline state, obtaining the current cumulative offline time; when the cumulative offline time is less than a preset offline calibration threshold, retrieving the system time of the local RTC chip, and using the system time of the local RTC chip as the external calibration reference time.
[0036] It should be noted that the premise of retrieving the local RTC chip time is an offline environment. However, when the offline time from the last online time to the current time is too long and exceeds the preset offline calibration threshold, it may mean that the TBOX has other forms of failure. This time is generally 24 hours or longer, and the time after the vehicle is powered off and turned off is not included. When this threshold is exceeded, the driver should be prompted to check the TBOX before performing subsequent calibration work.
[0037] Step A30: Generate time calibration information according to the external calibration reference time, and send the time calibration information to the MCU core to complete the main core time calibration.
[0038] It should be noted that no matter whether it is the latest UTC time obtained from the network or the time of the local RTC chip, the system will generate time calibration information based on this reference time. In addition to the external calibration reference time, the time calibration information also includes the networking status of TBOX. After receiving this information, the MCU core can decide whether to select the external calibration reference time to complete the main core time calibration.
[0039] It is understandable that MCU is usually designed for simple control applications and is suitable for handling simple and specific tasks, such as real-time vehicle control tasks (such as engine control, braking system, steering system, etc.) and management of internal vehicle network communications. Therefore, MCU has higher requirements for clock accuracy. The MCU here also has a built-in RTC chip, which is used to calibrate the local time without using external information when the confidence of the external calibration reference time is not high.
[0040] The present application obtains the network connection status at the current moment; determines the external calibration reference time according to the network connection status; generates time calibration information according to the external calibration reference time, and sends the time calibration information to the MCU core to complete the main core time calibration.
[0041] In summary, the present application can ensure that the vehicle control system can perform effective clock calibration under different network conditions through the above steps, provide a reference basis for subsequent time calibration and synchronization between multiple cores, improve the accuracy and reliability of the system, and is crucial for vehicle remote monitoring, safety functions and data recording functions. This method not only improves the intelligence level of the vehicle control system, but also provides a solid foundation for the development of vehicle autonomous driving and vehicle networking technology.
[0042] Reference Figure 2 , Figure 2 This is a flow chart of a second embodiment of a multi-core controller clock calibration method of the present application. Based on the above-mentioned first embodiment, a second embodiment of a multi-core controller clock calibration method of the present application is proposed.
[0043] In this embodiment, the multi-core controller clock calibration method is applied to an MCU core, and the MCU core has a built-in real-time clock chip RTC. The multi-core controller clock calibration method includes: Step B10: Obtain the time calibration information sent by the vehicle-mounted wireless communication box.
[0044] It should be noted that the present invention has built-in real-time clock chips RTC in both the on-board wireless communication box (TBOX) and the MCU. The two sets of RTC chips work independently, which can ensure that even if the MCU is disconnected from the TBOX or one of them fails, the other can still provide time services. The RTC in the MCU can be used as a backup time source to ensure that the clock calibration and synchronization of the MCU core and the SOC core are not affected, thereby improving the time redundancy and reliability of the entire system.
[0045] It is understood that the MCU core receives time calibration information from TBOX through the internal communication interface. This information may include the current UTC time, time zone information, daylight saving time adjustment, etc., as well as the network connection status of TBOX and the timestamp of the RTC chip.
[0046] Step B20: Calibrate the local MCU system time according to the time calibration information.
[0047] In one embodiment, calibrating the local MCU system time according to the time calibration information includes: obtaining the clock calibration history record and the external calibration reference time of the vehicle-mounted wireless communication box according to the time calibration information; evaluating the confidence result of the external calibration reference time according to the clock calibration history record; determining the local MCU calibration reference time according to the confidence evaluation result; and calibrating the backup RTC chip according to the local MCU calibration reference time to complete the calibration of the local MCU system time.
[0048] It is understandable that since the external calibration reference time may be the RTC chip time sent when TBOX is not connected to the Internet, this time needs to be analyzed for confidence before the MCU performs local calibration. If the confidence of the external calibration reference time is high, the MCU core may give priority to this time; if the confidence is low, the MCU core may rely on the local RTC chip time or other internal calibration mechanisms.
[0049] It should be noted that this process is limited to the case where the external calibration reference time is the RTC chip time sent when the TBOX is not connected to the Internet. Assuming that the external calibration reference time is the real-time network time, there is no need to perform confidence analysis and the calibration can be directly called.
[0050] In one embodiment, the confidence assessment result of the external calibration reference time based on the clock calibration history record includes: determining a system clock offset parameter based on the clock calibration history record; obtaining a local MCU theoretical time based on the system clock offset parameter; and obtaining a confidence assessment result of the external calibration reference time based on the local MCU theoretical time and the real-time local MCU system time.
[0051] It should be noted that by analyzing the clock calibration history, the MCU core can identify the deviation trend or pattern of the system clock over time. These historical data provide information about how the system clock drifts with environmental changes (such as temperature changes), allowing the MCU core to determine an offset parameter that reflects the average deviation of the system clock relative to the external reference time.
[0052] It is understood that, using the determined system clock offset parameters, the MCU core can calculate a theoretical time, which is based on the external calibration reference time and takes into account the offset parameters. This theoretical time represents the time that the MCU core would have if there was no offset. By comparing the theoretical time of the local MCU with the real-time local MCU system time, the MCU core can evaluate the confidence of the external calibration reference time. If the theoretical time is not much different from the real-time system time, it means that the external calibration reference time is reliable; if there is a large deviation, it may indicate that the external calibration reference time is inaccurate or there are other problems.
[0053] In one embodiment, determining the system clock offset parameter based on the clock calibration history record includes: obtaining an offline calibration history record based on the clock calibration history record; obtaining a total offline interval duration and a total calibration time difference based on the offline calibration history record; obtaining a system time drift coefficient based on the total offline interval duration and the total calibration time difference, and using the system time drift coefficient as the system clock offset parameter.
[0054] It should be noted that for each offline calibration event, the system will accumulate the total duration of the offline interval. At the same time, the system will also calculate the total difference between the real time and the time before calibration, that is, the cumulative value of the difference between the actual time and the expected time at each calibration, so as to determine an average level that needs to be calibrated, and estimate the possible deviation size based on the offline duration of this time.
[0055] It can be understood that this method provides a method for calculating system clock offset parameters based on actual historical data, thereby improving the accuracy and reliability of clock calibration.
[0056] Step B30: Determine processor clock synchronization information according to the calibrated local MCU system time.
[0057] It should be noted that the processor clock synchronization information includes not only the current precise time, but may also include the time calibration deviation value, the calibration timestamp, and any necessary clock adjustment instructions. This information will be used to synchronize the time of the MCU core with other processor cores (such as the SOC core) to ensure the time consistency of the entire vehicle control system. The determined clock synchronization information will be sent to other processor cores that need to be synchronized through the vehicle's internal communication network (such as CAN, LIN or Ethernet).
[0058] Step B40: Transmit the processor clock synchronization information to the SOC core to complete dual-core time synchronization.
[0059] It can be understood that after the MCU completes the time calibration, it transmits it to the SOC core as soon as possible to help it perform time calibration, that is, the transmission of the processor clock synchronization information is real-time, ensuring that the SOC core can adjust its internal clock according to the latest time calibration information to keep consistent with the MCU core time.
[0060] This embodiment first obtains the time calibration information sent by the vehicle-mounted wireless communication box; calibrates the local MCU system time according to the time calibration information; determines the processor clock synchronization information according to the calibrated local MCU system time; and transmits the processor clock synchronization information to the SOC core to complete the dual-core time synchronization.
[0061] In summary, by building in the real-time clock chip RTC in the vehicle wireless communication box (TBOX) and MCU respectively, an efficient and reliable vehicle multi-core controller clock calibration method is realized. This method can maintain the continuity of time service when the TBOX and MCU are disconnected or any unit fails, thereby enhancing the time redundancy and reliability of the system. The MCU main core can intelligently evaluate the confidence of the external calibration reference time by analyzing the clock calibration history, and calibrate the local system time accordingly, improving the accuracy of clock calibration, and transmitting it to the SOC core in real time, ensuring the time consistency between the MCU core and the SOC core. This method improves the safety and response speed of the vehicle.
[0062] Reference Figure 3 The present application also provides a multi-core controller clock calibration device, the multi-core controller clock calibration device comprising: The network status monitoring module 10 is used to obtain the current network connection status; A data analysis module 20, configured to determine an external calibration reference time according to the network connection status; The time calibration processing module 30 is used to generate time calibration information according to the external calibration reference time, and send the time calibration information to the MCU core to complete the main core time calibration.
[0063] In one embodiment, the data analysis module 20 is also used to obtain the current network UTC time when the vehicle-mounted wireless communication box is in an online state; calibrate the local RTC chip according to the network UTC time, and obtain the system time according to the calibrated local RTC chip; and use the system time of the calibrated local RTC chip as the external calibration reference time.
[0064] In one embodiment, the data analysis module 20 is also used to obtain the current cumulative offline time when the vehicle-mounted wireless communication box is in an offline state; when the cumulative offline time is less than a preset offline calibration threshold, the system time of the local RTC chip is retrieved, and the system time of the local RTC chip is used as the external calibration reference time.
[0065] In one embodiment, the time calibration processing module 30 is also used to obtain time calibration information sent by the vehicle-mounted wireless communication box; calibrate the local MCU system time according to the time calibration information; determine the processor clock synchronization information according to the calibrated local MCU system time; and transmit the processor clock synchronization information to the SOC core to complete dual-core time synchronization.
[0066] In one embodiment, the time calibration processing module 30 is also used to obtain the clock calibration history record and the external calibration reference time of the vehicle-mounted wireless communication box according to the time calibration information; according to the clock calibration history record, a confidence evaluation result of the external calibration reference time; according to the confidence evaluation result, a local MCU calibration reference time is determined; according to the local MCU calibration reference time, the backup RTC chip is calibrated to complete the calibration of the local MCU system time.
[0067] In one embodiment, the time calibration processing module 30 is also used to determine the system clock offset parameter based on the clock calibration history record; obtain the local MCU theoretical time based on the system clock offset parameter; and obtain the confidence evaluation result of the external calibration reference time based on the local MCU theoretical time and the real-time local MCU system time.
[0068] In one embodiment, the time calibration processing module 30 is also used to obtain an offline calibration history record based on the clock calibration history record; obtain a total offline interval duration and a total difference between the calibration time based on the offline calibration history record; obtain a system time drift coefficient based on the total offline interval duration and the total difference between the calibration time, and use the system time drift coefficient as the system clock offset parameter.
[0069] Reference below Figure 4, which shows a schematic diagram of the structure of a multi-core controller clock calibration device suitable for implementing an embodiment of the present application. The multi-core controller clock calibration device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The multi-core controller clock calibration device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0070] like Figure 4 As shown, the multi-core controller clock calibration device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the multi-core controller clock calibration device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the multi-core controller clock calibration device to communicate with other devices wirelessly or by wire to exchange data. Although the multi-core controller clock calibration device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0071] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0072] The multi-core controller clock calibration device provided by the present application adopts the multi-core controller clock calibration method in the above embodiment, which can solve the technical problem of how to achieve time calibration and synchronization of the processor cores of each subsystem in the vehicle control system in the art. Compared with the prior art, the beneficial effects of the multi-core controller clock calibration device provided by the present application are the same as the beneficial effects of the multi-core controller clock calibration method provided by the above embodiment, and the other technical features in the multi-core controller clock calibration device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0073] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0074] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0075] The present application also provides a storage medium, on which a multi-core controller clock calibration program is stored. When the multi-core controller clock calibration program is executed by a processor, the steps of the multi-core controller clock calibration method described in any one of the above are implemented.
[0076] The storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: RandomAccess Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0077] The storage medium mentioned above may be included in the multi-core controller clock calibration device; or may exist independently without being assembled into the multi-core controller clock calibration device.
[0078] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the multi-core controller clock calibration device, the multi-core controller clock calibration device: obtains the network connection status at the current moment; determines the external calibration reference time according to the network connection status; generates time calibration information according to the external calibration reference time, and sends the time calibration information to the MCU core to complete the main core time calibration.
[0079] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0080] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0081] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0082] The storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned multi-core controller clock calibration method, and can solve the technical problem of how to achieve time calibration and synchronization of the processor cores of each subsystem in the vehicle control system. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the multi-core controller clock calibration method provided in the above-mentioned embodiment, and will not be repeated here.
[0083] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A multi-core controller clock calibration method, characterized in that: Applied to a vehicle-mounted wireless communication box, the vehicle-mounted wireless communication box has a built-in real-time clock chip RTC, and the multi-core controller clock calibration method includes: Get the current network connection status; Determining an external calibration reference time according to the network connection state; Generate time calibration information according to the external calibration reference time, and send the time calibration information to the MCU core to complete the main core time calibration.
2. The multi-core controller clock calibration method according to claim 1, characterized in that: The step of determining a calibration reference time according to the network connection state includes: When the vehicle-mounted wireless communication box is in an online state, obtaining the current network UTC time; Calibrate the local RTC chip according to the network UTC time, and obtain the system time according to the calibrated local RTC chip; The system time of the calibrated local RTC chip is used as the external calibration reference time.
3. The multi-core controller clock calibration method according to claim 1, characterized in that: The step of determining the calibration reference time according to the network connection state further includes: When the vehicle-mounted wireless communication box is in an offline state, obtaining the current cumulative offline time; When the offline accumulated time is less than a preset offline calibration threshold, the system time of the local RTC chip is retrieved, and the system time of the local RTC chip is used as the external calibration reference time.
4. A multi-core controller clock calibration method, characterized in that: Applied to an MCU core, the MCU core has a built-in backup real-time clock chip RTC, and the multi-core controller clock calibration method includes: Get the time calibration information sent by the vehicle wireless communication box; Calibrate the local MCU system time according to the time calibration information; Determine processor clock synchronization information based on the calibrated local MCU system time; The processor clock synchronization information is transmitted to the SOC core to complete dual-core time synchronization.
5. The multi-core controller clock calibration method according to claim 4, characterized in that: The step of calibrating the local MCU system time according to the time calibration information includes: According to the time calibration information, obtaining the clock calibration history record and the external calibration reference time of the vehicle-mounted wireless communication box; A confidence evaluation result of the external calibration reference time according to the clock calibration history record; Determining a local MCU calibration reference time according to the confidence evaluation result; The backup RTC chip is calibrated according to the local MCU calibration reference time to complete the calibration of the local MCU system time.
6. The multi-core controller clock calibration method according to claim 5, characterized in that: The confidence evaluation result of the external calibration reference time according to the clock calibration history record includes: Determining a system clock offset parameter according to the clock calibration history record; According to the system clock offset parameter, the local MCU theoretical time is obtained; A confidence evaluation result of the external calibration reference time is obtained according to the local MCU theoretical time and the real-time local MCU system time.
7. The multi-core controller clock calibration method according to claim 6, characterized in that: Determining the system clock offset parameter according to the clock calibration history record includes: Obtaining an offline calibration history record according to the clock calibration history record; According to the offline calibration history record, obtain the total offline interval duration and the total difference between the calibration time; A system time drift coefficient is obtained according to the total duration of the offline interval and the total difference of the calibration time, and the system time drift coefficient is used as the system clock offset parameter.
8. A multi-core controller clock calibration device, characterized in that: The multi-core controller clock calibration device comprises: The network status monitoring module is used to obtain the current network connection status; A data analysis module, used to determine an external calibration reference time according to the network connection state; The time calibration processing module is used to generate time calibration information according to the external calibration reference time, and send the time calibration information to the MCU core to complete the main core time calibration.
9. A multi-core controller clock calibration device, characterized in that: The multi-core controller clock calibration device includes: a memory, a processor, and a multi-core controller clock calibration program stored in the memory and executable on the processor, wherein the multi-core controller clock calibration program is configured to implement the steps of the multi-core controller clock calibration method as described in any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores a multi-core controller clock calibration program, which, when executed by a processor, implements the steps of the multi-core controller clock calibration method according to any one of claims 1 to 7.
Citation Information
Cited By
Electronic device, clock calibration method, storage medium, and program product
CN120335550A