Intelligent differentiated forwarding method, device and equipment of switch trdp protocol and storage medium

By parsing switch data packets and using a decision tree model to identify TRDR data packets, the problem of existing switches being unable to accurately distinguish TRDR data packets under high load conditions is solved, achieving accurate identification and priority forwarding of data packets and improving the deterministic communication performance of the system.

CN122160349APending Publication Date: 2026-06-05SHENZHEN FENGRUNDA TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN FENGRUNDA TECH CO LTD
Filing Date
2026-05-07
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing switches cannot accurately distinguish between TRDR packets and management packets under high load conditions, leading to misjudgment or forwarding delays of real-time control commands, which affects the deterministic communication performance of the system.

Method used

By parsing the data packets of each port of the switch, extracting target feature fields, using a decision tree model for identification, and allocating the data packets to the corresponding priority forwarding queues based on the identification results, the accurate identification and differentiated forwarding of TRDR data packets are achieved.

Benefits of technology

In a hybrid protocol environment, accurate differentiation and priority forwarding of TRDR packets were achieved, improving the deterministic communication performance of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122160349A_ABST
    Figure CN122160349A_ABST
Patent Text Reader

Abstract

The application discloses a switch TRDP protocol intelligent differentiated forwarding method and device, equipment and storage medium, and relates to the technical field of network communication, which comprises the following steps: analyzing data packets of each port of a switch to obtain target characteristic fields; identifying the data packets based on a decision tree model and the target characteristic fields to obtain an identification result; and distributing the data packets to corresponding priority forwarding queues according to the identification result. The technical problem of how to realize accurate identification and differentiated forwarding scheduling of TRDR data packets without relying on fixed port configuration in an industrial switching network coexisting with mixed protocols is solved, deep analysis and intelligent identification based on protocol characteristic fields of data packets are realized, and it is ensured that TRDR data packets can still be accurately distinguished and preferentially forwarded in a high-load mixed traffic environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network communication technology, and in particular to a method, apparatus, device and storage medium for intelligent differentiated forwarding of the TRDP protocol in a switch. Background Technology

[0002] With the increasing demands for real-time and deterministic data transmission in industrial automation, railway communication, and rail transit, networks simultaneously carry TRDR data streams and conventional Internet Protocol management data streams. This necessitates that switches accurately distinguish between different protocol types of data packets under high load conditions to ensure the transmission quality of critical control services.

[0003] Existing switches typically rely on static port mapping or fixed protocol ports to identify Train Real-time Data Protocol (TRDR) data streams. This method cannot accurately distinguish between real-time data packets and management data packets when the protocol identifier changes dynamically or when multiple protocols are transmitted in a mixed manner. Furthermore, it lacks the ability to deeply analyze the internal characteristic fields of data packets, which can easily lead to misjudgment or forwarding delays of real-time control commands, affecting the deterministic communication performance of the system.

[0004] Therefore, in industrial switching networks where mixed protocols coexist, how to achieve differentiated forwarding and scheduling of TRDP packets is an urgent problem to be solved.

[0005] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention

[0006] The main objective of this application is to provide a method, apparatus, device, and storage medium for intelligent differentiated forwarding of TRDP protocol packets in a switch, aiming to solve the technical problem of how to achieve differentiated forwarding scheduling of TRDP packets.

[0007] To achieve the above objectives, this application proposes a method for intelligent differentiated forwarding of the TRDP protocol in a switch, the method comprising: Parse the data packets on each port of the switch to obtain the target feature fields; The data packet is identified based on the decision tree model and the target feature fields to obtain the identification result; The data packet is assigned to the corresponding priority forwarding queue based on the identification result.

[0008] In one embodiment, the parsing of data packets from each port of the switch to obtain target feature fields includes: Based on the Ethernet frame headers of data packets from each port of the switch, the source MAC address and destination MAC address are obtained. Based on the IP header of the data packets from each port of the switch, the protocol identifier is obtained; The data packets are filtered based on the source MAC address, destination MAC address, and protocol identifier to obtain the target data packets; Extract the sequence number, timestamp, data type, length information, and checksum from the protocol header of the target data packet as target feature fields.

[0009] In one embodiment, extracting the sequence number, timestamp, data type, length information, and checksum as target feature fields from the protocol header of the target data packet includes: Extract the sequence number, timestamp, data type, length information, and checksum from the protocol header of the target data packet as protocol feature fields; The protocol feature fields are matched with the statistical feature library to obtain the feature matching degree; The protocol feature fields whose feature matching degree is within a preset threshold range are used as target feature fields.

[0010] In one embodiment, before matching the protocol feature fields with the statistical feature library to obtain the feature matching degree, the method further includes: Collect multiple historical TRDP protocol data packets; Parse the historical TRDP protocol data packets to obtain the fixed value of the protocol identifier, the increasing pattern of the sequence number, the precision range of the timestamp, and the correlation between the payload length and the data type; A statistical feature library is constructed based on the fixed value of the protocol identifier, the incrementing pattern of the sequence number, the precision range of the timestamp, and the correlation between the payload length and the data type.

[0011] In one embodiment, before identifying the data packet based on the decision tree model and the target feature field to obtain the identification result, the method further includes: Collect mirrored traffic data in a switch networking environment; Separate a first set of data packets carrying a TRDR-specific identifier and a second set of data packets not carrying the TRDR-specific identifier from the mirrored traffic data; Extract the sequence number, timestamp, data type, length information and check code from the first data packet set to construct the first feature sample set; Extract the sequence number, timestamp, data type, length information and check code from the second data packet set to construct the second feature sample set; The first feature sample set and the second feature sample set are input into the initial decision tree model, and the internal node split bars of the initial decision tree model are adjusted until the difference between the decision result output by the initial decision tree model for the first feature sample set and the decision result output for the second feature sample set satisfies the preset constraint, thus obtaining the decision tree model.

[0012] In one embodiment, the step of identifying the data packet based on the decision tree model and the target feature field to obtain the identification result includes: The target feature field is input into the decision tree model, and the confidence level of the data packet corresponding to the target feature field output by the decision tree model is obtained; When the confidence level is less than the first confidence threshold, the identification result is determined to be that the data packet is a valid TRDR data packet; When the confidence level is greater than or equal to the first confidence threshold and the confidence level is less than the second confidence threshold, the identification result is determined to be that the data packet is a suspected TRDR data packet; When the confidence level is greater than the second confidence threshold, the identification result is determined to be that the data packet is an invalid TRDR data packet, wherein the first confidence threshold is greater than the second confidence threshold.

[0013] In one embodiment, the priority forwarding queue includes a first priority forwarding queue, a second priority forwarding queue, and a third priority forwarding queue, wherein the priority of the first priority forwarding queue is greater than the priority of the second priority forwarding queue, and the priority of the second priority forwarding queue is greater than the priority of the third priority forwarding queue. The step of allocating the data packet to the corresponding priority forwarding queue based on the identification result includes: When the identification result indicates that the data packet is a valid TRDR data packet, the data packet is added to the first priority forwarding queue; When the identification result indicates that the data packet is a suspected TRDR data packet, the data packet is added to the second priority forwarding queue; When the identification result indicates that the data packet is an invalid TRDR data packet, the data packet is added to the third priority forwarding queue.

[0014] Furthermore, to achieve the above objectives, this application also proposes a switch TRDP protocol intelligent differentiated forwarding device, the switch TRDP protocol intelligent differentiated forwarding device comprising: The parsing module is used to parse data packets from each port of the switch to obtain target feature fields; The identification module is used to identify the data packet based on the decision tree model and the target feature field to obtain the identification result; The allocation module is used to allocate the data packet to the corresponding priority forwarding queue according to the identification result.

[0015] Furthermore, to achieve the above objectives, this application also proposes a switch TRDP protocol intelligent differential forwarding device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the switch TRDP protocol intelligent differential forwarding method as described above.

[0016] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the switch TRDP protocol intelligent differential forwarding method as described above.

[0017] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the switch TRDP protocol intelligent differentiated forwarding method as described above.

[0018] This application parses data packets from each port of a switch to obtain target feature fields; identifies the data packets based on a decision tree model and the target feature fields to obtain identification results; and allocates the data packets to the corresponding priority forwarding queues according to the identification results. This solves the technical problem of how to achieve accurate identification and differentiated forwarding scheduling of TRDR data packets in industrial switching networks with coexisting mixed protocols without relying on fixed port configurations. It achieves deep parsing and intelligent identification based on the protocol feature fields of the data packets themselves, ensuring that TRDR data packets can still be accurately distinguished and prioritized for forwarding even under high-load mixed traffic environments. Attached Figure Description

[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a flowchart illustrating an embodiment of the TRDP protocol intelligent differentiated forwarding method for switches in this application. Figure 2 This is a flowchart illustrating Embodiment 2 of the TRDP protocol intelligent differentiated forwarding method for switches in this application. Figure 3 This is a schematic diagram of the module structure of the intelligent differentiated forwarding device for the TRDP protocol in a switch according to an embodiment of this application; Figure 4 This is a schematic diagram of the device structure of the hardware operating environment involved in the intelligent differentiated forwarding method of the TRDP protocol in the embodiments of this application.

[0022] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0023] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0024] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0025] The main solution of this application embodiment is: parsing the data packets of each port of the switch to obtain the target feature field; identifying the data packets based on the decision tree model and the target feature field to obtain the identification result; and allocating the data packets to the corresponding priority forwarding queue according to the identification result.

[0026] In this embodiment, for ease of description, the following description uses the switch TRDP protocol intelligent differentiated forwarding x system as the execution subject.

[0027] Since existing switches typically rely on static port mapping or fixed protocol ports to identify data streams, this method cannot accurately distinguish between real-time data packets and management data packets when protocol identifiers change dynamically or when multiple protocols are mixed and transmitted. Furthermore, it lacks the ability to deeply analyze the internal characteristic fields of data packets, which can easily lead to misjudgment or forwarding delays of real-time control commands, affecting the deterministic communication performance of the system.

[0028] This application provides a solution that addresses the technical challenge of accurately identifying and selectively forwarding TRDR packets in industrial switching networks with coexisting protocols, without relying on fixed port configurations. It achieves deep analysis and intelligent identification based on the protocol characteristic fields of the packets themselves, ensuring that TRDR packets can still be accurately distinguished and prioritized for forwarding even under high-load mixed traffic environments.

[0029] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device capable of implementing the above functions, such as a switch TRDP protocol intelligent differentiated forwarding x system. The following description uses a switch TRDP protocol intelligent differentiated forwarding x system as an example to illustrate this embodiment and the subsequent embodiments.

[0030] Based on this, embodiments of this application provide a method for intelligent differentiated forwarding of the TRDP protocol in a switch, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the intelligent differentiated forwarding method for the TRDP protocol in the switch according to this application.

[0031] In this embodiment, the switch TRDP protocol intelligent differentiated forwarding method includes steps S10~S30: Step S10: Parse the data packets on each port of the switch to obtain the target feature field; It should be noted that a port refers to the physical interface on a switch used to connect network devices; a data packet refers to a complete data unit in network transmission that encapsulates protocol header information and payload data; and target feature fields refer to a set of key fields extracted from data packets to characterize TRDR features.

[0032] It is understandable that since each port of the switch carries both TRDR data streams and regular management data streams, performing deep parsing on all data packets directly would generate a large amount of invalid computation. Therefore, step S10, which filters and extracts features from data packets layer by layer, can avoid invalid parsing of irrelevant data packets, thereby improving the efficiency and accuracy of feature extraction.

[0033] In one feasible implementation, step S10 may include: obtaining the source MAC address and destination MAC address based on the Ethernet frame header of the data packets of each port of the switch; obtaining the protocol identifier based on the IP header of the data packets of each port of the switch; filtering the data packets according to the source MAC address, destination MAC address, and protocol identifier to obtain target data packets; and extracting the sequence number, timestamp, data type, length information, and checksum from the protocol header of the target data packets as target feature fields.

[0034] It should be noted that the Ethernet frame header refers to the encapsulation header of a data packet at the data link layer, containing the physical address information of the sender and receiver; the source medium access control address refers to the physical address of the device sending the data packet; the destination medium access control address refers to the physical address of the target device to which the data packet is expected to arrive; the target data packet refers to a data packet that has been preliminarily determined to be a suspected TRDR after being filtered by the medium access control address and protocol identifier; the sequence number is a field in the protocol header of the data packet used to identify the order in which the data packets were sent; the timestamp is a field in the protocol header of the data packet that records the time when the data packet was sent; the data type is a field in the protocol header of the data packet that identifies the data type of the payload; the length information is a field in the protocol header of the data packet that identifies the length of the payload data; the checksum is a field in the protocol header of the data packet used to verify the integrity of the header; and the protocol feature fields refer to all feature fields directly extracted from the protocol header of the data packet without filtering.

[0035] Specifically, the Ethernet frame header of the data packet is parsed to extract the source and destination Media Access Control (MAC) addresses, thereby filtering data packets outside the industrial control network. The Internet Protocol (IP) header of the filtered data packets is parsed to extract the protocol identifier. The protocol identifier is compared with the fixed proprietary identifier of the TRDR (Transportation Recorder), and target data packets with matching values ​​are selected. The TRDR header of the target data packet is parsed to extract the sequence number, timestamp, data type, length information, and checksum as protocol feature fields. Each feature in the protocol feature field is compared with the corresponding statistical feature item in the statistical feature library to calculate the feature matching degree. Finally, the protocol feature fields whose feature matching degree is within the preset threshold range are determined as the target feature fields.

[0036] Further, the step of extracting the sequence number, timestamp, data type, length information, and checksum as target feature fields from the protocol header of the target data packet includes: extracting the sequence number, timestamp, data type, length information, and checksum as protocol feature fields from the protocol header of the target data packet; matching the protocol feature fields with a statistical feature library to obtain a feature matching degree; and using the protocol feature fields whose feature matching degree is within a preset threshold range as target feature fields.

[0037] It should be noted that the statistical feature library refers to a feature benchmark library constructed based on the statistical patterns of a large number of historical TRDR data packets; the feature matching degree refers to the degree of agreement between the protocol feature field and each statistical feature item in the statistical feature library; the preset threshold range refers to the pre-set matching degree range used to distinguish between valid and invalid features; and the target feature field refers to a valid feature field whose feature matching degree is within the preset threshold range and has been confirmed as usable for model recognition.

[0038] Specifically, the sequence number, timestamp, data type, length information, and checksum extracted from the TRDR header of the target data packet are determined as the protocol feature fields; the sequence number in the protocol feature fields is compared with the sequence number increment pattern in the statistical feature library; the timestamp in the protocol feature fields is compared with the timestamp precision range in the statistical feature library; the data type and length information in the protocol feature fields are compared with the correlation between payload length and data type in the statistical feature library; and the feature matching degree is calculated by combining the comparison results; the protocol feature fields whose feature matching degree is within the preset threshold range are selected and determined as the target feature fields.

[0039] Before matching the protocol feature fields with the statistical feature library to obtain the feature matching degree, the method further includes: collecting multiple historical TRDP protocol data packets; parsing each historical TRDP protocol data packet to obtain the fixed value of the protocol identifier, the increasing pattern of the sequence number, the precision range of the timestamp, the correlation between the payload length and the data type; and constructing a statistical feature library based on the fixed value of the protocol identifier, the increasing pattern of the sequence number, the precision range of the timestamp, and the correlation between the payload length and the data type.

[0040] It should be noted that historical TRDR packets refer to TRDR packet samples that have been collected and confirmed during previous network operations; the fixed value of the protocol identifier refers to the fixed and unique identifier value of TRDR in the Internet Protocol header; the sequence number increment pattern refers to the pattern of the sequence number field of TRDR packets increasing with the order of transmission; the timestamp precision range refers to the precision range of the timestamp field of TRDR packets; and the relationship between payload length and data type refers to the fixed correspondence between the payload lengths of different data types in TRDR packets.

[0041] Specifically, multiple historical data packets that have been confirmed as TRDRs are collected from the switch networking environment. Each historical TRDR data packet is subjected to in-depth analysis. The fixed value of the protocol identifier is extracted from the Internet Protocol header. The sequence number increment pattern, the timestamp accuracy range, and the correlation between the payload length and the data type are extracted from the TRDR header. The above statistical features are summarized and stored to form the statistical feature library.

[0042] In this embodiment, by performing hierarchical parsing of data packets and matching and filtering with statistical feature databases, the problem that existing switches cannot deeply parse the internal feature fields of TRDR is solved, thereby improving the extraction accuracy and effectiveness of target feature fields.

[0043] The above are merely feasible implementations of step S10 provided in this embodiment. This embodiment does not specifically limit the specific implementation of step S10.

[0044] Step S20: Identify the data packet based on the decision tree model and the target feature field to obtain the identification result; It should be noted that the decision tree model refers to a classification model pre-trained based on a large number of feature samples of TRDR and non-TRDR data packets; the identification result refers to the determination of the protocol type to which the data packet belongs by the decision tree model.

[0045] It is understandable that, since TRDR data packets and non-TRDR data packets in the network environment have different value patterns in the feature fields, static statistical feature matching alone is difficult to cover all variant cases. Therefore, step S20 is performed to classify and determine the target feature fields using a trained decision tree model. This can avoid the omission or misjudgment of unknown variants by static matching rules, thereby improving the accuracy and generalization ability of the recognition results.

[0046] In one feasible implementation, step S20 may include: inputting the target feature field into the decision tree model and obtaining the confidence level of the data packet corresponding to the target feature field output by the decision tree model; when the confidence level is less than a first confidence threshold, determining that the identification result is that the data packet is a valid TRDR data packet; when the confidence level is greater than or equal to the first confidence threshold and the confidence level is less than a second confidence threshold, determining that the identification result is that the data packet is a suspected TRDR data packet; when the confidence level is greater than the second confidence threshold, determining that the identification result is that the data packet is an invalid TRDR data packet, wherein the first confidence threshold is greater than the second confidence threshold.

[0047] It should be noted that the confidence score refers to the probability score output by the decision tree model that the data packet belongs to a valid TRDR; a valid TRDR refers to the category to which a data packet is determined to conform to the TRDR specification; a suspected TRDR refers to the category to which a data packet is determined to have some TRDR characteristics but insufficient confidence; an invalid TRDR data packet refers to the category to which a data packet is determined to not conform to the TRDR specification; the first confidence threshold is the score boundary used to distinguish between valid TRDRs and suspected TRDRs; and the second confidence threshold is the score boundary used to distinguish between suspected TRDRs and invalid TRDR data packets.

[0048] Specifically, the target feature field obtained in step S10 is sent as input data to the decision tree model. The decision tree model performs layer-by-layer judgment on each feature item of the target feature field according to the internal node splitting conditions, calculates and outputs the confidence score. The confidence score is compared sequentially with the first confidence threshold and the second confidence threshold, and the corresponding recognition result is determined according to the range in which the comparison result falls.

[0049] In this embodiment, the target feature fields are classified and judged by a decision tree model, which solves the problem of insufficient adaptability of single statistical feature matching to protocol variants and improves the hierarchical precision and judgment accuracy of the recognition results.

[0050] The above are merely feasible implementations of step S20 provided in this embodiment. This embodiment does not specifically limit the specific implementation of step S20.

[0051] Step S30: Assign the data packet to the corresponding priority forwarding queue according to the identification result; It should be noted that the priority forwarding queue includes a first priority forwarding queue, a second priority forwarding queue, and a third priority forwarding queue. The priority of the first priority forwarding queue is higher than the priority of the second priority forwarding queue, and the priority of the second priority forwarding queue is higher than the priority of the third priority forwarding queue.

[0052] It is understandable that since TRDR is used to transmit real-time control commands and status data in industrial control networks, its forwarding delay directly affects the response performance of the control system. Therefore, step S30, which allocates target data packets to forwarding queues of different priorities according to the protocol type of the identification result, can avoid real-time control data packets and management data packets competing for the same forwarding resources, thereby improving the real-time performance and determinism of TRDR data packet forwarding.

[0053] In one feasible implementation, step S30 may include: adding the data packet to the first priority forwarding queue when the identification result is that the data packet is a valid TRDR data packet; adding the data packet to the second priority forwarding queue when the identification result is that the data packet is a suspected TRDR data packet; and adding the data packet to the third priority forwarding queue when the identification result is that the data packet is an invalid TRDR data packet.

[0054] It should be noted that the first priority forwarding queue is the highest priority sending queue specifically used to carry valid TRDR data packets; the second priority forwarding queue is the second highest priority sending queue used to carry suspected TRDR data packets; and the third priority forwarding queue is the low priority sending queue used to carry invalid TRDR data packets.

[0055] Specifically, upon receiving the identification result output in step S20, a corresponding queue allocation operation is performed based on the protocol category to which the target data packet belongs in the identification result. When the identification result indicates a valid TRDR data packet, the target data packet is sent to the first priority forwarding queue to await priority transmission. When the identification result indicates a suspected TRDR data packet, the target data packet is sent to the second priority forwarding queue for transmission according to the scheduling policy. When the identification result indicates an invalid TRDR data packet, the target data packet is sent to the third priority forwarding queue for normal transmission or is discarded.

[0056] In this embodiment, the problem of uncertain forwarding delay of real-time control data in a high-load mixed traffic environment is solved by differentiating queue allocation based on the identification results, and the forwarding priority guarantee capability of TRDR data packets is improved.

[0057] The above are merely feasible implementations of step S30 provided in this embodiment. This embodiment does not specifically limit the specific implementation of step S30.

[0058] This embodiment provides an intelligent differentiated forwarding method for TRDR protocol in a switch. It parses data packets from each port of the switch to obtain target feature fields; identifies the data packets based on a decision tree model and the target feature fields to obtain identification results; and allocates the data packets to the corresponding priority forwarding queues according to the identification results. This solves the technical problem of how to achieve accurate identification and differentiated forwarding scheduling of TRDR data packets in industrial switching networks with coexisting protocols without relying on fixed port configurations. It achieves deep parsing and intelligent identification based on the protocol feature fields of the data packets themselves, ensuring that TRDR data packets can still be accurately distinguished and prioritized for forwarding even under high-load mixed traffic environments.

[0059] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 The method for intelligent differentiated forwarding of the TRDP protocol in the switch further includes steps S11 to S15 before step S20: Step S11: Collect mirrored traffic data in the switch networking environment; It should be noted that the switch networking environment refers to the network operating environment consisting of switches and multiple industrial control nodes and management devices connected through physical ports; mirrored traffic data refers to all traffic copy data obtained by copying and aggregating the original data packets transmitted by each port in the switch networking environment to a specified packet capture port through the port mirroring function.

[0060] Specifically, in the switch networking environment, the port mirroring function is enabled to copy the data traffic sent and received by all physical ports of the switch to a designated packet capture port in real time, and obtain the mirrored traffic data containing complete frame structure, timing information and port source information from the packet capture port.

[0061] It is understandable that, since each port of the switch carries both the real-time train data protocol data stream and the conventional Internet Protocol management data stream, collecting data from only a single port or a single type of data would result in incomplete samples. Therefore, step S11 is performed to obtain the mirrored traffic data of all ports in the network. This can avoid sample bias caused by the limited sample collection range, thereby improving the comprehensiveness of sample coverage for subsequent model training.

[0062] Step S12: Separate a first set of data packets carrying the TRDR-specific identifier and a second set of data packets not carrying the TRDR-specific identifier from the mirrored traffic data; It should be noted that the TRDR exclusive identifier refers to the fixed protocol identifier field value in the Internet Protocol header of the Train Real-Time Data Protocol; the first data packet set refers to the set of data packets selected from the mirrored traffic data whose protocol identifier field in the Internet Protocol header is consistent with the TRDR exclusive identifier; the second data packet set refers to the set of data packets selected from the mirrored traffic data whose protocol identifier field in the Internet Protocol header is inconsistent with the TRDR exclusive identifier.

[0063] Specifically, for each data packet in the mirrored traffic data, the Internet Protocol header is parsed, the Protocol Identifier field is extracted, the value of the Protocol Identifier field is compared with the Train Real-Time Data Protocol Specific Identifier, and data packets with the same value are assigned to the first data packet set, while data packets with different values ​​are assigned to the second data packet set.

[0064] It is understandable that, since model training requires distinguishing the feature differences between train real-time data protocol data packets and non-train real-time data protocol data packets, mixing the two types of data packets as input will cause the model to fail to learn effective classification boundaries. Therefore, step S12 is performed to classify and separate the mirror traffic data according to the train real-time data protocol exclusive identifier. This can avoid the interference of positive and negative sample confusion on the model training effect, thereby improving the accuracy of sample labeling and the effectiveness of training data.

[0065] Step S13: Extract the sequence number, timestamp, data type, length information and check code from the first data packet set to construct the first feature sample set.

[0066] It should be noted that the first feature sample set refers to the feature data set used to characterize the positive sample of the train real-time data protocol, which consists of the sequence number field, timestamp field, data type field, length information field, and check code field extracted from each data packet of the first data packet set.

[0067] Specifically, for each data packet in the first data packet set, the train real-time data protocol header is parsed to extract the sequence number, the timestamp, the data type, the length information, and the checksum. The extracted five feature fields are used as a positive feature sample, and all positive feature samples are summarized to construct the first feature sample set.

[0068] It is understandable that, since the data packets in the first data packet set all carry the exclusive identifier of the train real-time data protocol, but may contain invalid data packets due to verification failure or abnormal frame structure, step S13 is performed to extract features from the first data packet set. This can avoid the features of invalid data packets from misleading the model training, thereby improving the quality and representativeness of the first feature sample set.

[0069] Step S14: Extract the sequence number, timestamp, data type, length information and check code from the second data packet set to construct the second feature sample set.

[0070] It should be noted that the second feature sample set refers to the feature data set used to characterize the negative samples of the non-train real-time data protocol, which consists of the sequence number field, timestamp field, data type field, length information field, and check code field extracted from each data packet of the second data packet set.

[0071] Specifically, for each data packet in the second data packet set, the corresponding fields are parsed according to the same offset position and length rules as the train real-time data protocol header. The field values ​​corresponding to the sequence number, the timestamp, the data type, the length information, and the check code are extracted. The extracted five field values ​​are used as a negative feature sample. All negative feature samples are summarized to construct the second feature sample set.

[0072] It is understandable that, since the data packets in the second data packet set do not carry the exclusive identifier of the train real-time data protocol, the actual content of the corresponding field position does not follow the train real-time data protocol specification. Therefore, step S14 is performed to extract the field value at the same position as the train real-time data protocol as a negative sample. This can prevent the model from being unable to establish a classification boundary due to the lack of negative reference, thereby improving the model's ability to distinguish between positive and negative samples.

[0073] Step S15: Input the first feature sample set and the second feature sample set into the initial decision tree model and adjust the internal node split bars of the initial decision tree model until the difference between the decision result output by the initial decision tree model for the first feature sample set and the decision result output for the second feature sample set satisfies the preset constraint, thereby obtaining the decision tree model.

[0074] It should be noted that the initial decision tree model refers to a tree-shaped classification model that has not yet been trained with feature samples and whose internal node splitting conditions are in their initial state; the internal node splitting conditions refer to the feature judgment rules used to divide the input sample flow on each branch node of the decision tree model; the judgment result refers to the classification conclusion output by the initial decision tree model for the protocol category to which the input feature sample belongs; the preset constraint refers to the pre-set convergence condition used to measure the model's ability to classify and distinguish between the first feature sample set and the second feature sample set.

[0075] Specifically, positive feature samples from the first feature sample set and negative feature samples from the second feature sample set are input into the initial decision tree model. The initial decision tree model calculates information gain at each internal node based on the input sample features and adjusts the splitting conditions of the internal nodes so that samples of the same type flow to the same branch node. The adjustment process is repeated iteratively until the degree of distinction between the judgment results output by the initial decision tree model for positive feature samples and the judgment results output for negative feature samples meets the preset constraint. The model at this time is taken as the decision tree model that has been trained.

[0076] It is understandable that since the untrained initial decision tree model cannot effectively distinguish the feature differences between train real-time data protocol data packets and non-train real-time data protocol data packets, step S15 is performed to iteratively train the initial decision tree model using the first feature sample set and the second feature sample set. This can avoid misjudgment problems caused by the fuzzy model classification boundary, thereby improving the accuracy of the decision tree model in identifying unknown data packet protocol types.

[0077] This embodiment provides a method for intelligent differentiated forwarding of the TRDR protocol in a switch. It collects mirrored traffic data in a switch network environment; separates a first set of data packets carrying a TRDR-specific identifier and a second set of data packets not carrying the TRDR-specific identifier from the mirrored traffic data; extracts sequence number, timestamp, data type, length information, and checksum from the first set of data packets to construct a first feature sample set; extracts sequence number, timestamp, data type, length information, and checksum from the second set of data packets to construct a second feature sample set; inputs the first and second feature sample sets into an initial decision tree model and adjusts the internal node split bars of the initial decision tree model until the difference between the judgment result output by the initial decision tree model for the first feature sample set and the judgment result output for the second feature sample set satisfies a preset constraint, thus obtaining the decision tree model. Since the untrained initial decision tree model cannot effectively distinguish the feature differences between train real-time data protocol data packets and non-train real-time data protocol data packets, step S15 is performed to iteratively train the initial decision tree model using the first and second feature sample sets. This avoids misjudgment problems caused by blurred model classification boundaries, thereby improving the accuracy of the decision tree model in identifying unknown data packet protocol types.

[0078] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the intelligent differentiated forwarding method of the TRDP protocol for switches in this application. Any simple modifications based on this technical concept are within the protection scope of this application.

[0079] This application also provides a switch TRDP protocol intelligent differentiated forwarding device, please refer to... Figure 3 The switch's TRDP protocol intelligent differentiated forwarding device includes: Parsing module 10 is used to parse data packets on each port of the switch to obtain target feature fields; The identification module 20 is used to identify the data packet based on the decision tree model and the target feature field to obtain the identification result; The allocation module 30 is used to allocate the data packet to the corresponding priority forwarding queue according to the identification result.

[0080] The intelligent differentiated forwarding device for TRDP protocol of the switch provided in this application adopts the intelligent differentiated forwarding method for TRDP protocol of the switch in the above embodiments, which can solve the technical problem of how to realize differentiated forwarding scheduling of TRDP data packets. The beneficial effects of the intelligent differentiated forwarding device for TRDP protocol of the switch provided in this application are the same as the beneficial effects of the intelligent differentiated forwarding method for TRDP protocol of the switch provided in the above embodiments, and other technical features in the intelligent differentiated forwarding device for TRDP protocol of the switch are the same as the features disclosed in the method of the above embodiments, and will not be repeated here.

[0081] The parsing module 10 is further configured to obtain the source MAC address and destination MAC address based on the Ethernet frame header of the data packets of each port of the switch; obtain the protocol identifier based on the IP header of the data packets of each port of the switch; filter the data packets according to the source MAC address, destination MAC address, and protocol identifier to obtain the target data packet; and extract the sequence number, timestamp, data type, length information, and checksum from the protocol header of the target data packet as target feature fields.

[0082] The parsing module 10 is further configured to extract the sequence number, timestamp, data type, length information and checksum from the protocol header of the target data packet as protocol feature fields; match the protocol feature fields with a statistical feature library to obtain the feature matching degree; and use the protocol feature fields whose feature matching degree is within a preset threshold range as target feature fields.

[0083] The parsing module 10 is also used to collect multiple historical TRDP protocol data packets; parse each historical TRDP protocol data packet to obtain the fixed value of the protocol identifier, the increasing pattern of the sequence number, the precision range of the timestamp, the correlation between the payload length and the data type; and construct a statistical feature library based on the fixed value of the protocol identifier, the increasing pattern of the sequence number, the precision range of the timestamp, and the correlation between the payload length and the data type.

[0084] The identification module 20 is further configured to collect mirrored traffic data in the switch networking environment; separate a first set of data packets carrying a TRDR-specific identifier and a second set of data packets not carrying the TRDR-specific identifier from the mirrored traffic data; extract sequence number, timestamp, data type, length information and checksum from the first set of data packets to construct a first feature sample set; extract sequence number, timestamp, data type, length information and checksum from the second set of data packets to construct a second feature sample set; input the first feature sample set and the second feature sample set into an initial decision tree model and adjust the internal node split bars of the initial decision tree model until the difference between the judgment result output by the initial decision tree model for the first feature sample set and the judgment result output by the initial decision tree model for the second feature sample set satisfies a preset constraint, thereby obtaining a decision tree model.

[0085] The identification module 20 is further configured to input the target feature field into the decision tree model and obtain the confidence level of the data packet corresponding to the target feature field output by the decision tree model; when the confidence level is less than a first confidence threshold, determine that the identification result is that the data packet is a valid TRDR data packet; when the confidence level is greater than or equal to the first confidence threshold and the confidence level is less than a second confidence threshold, determine that the identification result is that the data packet is a suspected TRDR data packet; when the confidence level is greater than the second confidence threshold, determine that the identification result is that the data packet is an invalid TRDR data packet, wherein the first confidence threshold is greater than the second confidence threshold.

[0086] The allocation module 30 is further configured to add the data packet to the first priority forwarding queue when the identification result is that the data packet is a valid TRDR data packet; add the data packet to the second priority forwarding queue when the identification result is that the data packet is a suspected TRDR data packet; and add the data packet to the third priority forwarding queue when the identification result is that the data packet is an invalid TRDR data packet.

[0087] This application provides a switch TRDP protocol intelligent differential forwarding device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the switch TRDP protocol intelligent differential forwarding method in the above embodiment 1.

[0088] The following is for reference. Figure 4This document illustrates a structural schematic diagram of a switch TRDP protocol intelligent differential forwarding device suitable for implementing embodiments of this application. The switch TRDP protocol intelligent differential forwarding device in embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 4 The illustrated switch TRDP protocol intelligent differential forwarding device is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0089] like Figure 4 As shown, the TRDP protocol intelligent differential forwarding device for a switch may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1002 or a program loaded from storage device 1003 into random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the TRDP protocol intelligent differential forwarding device for the switch. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the switch's TRDP protocol intelligent differential forwarding device to communicate wirelessly or wiredly with other devices to exchange data. Although the figure shows switch TRDP protocol intelligent differential forwarding devices with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented alternatively.

[0090] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0091] The intelligent differentiated forwarding device for TRDP protocol provided in this application adopts the intelligent differentiated forwarding method for TRDP protocol in the above embodiments, which can solve the technical problem of how to achieve differentiated forwarding scheduling of TRDP data packets. The beneficial effects of the intelligent differentiated forwarding device for TRDP protocol in this application are the same as those of the intelligent differentiated forwarding method for TRDP protocol in the above embodiments. In addition, other technical features of the intelligent differentiated forwarding device for TRDP protocol in this application are the same as those disclosed in the previous embodiment method, and will not be repeated here.

[0092] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0093] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0094] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, which are used to execute the switch TRDP protocol intelligent differential forwarding method in the above embodiments.

[0095] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0096] The aforementioned computer-readable storage medium may be included in the switch's TRDP protocol intelligent differentiated forwarding device; or it may exist independently and not be assembled into the switch's TRDP protocol intelligent differentiated forwarding device.

[0097] The aforementioned computer-readable storage medium carries one or more programs. When the aforementioned one or more programs are executed by the switch's TRDP protocol intelligent differentiated forwarding device, the switch's TRDP protocol intelligent differentiated forwarding device: parses the data packets of each port of the switch to obtain target feature fields; identifies the data packets based on a decision tree model and the target feature fields to obtain identification results; and allocates the data packets to the corresponding priority forwarding queue according to the identification results.

[0098] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0099] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0100] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0101] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., computer programs) for executing the above-described intelligent differentiated forwarding method of the TRDP protocol for switches. It can solve the technical problem of how to implement differentiated forwarding scheduling of TRDP packets. The beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the intelligent differentiated forwarding method of the TRDP protocol for switches provided in the above embodiments, and will not be repeated here.

[0102] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described switch TRDP protocol intelligent differentiated forwarding method.

[0103] The computer program product provided in this application can solve the technical problem of how to implement differentiated forwarding and scheduling of TRDP packets. The beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the intelligent differentiated forwarding method of TRDP protocol for switches provided in the above embodiments, and will not be repeated here.

[0104] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A method for intelligent differentiated forwarding of TRDP protocol in a switch, characterized in that, The method includes: Parse the data packets on each port of the switch to obtain the target feature fields; The data packet is identified based on the decision tree model and the target feature fields to obtain the identification result; The data packet is assigned to the corresponding priority forwarding queue based on the identification result; Before obtaining the identification result by identifying the data packet based on the decision tree model and the target feature field, the method further includes: Collect mirrored traffic data in a switch networking environment; Separate a first set of data packets carrying a TRDR-specific identifier and a second set of data packets not carrying the TRDR-specific identifier from the mirrored traffic data; Extract the sequence number, timestamp, data type, length information and check code from the first data packet set to construct the first feature sample set; Extract the sequence number, timestamp, data type, length information and check code from the second data packet set to construct the second feature sample set; The first feature sample set and the second feature sample set are input into the initial decision tree model, and the internal node split bars of the initial decision tree model are adjusted until the difference between the decision result output by the initial decision tree model for the first feature sample set and the decision result output for the second feature sample set satisfies the preset constraint, thus obtaining the decision tree model.

2. The method as described in claim 1, characterized in that, The parsing of data packets from each port of the switch yields target feature fields, including: Based on the Ethernet frame headers of data packets from each port of the switch, the source MAC address and destination MAC address are obtained. Based on the IP header of the data packets from each port of the switch, the protocol identifier is obtained; The data packets are filtered based on the source MAC address, destination MAC address, and protocol identifier to obtain the target data packets; Extract the sequence number, timestamp, data type, length information, and checksum from the protocol header of the target data packet as target feature fields.

3. The method as described in claim 2, characterized in that, The step of extracting the sequence number, timestamp, data type, length information, and checksum from the protocol header of the target data packet as target feature fields includes: Extract the sequence number, timestamp, data type, length information, and checksum from the protocol header of the target data packet as protocol feature fields; The protocol feature fields are matched with the statistical feature library to obtain the feature matching degree; The protocol feature fields whose feature matching degree is within a preset threshold range are used as target feature fields.

4. The method as described in claim 3, characterized in that, Before matching the protocol feature fields with the statistical feature library to obtain the feature matching degree, the method further includes: Collect multiple historical TRDP protocol data packets; Parse the historical TRDP protocol data packets to obtain the fixed value of the protocol identifier, the increasing pattern of the sequence number, the precision range of the timestamp, and the correlation between the payload length and the data type; A statistical feature library is constructed based on the fixed value of the protocol identifier, the incrementing pattern of the sequence number, the precision range of the timestamp, and the correlation between the payload length and the data type.

5. The method as described in claim 1, characterized in that, The identification of the data packet based on the decision tree model and the target feature fields, to obtain the identification result, includes: The target feature field is input into the decision tree model, and the confidence level of the data packet corresponding to the target feature field output by the decision tree model is obtained; When the confidence level is less than the first confidence threshold, the identification result is determined to be that the data packet is a valid TRDR data packet; When the confidence level is greater than or equal to the first confidence threshold and the confidence level is less than the second confidence threshold, the identification result is determined to be that the data packet is a suspected TRDR data packet; When the confidence level is greater than the second confidence threshold, the identification result is determined to be that the data packet is an invalid TRDR data packet, wherein the first confidence threshold is greater than the second confidence threshold.

6. The method as described in claim 1, characterized in that, The priority forwarding queue includes a first priority forwarding queue, a second priority forwarding queue, and a third priority forwarding queue. The priority of the first priority forwarding queue is greater than the priority of the second priority forwarding queue, and the priority of the second priority forwarding queue is greater than the priority of the third priority forwarding queue. The step of allocating the data packet to the corresponding priority forwarding queue based on the identification result includes: When the identification result indicates that the data packet is a valid TRDR data packet, the data packet is added to the first priority forwarding queue; When the identification result indicates that the data packet is a suspected TRDR data packet, the data packet is added to the second priority forwarding queue; When the identification result indicates that the data packet is an invalid TRDR data packet, the data packet is added to the third priority forwarding queue.

7. A switch TRDP protocol intelligent differentiated forwarding device, characterized in that, The device includes: The parsing module is used to parse data packets from each port of the switch to obtain target feature fields; The identification module is used to identify the data packet based on the decision tree model and the target feature field to obtain the identification result; The allocation module is used to allocate the data packet to the corresponding priority forwarding queue according to the identification result; The identification module is further configured to collect mirrored traffic data in the switch networking environment; separate a first set of data packets carrying a TRDR-specific identifier and a second set of data packets not carrying the TRDR-specific identifier from the mirrored traffic data; extract sequence number, timestamp, data type, length information and checksum from the first set of data packets to construct a first feature sample set; extract sequence number, timestamp, data type, length information and checksum from the second set of data packets to construct a second feature sample set; input the first feature sample set and the second feature sample set into an initial decision tree model and adjust the internal node split bars of the initial decision tree model until the difference between the judgment result output by the initial decision tree model for the first feature sample set and the judgment result output by the initial decision tree model for the second feature sample set satisfies a preset constraint, thereby obtaining a decision tree model.

8. A switch TRDP protocol intelligent differentiated forwarding device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the switch TRDP protocol intelligent differential forwarding method as described in any one of claims 1 to 6.

9. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the switch TRDP protocol intelligent differentiated forwarding method as described in any one of claims 1 to 6.