Time synchronization method and device, electronic equipment and storage medium
By obtaining and adjusting the local time of multiple base stations in the intelligent metropolitan area network, the problem of time desynchronization between MAR equipment and base stations when the time server fails or the transmission link is interrupted is solved, ensuring network synchronization and user experience.
Patent Information
- Application Number
- CN202411095834.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-10-18
AI Technical Summary
In the communication network, when the time server fails or the transmission link is interrupted, the MAR equipment of the intelligent metropolitan area network will freely oscillate, causing time to be out of synchronization and affecting the synchronization of the entire network.
By obtaining the local time of multiple base stations connected to the smart metropolitan area network, adjusting the local time of the MAR device to obtain the target local time, and based on this time, the local time of the base station connected to the MAR device is synchronously adjusted to reduce time desynchronization. problem.
In the event of abnormal time synchronization, ensure the normal use of the MAR device and the base station connected to it, improve user experience, and reduce the occurrence of time desynchronization.
Smart Images

Figure CN118804267A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of wireless communications, and in particular to a time synchronization method, device, electronic device and storage medium. Background Art
[0002] In the communication network, the time server is used to provide time for the devices in the communication network. Among them, the convergence layer router (MER) and access layer router (MAR) of the intelligent metropolitan area network in the communication network can use the best master clock algorithm (BMCA) in the 1588V2 protocol to obtain the time provided by the time server. Then the MAR device of the intelligent metropolitan area network sends this time to the base station connected to the MAR device, thus ensuring that the time of the entire communication network is synchronized.
[0003] However, when a time server fails or a transmission link in a communication network is interrupted, the MAR device of the intelligent metropolitan area network may generate free oscillation, which may cause the time of the intelligent metropolitan area network to be out of synchronization. Summary of the invention
[0004] The present application provides a time synchronization method, device, electronic device and storage medium, which can reduce the problem of time asynchrony in an intelligent metropolitan area network.
[0005] In order to achieve the above objectives, this application adopts the following technical solutions:
[0006] In a first aspect, the present application provides a time synchronization method, the method comprising:
[0007] In response to a time synchronization anomaly in an intelligent metropolitan area network, local times of multiple base stations connected to the intelligent metropolitan area network are obtained; based on the local times of the multiple base stations, the local time of the MAR device is adjusted to obtain a target local time; based on the target local time, the local time of the base station connected to the MAR device is time-synchronized and adjusted.
[0008] In combination with the first aspect, in a possible implementation manner, the intelligent metropolitan area network includes multiple MAR devices, wherein one MAR device is connected to one base station;
[0009] Obtaining the local time of multiple base stations connected to the intelligent metropolitan area network, including: obtaining the local time of the base station connected to the MAR device; sending a time acquisition request to other MAR devices among the multiple MAR devices except the current MAR device, the time acquisition request is used to request to obtain the local time of the base station connected to the other MAR devices; receiving the local time returned by the other MAR devices based on the time acquisition request; based on the local time of the base station connected to the MAR device and the local time returned by the other MAR devices, obtaining the local time of the multiple base stations connected to the intelligent metropolitan area network.
[0010] In combination with the first aspect, in a possible implementation manner, obtaining local time of multiple base stations connected to the intelligent metropolitan area network includes at least one of the following:
[0011] Obtain the local time of a preset number of base stations from multiple base stations connected to the intelligent metropolitan area network; obtain the local time of a pre-specified base station from multiple base stations connected to the intelligent metropolitan area network; obtain the local time of a base station in working state from multiple base stations connected to the intelligent metropolitan area network.
[0012] In combination with the first aspect, in a possible implementation manner, adjusting the local time of the MAR device based on the local times of multiple base stations to obtain the target local time includes:
[0013] Based on the local times of the multiple base stations, determine the local time with the smallest difference from the local time of the MAR device; based on the local time with the smallest difference from the local time of the MAR device, adjust the local time of the MAR device to obtain the target local time.
[0014] In combination with the first aspect, in a possible implementation manner, based on the target local time, time synchronization adjustment is performed on the local time of the base station connected to the MAR device, including:
[0015] A time adjustment instruction is sent to a base station connected to the MAR device, where the time adjustment instruction is used to instruct to adjust the local time of the base station to the target local time.
[0016] In combination with the first aspect above, in a possible implementation method, for a base station among multiple base stations that has an antenna for receiving a global positioning system GPS signal, the local time of the base station is determined based on the GPS signal; for a base station among multiple base stations that does not have an antenna for receiving a GPS signal, the local time of the base station is determined based on the 1588V2 protocol.
[0017] In a second aspect, the present application provides a time synchronization device, the device comprising:
[0018] An acquisition unit, configured to acquire local time of multiple base stations connected to the intelligent metropolitan area network in response to a time synchronization anomaly of the intelligent metropolitan area network;
[0019] A first adjustment unit, configured to adjust the local time of the MAR device based on the local times of the multiple base stations to obtain a target local time;
[0020] The second adjustment unit is used to perform time synchronization adjustment on the local time of the base station connected to the MAR device based on the target local time.
[0021] In combination with the above second aspect, in a possible implementation manner, the intelligent metropolitan area network includes multiple MAR devices, one of which is connected to one base station;
[0022] Acquisition unit for:
[0023] Obtain the local time of the base station connected to the MAR device; send a time acquisition request to other MAR devices among multiple MAR devices except the current MAR device, the time acquisition request is used to request to obtain the local time of the base station connected to other MAR devices; receive the local time returned by other MAR devices based on the time acquisition request; based on the local time of the base station connected to the MAR device and the local time returned by other MAR devices, obtain the local time of multiple base stations connected to the intelligent metropolitan area network.
[0024] In conjunction with the second aspect, in a possible implementation manner, the acquiring unit is configured to perform at least one of the following:
[0025] Obtain the local time of a preset number of base stations from multiple base stations connected to the intelligent metropolitan area network; obtain the local time of a pre-specified base station from multiple base stations connected to the intelligent metropolitan area network; obtain the local time of a base station in working state from multiple base stations connected to the intelligent metropolitan area network.
[0026] In combination with the second aspect, in a possible implementation manner, the first adjustment unit is used to:
[0027] Based on the local times of the multiple base stations, determine the local time with the smallest difference from the local time of the MAR device; based on the local time with the smallest difference from the local time of the MAR device, adjust the local time of the MAR device to obtain the target local time.
[0028] In combination with the second aspect, in a possible implementation manner, the second adjustment unit is used to:
[0029] A time adjustment instruction is sent to a base station connected to the MAR device, where the time adjustment instruction is used to instruct to adjust the local time of the base station to the target local time.
[0030] In combination with the above-mentioned second aspect, in a possible implementation method, for a base station among multiple base stations that has an antenna for receiving a global positioning system GPS signal, the local time of the base station is determined based on the GPS signal; for a base station among multiple base stations that does not have an antenna for receiving a GPS signal, the local time of the base station is determined based on the 1588V2 protocol.
[0031] In a third aspect, the present application provides an electronic device comprising: a processor and a communication interface; the communication interface and the processor are coupled, and the processor is used to run a computer program or instructions to implement a time synchronization method as described in the first aspect and any possible implementation method of the first aspect.
[0032] In a fourth aspect, the present application provides a computer-readable storage medium, which stores instructions. When the instructions are executed on an electronic device, the electronic device executes the time synchronization method described in the first aspect and any possible implementation of the first aspect.
[0033] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute a time synchronization method as described in the first aspect and any possible implementation manner of the first aspect.
[0034] In a sixth aspect, the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run a computer program or instructions to implement a time synchronization method as described in the first aspect and any possible implementation method of the first aspect.
[0035] Specifically, the chip provided in the present application also includes a memory for storing computer programs or instructions.
[0036] It should be noted that the above computer instructions may be stored in whole or in part on a computer-readable storage medium, wherein the computer-readable storage medium may be packaged together with the processor of the device, or may be packaged separately from the processor of the device, which is not limited in this application.
[0037] The descriptions of the second to sixth aspects of the present application can refer to the detailed description of the first aspect; and the beneficial effects of the descriptions of the second to sixth aspects can refer to the beneficial effect analysis of the first aspect, which will not be repeated here.
[0038] In this application, the name of the above-mentioned time synchronization device does not limit the device or functional module itself. In actual implementation, these devices or functional modules may appear with other names. As long as the functions of each device or functional module are similar to those of this application, they fall within the scope of the claims of this application and their equivalent technologies.
[0039] These and other aspects of the present application will become more apparent from the following description.
[0040] Based on the above technical solution, the time synchronization method provided by the present application, in the case of abnormal time synchronization of the intelligent metropolitan area network, adjusts the local time of the MAR device by acquiring the local time of multiple base stations connected to the intelligent metropolitan area network, and obtains the adjusted target local time, and based on the target local time, adjusts the local time of the base station connected to the MAR device, which can reduce the problem of time asynchrony in the intelligent metropolitan area network, thereby ensuring the normal use of the MAR device and the base station connected to the MAR device in the case of abnormal time synchronization of the intelligent metropolitan area network, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 A schematic diagram of time synchronization of a communication network provided in an embodiment of the present application;
[0042] Figure 2 A schematic diagram of time asynchrony in a communication network provided in an embodiment of the present application;
[0043] Figure 3 A schematic diagram of the architecture of a time synchronization method provided in an embodiment of the present application;
[0044] Figure 4 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0045] Figure 5 A flowchart of a time synchronization method provided in an embodiment of the present application;
[0046] Figure 6 A flowchart of another time synchronization method provided in an embodiment of the present application;
[0047] Figure 7 A flow chart of a local time determined by a base station having an antenna for receiving GPS signals provided in an embodiment of the present application;
[0048] Figure 8 A time synchronization flow chart of a base station with an antenna for receiving GPS signals provided in an embodiment of the present application;
[0049] Fig. 9 A time synchronization flow chart of a base station that does not have an antenna for receiving GPS signals provided in an embodiment of the present application;
[0050] Fig.10 A schematic diagram of the structure of a time synchronization device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0052] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0053] The terms "first" and "second" and the like in the specification and drawings of this application are used to distinguish different objects, or to distinguish different processing of the same object, rather than to describe a specific order of objects.
[0054] In addition, the terms "including" and "having" and any variations thereof mentioned in the description of the present application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
[0055] It should be noted that, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0056] In the description of the present application, unless otherwise specified, “plurality” means two or more.
[0057] The following explains the terms involved in the embodiments of the present application to facilitate the reader's understanding.
[0058] (1) Intelligent metropolitan area network, a network used to transmit various voice and data services. In the embodiment of the present application, the intelligent metropolitan area network includes a core layer, a convergence layer and an access layer. The core layer can provide high-bandwidth service bearing and transmission, and complete interconnection with the existing network; the convergence layer can provide user service data aggregation and distribution processing for service access nodes, and the convergence layer includes switch equipment, etc.; the access layer can realize user access, and the access layer includes router equipment, etc.
[0059] (2) 1588V2 protocol is a standard protocol for precise time synchronization of control systems. It can achieve high-precision time synchronization between devices. In the embodiment of the present application, the MAR device and MER device in the intelligent metropolitan area network, and the base station connected to the MAR device can obtain time based on the 1588V2 protocol.
[0060] (3) The best master clock algorithm (BMCA) can divide the clocks in the network into master clocks and slave clocks, and determine the best master clock in the network. The device's own time tracks the time of the master clock to ensure the time synchronization and stable operation of the devices in the network.
[0061] The communication network includes a bearer network, of which the intelligent metropolitan area network is an important part. In the communication network, the time server can obtain accurate time from the satellite to provide time for the devices in the communication network. The MER devices and MAR devices in the intelligent metropolitan area network can obtain time based on the BMCA algorithm passed by the 1588V2 protocol. The MER devices and MAR devices in the intelligent metropolitan area network automatically determine an optimal master clock based on the judgment result of the BMCA algorithm, that is, they can automatically track a primary time signal. This optimal master clock source may be a time server or a device in the intelligent metropolitan area network.
[0062] That is to say, in the process of obtaining time, according to the judgment result of the BMCA algorithm, some devices obtain time directly from the time server, and some devices obtain time from a device in the intelligent metropolitan area network. Since the entire communication network link is communicating normally, that is to say, the time obtained from a device in the intelligent metropolitan area network can be considered to be obtained indirectly from the time server, that is, in the communication network, the time of the MER device and the MAR device in the intelligent metropolitan area network is synchronized. Then the intelligent metropolitan area network MAR device sends this time to the base station connected to the MAR device.
[0063] The current fifth generation mobile communication technology (5G) base station can be divided into a base station with an antenna for receiving global positioning system (GPS) signals and a base station without an antenna for receiving GPS signals, such as a base station deployed in an underground or subway scene. Among them, for a base station with an antenna for receiving GPS signals, the local time can be determined from the received GPS signal, and the base station can also receive the time sent by the time server based on the 1588V2 protocol and forwarded by the MAR device of the intelligent metropolitan area network, thereby determining the local time, and giving priority to the local time determined from the received GPS signal. For a base station that does not have an antenna for receiving GPS signals, it can only receive the time sent by the time server based on the 1588V2 protocol and forwarded by the MAR device of the intelligent metropolitan area network, thereby determining the local time. In other words, for a base station that does not have an antenna for receiving GPS signals, the path to determine the local time is from the time server to the MAR device of the intelligent metropolitan area network and then to the base station connected to the MAR device.
[0064] like Figure 1 As shown in the figure, a schematic diagram of time synchronization of a communication network is introduced. The time server obtains time from the satellite, and then the MER device and MAR device in the intelligent metropolitan area network can obtain time based on the 1588V2 protocol combined with the BMCA algorithm. Then the MAR device sends the time to the base station connected to the MAR device. Among them, the base station with an antenna for receiving GPS signals obtains the local time from the received GPS signal.
[0065] However, when a time server fails or a transmission link is interrupted in a communication network, the MER and MAR devices in the intelligent metropolitan area network will generate free oscillations, which will cause the time between these devices to be out of sync. Due to the judgment results based on the BMCA algorithm, the master clock sources determined by these devices are not the same, which will cause the entire communication network time to be out of sync. For base stations, the local time between base stations with antennas that receive GPS signals and base stations without antennas that receive GPS signals will be out of sync. When the local time difference between a base station and its neighboring base stations is large, a base station synchronization alarm message will appear. Figure 2 As shown, a schematic diagram of time asynchrony in a communication network is introduced.
[0066] In view of this, the time synchronization method provided in the embodiment of the present application, when the time synchronization of the smart metropolitan area network is abnormal, adjusts the local time of the MAR device by acquiring the local time of multiple base stations connected to the smart metropolitan area network, and obtains the adjusted target local time, and based on the target local time, synchronizes and adjusts the local time of the base station connected to the MAR device, which can reduce the problem of time asynchrony in the smart metropolitan area network, thereby ensuring the normal use of the MAR device and the base station connected to the MAR device when the time synchronization of the smart metropolitan area network is abnormal, thereby improving the user experience.
[0067] The implementation of the embodiments of the present application will be described in detail below in conjunction with the accompanying drawings.
[0068] Figure 3 The following is a schematic diagram of the architecture of a time synchronization method provided in an embodiment of the present application. Figure 3 As shown, the architecture includes: a MAR device 301 and a base station 302 connected to the MAR device.
[0069] In some embodiments, the MAR device 301 may be provided with a communication function, such as a communication function between the MAR device 301 and a base station 302 connected to the MAR device, and a communication function between MAR devices.
[0070] In the embodiment of the present application, the MAR device 301 may send a time acquisition request to the base station 302 connected to the MAR device and other MAR devices except the current MAR device, so as to acquire the local time of the corresponding device.
[0071] In some embodiments, the base station 302 connected to the MAR device may provide a storage function, such as storing the local time of the base station itself, to facilitate subsequent flexible access.
[0072] In a possible implementation, the base station 302 connected to the MAR device may be divided into a base station 3021 having an antenna for receiving GPS signals and a base station 3022 not having an antenna for receiving GPS signals.
[0073] The base station 3021 having an antenna for receiving GPS signals determines the local time of the base station based on the GPS signals.
[0074] The base station 3022 which does not have an antenna for receiving GPS signals determines the local time of the base station based on the 1588V2 protocol.
[0075] It should be noted that the base station 302 connected to the MAR device can be a base station device in a 5G network, or a base station in a future communication system, etc. The base station can include various macro base stations, micro base stations, home base stations, wireless remotes, reconfigurable intelligent surfaces (RIS), routers, wireless fidelity (WIFI) devices and other network side devices, which are not limited to this embodiment of the present application.
[0076] In the embodiment of the present application, the MAR device 301 can provide a target local time for the base station 302 connected to the MAR device, so as to perform time synchronization adjustment on the local time of the base station 302 connected to the MAR device.
[0077] It should be noted that one MAR device in the intelligent metropolitan area network is connected to one base station. The intelligent metropolitan area network includes multiple MAR devices, and the time synchronization process needs to be performed for each MAR device. For a MAR device, the time synchronization process can be: in the case of abnormal time synchronization in the intelligent metropolitan area network, the MAR device 301 sends a time acquisition request to the base station 302 connected to the MAR device and other MAR devices except the current MAR device, which is used to obtain the local time of the base station 302 connected to the MAR device and the local time of the base station connected to other MAR devices; then based on the local time returned by the base station 302 connected to the MAR device, the MAR device 301 adjusts the local time and obtains the target local time; finally, based on the target local time, the MAR device 301 sends the target local time to the base station 302 connected to the MAR device for time adjustment.
[0078] In some embodiments, Figure 3 In the architecture shown, the MAR device 301 and the base station 302 connected to the MAR device can establish a connection through a communication link to achieve communication between the MAR device 301 and the base station 302 connected to the MAR device. The communication link can be a wired link or a wireless link, which is not limited in the embodiments of the present application.
[0079] When implemented through hardware, the MAR device can be integrated as follows Figure 4 The hardware structure of the electronic device shown in FIG. Figure 4 As shown, the hardware structure of the electronic device is introduced.
[0080] Figure 4 The hardware structure diagram of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 4As shown, the electronic device includes at least one processor 401, a communication line 402, and at least one communication interface 404, and may also include a memory 403. The processor 401, the memory 403 and the communication interface 404 may be connected via the communication line 402.
[0081] Processor 401 can be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application, such as: one or more digital signal processors (DSP), or one or more field programmable gate arrays (FPGA).
[0082] The communication line 402 may include a wired line for transmitting information between the above-mentioned components.
[0083] The communication interface 404 is used to communicate with other devices or communication networks, and can use any transceiver-like device, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), etc.
[0084] The memory 403 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, an optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to include or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.
[0085] In one possible design, the memory 403 can exist independently of the processor 401, that is, the memory 403 can be a memory outside the processor 401. In this case, the memory 403 can be connected to the processor 401 through the communication line 402, and is used to store execution instructions or application code, and the execution is controlled by the processor 401 to implement the switching configuration method provided in the following embodiment of the present application. In another possible design, the memory 403 can also be integrated with the processor 401, that is, the memory 403 can be the internal memory of the processor 401, for example, the memory 403 is a high-speed cache, which can be used to temporarily store some data and instruction information.
[0086] As a possible implementation, the processor 401 may include one or more CPUs, for example Figure 4 As another possible implementation, the electronic device may include multiple processors, such as Figure 4 As another possible implementation, the electronic device may further include an output device 405 and an input device 406.
[0087] It should be pointed out that the various embodiments of the present application can refer to each other, for example, the same or similar steps, method embodiments, system embodiments and device embodiments can refer to each other without limitation.
[0088] Figure 5 A flowchart of a time synchronization method provided in an embodiment of the present application, which can be applied to Figure 3 In the architecture shown in Figure 5 As shown, the method comprises the following steps:
[0089] S501. In response to a time synchronization anomaly in a smart metropolitan area network, a MAR device obtains local time of multiple base stations connected to the smart metropolitan area network.
[0090] The time synchronization anomaly of the intelligent metropolitan area network may be that the time between MAR devices in the intelligent metropolitan area network is not synchronized.
[0091] In one possible implementation, when a time server fails or a transmission link in a communication network is interrupted, the MER devices and MAR devices in the smart metropolitan area network cannot obtain the precise time provided by the time server, and the MER devices and MAR devices in the smart metropolitan area network will oscillate freely themselves, causing the local times of these devices to be out of sync, and the determination result of the BMCA algorithm in the communication network will switch from tracking the time of the master clock to tracking the time of the slave clock. Based on the determination result of the BMCA algorithm, the clock sources determined by these devices are not the same, that is, the tracked times are inconsistent, resulting in time asynchrony in the entire communication network.
[0092] In one possible implementation, the method by which the MAR device obtains the local time of multiple base stations connected to the smart metropolitan area network includes at least one of the following methods: obtaining the local time of a preset number of base stations from the multiple base stations connected to the smart metropolitan area network; obtaining the local time of a pre-specified base station from the multiple base stations connected to the smart metropolitan area network; obtaining the local time of a base station in working state from the multiple base stations connected to the smart metropolitan area network.
[0093] The preset number may be a preset value, such as 3.
[0094] The pre-designated base station may be a MAR device that pre-stores a unique identification code of a specific base station. In the case of abnormal time synchronization of the intelligent metropolitan area network, the MAR device can obtain the local time of the corresponding base station according to the stored unique identification code.
[0095] A base station in working state may be a base station that can communicate normally with a MAR device. For example, a MAR device sends information to a base station connected to the MAR device, and the information is used to determine whether the base station can communicate normally. Within a preset time, the base station can normally send a response to the information to the MAR device.
[0096] Taking the example that there are 5 base stations connected to the intelligent metropolitan area network, of which 3 are preset and the pre-designated base stations are a, b, and c, the way for the MAR device to obtain the local time of multiple base stations connected to the intelligent metropolitan area network can be that the MAR device obtains the local time of base stations a, b, and c from the multiple base stations connected to the intelligent metropolitan area network.
[0097] In this way, the MAR device can obtain the local time of multiple base stations in a variety of ways to ensure that data is provided for obtaining the target local time during the subsequent time synchronization process.
[0098] In this way, when the time synchronization of the intelligent metropolitan area network is abnormal, the local time of multiple base stations can be obtained, providing a data basis for subsequent time synchronization.
[0099] S502: The MAR device adjusts the local time of the MAR device based on the local times of multiple base stations to obtain a target local time.
[0100] It should be noted that the MAR device adjusts the local time of the MAR device based on the local time of multiple base stations, which is actually the calibration of the local time of the MAR device, that is, calibrating the local time of the MAR devices in the intelligent metropolitan area network to the same time.
[0101] In this way, the time of the MAR device in the intelligent metropolitan area network can be adjusted, and the adjusted target local time can be obtained, which can provide the time data to be adjusted for subsequent time synchronization adjustment.
[0102] S503: The MAR device performs time synchronization adjustment on the local time of the base station connected to the MAR device based on the target local time.
[0103] In this way, the target local time can be sent to the base station connected to the MAR device, reducing the time asynchrony problem of the intelligent metropolitan area network.
[0104] The time synchronization method provided in the embodiment of the present application, when the time synchronization of the intelligent metropolitan area network is abnormal, adjusts the local time of the MAR device by acquiring the local time of multiple base stations connected to the intelligent metropolitan area network, and obtains the adjusted target local time, and based on the target local time, adjusts the local time of the base station connected to the MAR device, which can reduce the problem of time asynchrony in the intelligent metropolitan area network, thereby ensuring the normal use of the MAR device and the base station connected to the MAR device when the time synchronization of the intelligent metropolitan area network is abnormal, and improving the user experience.
[0105] For example, Figure 6 As shown, Figure 6 A flowchart of another time synchronization method provided in an embodiment of the present application. The method comprises the following steps:
[0106] S601. The MAR device obtains the local time of the base station connected to the MAR device.
[0107] It should be noted that the intelligent metropolitan area network includes multiple MAR devices, and one MAR device is connected to one base station.
[0108] In one possible implementation, the process of a MAR device acquiring the local time of a base station connected to the MAR device may be: the MAR device sends a time acquisition request to the base station connected to the MAR device, and the time acquisition request is used to request to acquire the local time of the base station connected to the MAR device; after receiving the time acquisition request, the base station connected to the MAR device sends the local time of the base station to the MAR device; the MAR device receives the local time returned by the base station connected to the MAR device, and acquires the local time of the base station connected to the MAR device therefrom.
[0109] In addition, multiple MAR devices in the intelligent metropolitan area network can obtain the local time of the base station connected to the MAR device through the above process, thereby obtaining the local time of multiple base stations connected to the intelligent metropolitan area network.
[0110] It should be noted that the base station connected to the MAR device can be divided into a base station with an antenna for receiving GPS signals and a base station without an antenna for receiving GPS signals.
[0111] In a possible implementation, for a base station among multiple base stations that has an antenna for receiving GPS signals, the local time of the base station is determined based on the GPS signals.
[0112] like Figure 7 As shown, a flow chart of determining the local time of a base station with an antenna for receiving GPS signals is introduced. For a base station with an antenna for receiving GPS signals, the process of determining the local time may be:
[0113] Step 1: The base station determines whether the antenna is working properly. If the antenna is working properly, execute step 2; if the antenna is not working properly, execute step 3.
[0114] Step 2: The base station determines the local time from the received GPS signal.
[0115] In a possible implementation manner, an antenna of a base station may receive a GPS signal transmitted from a satellite, wherein the signal includes timestamp information, wherein the timestamp information is used to determine the local time.
[0116] Step 3: The base station receives the time sent by the time server based on the 1588V2 protocol and forwarded by the MAR device of the intelligent metropolitan area network, so that the base station determines the local time.
[0117] In a possible implementation, the antenna may not work properly because of a short circuit, an open circuit, or interference with satellite signals.
[0118] It should be noted that when the antenna works normally again, the base station switches to obtaining time from the received GPS signal.
[0119] In this way, it is possible to ensure that a base station equipped with an antenna for receiving GPS signals can determine the local time in a variety of ways, thereby ensuring the normal use of the base station.
[0120] In another possible implementation, for a base station among the multiple base stations that does not have an antenna for receiving GPS signals, the local time of the base station is determined based on the 1588V2 protocol.
[0121] For a base station that does not have an antenna for receiving GPS signals, the process of determining the local time may be: the base station receives the time sent by the time server based on the 1588V2 protocol and forwarded by the MAR device of the intelligent metropolitan area network, so that the base station determines the local time.
[0122] In this way, base stations that do not have antennas for receiving GPS signals can determine local time based on the 1588V2 protocol, providing a data basis for subsequent time synchronization.
[0123] In this way, when the time of the intelligent metropolitan area network is not synchronized, by obtaining the local time of the base station connected to the MAR device, a time basis can be provided for subsequent time synchronization adjustment.
[0124] S602: The MAR device sends a time acquisition request to other MAR devices except the current MAR device among the multiple MAR devices. The time acquisition request is used to request to acquire the local time of the base station connected to the other MAR devices.
[0125] S603: The MAR device receives the local time returned by other MAR devices based on the time acquisition request.
[0126] In this way, the local time of multiple base stations connected to the MAR device can be acquired through the MAR device, providing data for subsequent determination of the target local time.
[0127] It should be noted that the process of other MAR devices acquiring the local time of the base station connected to the other MAR devices is similar to the process of the MAR device acquiring the local time of the base station connected to the MAR device in the above S601, and will not be repeated here.
[0128] S604. The MAR device obtains the local time of multiple base stations connected to the intelligent metropolitan area network based on the local time of the base station connected to the MAR device and the local time returned by other MAR devices.
[0129] In this way, the local time of multiple base stations in the intelligent metropolitan area network can be obtained to provide data for subsequent time synchronization.
[0130] The above S601 to S604 correspond to Figure 5 In S501 shown, the MAR device obtains the local time of multiple base stations connected to the intelligent metropolitan area network in response to the time synchronization anomaly of the intelligent metropolitan area network.
[0131] S605: The MAR device determines, based on the local times of the multiple base stations, a local time having a minimum difference with the local time of the MAR device.
[0132] In this way, by determining the local time with the smallest difference from the local time of the MAR device, it is possible to find a relatively close time as much as possible during the subsequent time synchronization adjustment while the MAR device is oscillating freely, thereby facilitating the adjustment of the local time of the MAR device and providing the time data to be adjusted for the subsequent time synchronization adjustment.
[0133] S606: The MAR device adjusts the local time of the MAR device based on the local time having the smallest difference with the local time of the MAR device to obtain the target local time.
[0134] In this way, based on the local time with the smallest difference from the local time of the MAR device, the local time of the MAR device in the intelligent metropolitan area network can be adjusted to reduce the time asynchrony problem of the intelligent metropolitan area network. After obtaining the adjusted target local time, the time data to be adjusted can be provided for subsequent time synchronization adjustments.
[0135] S607: The MAR device sends a time adjustment instruction to the base station connected to the MAR device. The time adjustment instruction is used to instruct to adjust the local time of the base station to the target local time.
[0136] It should be noted that after the MAR device sends a time adjustment instruction to the base station connected to the MAR device, if the base station connected to the MAR device is a base station with an antenna for receiving GPS signals, then after the base station receives the time adjustment instruction, since the antenna of the base station is working normally, the process of determining the time by the received GPS signal will be prioritized, that is, the base station will not adjust the local time to the target local time.
[0137] If the base station connected to the MAR device is a base station that does not have an antenna for receiving GPS signals, after receiving the time adjustment instruction, the base station can adjust the local time of the base station to the target local time based on the time adjustment instruction.
[0138] In this way, based on the target local time, the problem of time asynchrony in the intelligent metropolitan area network can be reduced.
[0139] It should be noted that the above Figure 6 The time synchronization method shown is an exemplary description of a time synchronization process. After a time synchronization process is completed, the MAR device can continue to adjust the time synchronization based on the time synchronization status of the intelligent metropolitan area network until the time server works normally or the transmission link in the communication network recovers to normal.
[0140] In the above embodiment, in the case of abnormal time synchronization in the intelligent metropolitan area network, the local time of the MAR device is adjusted by acquiring the local time of multiple base stations connected to the intelligent metropolitan area network, and the adjusted target local time is obtained. Based on the target local time, the local time of the base station connected to the MAR device is synchronously adjusted, which can reduce the problem of time asynchrony in the intelligent metropolitan area network, thereby ensuring the normal use of the MAR device and the base station connected to the MAR device in the case of abnormal time synchronization in the intelligent metropolitan area network, thereby improving the user experience.
[0141] The technical solution provided in the embodiment of the present application takes the local time with the smallest difference from the local time of the MAR device as the target local time. When the device is oscillating freely, it can find a time that is as close as possible and adjust the local time of the MAR device to obtain the adjusted target local time. In the subsequent time synchronization adjustment process, fine-tuning is performed step by step to reduce the problem of time asynchrony in the intelligent metropolitan area network.
[0142] For example, Figure 8 A flow chart of time synchronization of a base station with an antenna for receiving GPS signals provided in an embodiment of the present application. When the antenna is working normally, the time synchronization process of the base station with an antenna for receiving GPS signals may be:
[0143] S801. In response to a time synchronization anomaly in a smart metropolitan area network, a MAR device obtains local time of multiple base stations connected to the smart metropolitan area network.
[0144] S802. The MAR device adjusts the local time of the MAR device based on the local times of multiple base stations to obtain a target local time.
[0145] S803. The MAR device sends a time adjustment instruction to a base station connected to the MAR device and having an antenna for receiving GPS signals based on the target local time.
[0146] S804: After receiving the time adjustment instruction, the base station having an antenna for receiving GPS signals does not adjust the local time to the target local time.
[0147] For example, Fig. 9 A time synchronization flow chart of a base station that does not have an antenna for receiving GPS signals is provided in an embodiment of the present application.
[0148] S901. In response to a time synchronization anomaly in a smart metropolitan area network, a MAR device obtains local time of multiple base stations connected to the smart metropolitan area network.
[0149] S902. The MAR device adjusts the local time of the MAR device based on the local times of the multiple base stations to obtain a target local time.
[0150] S903: The MAR device sends a time adjustment instruction to a base station connected to the MAR device and not having an antenna for receiving GPS signals based on the target local time.
[0151] S904: After receiving the time adjustment instruction, the base station that does not have an antenna for receiving GPS signals adjusts the local time to the target local time.
[0152] The embodiment of the present application can divide the time synchronization device into functional modules or functional units according to the above method example. For example, each functional module or functional unit can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules or functional units. Among them, the division of modules or units in the embodiment of the present application is schematic, which is only a logical function division. There may be other division methods in actual implementation.
[0153] like Fig.10 FIG. 1 is a schematic diagram of a time synchronization device according to an embodiment of the present application. The time synchronization device 100 includes:
[0154] An acquisition unit 1001 is configured to acquire local time of multiple base stations connected to the intelligent metropolitan area network in response to a time synchronization anomaly of the intelligent metropolitan area network;
[0155] A first adjustment unit 1002 is configured to adjust the local time of the MAR device based on the local times of the multiple base stations to obtain a target local time;
[0156] The second adjustment unit 1003 is configured to perform time synchronization adjustment on the local time of the base station connected to the MAR device based on the target local time.
[0157] In a possible implementation, the intelligent metropolitan area network includes a plurality of MAR devices, wherein one MAR device is connected to one base station;
[0158] The acquisition unit 1001 is used for:
[0159] Obtain the local time of the base station connected to the MAR device; send a time acquisition request to other MAR devices among multiple MAR devices except the current MAR device, the time acquisition request is used to request to obtain the local time of the base station connected to other MAR devices; receive the local time returned by other MAR devices based on the time acquisition request; based on the local time of the base station connected to the MAR device and the local time returned by other MAR devices, obtain the local time of multiple base stations connected to the intelligent metropolitan area network.
[0160] In a possible implementation, the acquisition unit 1001 is used for at least one of the following:
[0161] Obtain the local time of a preset number of base stations from multiple base stations connected to the intelligent metropolitan area network; obtain the local time of a pre-specified base station from multiple base stations connected to the intelligent metropolitan area network; obtain the local time of a base station in working state from multiple base stations connected to the intelligent metropolitan area network.
[0162] In a possible implementation manner, the first adjustment unit 1002 is configured to:
[0163] Based on the local times of the multiple base stations, determine the local time with the smallest difference from the local time of the MAR device; based on the local time with the smallest difference from the local time of the MAR device, adjust the local time of the MAR device to obtain the target local time.
[0164] In a possible implementation manner, the second adjustment unit 1003 is configured to:
[0165] A time adjustment instruction is sent to a base station connected to the MAR device, where the time adjustment instruction is used to instruct to adjust the local time of the base station to the target local time.
[0166] In one possible implementation, for a base station among multiple base stations that has an antenna for receiving a global positioning system GPS signal, the local time of the base station is determined based on the GPS signal; for a base station among multiple base stations that does not have an antenna for receiving a GPS signal, the local time of the base station is determined based on the 1588V2 protocol.
[0167] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0168] An embodiment of the present application provides a computer program product including instructions. When the computer program product is run on an electronic device, the electronic device executes the time synchronization method in the above method embodiment.
[0169] An embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on an electronic device, the electronic device executes the time synchronization method in the method flow shown in the above method embodiment.
[0170] Among them, the computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read only memory (EPROM), a register, a hard disk, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above, or any other form of computer-readable storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). In the embodiments of the present application, a computer-readable storage medium may be any tangible medium that contains or stores a program, which may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0171] Since the time synchronization device, computer-readable storage medium, and computer program product in the embodiments of the present application can be applied to the above method, the technical effects that can be obtained can also refer to the above method embodiments, and the embodiments of the present application will not be repeated here.
[0172] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0173] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0174] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0175] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application 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.
Claims
1. A time synchronization method, characterized in that: An access layer router MAR device applied to an intelligent metropolitan area network, the method comprising: In response to a time synchronization anomaly of the intelligent metropolitan area network, obtaining local time of a plurality of base stations connected to the intelligent metropolitan area network; Adjusting the local time of the MAR device based on the local times of the multiple base stations to obtain a target local time; Based on the target local time, a time synchronization adjustment is performed on the local time of the base station connected to the MAR device.
2. The method according to claim 1, characterized in that The intelligent metropolitan area network includes multiple MAR devices, one of which is connected to a base station; The obtaining of the local time of the plurality of base stations to which the intelligent metropolitan area network is connected comprises: Obtaining the local time of the base station connected to the MAR device; Sending a time acquisition request to other MAR devices among the multiple MAR devices except the current MAR device, wherein the time acquisition request is used to request to acquire the local time of the base station connected to the other MAR devices; and receiving the local time returned by the other MAR devices based on the time acquisition request; Based on the local time of the base station connected to the MAR device and the local time returned by the other MAR devices, the local time of multiple base stations connected to the intelligent metropolitan area network is obtained.
3. The method according to claim 1, characterized in that The acquiring of the local time of the plurality of base stations connected to the intelligent metropolitan area network includes at least one of the following: Acquire local time of a preset number of base stations from a plurality of base stations connected to the intelligent metropolitan area network; Acquiring a local time of a pre-specified base station from a plurality of base stations connected to the intelligent metropolitan area network; The local time of a base station in working state is obtained from a plurality of base stations connected to the intelligent metropolitan area network.
4. The method according to claim 1, characterized in that: The adjusting the local time of the MAR device based on the local time of the multiple base stations to obtain the target local time includes: Determine, based on the local times of the multiple base stations, a local time having a minimum difference with the local time of the MAR device; Based on the local time having the smallest difference with the local time of the MAR device, the local time of the MAR device is adjusted to obtain the target local time.
5. The method according to claim 1, characterized in that The step of adjusting the local time of a base station connected to the MAR device based on the target local time synchronously includes: A time adjustment instruction is sent to a base station connected to the MAR device, where the time adjustment instruction is used to instruct to adjust the local time of the base station to the target local time.
6. The method according to claim 1, characterized in that For a base station among the plurality of base stations that has an antenna for receiving a global positioning system GPS signal, the local time of the base station is determined based on the GPS signal; For a base station among the multiple base stations that does not have an antenna for receiving the GPS signal, the local time of the base station is determined based on the 1588V2 protocol.
7. A time synchronization device, characterized in that: The device comprises: An acquisition unit, configured to acquire local time of a plurality of base stations connected to the intelligent metropolitan area network in response to a time synchronization anomaly of the intelligent metropolitan area network; A first adjustment unit, configured to adjust the local time of the MAR device based on the local times of the multiple base stations to obtain a target local time; The second adjustment unit is used to perform time synchronization adjustment on the local time of the base station connected to the MAR device based on the target local time.
8. An electronic device, characterized in that: include: A processor and a communication interface; the communication interface is coupled to the processor, and the processor is used to run a computer program or instruction to implement the time synchronization method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions. When an electronic device executes the instructions, the electronic device executes the time synchronization method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The computer program product comprises computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the time synchronization method according to any one of claims 1 to 6.
