CN117955820A - PTP data analysis method - Google Patents

PTP data analysis method Download PDF

Info

Publication number
CN117955820A
CN117955820A CN202410166536.4A CN202410166536A CN117955820A CN 117955820 A CN117955820 A CN 117955820A CN 202410166536 A CN202410166536 A CN 202410166536A CN 117955820 A CN117955820 A CN 117955820A
Authority
CN
China
Prior art keywords
data
message
time
messages
ptp
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410166536.4A
Other languages
Chinese (zh)
Inventor
李强
毕延军
雷洪涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sichuan Hengwan Technology Co Ltd
Original Assignee
Sichuan Hengwan Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sichuan Hengwan Technology Co Ltd filed Critical Sichuan Hengwan Technology Co Ltd
Priority to CN202410166536.4A priority Critical patent/CN117955820A/en
Publication of CN117955820A publication Critical patent/CN117955820A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention provides a PTP data analysis method, which comprises the following steps: establishing a custom data structure having a header common to standard PTP messages; capturing data in real time, and storing the data in a linked list container according to a sequence; according to a preset triggering condition, data in the linked list container are transferred and stored; and carrying out data analysis on the transferred data, and printing and displaying abnormal information and designated data. The invention can analyze historical data and locate problems when problems occur; the automatic tool is adopted to analyze and grab the data, so that the labor is saved; the triggering means are various; the data is analyzed, so that the clock problem can be located, and the data can also be used for acquiring the synchronous information.

Description

PTP data analysis method
Technical Field
The invention relates to the field of data analysis, in particular to a PTP (PRECISE TIME protocol) data analysis method applied to PTP equipment.
Background
For PTP operation, because of the large amount of data (about 56 data in one second), and PTP adjustment is a continuous process, only the final state can be seen when a problem occurs, and the history adjustment process cannot be presented; furthermore, since PTP is a function strongly associated with an external environment, a problem is not necessarily defined in the device itself, and may be caused by a network environment, so that when a problem occurs, it is particularly important to initially determine where the problem is.
In addition, the capturing PTP data in the usual state can capture the pcap package by tcpdump (a tool for capturing internet access data), but the captured pcap (file format generated by tcpdump engineering) file is in a standard file format, so that it is difficult to intuitively embody the data needed by us, and there is no ready-made API (application programming interface) interface function for accessing the pcap file. And the hardware time stamp of the PTP message sent or received from the clock cannot be grasped, and cannot be used for verifying the validity of the data. Therefore, in addition to the standard PTP protocol message data, some custom data needs to be recorded for outputting the critical information inside the program.
Disclosure of Invention
Aiming at the problems in the prior art, the PTP data analysis method is applied to PTP (PRECISE TIME protocol) equipment, utilizes an open-source PTP4l (PTP for linux) program to grasp information data, is used for analyzing historical data when problems occur and is used for positioning the problems, and meanwhile, the data is grasped according to automatic tool analysis, so that labor is saved.
The technical scheme adopted by the invention is as follows: a PTP data analysis method, comprising:
Establishing a custom data structure having a header common to standard PTP messages;
capturing data in real time, and storing the data in a linked list container according to a sequence;
According to a preset triggering condition, data in the linked list container are transferred and stored;
and carrying out data analysis on the transferred data, and printing and displaying abnormal information and designated data.
Further, the establishing the custom data structure includes:
each data record has a common portion comprising: message type, sequence number, domain name, flag domain, hardware timestamp, timestamp calibration value, and interval value;
for all received and sent standard PTP messages, the data type is defined as protocol;
For root mean square data, the method also comprises a current time difference root mean square/maximum value/minimum value, a frequency difference root mean square/maximum value/minimum value and a time delay root mean square/maximum value/minimum value, and the data type is defined as rms;
For state data, a snapshot of the state change is defined, including: time, a current root mean square value, a current clock difference value and a current link delay value, and a data type is defined as state;
for attribute data, further comprising: whether the data is in two steps, whether the data is in phase modulation, a filtering mode, a convergence threshold, a servo algorithm mode and parameters, and the data type is defined as property.
Further, the specific process of capturing data in real time is as follows:
For the received and sent standard PTP messages, unconditionally storing the received and sent standard PTP messages in a linked list container, and triggering by a message event;
For each second of record, constructing root mean square, frequency difference, link delay and time difference into an expansion_rms message, storing the message in a linked list container, and triggering by periodic record;
For state change, the synchronous message sending and receiving time stamp, the time delay measuring message sending and receiving time stamp, the current clock difference value, the servo state machine state and the synchronous state machine state are constructed into an expansion_state message, and are stored in a linked list container and triggered by a state change event;
For PTP configuration information, it is recorded at start-up, constructed as an expand_property message, and stored in a linked list container, triggered only once at start-up.
Further, the method also comprises the step of configuring the data types needing to be grabbed through the configuration file.
Further, the preset triggering condition includes:
① When the PTP state changes;
② The first time a container linked list is full after PTP locking.
Further, the transferring strategy includes:
All messages require the content of the header information to be transferred, including: print sequence number, message type, message sequence number, hardware timestamp, timestamp carried by message, local timestamp, calibration value, domain name number, interval period, and port number.
For notification messages, clock source information needs to be restored;
for the expand_rms message, the current root mean square, frequency difference, link delay and time difference are also required to be transferred;
For the expansion_state message, a time stamp is sent out by a transfer synchronization request message, and a time stamp and a state value of the message are received by a time delay measurement request;
for the expand_property message, a dump link time recording mechanism, a clock lock decision threshold, an enabled phasing mode, a phasing threshold, a filter type and length, a target media access control address, and whether a follow message is included are also required.
Further, the specific method for data analysis comprises the following steps:
traversing all notification messages, sequentially judging whether the contents of two adjacent notification messages are different, whether the serial numbers are discontinuous, and whether the interval time is greater than 1.5 times of the normal time, and if any judging condition results in yes, printing abnormal information of the corresponding messages is needed;
Traversing all synchronous/following messages, and sequentially judging whether the sequence numbers of two adjacent messages are intermittent, whether the synchronous and following messages are not matched and whether the sending and receiving time stamps of the synchronous messages are abnormal, wherein if any judging condition results are yes, the abnormal information of the corresponding messages needs to be printed;
traversing all delay request/response messages, and sequentially judging whether the sequence numbers of two adjacent messages are intermittent, whether the request and response messages are not matched and whether the time stamps sent and received by the delay measurement messages are abnormal, wherein if the judgment result is yes, the abnormal information of the corresponding messages needs to be printed;
and traversing all the periodic rms messages, judging whether the time difference, the frequency difference and the time delay difference change by more than 100ppb or not, if so, printing abnormal information, and if not, traversing all the state change information and printing the abnormal information.
Further, when traversing all synchronous/following messages, the specific method for judging whether the sending and receiving time stamps of the synchronous messages are abnormal is as follows:
Step A, judging whether the interval time of the synchronous message receiving time stamp is more than 1.5 times of the normal time, if so, entering the step B, otherwise, entering the step C;
Step B, judging whether the interval time of sending out the time stamp by the synchronous message is more than 1.5 times of the normal time, if so, indicating that the master clock is abnormal, entering the step D, and if not, indicating that the slave clock is abnormal, entering the step D;
step C, calculating whether the difference between the sending time stamp and the receiving time stamp of the synchronous message exceeds 100ns, if yes, entering a step D, otherwise, ending the flow;
and D, printing abnormal information.
Further, when traversing all delay request/response messages, the specific method for judging whether the sending and receiving time stamps of the delay measurement messages are abnormal is as follows:
Step a, judging whether the interval time of the time stamp received by the time delay measurement message is more than 1.5 times of the normal time, if so, entering the step b, otherwise, entering the step c;
Step b, judging whether the interval time of the time stamp sent by the time delay measurement message is more than 1.5 times of the normal time, if so, entering the step d, otherwise, entering the step d,
Step c, calculating whether the difference between the sending time stamp and the receiving time stamp of the time delay measurement message exceeds 100ns, if yes, entering a step d, otherwise, ending the flow;
and d, printing abnormal information.
Further, the method further comprises printing display designated data, and specifically comprises the following steps:
comparing the data with the data type of rms with a preset threshold, and if the data type of rms is larger than the threshold, printing and displaying;
when initializing, printing data with the display data type of property;
when the state is changed, data of which the display data type is state is printed.
Compared with the prior art, the beneficial effects of adopting the technical scheme are as follows:
1. Historical data can be analyzed when problems occur, the problems are positioned, meanwhile, the data are grasped according to the analysis of an automatic tool, and labor is saved.
2. The triggering means are various, and can be used for triggering grabbing when abnormality occurs or triggering grabbing once through commands
3. The data is analyzed through a background program, so that the problems of a master clock or a slave clock can be primarily confirmed due to various purposes; and may also be used to obtain synchronization information.
Drawings
Fig. 1 is a flowchart of a PTP data analysis method according to the present invention.
Fig. 2 is a flowchart of PTP synchronization messages according to an embodiment of the present invention.
Fig. 3 is a schematic diagram of data capturing and transferring according to an embodiment of the present invention.
FIG. 4 is a schematic diagram of data backup according to an embodiment of the present invention.
FIG. 5 is a schematic diagram illustrating data analysis according to an embodiment of the present invention.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar modules or modules having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the application. On the contrary, the embodiments of the application include all alternatives, modifications and equivalents as may be included within the spirit and scope of the appended claims.
Step 1, establishing a custom data structure.
In practical application, the formats and contents of each data are different, and in order to reflect the time-context relationship of each data, the whole data are stored in the same container, and all the data need to be integrated to form a combined data type, and the most time-standard PTP messages are considered to be applied in PTP equipment.
Further elaboration is provided below for the defined type data:
In this embodiment, each data record has a common portion comprising: message type, sequence number, domain name, flag domain, hardware timestamp, timestamp calibration value, interval value, etc.
① For all received and sent standard PTP messages, the data type is defined as protocol (a flag mainly used to distinguish one type of data type, protocol related, i.e. standard PTP message).
② The root mean square data also includes a current time difference root mean square/maximum/minimum, a frequency difference root mean square/maximum/minimum, and a time delay root mean square/maximum/minimum, and the data type is defined as rms (a flag mainly used for distinguishing one type of data type, root mean square correlation, i.e., a statistical value per second).
③ For state data, a snapshot of the state change is defined, including: time, current root mean square value, current clock difference value and current link delay value, the data type is defined as state (mainly used for distinguishing the mark of one type of data type, state correlation, namely current state snapshot).
④ For attribute data, further comprising: whether it is a two-step, phase modulation, filtering mode, convergence threshold, servo algorithm mode and parameters, such as single step (no following message) or two steps (following message), multicast media access control address, threshold, etc., the data type is defined as property (mainly used for distinguishing the mark of a type of data type, attribute correlation, i.e. the configuration information of the current application).
And 2, capturing data in real time, and storing the data in a linked list container according to the sequence.
In this embodiment, in addition to grabbing the standard PTP message, the custom type data needs to be grabbed, please refer to fig. 3, and the grabbing process is as follows:
① For standard PTP messages received and sent, the messages are unconditionally stored in a linked list container and triggered by message events.
② For each second of recording, the root mean square, frequency difference, link delay and time difference are structured as one expand_rms message (a flag for distinguishing one type of data type, representing root mean square per second), and stored in a linked list container, triggered by periodic recording.
③ For state change, the synchronous message sending out time stamp t1, the synchronous message receiving time stamp t2, the time delay measuring message sending out time stamp t3 and the time delay measuring message receiving time stamp t4 (as shown in fig. 2), the current clock difference value, the state of the servo state machine and the state of the synchronous state machine are configured into an expand_state message (a mark for distinguishing one type of data type and representing the current state information), and are stored in a linked list container and triggered by a state change event.
④ For PTP configuration information, recording is carried out when the PTP4l process is started, an expansion_property message is constructed and stored in a linked list container, and the configuration information is triggered only once when the PTP4l process is started.
It should be noted that, in order to avoid competing resources during data storage, the order needs to be ensured; if the files are directly written, long-term occupation of the central processing unit and the IO bus can be caused, the performance of the integrated RU (radio frequency unit) is affected, meanwhile, PTP adjustment is very complicated, and if the central processing unit occupies for a long time, the performance of the PTP can be affected. Therefore, in this embodiment, the captured data is directly stored in the memory, and is written into the file only when the captured data needs to be transferred.
Furthermore, as the data are continuously generated, the memory needs to be recycled, in order to avoid frequent addressing operation, the idea of using intelligent pointers is adopted, the pointers of the application memory are stored in the linked list container, the memory is released only when the memory needs to be released, two places can lead to the memory release, and firstly, when all information is printed, the memory is released after the container is read empty; and secondly, when a node is needed to be inserted into the full linked list tail, the memory of the linked list head node can be released. With continued reference to fig. 3, in this embodiment, the newly grabbed data is added to the tail of the linked list by using a linked list mode, and a pointer is pointed to the tail of the linked list, and the pointer is moved once every time one data is added. And meanwhile, another variable is defined for recording the length of the current linked list element, when the linked list is full, deleting and releasing the memory of the element of the linked list head before adding the element, and updating the pointer of the linked list head.
In one embodiment, the data types to be grabbed can be configured through the configuration file, and the data types can be flexibly and conveniently changed and positioned.
And step 3, according to a preset trigger condition, the data in the linked list container are transferred and stored.
In this embodiment, the preset trigger conditions for data transfer include:
① When the PTP state changes;
② The first time a container linked list is full after PTP locking.
When the data is transferred, the following strategies can be considered as the data is simple, and all data in the data interfaces are not required to be transferred, but only the concerned data is required to be recorded:
All messages require the content of the header information to be transferred, including: the print sequence number, the message type, the message sequence number, the hardware timestamp (which represents the synchronization request message receipt timestamp and the delay measurement request message issue timestamp), the timestamp carried by the message (which represents the synchronization request message issue timestamp and the delay measurement request receipt message timestamp), the local timestamp, the calibration value (mainly the synchronization request message issue timestamp, the delay measurement request receipt message timestamp offset in the synchronization/follow/delay measurement response message), the domain name, the interval period, and the port number.
For the notification message, the clock source information needs to be restored, and the method is mainly used for BMC algorithm verification and specifically comprises the following steps: time zone offset, master clock priority 1, master clock priority 2, number of iterations to skip, time source information, clock quality, clock level, clock accuracy, etc. The notification message belongs to a standard PTP message, and after the standard PTP message is received, the whole PTP message is recorded. When the transfer of standard PTP messages is performed, the print head information is required for all standard PTP messages. In addition, printing clock source information is required for the notification message.
For the expand_rms message, the current root mean square, frequency difference, link delay and time difference are also required to be transferred;
for the expand_state message, the timestamp sent by the dump synchronization request message is also needed to be compared with the timestamp and the state value of the received message of the delay measurement request.
For the expand_property message, a dump link time recording mechanism, a clock lock decision threshold, an enabled phasing mode, a phasing threshold, a filter type and length, a target media access control address, and whether a follow message is included are also required.
And 4, performing data analysis on the transferred data, and printing and displaying abnormal information and designated data.
After the data is transferred, the transferred data needs to be analyzed, abnormal judgment is carried out, and important information is displayed. Referring to fig. 5, when data analysis is performed, all information in the pre-saved data file is saved in the dictionary structure, whether attribute data exists is determined, if so, the information is directly printed, and if not, one-to-one analysis is performed for each type of message, in this embodiment, the analysis is performed mainly for notification/synchronization/following/delay request/delay response messages in the standard PTP message. The specific analysis process is as follows:
① Traversing all notification messages, sequentially judging whether the contents of two adjacent notification messages are different, whether the serial numbers are discontinuous, and whether the interval time is greater than 1.5 times of the normal time, and if yes, printing the abnormal information of the corresponding message.
② Traversing all synchronous/following messages, sequentially judging whether the sequence numbers of two adjacent messages are discontinuous, whether the synchronous and following messages are not matched, and whether the sending and receiving time stamps of the synchronous messages are abnormal, wherein if yes, the abnormal information of the corresponding messages needs to be printed.
For the exception judgment of sending and receiving time stamps of synchronous messages, in this embodiment, the specific steps are as follows:
Step 411, judging whether the interval time of the synchronous message receiving time stamp is greater than 1.5 times of normal, if yes, entering step 412, otherwise entering step 413;
Step 412, determining whether the interval time of the time stamp sent by the synchronization message is greater than 1.5 times of the normal time, if yes, indicating that the master clock is abnormal, entering step 414, if no, indicating that the slave clock is abnormal, entering step 414;
Step 413, calculating whether the difference between the sending and receiving time stamps of the synchronous message exceeds 100ns, if yes, entering step 414, otherwise ending the flow;
step 414, printing abnormal information.
③ Traversing all delay request/response messages, sequentially judging whether the sequence numbers of two adjacent messages are discontinuous, whether the request and response messages are not matched, whether the time stamp sent and received by the delay measurement message is abnormal, and if yes, printing the abnormal information of the corresponding message is needed.
For the exception judgment of the sending and receiving time stamps of the delay measurement, in this embodiment, the specific steps are as follows:
step 421, judging whether the interval time of the time stamp of the time delay measurement message is greater than 1.5 times of the normal time, if yes, entering step 422, otherwise entering step 423;
Step 422, determining whether the interval time of the time stamp sent by the time delay measurement message is greater than 1.5 times of the normal time, if so, entering step 424, if not, entering step 424,
Step 423, calculating whether the difference between the sending time stamp and the receiving time stamp of the time delay measurement message exceeds 100ns, if yes, entering step 424, otherwise ending the flow;
step 424, printing abnormal information.
Referring to fig. 4, in one embodiment, the method further includes a file backup process, specifically as follows:
step A, periodically checking whether the file size of the data transfer is larger than 1M, if so, entering the step B, otherwise, entering the step A;
step B, backing up the file;
step C, judging whether the number of the backup files exceeds the standard, if so, entering a step D, otherwise, entering a step A;
And D, deleting the earliest backup file, and entering the step A.
④ And traversing all the periodic rms messages, judging whether the time difference, the frequency difference and the time delay difference change by more than 100ppb or not, if so, printing abnormal information, and if not, traversing all the state change information and printing the abnormal information.
Further, in this embodiment, there is also provided a print display of specified data, including:
comparing the data with the data type of rms with a preset threshold, and if the data type of rms is larger than the threshold, printing and displaying;
when initializing, printing data with the display data type of property;
when the state is changed, data of which the display data type is state is printed.
In this embodiment, the case of performing normal abnormality determination and performing abnormality prompt is provided, which is specifically as follows:
① The discontinuous sequence number of the synchronous message indicates that the synchronous message is lost and prompts abnormality.
② And in the double-step mode, the following message corresponding to the synchronous message cannot be found, and abnormality is prompted.
③ In the double-step mode, redundant following messages exist, the sequence numbers of the synchronous messages are discontinuous, or the sequence numbers of the synchronous messages are lost, so that abnormality is prompted.
④ And in the single-step mode, the interval value of the synchronous message sending time stamp (the time stamp carried by the message and the corrected value of the double-step message, namely the time stamp sent by the synchronous request message) exceeds half of the theoretical value, so that the condition that the opposite terminal equipment is abnormal is indicated, and the abnormality is prompted.
⑤ The interval value (the timestamp carried by the message+the correction value of the double-step message, namely the timestamp sent by the synchronous request message) of the following message sending timestamp in the double-step mode exceeds half of the theoretical value, which indicates that the opposite terminal equipment has an abnormality and prompts the abnormality.
⑥ The interval value of the synchronization message reception time stamp (hardware time stamp, i.e., synchronization request message reception time stamp) exceeds half of the theoretical value. At this time, further judging the change amount of the timestamp sent by the synchronous request message in the last step, if the two change amounts are almost different, indicating that the local receiving end has no problem; if the two variation differences are large, the problem of the local receiving end is indicated, and the abnormality is prompted.
⑦ Judging whether the value of the timestamp of the synchronous message received by the timestamp-the timestamp of the synchronous message sent by the timestamp-the corrected value of the timestamp is suddenly changed, for example, the change is larger than 100, and the like, and judging whether the change amounts of the timestamp of the time stamp sent by the time delay measurement request message and the timestamp of the time stamp received by the time delay measurement request message are suddenly changed, and judging whether the value of the timestamp of the time stamp of the time delay measurement request message received by the time delay measurement request message is suddenly changed, if the value of the timestamp of the time stamp sent by the time delay measurement request message is suddenly changed, prompting abnormality.
⑧ The sequence number of the delay measurement request message is discontinuous, the delay measurement response corresponding to the delay measurement request can not be found under the condition that the sequence numbers are the same, and the delay measurement request corresponding to the delay measurement response can not be found, so that abnormality is required to be prompted.
⑨ And judging whether the interval time of the hardware time stamp (the time stamp sent by the time delay measurement request message) of the two time delay measurement requests exceeds half, if so, indicating that the local area possibly has problems, and prompting abnormality.
⑩ Judging whether the interval time of the time stamp carried by the message sending the time delay measurement response twice (the time stamp of the message received by the time delay measurement request) exceeds half, if so, continuously judging whether the hardware time stamp sent by the corresponding time delay measurement request message (the time stamp sent by the time delay measurement request message) is changed, if not, indicating that the opposite terminal possibly has a problem, and prompting abnormality.
In one embodiment, the data may be analyzed using Python scripts, important information printed to the screen, and graphical displays may be considered.
The PTP data analysis method provided by the invention has various purposes, and can preliminarily confirm whether the problem is a master clock (provided with clock source equipment) or a slave clock (tracked with clock source equipment); it may also be used to obtain synchronization information such as one-step (the timestamp sent by the synchronization message is included in the present synchronization message) or two-step (the timestamp sent by the synchronization message is included in a separate follow message), multicast medium access control address, clock source information, PTP message frequency, current time difference (master and slave clock difference values) values, etc.
In particular, according to embodiments of the present application, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts.
It should be noted that, the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-Only Memory (ROM), an erasable programmable read-Only Memory (Erasable Programmable Read Only Memory, EPROM), a flash Memory, an optical fiber, a portable compact disc read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present application, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Where each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present application may be implemented by software, or may be implemented by hardware, and the described units may also be provided in a processor. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
As another aspect, the present application also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the PTP data analysis method described in the above embodiment.
As another aspect, the present application also provides a computer-readable medium that may be contained in the electronic device described in the above embodiment; or may exist alone without being incorporated into the electronic device. The computer-readable medium carries one or more programs that, when executed by one of the electronic devices, cause the electronic device to implement the PTP data analysis method described in the above embodiment.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a server, a touch terminal, or a network device, etc.) to perform the method according to the embodiments of the present application.
The specific meaning of the above terms in the present invention will be understood in detail by those skilled in the art; the accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention. The components of the embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
While embodiments of the present application have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the application, and that variations, modifications, alternatives and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the application.

Claims (10)

1. A PTP data analysis method, characterized by comprising:
Establishing a custom data structure having a header common to standard PTP messages;
capturing data in real time, and storing the data in a linked list container according to a sequence;
According to a preset triggering condition, data in the linked list container are transferred and stored;
and carrying out data analysis on the transferred data, and printing and displaying abnormal information and designated data.
2. The PTP data analysis method of claim 1, wherein establishing a custom data structure includes:
each data record has a common portion comprising: message type, sequence number, domain name, flag domain, hardware timestamp, timestamp calibration value, and interval value;
for all received and sent standard PTP messages, the data type is defined as protocol;
For root mean square data, the method also comprises a current time difference root mean square/maximum value/minimum value, a frequency difference root mean square/maximum value/minimum value and a time delay root mean square/maximum value/minimum value, and the data type is defined as rms;
For state data, a snapshot of the state change is defined, including: time, a current root mean square value, a current clock difference value and a current link delay value, and a data type is defined as state;
for attribute data, further comprising: whether the data is in two steps, whether the data is in phase modulation, a filtering mode, a convergence threshold, a servo algorithm mode and parameters, and the data type is defined as property.
3. The PTP data analysis method according to claim 1 or 2, wherein the specific process of capturing data in real time is:
For the received and sent standard PTP messages, unconditionally storing the received and sent standard PTP messages in a linked list container, and triggering by a message event;
For each second of record, constructing root mean square, frequency difference, link delay and time difference into an expansion_rms message, storing the message in a linked list container, and triggering by periodic record;
For state change, the synchronous message sending and receiving time stamp, the time delay measuring message sending and receiving time stamp, the current clock difference value, the servo state machine state and the synchronous state machine state are constructed into an expansion_state message, and are stored in a linked list container and triggered by a state change event;
For PTP configuration information, it is recorded at start-up, constructed as an expand_property message, and stored in a linked list container, triggered only once at start-up.
4. A PTP data analysis method according to claim 3, further comprising configuring the type of data to be grabbed by a configuration file.
5. The PTP data analysis method according to claim 1, wherein said preset trigger condition includes:
① When the PTP state changes;
② The linked list container is full for the first time after PTP locking.
6. The PTP data analysis method according to claim 1 or 5, wherein said policy of restocking comprises:
All messages require the content of the header information to be transferred, including: print sequence number, message type, message sequence number, hardware timestamp, timestamp carried by message, local timestamp, calibration value, domain name number, interval period, and port number.
For notification messages, clock source information needs to be restored;
for the expand_rms message, the current root mean square, frequency difference, link delay and time difference are also required to be transferred;
For the expansion_state message, a time stamp is sent out by a transfer synchronization request message, and a time stamp and a state value of the message are received by a time delay measurement request;
for the expand_property message, a dump link time recording mechanism, a clock lock decision threshold, an enabled phasing mode, a phasing threshold, a filter type and length, a target media access control address, and whether a follow message is included are also required.
7. The PTP data analysis method according to claim 1, wherein the specific method of data analysis includes:
traversing all notification messages, sequentially judging whether the contents of two adjacent notification messages are different, whether the serial numbers are discontinuous, and whether the interval time is greater than 1.5 times of the normal time, and if any judging condition results in yes, printing abnormal information of the corresponding messages is needed;
Traversing all synchronous/following messages, and sequentially judging whether the sequence numbers of two adjacent messages are intermittent, whether the synchronous and following messages are not matched and whether the sending and receiving time stamps of the synchronous messages are abnormal, wherein if any judging condition results are yes, the abnormal information of the corresponding messages needs to be printed;
traversing all delay request/response messages, and sequentially judging whether the sequence numbers of two adjacent messages are intermittent, whether the request and response messages are not matched and whether the time stamps sent and received by the delay measurement messages are abnormal, wherein if the judgment result is yes, the abnormal information of the corresponding messages needs to be printed;
and traversing all the periodic rms messages, judging whether the time difference, the frequency difference and the time delay difference change by more than 100ppb or not, if so, printing abnormal information, and if not, traversing all the state change information and printing the abnormal information.
8. The PTP data analysis method according to claim 7, wherein when traversing all sync/follow messages, the specific method for judging whether the sync message sending and receiving time stamps are abnormal is:
Step A, judging whether the interval time of the synchronous message receiving time stamp is more than 1.5 times of the normal time, if so, entering the step B, otherwise, entering the step C;
Step B, judging whether the interval time of sending out the time stamp by the synchronous message is more than 1.5 times of the normal time, if so, indicating that the master clock is abnormal, entering the step D, and if not, indicating that the slave clock is abnormal, entering the step D;
step C, calculating whether the difference between the sending time stamp and the receiving time stamp of the synchronous message exceeds 100ns, if yes, entering a step D, otherwise, ending the flow;
and D, printing abnormal information.
9. The PTP data analysis method according to claim 7, wherein when traversing all delay request/response messages, the specific method for determining whether the delay measurement message sending and receiving time stamps are abnormal is:
Step a, judging whether the interval time of the time stamp received by the time delay measurement message is more than 1.5 times of the normal time, if so, entering the step b, otherwise, entering the step c;
Step b, judging whether the interval time of the time stamp sent by the time delay measurement message is more than 1.5 times of the normal time, if so, entering the step d, otherwise, entering the step d,
Step c, calculating whether the difference between the sending time stamp and the receiving time stamp of the time delay measurement message exceeds 100ns, if yes, entering a step d, otherwise, ending the flow;
and d, printing abnormal information.
10. The PTP data analysis method according to claim 7, further comprising printing display designation data, specifically comprising:
comparing the data with the data type of rms with a preset threshold, and if the data type of rms is larger than the threshold, printing and displaying;
when initializing, printing data with the display data type of property;
when the state is changed, data of which the display data type is state is printed.
CN202410166536.4A 2024-02-06 2024-02-06 PTP data analysis method Pending CN117955820A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410166536.4A CN117955820A (en) 2024-02-06 2024-02-06 PTP data analysis method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410166536.4A CN117955820A (en) 2024-02-06 2024-02-06 PTP data analysis method

Publications (1)

Publication Number Publication Date
CN117955820A true CN117955820A (en) 2024-04-30

Family

ID=90798197

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410166536.4A Pending CN117955820A (en) 2024-02-06 2024-02-06 PTP data analysis method

Country Status (1)

Country Link
CN (1) CN117955820A (en)

Similar Documents

Publication Publication Date Title
CN109739727B (en) Service monitoring method and device in micro-service architecture
US8042004B2 (en) Diagnosing communications between computer systems
EP2222003B1 (en) Field control system
EP2902940B1 (en) Storage system and method for processing data operation request
CN110928561B (en) Vehicle controller software version management method and device, vehicle and storage medium
US10127093B1 (en) Method and apparatus for monitoring a message transmission frequency in a robot operating system
CN111865466B (en) Time synchronization method, device, time-given equipment and storage medium
CN112272243B (en) Address allocation method
CN108062235B (en) Data processing method and device
US11360872B2 (en) Creating statistical analyses of data for transmission to servers
CN111314174A (en) Network dial testing method and device based on block chain and SDN edge computing network system
US11930292B2 (en) Device state monitoring method and apparatus
CN115756908A (en) Method for real-time ECU crash reporting and recovery
CN108038127B (en) Data synchronization method, device, terminal equipment and storage medium
CN111831954B (en) Content data updating method, device, computer equipment and storage medium
CN117955820A (en) PTP data analysis method
JP4786392B2 (en) Event information management system
CN110554929A (en) Data verification method and device, computer equipment and storage medium
CN112905106B (en) Data processing method, device, system, equipment and storage medium
CN107239378B (en) Overtime monitoring method and system
CN110113187B (en) Configuration updating method and device, configuration server and configuration system
CN112988689A (en) State checking method and device, electronic equipment and computer readable storage medium
JP2000242618A (en) Network system and time synchronization method therefor
CN112749142A (en) Handle management method and system
CN111752786A (en) Data storage method, data summarization method, equipment and medium in pressure test process

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination