High-speed comprehensive detection train detection data transmission flow control method and device

By using flow control methods in high-speed comprehensive detection trains and dynamically adjusting transmission parameters, the problems of low detection data transmission efficiency and data loss are solved, and higher transmission integrity rate and reliability are achieved.

CN118890660APending Publication Date: 2024-11-01CHINA ACADEMY OF RAILWAY SCI CORP LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410906572.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-08
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

The existing detection data transmission efficiency is low, and it is prone to network blockage and data loss, resulting in incomplete data, seriously affecting subsequent analysis and processing.

Method used

The high-speed comprehensive detection train detection data transmission flow control method is adopted, and the data source changes are scanned regularly to determine the saturation of the transmission resource, and dynamically adjust the flow control detection interval value, the packet sending thread sleep time and the maximum allowable packet loss during the transmission process. Flow control adjustment relationship reduces network blockage and data loss.

Benefits of technology

It effectively improves the complete rate of detection data transmission, reduces network blockage and data loss, and improves the efficiency and reliability of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118890660A_ABST
    Figure CN118890660A_ABST
Patent Text Reader

Abstract

The invention discloses a high-speed comprehensive detection train detection data transmission flow control method and device. The method comprises the following steps: regularly scanning whether a data source is changed or not; when the data source changes and the transmission resource is unsaturated, the changed file is transmitted to a ground server; in the transmission process, according to a preset flow control adjustment relation, the flow control detection interval value, the packet sending thread dormancy duration and the maximum allowable packet loss number are dynamically adjusted, the flow control detection interval value indicates that dynamic adjustment is executed every time the flow control detection interval value number of data packets is sent, the packet sending thread dormancy duration indicates the data transmission thread dormancy duration, and the maximum allowable packet loss number is larger than the maximum allowable packet loss number. The flow control adjustment relation comprises the relation between the change trend of the packet loss number and the maximum allowable packet loss number, the packet loss number, the packet loss rate, the maximum allowable packet loss number, the number of the threads which perform data transmission at present, and the relation between the flow control detection interval value and the sleep duration of the packet sending threads. Network congestion can be reduced, and the detection data transmission integrity rate can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of wireless transmission of detection data of a high-speed comprehensive detection train, and in particular to a method and device for flow control of data transmission of detection data of a high-speed comprehensive detection train. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No admission is made that the description herein is prior art by inclusion in this section.

[0003] Comprehensive inspection trains, comprehensive inspection vehicles, professional inspection vehicles and mounted monitoring equipment are the main means of inspection and monitoring of high-speed railway infrastructure operations. The inspection and monitoring data generated are large in scale and diverse in types, showing characteristics of multi-source, heterogeneous and massive, and the amount of inspection data transmitted is huge.

[0004] The existing detection data transmission is still mainly based on manual dumping, which is inefficient. There are also a few network transmission technologies, but due to the huge amount of data and the technical limitations of the transmission equipment, network congestion and data loss are particularly prone to occur, resulting in incomplete data, which seriously affects the subsequent data analysis and processing. Summary of the invention

[0005] The embodiment of the present invention provides a high-speed comprehensive detection train detection data transmission flow control method, which is used to reduce network congestion, detection data loss, and improve the detection data transmission integrity rate. The method includes:

[0006] Regularly scan whether the data source has changed; the data source is obtained by the high-speed comprehensive inspection train performing the inspection task;

[0007] When the data source changes, the changed files are obtained, and at the same time, it is determined whether the transmission resources are saturated; whether the transmission resources are saturated is determined based on the number of files to be transmitted and the total storage capacity of the files to be transmitted;

[0008] When the transmission resources are not saturated, the changed files will be transmitted to the ground service end; wherein, during the transmission process, the flow control detection interval value, the sleep time of the packet sending thread and the maximum allowed number of packet losses are dynamically adjusted according to the preset flow control adjustment relationship, the flow control detection interval value indicates: dynamic adjustment is performed every time a flow control detection interval value of data packets are sent, the sleep time of the packet sending thread indicates the sleep time of the thread transmitting data, and the flow control adjustment relationship includes: a first relationship between the trend of the packet loss number and the maximum allowed number of packet losses, and a second relationship between the packet loss number, packet loss rate, the maximum allowed number of packet losses and the number of threads currently performing data transmission, and the flow control detection interval value and the sleep time of the packet sending thread.

[0009] The embodiment of the present invention also provides a high-speed comprehensive detection train detection data transmission flow control device, which is used to reduce network congestion, detection data loss, and improve the detection data transmission integrity rate. The device includes:

[0010] A file scanning module is used to periodically scan whether a data source has changed; the data source is obtained by the high-speed comprehensive inspection train when performing inspection tasks;

[0011] The idle resource judgment module is used to obtain the changed files when the data source changes, and judge whether the transmission resources are saturated; whether the transmission resources are saturated is judged according to the number of files to be transmitted and the total storage capacity of the files to be transmitted;

[0012] The transmission module is used to transmit the changed files to the ground service end when the transmission resources are not saturated; wherein, during the transmission process, the flow control detection interval value, the sleep time of the packet sending thread and the maximum allowed packet loss are dynamically adjusted according to the preset flow control adjustment relationship, the flow control detection interval value indicates: dynamic adjustment is performed every time the flow control detection interval value of data packets are sent, the sleep time of the packet sending thread indicates the sleep time of the thread transmitting data, and the flow control adjustment relationship includes: the first relationship between the trend of the packet loss number and the maximum allowed packet loss number, and the second relationship between the packet loss number, packet loss rate, the maximum allowed packet loss number and the number of threads currently performing data transmission, and the flow control detection interval value and the sleep time of the packet sending thread.

[0013] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned high-speed comprehensive inspection train inspection data transmission flow control method when executing the computer program.

[0014] An embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned high-speed comprehensive detection train detection data transmission flow control method is implemented.

[0015] An embodiment of the present invention also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the above-mentioned high-speed comprehensive detection train detection data transmission flow control method.

[0016] In the embodiment of the present invention, a data source is scanned regularly to see if it changes; the data source is obtained by the high-speed comprehensive inspection train performing the inspection task; when the data source changes, the changed files are obtained, and at the same time, it is determined whether the transmission resources are saturated; whether the transmission resources are saturated is determined based on the number of files to be transmitted and the total storage capacity of the files to be transmitted; when the transmission resources are not saturated, the changed files are transmitted to the ground service end; wherein, during the transmission process, the flow control detection interval value, the sleep time of the packet sending thread and the maximum allowed number of packet losses are dynamically adjusted according to the preset flow control adjustment relationship, the flow control detection interval value indicates: dynamic adjustment is performed every time a flow control detection interval value of data packets are sent, the sleep time of the packet sending thread indicates the sleep time of the thread transmitting data, and the flow control adjustment relationship includes: a first relationship between the trend of the packet loss number and the maximum allowed number of packet losses, and a second relationship between the packet loss number, the packet loss rate, the maximum allowed number of packet losses and the number of threads currently performing data transmission, and the flow control detection interval value and the sleep time of the packet sending thread. When the embodiment of the present invention performs high-speed comprehensive inspection train inspection data transmission, it first determines whether the transmission resources are saturated based on the number of files to be transmitted and the total storage capacity of the files to be transmitted. When the transmission resources are not saturated, the flow control adjustment relationship is used to transmit the changed data to the ground service end, wherein the flow control adjustment relationship includes: the first relationship between the trend of the number of packet losses and the maximum allowed number of packet losses, the second relationship between the number of packet losses, the packet loss rate, the maximum allowed number of packet losses and the number of threads currently performing data transmission, and the flow control detection interval value and the sleep time of the packet sending thread. Compared with the technical solutions in the prior art, the embodiment of the present invention proposes the concepts of flow control detection interval value, packet sending thread sleep time, maximum allowed number of packet losses and flow control adjustment relationship. The flow control adjustment relationship is used to dynamically adjust the flow control detection interval value, the sleep time of the packet sending thread and the maximum allowed number of packet losses, which can reduce network congestion, detection data loss, and improve the detection data transmission integrity rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0018] Figure 1 It is a flow chart of a high-speed comprehensive inspection train inspection data transmission flow control method according to an embodiment of the present invention;

[0019] Figure 2 It is a specific embodiment of the high-speed comprehensive detection train detection data transmission flow control method in the embodiment of the present invention;

[0020] Figure 3 It is a specific embodiment of the high-speed comprehensive detection train detection data transmission flow control method in the embodiment of the present invention;

[0021] Figure 4 It is a schematic diagram of a high-speed comprehensive detection train detection data transmission flow control device in an embodiment of the present invention;

[0022] Figure 5 Schematic diagram of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION

[0023] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0024] The existing detection data transmission is still mainly based on manual dumping, which is inefficient. There are also a small number of network transmission technologies, but due to the huge amount of data and the technical limitations of the transmission equipment, it is particularly easy to have network congestion and data loss, resulting in incomplete data, which seriously affects the subsequent data analysis and processing. To this end, an embodiment of the present invention proposes a high-speed comprehensive detection train detection data transmission flow control method.

[0025] Figure 1 FIG. 1 is a flow chart of a high-speed comprehensive detection train detection data transmission flow control method according to an embodiment of the present invention. Figure 1 As shown, the method includes:

[0026] Step 101, regularly scan whether the data source has changed; the data source is obtained by the high-speed comprehensive inspection train performing the inspection task;

[0027] Step 102: when the data source changes, the changed files are obtained, and at the same time, it is determined whether the transmission resources are saturated; whether the transmission resources are saturated is determined based on the number of files to be transmitted and the total storage capacity of the files to be transmitted;

[0028] Step 103: when the transmission resources are not saturated, the changed files are transmitted to the ground service end; wherein, during the transmission process, the flow control detection interval value, the sleep time of the packet sending thread and the maximum allowed number of packet losses are dynamically adjusted according to the preset flow control adjustment relationship, the flow control detection interval value indicates: dynamic adjustment is performed every time a flow control detection interval value of data packets are sent, the sleep time of the packet sending thread indicates the sleep time of the thread transmitting data, and the flow control adjustment relationship includes: a first relationship between the trend of packet loss and the maximum allowed number of packet losses, and a second relationship between the packet loss, packet loss rate, the maximum allowed number of packet losses and the number of threads currently performing data transmission, and the flow control detection interval value and the sleep time of the packet sending thread.

[0029] from Figure 1 It can be seen from the shown process that in the embodiment of the present invention, the data source is regularly scanned to see if it changes; the data source is obtained by the high-speed comprehensive inspection train performing the inspection task; when the data source changes, the changed file is obtained, and at the same time, it is determined whether the transmission resources are saturated; whether the transmission resources are saturated is determined based on the number of files to be transmitted and the total storage capacity of the files to be transmitted; when the transmission resources are not saturated, the changed files are transmitted to the ground service end; wherein, during the transmission process, according to the preset flow control adjustment relationship, the flow control detection interval value, the sleep time of the packet sending thread and the maximum allowed number of packet losses are dynamically adjusted, the flow control detection interval value indicates: dynamic adjustment is performed every time the flow control detection interval value of the data packet is sent, the sleep time of the packet sending thread indicates the sleep time of the thread transmitting data, and the flow control adjustment relationship includes: the first relationship between the trend of the packet loss number and the maximum allowed number of packet losses, the second relationship between the packet loss number, the packet loss rate, the maximum allowed number of packet losses and the number of threads currently performing data transmission, and the flow control detection interval value and the sleep time of the packet sending thread. When the embodiment of the present invention performs high-speed comprehensive inspection train inspection data transmission, it first determines whether the transmission resources are saturated based on the number of files to be transmitted and the total storage capacity of the files to be transmitted. When the transmission resources are not saturated, the flow control adjustment relationship is used to transmit the changed data to the ground service end, wherein the flow control adjustment relationship includes: the first relationship between the trend of the number of packet losses and the maximum allowed number of packet losses, the second relationship between the number of packet losses, the packet loss rate, the maximum allowed number of packet losses and the number of threads currently performing data transmission, and the flow control detection interval value and the sleep time of the packet sending thread. Compared with the technical solutions in the prior art, the embodiment of the present invention proposes the concepts of flow control detection interval value, packet sending thread sleep time, maximum allowed number of packet losses and flow control adjustment relationship. The flow control adjustment relationship is used to dynamically adjust the flow control detection interval value, the sleep time of the packet sending thread and the maximum allowed number of packet losses, which can reduce network congestion, detection data loss, and improve the detection data transmission integrity rate.

[0030] The following is a detailed explanation of the high-speed comprehensive inspection train inspection data transmission flow control method in an embodiment of the present invention.

[0031] The main objectives of the embodiments of the present invention include:

[0032] (1) High-speed comprehensive inspection train client transmission process;

[0033] (2) Define concepts such as flow control detection interval, packet sending thread sleep time, packet loss number, and maximum allowed packet loss number;

[0034] (3) Flow control adjustment principle: By dynamically balancing the flow control detection interval value and the sleep time of the packet sending thread, the client sending rate is adjusted to suppress the trend of increasing packet loss rate.

[0035] Among them, the high-speed comprehensive inspection train client is responsible for monitoring task status, real-time monitoring of file changes, real-time uploading of inspection files, transmission task progress, recording file transfer records, and file transfer integrity verification.

[0036] Specific file transfer process: The ground service creates synchronization tasks for different types of detection data and saves them to the database. The client obtains all synchronization tasks on the ground service and finds its own task according to its own configured professional type. According to the source directory, target directory, filtering time, etc. configured in the task, it monitors the corresponding data source directory file changes in real time, and puts the files to be sent into the queue to be sent. Through the file sending thread and based on the TCP transmission protocol, the files to be sent are sent to the ground service and stored in real time. The client calculates the size of the file to be sent, the size of the sent file, the transmission speed, and persists the file transfer record in real time, and transmits the sending progress to the ground service in real time through the UDP protocol. The ground service displays the progress of the task in real time and estimates the completion time.

[0037] The client transmission process may also include: the content of the start transmission request instruction sent by the client, which includes the basic information of the file; the ground server parses and processes it according to the instruction content after receiving the request; the client divides the file into blocks according to the file fragment size and sends the data packet containing the file content; the ground server parses and processes the data packet according to the agreed content after receiving the data packet; after the file content is completely sent, the client sends a file sending completion request instruction to the ground server; after receiving the completion request, the ground server merges the file fragments to generate a complete transmission file and performs an MD5 correctness check on the file. If the check fails, the file needs to be uploaded again. If the check succeeds, subsequent processing will continue.

[0038] In step 101, a data source is scanned periodically to see if it changes. The data source is obtained when a high-speed comprehensive inspection train performs an inspection task.

[0039] During implementation, locate the data source directory according to the task obtained from the server, and scan the data source regularly according to the preset interval scanning time. When the data source changes, including but not limited to file addition and file modification, determine the changed data. When no data source changes, exit and wait for the next scan.

[0040] In step 102, when the data source changes, the changed file is obtained, and at the same time, it is determined whether the transmission resources are saturated.

[0041] During implementation, to determine whether the transmission resources are saturated, two conditions must be met at the same time: the number of files to be transmitted is greater than the first value N1, and the total storage capacity of the files to be transmitted is greater than the second value M1. The first value N1 and the second value M1 are set in advance based on actual software and hardware resources.

[0042] Figure 2 This is a specific embodiment of the high-speed comprehensive detection train detection data transmission flow control method in the embodiment of the present invention, as shown in Figure 2 As shown, after determining whether the transmission resources are saturated, the following steps may also be included:

[0043] Step 201: When the transmission resources are saturated, after a first preset time interval, it is determined again whether the transmission resources are saturated.

[0044] For example, when the above two conditions are met at the same time, it is determined that the transmission resources are saturated. If saturated, it is determined again after an interval of 3 seconds whether the transmission resources are saturated.

[0045] In one embodiment, after obtaining the changed files, the following steps may also be performed:

[0046] Add the changed files to the first queue and update the first queue; the first queue includes multiple changed files acquired historically, and all changed files are sorted by priority;

[0047] After determining whether the transmission resources are saturated, the following steps may also be performed:

[0048] When the transmission resources are saturated, the files with a preset number of changes are extracted from the first queue in descending order of priority, and the files with a preset number of changes are added to the second queue; the files in the second queue are transmitted to the ground service end after preprocessing;

[0049] Re-determine whether the transmission resources are saturated.

[0050] During implementation, after obtaining the changed files in step 102, the files are added to the first queue. The priority of all the detection data can be determined according to the data source and data type identifier. For example, there are many sensors and detection systems for detecting different parts or components on the comprehensive detection train, which have different importance. Therefore, the detection data can also have different importance. The priority of different detection data can be determined based on this principle, so as to determine the priority of all the changed files.

[0051] When it is determined that the transmission resources are saturated, it can be determined first whether there are files waiting to be processed in the first queue; if there are files waiting to be processed in the first queue, multiple files are taken out of the first queue according to priority and added to the second queue, and then it is determined whether the transmission resources are saturated. If there are no files waiting to be processed in the first queue, it is determined again after an interval of 3 seconds whether the transmission resources are saturated.

[0052] By determining and processing whether transmission resources are saturated, network congestion can be alleviated, helping to reduce data loss.

[0053] In one embodiment, all changed files in the second queue are sorted by priority;

[0054] Before transmitting the changed data to the ground service end, the following may also be included:

[0055] Based on the MD5 algorithm and preset fragmentation parameters, all changed files in the second queue are preprocessed and added to the third queue. The maximum transmission data block size is set and the changed files are fragmented using the maximum transmission data block size. The files in the third queue are used for sequential transmission to the ground service end.

[0056] Figure 3 This is a specific embodiment of the high-speed comprehensive detection train detection data transmission flow control method in the embodiment of the present invention, as shown in Figure 3 As shown, the files in the second queue are preprocessed in order of priority from high to low. The archiving mode calculates the file fingerprint (for the ground service end to perform MD5 correctness verification later), and adds it to the third queue after the calculation is completed. The append mode determines whether the file incremental part M2 (storage size) is greater than the maximum transmission data block size M3. If it is greater, set the transmission block M4=M3. If not, set the transmission block M4=M2, calculate the data fingerprint of the transmission block M4, and add it to the third queue after the calculation is completed, where M4 is the transmission block. The files in the third queue will be transmitted directly to the ground service end. The append mode is a data transmission method in which the new data is added to the end of the existing data instead of overwriting it.

[0057] In step 103, the changed files are transmitted to the ground service end by using the preset flow control adjustment relationship.

[0058] In one embodiment, transmitting the changed files to the ground service end may include:

[0059] The files in the third queue are transmitted to the ground server based on the TCP transmission protocol. During the transmission process, based on the UDP protocol, it is determined whether each transmitted data packet has received a response from the ground server. If no response is received from the ground server, the corresponding data packet will be resent.

[0060] refer to Figure 3 When sending files, files waiting for transmission are obtained from the third queue in real time according to priority. When transmitting, they are transmitted in packets. A transmission record is generated for each packet. The transmission record status is start transmission. The data packet is added to the transmission record queue and sent to the server. After all transmissions are completed, the transmission record status is changed from start transmission to complete transmission. The size of the packet marking the completion of file transfer is marked, and the timestamp of the completion of file transfer and other information are updated.

[0061] refer to Figure 3, When sending completion detection: detect the transmission record whose status is sending completion, confirm that the sent packets have received the response from the server, if there are unfinished data packets within the preset time range of the timeout, then add the record back to the third queue, if all are received successfully within the timeout time range, then add it to the transmission completion queue.

[0062] After the ground service end receives the file, it performs a data consistency check. If it receives confirmation from the server within the timeout period, the transmission is completed and the next step is carried out. If it does not receive confirmation from the server within the timeout period, the data consistency check is performed again.

[0063] refer to Figure 3 ,Processing after the transmission is completed: the archive mode completes the transmission, and the append mode determines whether there is unfinished or new data. If the unfinished or new data size M5 is greater than the minimum incremental transmission data volume M6, the file is added to the second queue.

[0064] In the embodiment of the present invention, concepts such as flow control detection interval value, packet sending thread sleep time, packet loss number, and maximum allowed packet loss number are defined as follows.

[0065] Flow control detection interval value (ci): Flow control intervention will be performed after sending ci packets at an interval. The default value is 5.

[0066] Detection window (wt): dynamic time range, from the start of transmission to the current time. If all data packets are transmitted, the detection window starts again.

[0067] Packet sending thread sleep time (sl): the sleep time between sending data packets, in milliseconds.

[0068] Number of packets sent (sed): The number of packets sent during the detection window.

[0069] Number of received packets (rev): The number of packets received during the detection window.

[0070] Retransmitted packets (rs): The number of packets retransmitted within the detection window.

[0071] Number of threads (th): The number of threads currently performing data transmission.

[0072] Last MissAck: The number of packets that were not completely transmitted during the last detection.

[0073] In an embodiment of the present invention, according to a preset flow control adjustment relationship, the flow control detection interval value, the sleep time of the packet sending thread and the maximum allowed number of packet losses are dynamically adjusted to control the sending speed, thereby achieving the purpose of controlling the increasing trend of the packet loss rate, the packet loss rate threshold and the packet loss number threshold.

[0074] The number of packet losses (currentMissAck), packet loss rate (rate), and packet loss increase trend (qs) are defined as follows:

[0075] Number of lost packets (currentMissAck) = number of sent packets (sed) - number of received packets (rev) - number of resent packets (rs)

[0076] Packet loss rate (rate) = number of lost packets (currentMissAck) * 100.0 / sleep time of the packet sending thread (sl)

[0077] Packet loss increase trend (qs) = packet loss number (currentMissAck) - last packet loss number (lastMissAck)

[0078] In one embodiment, the first relationship between the packet loss number change trend and the maximum allowed packet loss number is determined as follows:

[0079] Every second preset duration:

[0080] Get the number of packet loss and determine whether the difference between two adjacent packet loss numbers is positive or negative;

[0081] When the difference is positive for a preset number of consecutive times, it is determined that the trend of the packet loss number is an upward trend, and the maximum allowed packet loss number is increased by a set step size;

[0082] When the difference is negative for a preset number of consecutive times, it is determined that the trend of the packet loss number is a downward trend, and the maximum allowed packet loss number is decreased by a set step size.

[0083] For example, if the packet loss number increase trend is positive for more than 20 consecutive times, it means that the packet loss number is on an upward trend. If the packet loss number increase trend is negative for 20 consecutive times, it means that the packet loss number is on a downward trend. The maximum allowed packet loss number (maxNotAck) increases when the packet loss number increase trend is positive, and decreases when the trend is negative. The minimum value is 500 (increases upward every 1000).

[0084] In one embodiment, during the transmission process, the flow control detection interval value, the sleep time of the packet sending thread and the maximum allowed packet loss number are dynamically adjusted according to the preset flow control adjustment relationship, including:

[0085] When the number of packet losses is greater than the maximum allowed number of packet losses, the flow control detection interval value ci and the packet sending thread sleep time sl are determined according to the following formula:

[0086]

[0087]

[0088] When the number of packet losses is not greater than the maximum allowed number of packet losses, the flow control detection interval and the sleep time of the packet sending thread are determined according to the following formula:

[0089] ci=max(8 / th,1)

[0090]

[0091] Among them, rate is the packet loss rate, and th is the number of threads currently performing data transmission. The above formula reflects the second relationship between the number of packet losses, the packet loss rate, the maximum allowed number of packet losses, the number of threads currently performing data transmission, and the flow control detection interval value and the sleep time of the packet sending thread.

[0092] During implementation, first determine the maximum allowed number of packet losses based on the first relationship and the obtained number of packet losses; then determine the flow control detection interval value and the sleep time of the packet sending thread based on the second relationship, the number of packet losses, the packet loss rate, the maximum allowed number of packet losses and the number of threads currently performing data transmission.

[0093] The flow control adjustment principle in the embodiment of the present invention controls the sending speed by dynamically adjusting the values ​​of ci and sl, thereby achieving the purpose of controlling the increasing trend of the packet loss rate, the packet loss rate threshold, and the packet loss number threshold.

[0094] The beneficial effects of the embodiments of the present invention are:

[0095] (1) Through the client transmission process in the embodiment of the present invention, the client can monitor the task status, monitor file changes in real time, upload and test files in real time, transfer task progress, record file transfer records, and perform file transfer integrity verification;

[0096] (2) By studying the client flow control adjustment principle in the embodiment of the present invention, the client can calculate the size of the file to be sent in real time and control the increase of the packet loss rate;

[0097] (3) By studying the client transmission process and flow control adjustment principle in the embodiment of the present invention, conditions can be created for data transmission in the high-speed detection environment of railway infrastructure;

[0098] (4) The embodiments of the present invention provide new ideas for other types of vehicle-to-ground transmission and flow control adjustment principles.

[0099] The embodiment of the present invention also provides a high-speed comprehensive detection train detection data transmission flow control device, as described in the following embodiment. Since the principle of solving the problem by the device is similar to the high-speed comprehensive detection train detection data transmission flow control method, the implementation of the device can refer to the implementation of the high-speed comprehensive detection train detection data transmission flow control method, and the repeated parts will not be repeated.

[0100] Figure 4Schematic diagram of a high-speed comprehensive detection train detection data transmission flow control device according to an embodiment of the present invention, as shown in FIG. Figure 4 As shown, the device comprises:

[0101] The file scanning module 401 is used to periodically scan whether the data source has changed; the data source is obtained by the high-speed comprehensive inspection train when performing the inspection task;

[0102] The idle resource judgment module 402 is used to obtain the changed files when the data source changes, and to judge whether the transmission resources are saturated; whether the transmission resources are saturated is judged according to the number of files to be transmitted and the total storage capacity of the files to be transmitted;

[0103] The transmission module 403 is used to transmit the changed files to the ground service end when the transmission resources are not saturated; wherein, during the transmission process, the flow control detection interval value, the sleep time of the packet sending thread and the maximum allowed packet loss are dynamically adjusted according to the preset flow control adjustment relationship, the flow control detection interval value indicates: dynamic adjustment is performed every time a flow control detection interval value of data packets are sent, the sleep time of the packet sending thread indicates the sleep time of the thread transmitting data, and the flow control adjustment relationship includes: a first relationship between the trend of the packet loss number and the maximum allowed packet loss number, and a second relationship between the packet loss number, packet loss rate, the maximum allowed packet loss number and the number of threads currently performing data transmission, and the flow control detection interval value and the sleep time of the packet sending thread.

[0104] In one embodiment, it further includes:

[0105] The first re-judgment module is used to re-judgment whether the transmission resources are saturated after the idle resource judgment module 402 judges whether the transmission resources are saturated and after a first preset time interval when the transmission resources are saturated.

[0106] In one embodiment, it further includes:

[0107] The first queue module is used for adding the changed files to the first queue and updating the first queue after the idle resource judgment module 402 obtains the changed files; the first queue includes multiple changed files obtained historically, and all the changed files are sorted by priority;

[0108] Also includes:

[0109] The second queue module is used for the idle resource judgment module 402 to judge whether the transmission resources are saturated. When the transmission resources are saturated, the files with a preset number of changes are extracted from the first queue in descending order of priority, and the files with a preset number of changes are added to the second queue; the files in the second queue are transmitted to the ground service end after preprocessing;

[0110] The second re-judgment module is used to re-judgment whether the transmission resources are saturated.

[0111] In one embodiment, all changed files in the second queue are sorted by priority;

[0112] Also includes:

[0113] The third queue module is used to pre-process all changed files in the second queue based on the MD5 algorithm and preset fragmentation parameters before the transmission module 403 transmits the changed data to the ground service end, and add the pre-processed files to the third queue, wherein the maximum transmission data block size is set, and the changed files are fragmented using the maximum transmission data block size. The files in the third queue are used to be transmitted to the ground service end in sequence.

[0114] In one embodiment, the transmission module 403 is specifically used for:

[0115] The files in the third queue are transmitted to the ground server based on the TCP transmission protocol. During the transmission process, based on the UDP protocol, it is determined whether each transmitted data packet has received a response from the ground server. If no response is received from the ground server, the corresponding data packet will be resent.

[0116] In one embodiment, the first relationship between the packet loss number change trend and the maximum allowed packet loss number is determined as follows:

[0117] Every second preset duration:

[0118] Get the number of packet loss and determine whether the difference between two adjacent packet loss numbers is positive or negative;

[0119] When the difference is positive for a preset number of consecutive times, it is determined that the trend of the packet loss number is an upward trend, and the maximum allowed packet loss number is increased by a set step size;

[0120] When the difference is negative for a preset number of consecutive times, it is determined that the trend of the packet loss number is a downward trend, and the maximum allowed packet loss number is decreased by a set step size.

[0121] In one embodiment, the transmission module 403 is specifically used for:

[0122] When the number of packet losses is greater than the maximum allowed number of packet losses, the flow control detection interval value ci and the packet sending thread sleep time sl are determined according to the following formula:

[0123]

[0124]

[0125] When the number of packet losses is not greater than the maximum allowed number of packet losses, the flow control detection interval and the sleep time of the packet sending thread are determined according to the following formula:

[0126] ci=max(8 / th,1)

[0127]

[0128] Among them, rate is the packet loss rate, and th is the number of threads currently performing data transmission.

[0129] Figure 5 Schematic diagram of a computer device in an embodiment of the present invention. Figure 5 As shown, an embodiment of the present invention also provides a computer device 500, including a processor 501, a memory 502, and a computer program 503 stored in the memory 502 and executable on the processor 501, wherein the processor 501 implements the above-mentioned high-speed comprehensive detection train detection data transmission flow control method when executing the computer program 503.

[0130] An embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned high-speed comprehensive detection train detection data transmission flow control method is implemented.

[0131] An embodiment of the present invention also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the above-mentioned high-speed comprehensive detection train detection data transmission flow control method.

[0132] In the embodiment of the present invention, a data source is scanned regularly to see if it changes; the data source is obtained by the high-speed comprehensive inspection train performing the inspection task; when the data source changes, the changed files are obtained, and at the same time, it is determined whether the transmission resources are saturated; whether the transmission resources are saturated is determined based on the number of files to be transmitted and the total storage capacity of the files to be transmitted; when the transmission resources are not saturated, the changed files are transmitted to the ground service end; wherein, during the transmission process, the flow control detection interval value, the sleep time of the packet sending thread and the maximum allowed number of packet losses are dynamically adjusted according to the preset flow control adjustment relationship, the flow control detection interval value indicates: dynamic adjustment is performed every time a flow control detection interval value of data packets are sent, the sleep time of the packet sending thread indicates the sleep time of the thread transmitting data, and the flow control adjustment relationship includes: a first relationship between the trend of the packet loss number and the maximum allowed number of packet losses, and a second relationship between the packet loss number, the packet loss rate, the maximum allowed number of packet losses and the number of threads currently performing data transmission, and the flow control detection interval value and the sleep time of the packet sending thread. When the embodiment of the present invention performs high-speed comprehensive inspection train inspection data transmission, it first determines whether the transmission resources are saturated based on the number of files to be transmitted and the total storage capacity of the files to be transmitted. When the transmission resources are not saturated, the flow control adjustment relationship is used to transmit the changed data to the ground service end, wherein the flow control adjustment relationship includes: the first relationship between the trend of the number of packet losses and the maximum allowed number of packet losses, the second relationship between the number of packet losses, the packet loss rate, the maximum allowed number of packet losses and the number of threads currently performing data transmission, and the flow control detection interval value and the sleep time of the packet sending thread. Compared with the technical solutions in the prior art, the embodiment of the present invention proposes the concepts of flow control detection interval value, packet sending thread sleep time, maximum allowed number of packet losses and flow control adjustment relationship. The flow control adjustment relationship is used to dynamically adjust the flow control detection interval value, the sleep time of the packet sending thread and the maximum allowed number of packet losses, which can reduce network congestion, detection data loss, and improve the detection data transmission integrity rate.

[0133] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0134] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0135] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0136] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0137] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A high-speed comprehensive detection train detection data transmission flow control method, characterized in that: include: Regularly scan the data source to see if it has changed; The data source is obtained by the high-speed comprehensive inspection train performing the inspection task; When the data source changes, the changed files are obtained, and at the same time, it is determined whether the transmission resources are saturated; whether the transmission resources are saturated is determined based on the number of files to be transmitted and the total storage capacity of the files to be transmitted; When the transmission resources are not saturated, the changed files will be transmitted to the ground service end; wherein, during the transmission process, the flow control detection interval value, the sleep time of the packet sending thread and the maximum allowed number of packet losses are dynamically adjusted according to the preset flow control adjustment relationship, the flow control detection interval value indicates: dynamic adjustment is performed every time a flow control detection interval value of data packets are sent, the sleep time of the packet sending thread indicates the sleep time of the thread transmitting data, and the flow control adjustment relationship includes: a first relationship between the trend of the packet loss number and the maximum allowed number of packet losses, and a second relationship between the packet loss number, packet loss rate, the maximum allowed number of packet losses and the number of threads currently performing data transmission, and the flow control detection interval value and the sleep time of the packet sending thread.

2. The method according to claim 1, characterized in that After determining whether the transmission resources are saturated, the following steps are also included: When the transmission resources are saturated, after a first preset time interval, it is determined again whether the transmission resources are saturated.

3. The method according to claim 1, characterized in that After getting the changed files, it also includes: Add the changed files to the first queue and update the first queue; the first queue includes multiple changed files acquired historically, and all changed files are sorted by priority; After determining whether the transmission resources are saturated, the following steps are also included: When the transmission resources are saturated, the files with a preset number of changes are extracted from the first queue in descending order of priority, and the files with a preset number of changes are added to the second queue; the files in the second queue are transmitted to the ground service end after preprocessing; Re-determine whether the transmission resources are saturated.

4. The method according to claim 3, characterized in that All changed files in the second queue are sorted by priority; Before the changed data is transmitted to the ground service end, it also includes: Based on the MD5 algorithm and preset fragmentation parameters, all changed files in the second queue are preprocessed and added to the third queue. The maximum transmission data block size is set and the changed files are fragmented using the maximum transmission data block size. The files in the third queue are used for sequential transmission to the ground service end.

5. The method according to claim 4, characterized in that Transmit the changed files to the ground service end, including: The files in the third queue are transmitted to the ground server based on the TCP transmission protocol. During the transmission process, based on the UDP protocol, it is determined whether each transmitted data packet has received a response from the ground server. If no response is received from the ground server, the corresponding data packet will be resent.

6. The method according to claim 1, characterized in that The first relationship between the packet loss number change trend and the maximum allowed packet loss number is determined as follows: Every second preset duration: Get the number of packet loss and determine whether the difference between two adjacent packet loss numbers is positive or negative; When the difference is positive for a preset number of consecutive times, it is determined that the trend of the packet loss number is an upward trend, and the maximum allowed packet loss number is increased by a set step size; When the difference is negative for a preset number of consecutive times, it is determined that the trend of the packet loss number is a downward trend, and the maximum allowed packet loss number is decreased by a set step size.

7. The method according to claim 6, characterized in that During the transmission process, the flow control detection interval value, the sleep time of the packet sending thread and the maximum allowed packet loss are dynamically adjusted according to the preset flow control adjustment relationship, including: When the number of packet losses is greater than the maximum allowed number of packet losses, the flow control detection interval value ci and the packet sending thread sleep time sl are determined according to the following formula: When the number of packet losses is not greater than the maximum allowed number of packet losses, the flow control detection interval and the sleep time of the packet sending thread are determined according to the following formula: ci=max(8 / th,1) Among them, rate is the packet loss rate, and th is the number of threads currently performing data transmission.

8. A high-speed comprehensive detection train detection data transmission flow control device, characterized in that: include: The file scanning module is used to periodically scan whether the data source has changed; The data source is obtained by the high-speed comprehensive inspection train performing the inspection task; The idle resource judgment module is used to obtain the changed files when the data source changes, and judge whether the transmission resources are saturated; whether the transmission resources are saturated is judged according to the number of files to be transmitted and the total storage capacity of the files to be transmitted; The transmission module is used to transmit the changed files to the ground service end when the transmission resources are not saturated; wherein, during the transmission process, the flow control detection interval value, the sleep time of the packet sending thread and the maximum allowed packet loss are dynamically adjusted according to the preset flow control adjustment relationship, the flow control detection interval value indicates: dynamic adjustment is performed every time the flow control detection interval value of data packets are sent, the sleep time of the packet sending thread indicates the sleep time of the thread transmitting data, and the flow control adjustment relationship includes: the first relationship between the trend of the packet loss number and the maximum allowed packet loss number, and the second relationship between the packet loss number, packet loss rate, the maximum allowed packet loss number and the number of threads currently performing data transmission, and the flow control detection interval value and the sleep time of the packet sending thread.

9. The device according to claim 8, characterized in that The first relationship between the packet loss number change trend and the maximum allowed packet loss number is determined as follows: Every second preset duration: Get the number of packet loss and determine whether the difference between two adjacent packet loss numbers is positive or negative; When the difference is positive for a preset number of consecutive times, it is determined that the trend of the packet loss number is an upward trend, and the maximum allowed packet loss number is increased by a set step size; When the difference is negative for a preset number of consecutive times, it is determined that the trend of the packet loss number is a downward trend, and the maximum allowed packet loss number is decreased by a set step size.

10. The device according to claim 8, characterized in that The transmission module is specifically used for: When the number of packet losses is greater than the maximum allowed number of packet losses, the flow control detection interval value ci and the packet sending thread sleep time sl are determined according to the following formula: When the number of packet losses is not greater than the maximum allowed number of packet losses, the flow control detection interval and the sleep time of the packet sending thread are determined according to the following formula: ci=max(8 / th,1) Among them, rate is the packet loss rate, and th is the number of threads currently performing data transmission.

11. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

13. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.