Industrial 5G synchronization precision test method
By using the 5G gateway simulator and the Python data analysis module at the industrial site for embedded development, the problem of low test efficiency and low accuracy in the existing test environment was solved, and the efficient and accurate industrial 5G synchronization accuracy test was achieved.
Patent Information
- Application Number
- CN202411489920.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-01-24
AI Technical Summary
The existing industrial site test environment has problems such as difficulty in testing indicators, low testing efficiency and low accuracy, especially when conducting bidirectional delay testing of network applications.
Through the 5G gateway simulator embedded development, the built -in adjustable assembly test code is achieved at any time to test the network at any time, providing the ability to collect raw data, forming a traceable data source, and quickly obtaining the results through the Python data analysis module.
The experimental cycle was shortened, the experimental efficiency was improved, and the high accuracy of the industrial 5G synchronization accuracy test was achieved.
Smart Images

Figure CN119363279A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of communication technology, and in particular relates to an industrial 5G synchronization accuracy testing method. Background Art
[0002] The test environment of industrial sites only uses laboratory air interface testing and field wireless signal testing. These test environments have problems such as difficulty in index testing, low test efficiency and low accuracy. For example, in the existing two-way delay test of network applications, the two-way delay refers to the total time it takes for information to reach the receiver from the sender, plus the time it takes for the receiver to send information to the sender. Two-way delay is more common in engineering because the two-way delay can be measured only on one side of the information sender or receiver (using tools such as ping). In the basic LAN two-way delay test, two terminal devices deployed in the current LAN are usually selected. In one of the devices, the IP address of another device is specified and a data packet is sent to the device through the Ping command (Ping: Send a data packet of a certain length to the specified network address. According to the agreement, if the specified network address exists, a data packet of the same size will be returned. Of course, if there is no return within a specific time, it is a "timeout" and it will be considered that the specified network address does not exist. Data packet: a small segment of a larger information. Data sent over a computer network is divided into data packets, and then these data packets are reassembled by the computer or device that receives them). By triggering the Ping logic in a device and recording the command line echo, the binary star experiment result is obtained. Therefore, a test method with high test efficiency and accuracy is needed. Summary of the invention
[0003] The purpose of the present invention is to provide an industrial 5G synchronization accuracy test method, which, through the embedded development of a 5G gateway simulator, has built-in adjustable test code, can achieve network access and testing at any time, provide the ability to collect raw data, form a traceable data source, and achieve rapid results based on data, shorten the experimental cycle, and improve experimental efficiency.
[0004] The present invention provides an industrial 5G synchronization accuracy test method, which completes the industrial 5G synchronization accuracy test based on a test system. The test system includes a control computer, a wired network switch, a server and a client; the server is provided with an NTP server A; the client is provided with an NTP receiver B and an NTP receiver C; the control computer communicates with the NTP server A, the NTP receiver B and the NTP receiver C through the wired network switch, and the NTP server A communicates with the NTP receiver B and the NTP receiver C; the NTP server A is deployed on a terminal simulator A and serves as a test sender A; the NTP receiver B is deployed on a terminal simulator B and serves as a test receiver B; the NTP receiver C is deployed on a terminal simulator C and serves as a test receiver C; the method includes the following steps:
[0005] Step 1: Configure the code before testing:
[0006] Configure the configurable items in the C language source code according to the corresponding test conditions, including data packet size, sending interval, number of sends, and NTP time synchronization frequency;
[0007] Step 2, environment configuration before testing:
[0008] Make sure that all three simulators can successfully access the 5G private network. Use the ping command to verify that all simulators can communicate with each other through the 5G private network. If all are confirmed successful, verify that the NTP synchronization between the client and server can run normally.
[0009] Step 3: Perform the corresponding test:
[0010] Compile the C / C++ language source code into target files respectively, create corresponding folders in the simulator and put the corresponding compiled target files into them, and trigger the server-side simulator and the client-side simulator deployed target files in sequence through the terminal window;
[0011] Step 4: Get the original test data:
[0012] Obtain the corresponding raw data logs and transfer the logs to the control computer;
[0013] Step 5, trigger the data analysis process:
[0014] By triggering the Python data analysis module, the obtained raw data logs are entered and the corresponding analysis results are obtained.
[0015] Furthermore, the step 3 comprises:
[0016] 1) Test startup process:
[0017] The control computer triggers all operations and starts the programs of the test sender and the test receiver;
[0018] After the test sender and the test receiver receive the command from the control computer, the terminal simulator triggers the first round of NTP time synchronization based on wired transmission and starts the sending and receiving process;
[0019] 2) Cycle process after successful startup:
[0020] The test sender A sends messages to the test receiver B and the test receiver C simultaneously. When the test sender A triggers the action of sending messages to the test receiver B and the test receiver C, the current time point is immediately recorded in the terminal simulator A: T1, T2;
[0021] The test receiving end B and the test receiving end C receive the periodically sent messages of the test sender;
[0022] When the test receiver B and the test receiver C receive the message from the test sender A, they immediately record the current time in the terminal simulator B and the terminal simulator C: T3, T4;
[0023] Return the periodic message of the test sender A;
[0024] The test sender A receives the return messages from the test receiver B and the test receiver C in a blocking manner;
[0025] Perform interval sleep and set the sleep time to 500ms.
[0026] Furthermore, the step 3 also includes:
[0027] Calculate the one-way delay ΔT1 from the test sender A to the test receiver B, ΔT1 = T1-T3;
[0028] Calculate the one-way delay ΔT2 from the test sender A to the test receiver C, ΔT2 = T2-T4;
[0029] Calculate the synchronization accuracy time difference Tsync-diff, Tsync-diff = ΔT1 - ΔT2.
[0030] Furthermore, the step 4 comprises:
[0031] After all test programs are finished and the Done character appears in the terminal, use the cd command to check whether there are corresponding logs generated in the current path. There is one log on the receiving end and two logs on the server end.
[0032] If all logs are generated successfully, all available logs are transferred out of the terminal emulator, all logs are stored in the same folder of the control computer, and then the file address is updated in the Python data analysis module.
[0033] Furthermore, the step 5 comprises:
[0034] Read the logs obtained in each terminal emulator line by line according to the input file address, a total of three;
[0035] Clean the data of each log, grab the timestamp, and merge the results corresponding to different servers in the receiving end log and the timestamp of the corresponding server into two available dictionary objects according to the data packet sequence number;
[0036] Calculate and screen data based on the newly generated available dictionary object to obtain information related to latency and packet loss, and store the calculated latency results back into lists, with a total of two groups;
[0037] Calculate the synchronization accuracy based on the obtained delay list to obtain a synchronization accuracy delay difference data list;
[0038] Output corresponding charts based on the delay difference data list.
[0039] With the help of the above solution, through the industrial 5G synchronization accuracy test method, through the embedded development of the 5G gateway simulator, and the built-in adjustable test code, it is possible to access the network and test at any time, provide the ability to collect raw data, form a traceable data source, and quickly obtain results based on data, shortening the experimental cycle and improving experimental efficiency.
[0040] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention and implement it according to the contents of the specification, the following is a detailed description of the preferred embodiments of the present invention in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 is an architecture diagram of the test system of the present invention;
[0042] Figure 2 It is a plain text example of the present invention and the corresponding displayed information;
[0043] Figure 3 A test flow chart in one embodiment of the present invention;
[0044] Figure 4 The one-way delay result in one embodiment of the present invention;
[0045] Figure 5 This is the synchronization accuracy result in one embodiment of the present invention;
[0046] Figure 6 A line graph of synchronization accuracy results in one embodiment of the present invention;
[0047] Figure 7The test data results under different message sizes in one embodiment of the present invention are shown in FIG. 1 , where a is 64B, b is 128B, c is 256B, d is 512B, and e is 1024B. DETAILED DESCRIPTION
[0048] The specific implementation of the present invention is further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
[0049] Terminology explanation:
[0050] OPC UA 5G Simulator:
[0051] OPC UA (OPC Unified Architecture) is an open international standard communication protocol developed for safe and reliable data exchange in industries such as industrial automation. It can cross the barriers of device types, operating systems, and manufacturers to safely and reliably exchange data. The OPC UA 5G simulator is a gateway simulator that supports 5G cellular network communications to meet the requirements of low latency, multi-access, and large bandwidth in industrial 5G environment testing.
[0052] NTP time synchronization:
[0053] The Network Time Protocol (NTP) is an application layer protocol in the TCP / IP protocol suite, used to synchronize the clocks between clients and servers, and provide high-precision time correction. The NTP server receives accurate Coordinated Universal Time (UTC) from authoritative clock sources (such as atomic clocks, GPS), and the client requests and receives time from the server. NTP is transmitted based on UDP packets, and the UDP port number used is 123.
[0054] Python:
[0055] Python is an easy-to-learn, powerful programming language that has efficient high-level data structures and implements object-oriented programming simply and effectively. Python's concise syntax and support for dynamic input, coupled with the nature of an interpreted language, make it an ideal scripting language in many areas on most platforms, especially for rapid application development.
[0056] This embodiment provides an industrial 5G synchronization accuracy test method, which completes the industrial 5G synchronization accuracy test based on a test system.
[0057] Ginseng Figure 1As shown, the test system includes a control computer, a wired network switch, a server and a client; the server is provided with an NTP server A, and the client is provided with an NTP receiver B and an NTP receiver C; the control computer communicates with the NTP server A, the NTP receiver B and the NTP receiver C through the wired network switch, and the NTP server A communicates with the NTP receiver B and the NTP receiver C; the NTP server A is deployed in the terminal simulator A and serves as the test sender A; the NTP receiver B is deployed in the terminal simulator B and serves as the test receiver B; the NTP receiver C is deployed in the terminal simulator C and serves as the test receiver C.
[0058] The test method includes the following steps:
[0059] Step 1: Configure the code before testing: Configure the configurable items in the C language source code according to the corresponding test conditions, including data packet size, sending interval, and NTP time synchronization frequency.
[0060] In the C / C++ language source code, according to the test requirements or test purposes, the corresponding test conditions are configured accordingly (data packet size, sending interval, number of transmissions, NTP time synchronization frequency).
[0061] Step 2, environment configuration before testing:
[0062] Make sure that all three simulators can successfully access the 5G private network, and use the ping command to verify that each simulator can communicate with each other through the 5G private network. If all are confirmed successful, use ntpdate <client IP> to verify that the client and server NTP synchronization can run normally.
[0063] Step 3, perform corresponding tests: compile the C / C++ language source code into target files respectively, create corresponding folders in the simulator and put the corresponding compiled target files into them, and trigger the target files deployed on the server-side simulator and the client-side simulator in sequence through the terminal window.
[0064] Specifically, the concurrent logic server and client C / C++ language source codes based on the TCP / UDP protocol implemented by the Socket logic are compiled into target files respectively; corresponding folders are created in the simulator and the compiled target files are deployed to the newly created folders of the server device and the client device; the simulator is accessed through RDP or similar RDP software, and the target files deployed on the server simulator and the client simulator are triggered in sequence through the terminal window.
[0065] Step 4, original test data acquisition: obtain the corresponding original data log and transfer the log to the control computer.
[0066] After all programs are finished and the "Done" character appears in the terminal, you can use the cd command to check whether there is a corresponding log generated in the current path. The server has one log and the client has two logs. The plain text sample and the corresponding table information are as follows: Figure 2 If all logs are generated successfully, transfer all available logs out of the simulator via FTP or similar software, store all logs in the same folder on the control computer, and then update the file address into the Python data analysis module.
[0067] Step 5, triggering the data analysis process: triggering the Python data analysis module to input the obtained raw data logs and obtain the corresponding analysis results.
[0068] Once all log files are successfully entered into the data analysis module and the module code is successfully run, the corresponding analysis results can be directly viewed to help users quickly draw conclusions.
[0069] Ginseng Figure 1 As shown, the solid line represents wired transmission and the dotted line represents 5G wireless transmission.
[0070] The step 3 comprises:
[0071] 1) Test startup process:
[0072] ① All operations are triggered by the control computer, and the programs of the test sender and the test receiver are started;
[0073] ② After the test sender and the test receiver receive the command from the control computer, the terminal simulator triggers the first round of NTP time synchronization based on wired transmission and starts the sending and receiving process (adjustable periodic NTP time synchronization is then performed in the sending and receiving process).
[0074] 2) Cycle process after successful startup (number of cycles is 10,000 times):
[0075] ③ The test sender A sends messages to the test receiver B and the test receiver C simultaneously. When the test sender A triggers the action of sending messages to the test receiver B and the test receiver C, the current time point is immediately recorded in the terminal simulator A: T1, T2.
[0076] ④ Test receiving end B and test receiving end C receive the periodically sent messages from the test sender.
[0077] ⑤ When the test receiver B and the test receiver C receive the message from the test sender A, they immediately record the current time in the terminal simulator B and the terminal simulator C: T3, T4.
[0078] ⑦ Return the periodic message of the test sender A.
[0079] ⑧The test sender A blocks the reception of the return messages from the test receiver B and the test receiver C.
[0080] ⑩Perform interval sleep and set the sleep time to 500ms.
[0081] In this embodiment, step 3 further includes:
[0082] Calculate the one-way delay ΔT1 from the test sender A to the test receiver B, ΔT1 = T1-T3;
[0083] Calculate the one-way delay ΔT2 from the test sender A to the test receiver C, ΔT2 = T2-T4;
[0084] Calculate the synchronization accuracy time difference Tsync-diff, Tsync-diff = ΔT1 - ΔT2.
[0085] Ginseng Figure 3 As shown, in a specific example, the test details process is as follows:
[0086] ①-② is the triggering process, and the control computer starts the complete test process through cmd. (corresponding to Figure 1 The process in ①)
[0087] ③ is the NTP time synchronization process. At the beginning of the complete process, NTP time synchronization will be performed first to synchronize the starting time between the client and the server. Then, adjustable periodic time synchronization will be performed in the process to avoid excessive time differences caused by physical devices. (Corresponding to Figure 1 Process in ②)
[0088] ④ Concurrent process, A sends messages to B and C simultaneously. A records T1 and T2, which are the time of sending messages to B and C respectively. B records T3 and C records T4, which are the time of receiving the message sent by A. (Corresponding to Figure 1 Process ③-⑧)
[0089] ⑤ is the process of obtaining the logs generated by each simulator. (This is the step of the data analysis module).
[0090] In this embodiment, step 5 includes:
[0091] 1) Read the logs obtained in each terminal emulator line by line according to the input file address, a total of three;
[0092] 2) Clean the data of each log through Regex and other logics. After capturing the timestamp, merge the results corresponding to different servers in the receiving end log and the timestamp of the corresponding server into two available dictionary objects according to the data packet sequence number;
[0093] 3) Calculate and screen data based on the newly generated available dictionary object to obtain information related to delay and packet loss, and store the calculated delay results back into a list, with a total of two groups;
[0094] 4) Calculate the synchronization accuracy based on the obtained delay list to obtain a synchronization accuracy delay difference data list;
[0095] 5) Output corresponding charts based on the delay difference data list.
[0096] Figure 4 The maximum, minimum, and average values of the one-way delay in transmission for different message sizes at the same transmission interval (500ms) are shown in the figure. It can be seen whether the change in the experiment is linear as the message size changes; whether the value range of the delay is ideal and whether it can meet industrial needs.
[0097] Figure 5 The results shown are based on Figure 4 The synchronization accuracy results under dual-line concurrency were obtained after further calculation of the experimental data in . The figure shows the maximum delay difference, minimum delay interpolation and average delay interpolation for two groups of server devices under concurrent operation. It can be seen that the maximum difference is too large and does not meet industrial needs. The minimum interpolation is close to 0, indicating that there is a complete synchronization phenomenon. The average delay difference fluctuates greatly, which may be related to the purity of the network environment during the test, or it may be caused by the state of the physical device, but the values are all above 40ms, which is a big challenge for the industrial field.
[0098] Figure 6 For image Figure 5 As a result, it is more straightforward to show that the state of synchronization accuracy is nonlinearly related to the packet size.
[0099] Figure 7 The top ten latency data for different servers under different message sizes are shown. The upper right dot graph shows the result status of 100 data points in 10,000 data points under uniform sampling. Through the latency data of server 1 and server 2, the gap and size exchange can be clearly seen. The lower right dot graph shows the latency difference distribution of 10,000 data points. It can be seen that the latency difference is basically fixed in a certain range, and there are singular points (large value points) at the same time, and the distribution is irregular.
[0100] The present invention is oriented to the business demand indicators of 5G industrial applications, tests the network performance related to 5G industrial applications, performs corresponding data analysis, and outputs conclusions. Through the 5G gateway simulator, the two-way delay, one-way delay, and synchronization accuracy are tested under TCP and UDP protocols respectively, and the adjustable (sending message size, sending interval, and time calibration interval) test raw data are collected. Based on the original data (native information log), Python is used to realize automatic reading, data splitting, and data calculation. After generating readable data, data screening is performed, and data conversion generates point graphs, line graphs, and pie charts as needed and outputs conclusions.
[0101] The present invention uses an embedded 5G gateway simulator with built-in adjustable test code to enable network access and testing at any time, provide the ability to collect raw data, form a traceable data source, and quickly obtain results based on the data, thereby shortening the experimental cycle and improving experimental efficiency.
[0102] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the technical principles of the present invention, and these improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. An industrial 5G synchronization accuracy test method, characterized in that: The industrial 5G synchronization accuracy test is completed based on the test system, which includes a control computer, a wired network switch, a server and a client; the server is provided with an NTP server A, and the client is provided with an NTP receiver B and an NTP receiver C; the control computer communicates with the NTP server A, NTP receiver B, and NTP receiver C through the wired network switch, and the NTP server A communicates with the NTP receiver B and NTP receiver C; The NTP server A is deployed in the terminal simulator A and serves as the test sender A; the NTP receiver B is deployed in the terminal simulator B and serves as the test receiver B; the NTP receiver C is deployed in the terminal simulator C and serves as the test receiver C; the method comprises the following steps: Step 1: Configure the code before testing: Configure the configurable items in the C language source code according to the corresponding test conditions, including data packet size, sending interval, number of sends, and NTP time synchronization frequency; Step 2, environment configuration before testing: Make sure that all three simulators can successfully access the 5G private network. Use the ping command to verify that all simulators can communicate with each other through the 5G private network. If all are confirmed successful, verify that the NTP synchronization between the client and server can run normally. Step 3: Perform the corresponding test: Compile the C / C++ language source code into target files respectively, create corresponding folders in the simulator and put the corresponding compiled target files into them, and trigger the target files deployed on the server simulator and the client simulator in sequence through the terminal window; Step 4: Get the original test data: Obtain the corresponding raw data logs and transfer the logs to the control computer; Step 5, trigger the data analysis process: By triggering the Python data analysis module, the obtained raw data logs are entered and the corresponding analysis results are obtained.
2. The industrial 5G synchronization accuracy test method according to claim 1 is characterized in that: The step 3 comprises: 1) Test startup process: The control computer triggers all operations and starts the programs of the test sender and the test receiver; After the test sender and the test receiver receive the command from the control computer, the terminal simulator triggers the first round of NTP time synchronization based on wired transmission and starts the sending and receiving process; 2) Cycle process after successful startup: The test sender A sends messages to the test receiver B and the test receiver C simultaneously. When the test sender A triggers the action of sending messages to the test receiver B and the test receiver C, the current time point is immediately recorded in the terminal simulator A: T1, T2; The test receiving end B and the test receiving end C receive the periodically sent messages of the test sender; When the test receiver B and the test receiver C receive the message from the test sender A, they immediately record the current time in the terminal simulator B and the terminal simulator C: T3, T4; Return the periodic message of the test sender A; The test sender A receives the return messages from the test receiver B and the test receiver C in a blocking manner; Perform interval sleep and set the sleep time to 500ms.
3. The industrial 5G synchronization accuracy test method according to claim 2 is characterized in that: The step 3 also includes: Calculate the one-way delay ΔT1 from the test sender A to the test receiver B, ΔT1 = T1-T3; Calculate the one-way delay ΔT2 from the test sender A to the test receiver C, ΔT2 = T2-T4; Calculate the synchronization accuracy time difference Tsync-diff, Tsync-diff = ΔT1 - ΔT2.
4. The industrial 5G synchronization accuracy test method according to claim 3 is characterized in that: The step 4 comprises: After all test programs are finished and the Done character appears in the terminal, use the cd command to check whether there are corresponding logs generated in the current path. There is one log on the receiving end and two logs on the server end. If all logs are generated successfully, all available logs are transferred out of the terminal emulator, all logs are stored in the same folder of the control computer, and then the file address is updated in the Python data analysis module.
5. The industrial 5G synchronization accuracy test method according to claim 4 is characterized in that: The step 5 comprises: Read the logs obtained in each terminal emulator line by line according to the input file address, a total of three; Clean the data of each log, grab the timestamp, and merge the results corresponding to different servers in the receiving end log and the timestamp of the corresponding server into two available dictionary objects according to the data packet sequence number; Calculate and screen data based on the newly generated available dictionary object to obtain information related to latency and packet loss, and store the calculated latency results back into lists, with a total of two groups; Calculate the synchronization accuracy based on the obtained delay list to obtain a synchronization accuracy delay difference data list; Output corresponding charts based on the delay difference data list.