Network synchronization method and apparatus, network device, and storage medium
By using time window sliding segmentation and energy integration to generate synchronization control signals in network communication, the clock of network devices is adjusted, solving the problem that timestamp synchronization is susceptible to network latency and jitter, and achieving more stable and reliable network synchronization.
Patent Information
- Application Number
- CN202411236081.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2044-09-04
AI Technical Summary
Existing timestamp-based synchronization methods are susceptible to network latency and jitter in network communication, leading to increased synchronization errors and affecting the stability and reliability of the communication system.
By acquiring network system signal data, using a time window for sliding segmentation, calculating energy integrals and generating synchronization control signals, and adjusting network device clocks to achieve network synchronization.
It reduces the impact of network latency and jitter on synchronization accuracy, achieving more stable and reliable network synchronization, and is better able to cope with state changes and fluctuations in complex network environments.
Smart Images

Figure CN118945800B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of network communication, and in particular to a network synchronization method and device, network equipment and a storage medium. BACKGROUND
[0002] With the wide deployment and application of 4G and 5G networks, how to ensure the stability and reliability of the communication system has become a key problem to be solved. Network synchronization technology, as the core of ensuring the efficient operation of the communication system, is increasingly important.
[0003] At present, network synchronization technology mainly relies on a timestamp-based synchronization method. The timestamp-based synchronization method can achieve relatively accurate synchronization in most scenarios, providing strong support for the stable operation of the communication system. However, due to the influence of network delay and jitter and other factors, the precision of the timestamp is easily disturbed, resulting in an increase in synchronization error. SUMMARY
[0004] Therefore, the present application provides a network synchronization method, device, network equipment and storage medium to solve the technical problem of network synchronization.
[0005] The first aspect of the present application provides a network synchronization method, which comprises:
[0006] obtaining signal data in a network system collected by a sensor;
[0007] slidingly dividing the signal data using a time window;
[0008] calculating the energy integral of the signal data in each time window;
[0009] generating a synchronization control signal according to the energy integral;
[0010] adjusting the clock of a network device according to the synchronization control signal to achieve network synchronization.
[0011] Optionally, the sliding division of the signal data using a time window comprises:
[0012] obtaining the data packet arrival rate of the network system in the current time window;
[0013] comparing the data packet arrival rate with a preset first arrival rate threshold and a preset second arrival rate threshold, respectively, to obtain a comparison result;
[0014] adjusting the size of the current time window according to the comparison result;
[0015] slidingly dividing the signal data using the adjusted time window.
[0016] Optionally, the adjusting the size of the current time window according to the comparison result comprises:
[0017] when the comparison result is that the data packet arrival rate is less than the preset first arrival rate threshold, increasing the size of the current time window;
[0018] when the comparison result is that the data packet arrival rate is greater than the preset second arrival rate threshold, decreasing the size of the current time window;
[0019] when the comparison result is that the data packet arrival rate is greater than the preset first arrival rate threshold and less than the preset second arrival rate threshold, keeping the size of the current time window unchanged.
[0020] Optionally, the slidingly segmenting the signal data by using the time window comprises:
[0021] obtaining a data packet arrival rate and a buffer occupancy rate of the network system in the current time window;
[0022] mapping the data packet arrival rate to a preset arrival rate score value function to obtain an arrival rate score value;
[0023] mapping the buffer occupancy rate to a preset occupancy rate score value function to obtain an occupancy rate score value;
[0024] adjusting the current time window based on the arrival rate score value and the occupancy rate score value;
[0025] slidingly segmenting the signal data by using the adjusted time window.
[0026] Optionally, the adjusting the current time window based on the arrival rate score value and the occupancy rate score value comprises:
[0027] calculating based on a preset arrival rate weight, a preset occupancy rate weight, the arrival rate score value and the occupancy rate score value to obtain a weighted sum value;
[0028] judging whether the weighted sum value is within a preset sum value range;
[0029] when the weighted sum value is within the preset sum value range, increasing the size of the current time window based on the numerical value of the weighted sum value;
[0030] when the weighted sum value is not within the preset sum value range, decreasing the size of the current time window based on the numerical value of the weighted sum value.
[0031] Optionally, the generating the synchronization control signal according to the energy integral comprises:
[0032] identify a change trend of the energy integral based on a preset baseline;
[0033] identify a deviation type of the synchronization state according to the change trend;
[0034] calculate a deviation degree of the synchronization state according to the preset baseline and the energy integral;
[0035] generate a synchronization control signal according to the deviation type and the deviation degree.
[0036] Optionally, the adjusting the clock of the network device according to the synchronization control signal to realize network synchronization comprises:
[0037] monitoring a key parameter in the network device;
[0038] identifying a network state of the network device according to the key parameter;
[0039] determining a network synchronization frequency according to the network state;
[0040] adjusting the clock of the network device according to the synchronization control signal to realize network synchronization based on the network synchronization frequency.
[0041] A second aspect of the present application provides a network synchronization device, the device comprising:
[0042] an acquisition module configured to acquire signal data in a network system collected by a sensor;
[0043] a sliding module configured to perform sliding segmentation on the signal data using a time window;
[0044] a calculation module configured to calculate an energy integral of the signal data in each time window;
[0045] a generation module configured to generate a synchronization control signal according to the energy integral;
[0046] a synchronization module configured to adjust the clock of the network device according to the synchronization control signal to realize network synchronization.
[0047] A third aspect of the present application provides a network device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the network synchronization method when executing the computer program.
[0048] A fourth aspect of the present application provides a computer readable storage medium having a computer program stored thereon, wherein the computer program is executable by a processor to implement the steps of the network synchronization method.
[0049] The network synchronization method, device, network equipment and storage medium provided by the embodiments of the present application can more directly reflect the actual state of the network by acquiring network system signal data collected by a sensor, and provide more real-time and accurate information for synchronization. The signal data is divided by sliding using a time window, and the energy integral of the signal data in each time window is calculated, which can capture the change trend and intensity of the signal, thereby generating a more stable and reliable synchronization control signal. Finally, the clock of the network equipment is adjusted according to the generated synchronization control signal, and network synchronization is realized. Compared with the prior art of directly using a timestamp for synchronization, the present application reduces the influence of network delay and jitter on synchronization accuracy. The present application generates a synchronization control signal based on analysis of the entire signal data, making the synchronization process more robust and better able to cope with changes and fluctuations in network state, ensuring stable synchronization in complex network environments. BRIEF DESCRIPTION OF DRAWINGS
[0050] Figure 1 is a flowchart of a network synchronization method according to an embodiment of the present application;
[0051] Figure 2 is a functional module diagram of a network synchronization device according to an embodiment of the present application;
[0052] Figure 3 is a structural diagram of a network equipment according to an embodiment of the present application. DETAILED DESCRIPTION
[0053] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to be limiting of the present application. As used in the specification, the singular forms "a," "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "and / or" as used herein refer to any or all possible combinations of one or more of the associated listed items.
[0054] Hereinafter, the terms "first" and "second" are only for the purpose of description and cannot be understood as implying or suggesting relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first" and "second" can explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, the meaning of "a plurality of" is two or more, unless otherwise specified.
[0055] The network synchronization method provided by the embodiments of the present application is executed by network equipment, and accordingly, the network synchronization device runs in the network equipment.
[0056] Figure 1This is a flowchart of a network synchronization method provided in Embodiment 1 of the present invention. The network synchronization method specifically includes the following steps.
[0057] S11, acquire signal data from the network system collected by the sensor.
[0058] A network system is a system composed of multiple nodes (including sensor nodes, data processing centers, etc.) interconnected via wired or wireless means. These nodes can work together to achieve functions such as data acquisition, transmission, processing, and analysis.
[0059] A sensor is a device that can detect physical quantities and convert them into measurable signals. In network systems, sensors are used to collect signal data related to communication synchronization, such as clock signals and timestamp signals. These signals reflect the current state of network synchronization, including time deviations and jitter, and are transmitted to the data processing center via the network.
[0060] S12, the signal data is divided into sliding segments using a time window.
[0061] A time window is a fixed-length period of time used to extract a specific segment of data from continuous signal data. The window size (time length) and step size (distance the window moves in each iteration) are two key parameters defining a time window. The window size determines the amount of data contained within each time window. Larger time windows capture more contextual information but may reduce responsiveness to rapid changes; smaller time windows capture less contextual information but improve responsiveness to rapid changes. The step size determines how quickly the window moves across the signal data. When the step size equals the window size, windows do not overlap; when the step size is smaller than the window size, windows will overlap.
[0062] Initialize and determine the size and step size of the time window, as well as the starting position of the signal data. Starting from the starting position of the signal data, extract the first segment of data as the first time window according to the window size. Move the window along the signal data by the specified step size and extract the second segment of data as the second time window. Continue sliding the time window and extracting data until the entire signal data is covered or a predetermined termination condition is reached.
[0063] Sliding partitioning can transform continuous signal data into a series of data segments within time windows, thereby reducing the dimensionality of the data to some extent and facilitating subsequent processing. Furthermore, by dividing the signal data into multiple time windows, the data within each time window can be processed in parallel, thus improving the overall processing efficiency of the network system.
[0064] In order to flexibly cope with the dynamic changes of network traffic, ensure the accuracy and efficiency of signal data processing, the size of the time window can be dynamically adjusted based on the packet arrival rate of the network system.
[0065] In an optional embodiment, the sliding segmentation of the signal data using the time window comprises:
[0066] Obtaining the packet arrival rate of the network system in the current time window;
[0067] Comparing the packet arrival rate with a preset first arrival rate threshold and a preset second arrival rate threshold respectively to obtain a comparison result;
[0068] Adjusting the size of the current time window according to the comparison result;
[0069] Segmenting the signal data using the adjusted time window.
[0070] The preset first arrival rate threshold is less than the preset second arrival rate threshold. The preset first arrival rate threshold and the preset second arrival rate threshold can be set according to the performance requirements, processing capacity and historical traffic data of the network system.
[0071] The packet arrival rate refers to the number of data packets arriving at the network system per unit time, reflecting the intensity of network traffic. If the packet arrival rate is high within a time window, it means that more data packets need to be processed within the time window. If the time window is set too small, it may result in frequent data processing operations, increasing the processing burden and delay of the system; if the time window is set too large, it may result in prolonged processing time due to excessive data volume, thereby affecting the real-time performance of the system.
[0072] The obtained packet arrival rate is compared with the two preset thresholds (the first arrival rate threshold and the second arrival rate threshold) to obtain a comparison result. According to the comparison result, different adjustment strategies are used to adjust the size of the current time window. The comparison result can include: the packet arrival rate is less than the preset first arrival rate threshold, or the packet arrival rate is greater than the preset second arrival rate threshold, or the packet arrival rate is greater than the preset first arrival rate threshold but greater than the preset second arrival rate threshold.
[0073] With the adjusted time window, the signal data is continuously segmented in a sliding manner. In this process, the new time window moves on the signal data according to the adjusted step (which can be fixed or dynamically calculated based on the new window size), and extracts a segment of signal data for subsequent processing. The above optional implementation flexibly adjusts the size of the time window according to the actual situation of network load, rather than fixedly using the preset window size, so that the system can better adapt to the dynamic changes of network traffic and balance the processing efficiency and load of the network system. For example, when the data packet arrival rate increases, the time window size can be appropriately reduced to reduce the amount of data processed at a time and reduce the processing delay; on the contrary, when the data packet arrival rate decreases, the time window size can be appropriately increased to improve the processing efficiency.
[0074] In an optional implementation, the adjusting the size of the current time window according to the comparison result comprises:
[0075] when the comparison result is that the data packet arrival rate is less than the preset first arrival rate threshold, increasing the size of the current time window;
[0076] when the comparison result is that the data packet arrival rate is greater than the preset second arrival rate threshold, reducing the size of the current time window;
[0077] when the comparison result is that the data packet arrival rate is greater than the preset first arrival rate threshold and less than the preset second arrival rate threshold, keeping the size of the current time window unchanged.
[0078] The preset first arrival rate threshold represents a threshold at which the network traffic is at a relatively low level. If the data packet arrival rate is lower than the preset first arrival rate threshold, it may mean that the current network load is light, and the size of the time window can be appropriately increased to capture more context information. The preset second arrival rate threshold represents a threshold at which the network traffic approaches or exceeds the upper limit of the processing capacity. If the data packet arrival rate is higher than the preset second arrival rate threshold, it may mean that the current network load is heavy, and the size of the time window needs to be reduced to reduce the processing delay and improve the response speed. If the data packet arrival rate is between the preset first arrival rate threshold and the preset second arrival rate threshold, the current time window size can be kept unchanged or fine-tuned according to the actual situation.
[0079] For example, first, a first segment of data is extracted as a first time window from the start of the signal data according to the size of the initialized time window W0. Then, the packet arrival rate of the network system in the first time window is obtained, and the packet arrival rate is compared with a preset first arrival rate threshold and a preset second arrival rate threshold, respectively. If the packet arrival rate is less than the preset first arrival rate threshold, the size of the time window W0 is increased to obtain a time window W1. If the packet arrival rate is greater than the preset first arrival rate threshold, the size of the time window W0 is decreased to obtain a time window W1. The time window W1 is moved along the signal data by a specified step size, and a second segment of data is extracted as a second time window.
[0080] Next, the packet arrival rate of the network system in the second time window is obtained, and the packet arrival rate is compared with the preset first arrival rate threshold and the preset second arrival rate threshold, respectively. The size of the time window W1 is adjusted according to the comparison result to obtain a time window W2. The time window W2 is moved along the signal data by a specified step size, and a third segment of data is extracted as a third time window.
[0081] The packet arrival rate of the network system in the third time window is obtained, and the packet arrival rate is compared with the preset first arrival rate threshold and the preset second arrival rate threshold, respectively. The size of the time window W2 is adjusted according to the comparison result to obtain a time window W3. The time window W3 is moved along the signal data by a specified step size, and a fourth segment of data is extracted as a fourth time window.
[0082] This process is repeated until the entire signal data is covered.
[0083] The optional implementation described above dynamically adjusts the size of the time window based on the comparison result of the packet arrival rate and the preset threshold, which can ensure that the system maintains high processing efficiency and accuracy under different network traffic conditions.
[0084] In order to more flexibly cope with the dynamic changes of network traffic and further ensure the accuracy and efficiency of signal data processing, the size of the time window can be comprehensively adjusted based on the packet arrival rate and the buffer occupancy rate, so that the adjustment of the time window is more dynamic and flexible.
[0085] In an optional implementation, the sliding segmentation of the signal data using the time window comprises:
[0086] obtaining the packet arrival rate and the buffer occupancy rate of the network system in the current time window;
[0087] mapping the packet arrival rate to a preset arrival rate score value function to obtain an arrival rate score value;
[0088] mapping the buffer occupancy ratio to a preset occupancy ratio score value function to obtain an occupancy ratio score value;
[0089] adjusting the current time window based on the arrival rate score value and the occupancy ratio score value;
[0090] performing sliding segmentation on the signal data using the adjusted time window.
[0091] The buffer occupancy ratio refers to the proportion of occupied space in the current buffer, reflecting the use of the current processing capacity of the system. When the buffer occupancy ratio exceeds the high threshold, it indicates that the system processing pressure is large and may face congestion. At this time, the time window size should be reduced to reduce the amount of data processed each time and relieve system pressure. When the buffer occupancy ratio is lower than the low threshold, it indicates that the system processing capacity is relatively abundant. At this time, the time window size can be appropriately increased to improve processing efficiency.
[0092] In order to quantify the influence of data packet arrival rate and buffer occupancy ratio on network performance, an arrival rate score value function and an occupancy ratio score value function are preset. The preset arrival rate score value function gives a corresponding score value according to the arrival rate. The preset occupancy ratio score value function gives a corresponding score value according to the occupancy ratio. The higher the score value, the greater the influence of the parameter on the adjustment of the time window.
[0093] For example, assuming that the data packet arrival rate is less than a preset first arrival rate threshold, the data packet arrival rate is mapped to the preset arrival rate score value function, and the obtained arrival rate score value is -1. Assuming that the data packet arrival rate is greater than a preset second arrival rate threshold, the data packet arrival rate is mapped to the preset arrival rate score value function, and the obtained arrival rate score value is +1. Assuming that the data packet arrival rate is greater than the preset first arrival rate threshold and less than the preset second arrival rate threshold, the data packet arrival rate is mapped to the preset arrival rate score value function, and the obtained arrival rate score value is 0.
[0094] For example, assuming that the buffer occupancy ratio is less than a preset first occupancy ratio threshold, the buffer occupancy ratio is mapped to the preset occupancy ratio score value function, and the obtained occupancy ratio score value is -1. Assuming that the buffer occupancy ratio is greater than a preset second occupancy ratio threshold, the buffer occupancy ratio is mapped to the preset occupancy ratio score value function, and the obtained occupancy ratio score value is +1. Assuming that the buffer occupancy ratio is greater than the preset first occupancy ratio threshold and less than the preset second occupancy ratio threshold, the buffer occupancy ratio is mapped to the preset occupancy ratio score value function, and the obtained occupancy ratio score value is 0.
[0095] The arrival rate score value and the occupancy rate score value provide direct feedback on the current network status and performance. The system can adjust the size or frequency of the time window based on these score values. For example, if both the arrival rate score value and the occupancy rate score value are low, it means that the current network load is light, and the time window can be appropriately increased to reduce the number of splits and improve processing efficiency. Conversely, if the arrival rate score value and the occupancy rate score value are high, it means that the network load is heavy or the system is close to saturation, and the time window should be reduced to respond to network changes more timely.
[0096] In some cases, the system can also weight and sum the arrival rate score value and the occupancy rate score value to obtain a comprehensive score value.
[0097] Different weights can be assigned to the packet arrival rate and the buffer occupancy rate, or the same weight can be assigned to the packet arrival rate and the buffer occupancy rate. The current time window is adjusted based on the assigned weights, the arrival rate score value, and the occupancy rate score value.
[0098] In actual adjustment, the trends of the packet arrival rate and the buffer occupancy rate can be considered comprehensively. For example, if the packet arrival rate is rapidly rising and the buffer occupancy rate is gradually approaching the high threshold, the time window size can be reduced in advance even if the current buffer occupancy rate has not reached the high threshold, to prevent congestion from occurring.
[0099] The size of the time window is adjusted according to the above strategy, and the adjusted network status and system performance are monitored. If the adjusted effect is not ideal (e.g., the buffer occupancy rate is still too high or the packet loss rate increases), the adjustment strategy needs to be re-evaluated and further adjusted.
[0100] In an optional implementation, the adjusting the current time window based on the arrival rate score value and the occupancy rate score value comprises:
[0101] calculating a weighted sum value based on a preset arrival rate weight, a preset occupancy rate weight, the arrival rate score value, and the occupancy rate score value;
[0102] determining whether the weighted sum value is within a preset sum value range;
[0103] when the weighted sum value is within the preset sum value range, increasing the size of the current time window based on the numerical value of the weighted sum value;
[0104] when the weighted sum value is not within the preset sum value range, decreasing the size of the current time window based on the numerical value of the weighted sum value.
[0105] The preset arrival rate weight (W_AR) and the preset occupancy rate weight (W_OR) represent the importance of the system to the packet arrival rate and the buffer occupancy rate, and the value range is (0, 1), and the sum of the preset arrival rate weight (W_AR) and the preset occupancy rate weight (W_OR) is 1.
[0106] According to the preset arrival rate weight, the preset occupancy rate weight, the arrival rate score value (Score_AR) and the occupancy rate score value (Score_OR), a weighted sum value Weighted_Sum=W_AR*Score_AR+W_OR*Score_OR is obtained.
[0107] The preset sum value range is a predefined numerical interval, which is used to determine whether the weighted sum value is in the "ideal" or "acceptable" range.
[0108] The calculated weighted sum value is compared with the preset sum value range (such as -0.5 to 0.5) to determine whether the system state is in the ideal interval. If the weighted sum value is within the preset sum value range, it means that the arrival rate and occupancy rate of the system are in a relatively balanced and ideal state. At this time, the system has enough capacity to handle more user requests or data traffic without causing significant performance degradation or resource shortage. Therefore, by increasing the size of the current time window, the processing capacity of the system can be further expanded to cope with the possible increase in load, thereby improving the overall efficiency and response speed of the system. When the weighted sum value is not within the preset sum value range, the size of the current time window should be reduced based on the numerical value of the weighted sum value. Because at this time the arrival rate and occupancy rate of the system may have been unbalanced, the system may face the risk of overload or resource shortage. If the size of the time window continues to increase, it will further aggravate the burden of the system, which may lead to performance degradation, service delay or even system crash. Therefore, by reducing the size of the time window, the system load can be reduced and the processing efficiency can be improved, thereby ensuring the stable operation of the system.
[0109] For example, assuming that the preset arrival rate weight is 0.3, the preset occupancy rate weight is 0.7, the arrival rate score value is -1, the occupancy rate score value is 0, and the weighted sum value is -0.3, which is within the preset sum value range, then the current time window is increased by 30% to obtain a new time window.
[0110] Assuming that the preset arrival rate weight is 0.4, the preset occupancy rate weight is 0.6, the arrival rate score value is 0, the occupancy rate score value is 1, and the weighted sum value is 0.6, which is not within the preset sum value range, then the current time window is reduced by 60% to obtain a new time window.
[0111] It should be noted that when increasing or decreasing the time window, when the weighted sum value is -1 or 1, the adjusted time window is 0 due to a 100% reduction in the time window. For this extreme case, the packet arrival rate and buffer occupancy rate can be reacquired to recalculate the weighted sum value.
[0112] The above optional implementation adjusts the event window based on the weighted sum value, which can comprehensively consider the influence of the packet arrival rate and the buffer occupancy rate, making the adjustment of the time window more reasonable and effective.
[0113] S13, calculate the energy integral of the signal data in each time window.
[0114] The energy integral can be realized by calculating the sum of the squares or the sum of the absolute values of the signal data amplitudes, depending on the characteristics and requirements of the signal. The energy integral is an effective indicator of signal strength or activity, and through the integral operation, the overall energy level of the signal in the time window can be reflected.
[0115] The signal data in each time window can be preprocessed, such as filtering and denoising, to reduce the influence of interference and noise on subsequent processing. Then the energy integral of the preprocessed signal data is calculated.
[0116] S14, generate a synchronization control signal according to the energy integral.
[0117] Analyzing the trend of the energy integral over time can determine the current network synchronization state, and thus generate a corresponding synchronization control signal according to the synchronization state. The synchronization control signal can include adjusting the clock, frequency, phase, etc. parameters of the network equipment, or directly interacting with the network management system to optimize or restore the network synchronization state.
[0118] In an optional implementation, the generating a synchronization control signal according to the energy integral comprises:
[0119] identifying the change trend of the energy integral based on a preset baseline;
[0120] identifying the deviation type of the synchronization state according to the change trend;
[0121] calculating the deviation degree of the synchronization state according to the preset baseline and the energy integral;
[0122] generating a synchronization control signal according to the deviation type and the deviation degree.
[0123] The preset baseline is an average energy integral value obtained through long-term observation and statistical analysis when the system is running stably and there is no significant deviation.
[0124] The energy integral value corresponding to each time window is compared with the preset baseline to identify whether the energy integral has a monotonic increasing, monotonic decreasing, periodic fluctuation, or other trend. Based on the change trend of the energy integral, the deviation type of the synchronization state is identified. If the energy integral gradually deviates from the preset baseline over time, and the deviation is monotonic (such as gradually increasing or decreasing), the deviation type is identified as time drift. If the energy integral frequently fluctuates around the preset baseline, and the fluctuation amplitude exceeds the preset threshold, the deviation type is identified as jitter.
[0125] Once the deviation type is determined, the deviation degree needs to be further calculated to quantify the severity of the deviation. When the deviation type is time drift, the difference between the energy integral and the preset baseline is calculated to obtain the deviation degree. When the deviation type is jitter, the variance or standard deviation between the energy integral and the preset baseline is calculated to obtain the deviation degree.
[0126] According to the deviation type and the deviation degree, a corresponding synchronization control signal is generated to adjust the phase, frequency, amplitude, or other related parameters of the synchronization signal. For example, for time drift, the phase or frequency of the synchronization signal may need to be adjusted to gradually pull the synchronization signal back to the correct phase position. For jitter, a feedback control loop may be introduced to stabilize the output.
[0127] The above optional implementation introduces a preset baseline as a reference, enabling the system to evaluate the deviation between the current state and the ideal state in real time and take timely measures for correction. This dynamic adjustment mechanism helps to enhance the stability and robustness of the system, reducing system fluctuations or failures caused by synchronization deviation. By identifying the change trend of the energy integral and judging the deviation type of the synchronization state accordingly, minor deviations in the synchronization process can be accurately captured. According to the deviation type and the quantified deviation degree, the synchronization control signal is generated, which can adjust the synchronization parameters in a targeted manner, thereby significantly improving the synchronization accuracy of the system.
[0128] S15, adjusting the clock of the network device according to the synchronization control signal to achieve network synchronization.
[0129] The synchronization control signal contains key information such as time deviation, adjustment direction, and adjustment amount. The key information is parsed from the synchronization control signal for subsequent clock adjustment.
[0130] Based on the key information parsed from the synchronization control signal, the network device needs to calculate the time deviation between the current clock and the network reference clock (such as GPS time, NTP server time, etc.). This time deviation may be an absolute value or a relative value, depending on the format and convention of the synchronization control signal.
[0131] Once the time offset is determined, the network device can start adjusting its internal clock to eliminate the offset. By adjusting the frequency of the clock (i.e., the number of pulses per second), the speed of the clock is brought in line with the network reference clock. In cases where a quick correction of the time offset is needed, the phase of the clock (i.e., the offset of the current time) can be adjusted directly.
[0132] After the clock adjustment is completed, the network device needs to verify the adjustment effect. The current clock is compared with the network reference clock again to confirm whether the time offset has been eliminated or reduced to an acceptable range. If the adjustment effect is not ideal, it may be necessary to recalculate the time offset and adjust again. Network synchronization is a continuous process that requires constant monitoring and adjustment to ensure that the clocks remain synchronized at all times.
[0133] The network device can accurately adjust its internal clock according to the synchronization control signal, thereby achieving network synchronization and ensuring that the devices in the network can work in coordination, improving network performance and reliability.
[0134] In an optional implementation, the adjusting the clock of the network device according to the synchronization control signal to achieve network synchronization comprises:
[0135] Monitoring key parameters in the network device;
[0136] Identifying the network state of the network device according to the key parameters;
[0137] Determining the network synchronization frequency according to the network state;
[0138] Based on the network synchronization frequency, adjusting the clock of the network device according to the synchronization control signal to achieve network synchronization.
[0139] Key parameters refer to important indicators that can reflect the performance or state of the network device during operation, such as network delay, packet loss rate, CPU usage, memory occupancy, etc.
[0140] A threshold value is set for each key parameter, and the key parameter is compared with the corresponding threshold value to identify the network state. Network states include normal, high load, low delay, congestion, etc. For example, CPU usage exceeding 80% is considered a high load state, and network delay exceeding 100 milliseconds is considered a low performance state. Multiple key parameters can be analyzed comprehensively to obtain the most accurate network state evaluation result.
[0141] According to the identified network state, the network device dynamically adjusts its network synchronization frequency. The network synchronization frequency refers to the frequency of time synchronization between network devices, that is, how often the clock is adjusted to keep the time of devices in the network consistent. For example, in the case of high network load or large network delay, the synchronization frequency can be increased to improve the real-time and accuracy of synchronization; and when the network condition is stable, the synchronization frequency can be appropriately reduced to reduce the occupation of network resources.
[0142] In the above optional embodiment, the network state is identified according to the key parameters, and a suitable network synchronization frequency is determined based on the identified network state. Finally, the system adjusts the clock of the network device according to the network synchronization frequency and the received synchronization control signal, to ensure that each device in the network can keep time synchronization.
[0143] The present application can accurately identify and effectively control the network synchronization state by introducing the energy integral algorithm, thereby realizing high-precision synchronization and long-time maintenance.
[0144] Figure 2 is a structural diagram of a network synchronization device provided in Embodiment Two of the present application.
[0145] In some embodiments, the network synchronization device 20 can include a plurality of functional modules composed of computer program segments. The computer programs of each program segment in the network synchronization device 20 can be stored in the memory of the network device and executed by at least one processor to perform the functions of network synchronization (see Figure 1 Description).
[0146] In this embodiment, the network synchronization device 20 can be divided into a plurality of functional modules according to the functions it performs. The functional modules can include an acquisition module 201, a sliding module 202, a calculation module 203, a generation module 204, and a synchronization module 205. The module referred to by the present application refers to a series of computer program segments that can be executed by at least one processor and can complete a fixed function, which are stored in the memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.
[0147] The acquisition module 201 is configured to acquire signal data in a network system collected by a sensor.
[0148] The sliding module 202 is configured to perform sliding segmentation on the signal data using a time window.
[0149] The calculation module 203 is configured to calculate the energy integral of the signal data in each time window.
[0150] The generating module 204 is configured to generate a synchronization control signal according to the energy integration;
[0151] The synchronization module 205 is configured to adjust a clock of the network device according to the synchronization control signal to realize network synchronization.
[0152] It should be understood that various changes and specific embodiments of the network synchronization method provided in the above embodiments are also applicable to the network synchronization device in the present embodiment. Through the detailed description of the network synchronization method, those skilled in the art can clearly understand the implementation process of the network synchronization device in the present embodiment. For the sake of brevity of the description, it will not be described in detail here.
[0153] The present application also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement all or part of the steps of the network synchronization method.
[0154] Referring to Figure 3 Fig. 3 shows a structure diagram of a network device provided in the third embodiment of the present application. In the preferred embodiment of the present application, the network device 3 comprises a memory 31, at least one processor 32 and at least one communication bus 33.
[0155] Those skilled in the art should understand that Figure 3 The structure of the network device shown in the figure is not a limitation of the present application, and can be a bus structure or a star structure. The network device 3 can further comprise more or less other hardware or software, or different component arrangements.
[0156] In some embodiments, the network device 3 is a device capable of automatically performing numerical calculation and / or information processing according to pre-set or stored instructions. The hardware thereof includes but is not limited to microprocessors, application specific integrated circuits, programmable gate arrays, digital processors and embedded devices, etc. The network device 3 can also comprise a client device, which includes but is not limited to any electronic product capable of human-computer interaction with a client through a keyboard, a mouse, a remote controller, a touchpad or a voice control device, such as a personal computer, a tablet computer, a smart phone, a digital camera, etc.
[0157] It should be noted that the network device 3 is only an example, and other existing or future electronic products can also be applicable to the present application and should be included in the protection scope of the present application by reference.
[0158] In some embodiments, the memory 31 stores a computer program which, when executed by the at least one processor 32, implements all or part of the steps of the network synchronization method as described. The memory 31 includes a Read-Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), a One-time Programmable Read-Only Memory (OTPROM), an Electrically-Erasable Programmable Read-Only Memory (EEPROM), a Compact Disc Read-Only Memory (CD-ROM) or other optical disk storage, a magnetic disk storage or a tape storage, or any other medium of storage of computer-readable data in which the data stored is of a kind capable of being read by a computer. Further, the computer-readable storage medium can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required by a function, and the like.
[0159] In some embodiments, the at least one processor 32 is a control unit of the network device 3, which connects various components of the entire network device 3 through various interfaces and lines, and performs various functions of the network device 3 and processes data by running or executing programs or modules stored in the memory 31 and calling data stored in the memory 31. For example, the at least one processor 32 implements all or part of the steps of the network synchronization method as described in the embodiments of the present application when executing the computer program stored in the memory; or implements all or part of the functions of the network synchronization apparatus. The at least one processor 32 can be composed of integrated circuits, for example, can be composed of a single packaged integrated circuit, or can be composed of multiple packaged integrated circuits with the same function or different functions, including one or more combinations of a Central Processing Unit (CPU), a microprocessor, a digital processing chip, a graphics processor, and various control chips.
[0160] In some embodiments, the at least one communication bus 33 is configured to enable connection communication between the memory 31 and the at least one processor 32. Although not shown, the network device 3 can further include a power supply (such as a battery) for powering the various components. Preferably, the power supply is logically connected to the at least one processor 32 via a power management device, thereby enabling management of charging, discharging, and power consumption management, etc. The power supply can also include one or more direct current or alternating current power sources, recharging means, power failure detection circuitry, power conversion or inverter circuitry, power status indicator, etc. The network device 3 can further include a variety of sensors, a Bluetooth module, a Wi-Fi module, etc., which are not described herein.
[0161] The integrated units in the form of software function modules described above can be stored in a computer readable storage medium. The software function modules described above are stored in a storage medium, and include a plurality of instructions for causing a network device (which can be a personal computer, a network device, or a network device, etc.) or a processor to execute part of the method described in various embodiments of the present application.
[0162] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other manners. For example, the described apparatus embodiments are merely illustrative, and the division of the modules is merely a logical function division. There can be another division manner in actual implementation.
[0163] The modules illustrated as separate components can or can not be physically separated, and the components illustrated as modules can or can not be physical units. They can be located in one place, or distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments.
Claims
1. A network synchronization method, characterized by, The method comprises: acquiring signal data collected by a sensor in a network system; slidingly dividing the signal data using a time window; calculating an energy integral of the signal data in each time window; generating a synchronization control signal according to the energy integral; adjusting a clock of a network device according to the synchronization control signal to achieve network synchronization; the generating of the synchronization control signal according to the energy integral comprises: identifying a variation trend of the energy integral based on a preset baseline; identifying a deviation type of a synchronization state according to the variation trend; calculating a deviation degree of the synchronization state according to the preset baseline and the energy integral; generating a synchronization control signal according to the deviation type and the deviation degree; the adjusting of the clock of the network device according to the synchronization control signal to achieve network synchronization comprises: monitoring a key parameter in the network device; identifying a network state of the network device according to the key parameter; determining a network synchronization frequency according to the network state; adjusting the clock of the network device according to the synchronization control signal based on the network synchronization frequency to achieve network synchronization.
2. The network synchronization method of claim 1, wherein, the slidingly dividing of the signal data using a time window comprises: acquiring a data packet arrival rate of the network system in a current time window; comparing the data packet arrival rate with a preset first arrival rate threshold and a preset second arrival rate threshold respectively to obtain a comparison result; adjusting a size of the current time window according to the comparison result; slidingly dividing the signal data using the adjusted time window.
3. The network synchronization method of claim 2, wherein, the adjusting of the size of the current time window according to the comparison result comprises: when the comparison result is that the data packet arrival rate is less than the preset first arrival rate threshold, increasing the size of the current time window; when the comparison result is that the data packet arrival rate is greater than the preset second arrival rate threshold, decreasing the size of the current time window; when the comparison result is that the data packet arrival rate is greater than the preset first arrival rate threshold and less than the preset second arrival rate threshold, keeping the size of the current time window unchanged.
4. The network synchronization method of claim 1, wherein, the slidingly dividing of the signal data using a time window comprises: acquiring a data packet arrival rate and a buffer occupancy rate of the network system in a current time window; mapping the data packet arrival rate to a preset arrival rate score value function to obtain an arrival rate score value; mapping the buffer occupancy rate to a preset occupancy rate score value function to obtain an occupancy rate score value; adjusting the current time window based on the arrival rate score value and the occupancy rate score value; slidingly dividing the signal data using the adjusted time window.
5. The network synchronization method of claim 4, wherein, the adjusting of the current time window based on the arrival rate score value and the occupancy rate score value comprises: calculating a weighted sum value based on a preset arrival rate weight, a preset occupancy rate weight, the arrival rate score value and the occupancy rate score value; judging whether the weighted sum value is within a preset sum value range; when the weighted sum value is within the preset sum value range, increasing the size of the current time window based on a numerical value of the weighted sum value; When the weighted sum value is not within the preset sum value range, a size of the current time window is reduced based on a numerical value of the weighted sum value.
6. A network synchronization apparatus applied to the network synchronization method of any one of claims 1-5, characterized in that, The device comprises: An acquisition module is configured to acquire signal data in a network system collected by a sensor; A sliding module is configured to slide and divide the signal data by using a time window; A calculation module is configured to calculate energy integration of the signal data in each time window; A generation module is configured to generate a synchronization control signal according to the energy integration; A synchronization module is configured to adjust a clock of a network device according to the synchronization control signal to realize network synchronization.
7. A network device for use in the network synchronization method of any one of claims 1-5, wherein, The computer program is stored in the memory and executable on the processor, and the processor executes the computer program to realize the steps of the network synchronization method in any one of claims 1 to 5.
8. A computer readable storage medium having stored thereon a computer program for use in a network synchronization method according to any one of claims 1-5. The computer program is stored in the memory and executable on the processor, and the processor executes the computer program to realize the steps of the network synchronization method in any one of claims 1 to 5.
Citation Information
Patent Citations
Synchronization method for ultra-broadband system based on energy detection
CN101102164A