Session shunting method and system based on mean shift clustering
Through the session shunt method based on mean drift clustering, using sliding windows and multi-choice decision mechanism, the problem of performance loss of only passing verification packets in the traditional method is solved, and the precise separation of session streams under high bit error rate conditions is achieved. and error correction improve communication reliability and efficiency.
Patent Information
- Application Number
- CN202411329506.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-09-24
AI Technical Summary
The traditional session stream separation method only uses verification packets, resulting in performance losses and fails under high bit error rates, and cannot fully utilize all data packets, affecting communication reliability and efficiency.
Using the session shunt method based on mean drift clustering, the sliding window radius is determined through the elbow rule, the cluster center is updated using the multi-decision mechanism, the Hanming distance is calculated, and the five-tuple estimation is completed according to the minimum Hanming distance criterion to realize the session Precise separation and error correction of streams.
This method can make full use of all data packets under high bit error rate conditions, improve session stream shunt performance, expand the scope of bit error rate, expand from 10-3 to 10-1, and ensure communication reliability and efficiency.
Smart Images

Figure CN119233362A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of communication network session diversion, and in particular to a session diversion method and system based on mean shift clustering. Background Art
[0002] In traditional wireless communication reception processing, it is usually assumed that the binary data after demodulation and decoding by the physical layer is almost error-free. However, the layered design of the protocol stack from the data link layer to the application layer usually embeds verification information in data packets at multiple levels (cyclic redundancy check (CRC) and checksum check are widely used) to check the integrity and accuracy of the received data. This directly shows that relying solely on the physical layer cannot absolutely eliminate errors. In order to deal with the situation where the protocol reception processing packet contains errors and causes verification failure, the traditional communication transceiver processing architecture often designs a retransmission mechanism at the link layer and the transport layer to further improve the link and end-to-end communication reliability. However, the introduction of the retransmission mechanism will reduce transmission efficiency and increase communication latency.
[0003] In addition, some Internet services cannot use the retransmission mechanism. These services include two categories. One is the traditional one-way broadcast and multicast communication for the general public. For such services for human users, there is no feedback mechanism and no retransmission is possible. The other is the Internet of Things services that have strict requirements for high reliability and low latency, such as the 5G-V2X network of the Internet of Vehicles and the industrial Internet network. It is impractical to retransmit in these scenarios. Because the occurrence of communication errors and the increase in latency may cause great harm, even involving human life safety. Therefore, without changing the protocol standard and processing architecture, an effective error correction mechanism is incorporated into the protocol reception and processing flow from the link layer to the application layer of the terminal receiver at a small cost, which not only supplements the existing error detection and retransmission mechanism, but also has important significance for further improving reliability and reducing transmission latency.
[0004] The research on fault-tolerant processing of protocol control mainly includes fault-tolerant frame delimitation, processing of error-containing quintuples for session flow separation and disordered reassembly of separated session flows. Given that protocol control information mainly exists in the header field of IP data packets, this research can directly enhance the fault-tolerant decoding capability of IP data packets and improve communication reliability.
[0005] The core of session flow separation technology is to perform fault-tolerant identification of the five-tuple field in the packet header and divide the packets with the same five-tuple identifier into the same session flow. Some literature understands the session flow diversion problem from the perspective of channel decoding, and proposes a maximum a posteriori probability criterion (MAP) estimation method based on the relationship between checksum and sequence number. This method uses the data packets that have passed the check to complete the acquisition of the correct five-tuple set and the estimation of the prior probability, and then estimates the erroneous data packets that have not passed the check according to the MAP criterion, and finally completes the separation of the session flow. However, this method only relies on the packets that have passed the check to carry out research, and directly discards the packets that have not passed the check. Due to the failure to fully utilize all packets, some performance is lost. It is worth noting that the check pass rate of each layer decreases significantly with the increase of the bit error rate. When the bit error rate reaches a certain threshold, the number of available data packets will be greatly reduced (such as 10 -2 The IP layer verification pass rate is only 20%, 10 -1 , which seriously affects the performance of this method. Summary of the invention
[0006] The present invention aims to solve the problem that the traditional session flow separation method only uses the packets that have passed the verification and loses some performance. A session flow splitting method and system based on mean shift clustering are proposed, which can make full use of all data packets and greatly improve the flow splitting performance.
[0007] To achieve the above purpose, the technical solution adopted is:
[0008] A session diversion method based on mean shift clustering, comprising:
[0009] First, the elbow rule is used to determine the sliding window radius of each cluster of the message grouping;
[0010] Then, the majority decision mechanism is used to make the selected cluster center drift to the new cluster center continuously until the number of groups within the radius of the sliding window no longer increases, and the candidate cluster center is obtained;
[0011] Then calculate the Hamming distance between the candidate cluster center and the cluster center in the existing cluster center set. If it is greater than the set threshold, the candidate cluster center is added to the existing cluster center set, otherwise it is merged into the existing cluster center with the closest distance;
[0012] Continue to select one from the message groups that have not been selected as the cluster center as a new initial cluster center, repeat the above steps until all message groups have been traversed, and finally obtain a complete set of cluster centers;
[0013] Finally, the Hamming distance between each received packet and the cluster center in the cluster center set is calculated, and the estimation of the five-tuple is completed according to the minimum Hamming distance criterion, and finally the separation of the session flow is achieved.
[0014] According to the session splitting method based on mean shift clustering of the present invention, further, the process of calculating the sliding window radius of each cluster of the message grouping is:
[0015] After determining the size of a sliding window radius r within the legal value range, the mean shift clustering algorithm is executed to obtain k clustering results, i.e., k grouping categories;
[0016] Calculate the average bit error rate of a packet class
[0017] Estimate the average bit error rate for all packet categories and calculate the channel matching degree M under the sliding window radius r c ;
[0018] For all r values within the legal value range, the above channel matching degree M is performed. c Calculation of
[0019] Make the channel matching degree M c The curve changes with r;
[0020] The r value near the inflection point in the channel matching degree growth curve is determined as the optimal sliding window radius.
[0021] According to the session splitting method based on mean shift clustering of the present invention, further, the average bit error rate The calculation formula is as follows:
[0022]
[0023] Among them, N i represents the total number of packets contained in the ith cluster, pe represents the bit error rate, L represents the bit length of the quintuple in the packet, k is the number of clusters, Dn(x,y) represents the Hamming distance between two sequences x and y, C i is the i-th cluster center, a ij A five-tuple representing the j-th packet group in the i-th cluster.
[0024] According to the session splitting method based on mean shift clustering of the present invention, further, the channel matching degree M under the value of the sliding window radius r c The calculation formula is as follows:
[0025]
[0026] According to the session splitting method based on mean shift clustering of the present invention, further, a majority decision mechanism is adopted to update the cluster center, and the updated value of the bit is as follows:
[0027]
[0028] Where X is all possible values of each bit, X = [0, 1]; N is the number of all samples in the sliding window; I is the indicative function, y i is the value of all samples at the same position.
[0029] According to the session diversion method based on mean shift clustering of the present invention, further, completing the estimation of the five-tuple according to the minimum Hamming distance criterion includes:
[0030] For each received message group y, the minimum Hamming distance criterion is used for classification according to the following formula, that is, each group is assigned to the category corresponding to the cluster center with the minimum Hamming distance:
[0031]
[0032] Among them, C represents the cluster center set, C j represents the jth cluster center.
[0033] Furthermore, the present invention also proposes a session diversion system based on mean shift clustering, comprising a sliding window radius acquisition module, a candidate cluster center acquisition module, a cluster center determination module, a cluster center set acquisition module and a quintuple estimation module, wherein:
[0034] A sliding window radius acquisition module is used to determine the sliding window radius of each cluster of the message grouping by using the elbow rule;
[0035] The candidate cluster center acquisition module is used to use the majority decision mechanism to make the selected cluster center drift to the new cluster center continuously until the number of groups within the radius of the sliding window no longer increases, and the candidate cluster center is obtained;
[0036] The cluster center determination module is used to calculate the Hamming distance between the candidate cluster center and the cluster centers in the existing cluster center set. If the Hamming distance is greater than a set threshold, the candidate cluster center is added to the existing cluster center set; otherwise, it is merged into the existing cluster center with the closest distance.
[0037] The cluster center set acquisition module is used to continue to select one as a new initial cluster center from the message groups that have not been selected as cluster centers, and repeat the above steps until all message groups have been traversed, and finally a complete cluster center set is obtained;
[0038] The five-tuple estimation module is used to calculate the Hamming distance between each received packet and the cluster center in the cluster center set, complete the five-tuple estimation according to the minimum Hamming distance criterion, and finally realize the separation of the session flow.
[0039] The beneficial effects achieved by adopting the above technical solution are:
[0040] In order to overcome the problem of performance loss in existing session flow separation methods by only using received packets that have passed verification, the present invention proposes a session flow splitting method based on mean shift clustering. By applying a clustering algorithm, the number of session flows and their corresponding five-tuple information can be accurately identified from a large number of error-containing packets. This process not only realizes the effective correction of error-containing five-tuple data, but also ensures the accurate separation of session flows. The present invention can make full use of all data packets, and the flow splitting performance is greatly improved.
[0041] Furthermore, in order to overcome the problem that the existing method fails under high error channel conditions, the present invention is based on the mean shift clustering algorithm, which can complete the session flow diversion under high error conditions without verification, and expands the applicable range of the bit error rate from 10 -3 Expand to 10 -1 . BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings of the embodiments of the present invention, wherein the drawings are only used to illustrate some embodiments of the present invention, but not to limit all embodiments of the present invention thereto.
[0043] Figure 1 1 is a flow chart of a method for session diversion based on mean shift clustering according to the first embodiment of the present invention;
[0044] Figure 2 It is a schematic diagram of the process of determining the optimal sliding window radius according to the first embodiment of the present invention;
[0045] Figure 3 is an example diagram of the cluster center drifting to a new cluster center in the first embodiment of the present invention;
[0046] Figure 4 It is a five-tuple error probability diagram under different methods of the second embodiment of the present invention. DETAILED DESCRIPTION
[0047] The following will be combined with the accompanying drawings of specific embodiments of the present invention to clearly and completely describe the exemplary scheme of the embodiments of the present invention. Unless otherwise defined, the technical terms or scientific terms used in the present invention should be the common meanings understood by people with ordinary skills in the field.
[0048] Embodiment 1
[0049] like Figure 1 As shown, this embodiment discloses a session diversion method based on mean shift clustering, comprising the following steps:
[0050] Step S101: Determine the sliding window radius of each cluster of message groups using the elbow rule.
[0051] Assuming the sliding window radius is r, the larger the sliding window, the fewer the number of clusters, and the two are inversely proportional. Therefore, it is necessary to design a channel matching degree (M c ) indicator, which can reflect the degree of fit between clustering division and underlying channel characteristics as the sliding window parameter r changes, thereby determining the size of the sliding window radius r of each cluster in the mean shift clustering algorithm.
[0052] First, after determining the size of a sliding window radius r, the mean shift clustering algorithm is executed to obtain k clustering results, that is, k grouping categories. Based on the clustering results, the average bit error rate of a grouping category can be calculated by formula (1):
[0053]
[0054] Among them, N i , (i=1,2…k) represents the total number of packets contained in the ith cluster, pe represents the bit error rate, L represents the bit length of the quintuple in the packet, k is the number of clusters, Dn(x,y) represents the Hamming distance between two sequences x and y, C i , (i=1,2…k) is the i-th cluster center, a ij ,(j=1,2…N i ) represents the five-tuple of the jth message group in the i-th cluster. According to the different number of groups contained in each cluster in the clustering result, The estimation methods are also different.
[0055] Estimate the average bit error rate for all packet categories, and use formula (2) to calculate the channel matching degree M under the sliding window radius r c .
[0056]
[0057] When the bit error rate is pe, the Hamming distance between the received quintuple and its true quintuple, that is, the number of erroneous bits in the received quintuple D, is a random variable and obeys a binomial distribution with parameters 104 and pe, D~B(104,pe), with probability The law of large numbers states that the binomial distribution tends to a normal distribution as the number of trials n increases. In the five-tuple fault-tolerant estimation problem, n = 104, and the probability distribution of the number of erroneous bits in the five-tuple can be approximately considered to be a normal distribution. The more samples there are within the radius of the sliding window, the more conducive it is to the rapid convergence of the class center. Therefore, when calculating the channel matching degree, the value range of r should be from the r value corresponding to the coverage of 50% of the noisy five-tuple when the correct five-tuple is used as the class center, to the r value corresponding to the coverage of 90%. Refining the search space in this way can enhance the adaptability and accuracy of the algorithm to complex channel conditions. And determine the r value near the inflection point in the channel matching degree growth curve as the final value.
[0058] The algorithm for determining the optimal sliding window radius value is as follows: Figure 2 shown.
[0059]
[0060] Step S102: Use the majority decision mechanism to make the selected cluster center drift to the new cluster center (such as Figure 3 As shown in the figure), until the number of groups within the sliding window radius (i.e., clustering radius) no longer increases, the candidate clustering center is obtained.
[0061] The cluster center is updated using the majority decision mechanism, and the updated value of the bit is shown in formula (3).
[0062]
[0063] Where X is all possible values of each bit, X = [0, 1]; N is the number of all samples in the sliding window; I is the indicative function, y i , (i=1,2…N) is the value of all sample numbers at the same position.
[0064] Step S103, calculating the Hamming distance between the candidate cluster center obtained in step S102 and the cluster centers in the existing cluster center set. If the Hamming distance is greater than a set threshold, the candidate cluster center is added to the existing cluster center set; otherwise, it is merged into the existing cluster center with the nearest distance.
[0065] Step S104: Continue to select one from the message groups that have not been selected as the cluster center as a new initial cluster center, and repeat the above steps until all message groups have been traversed, and finally a complete set of cluster centers is obtained.
[0066] Step S105 , calculating the Hamming distance between each received packet and the cluster center in the cluster center set, completing the estimation of the five-tuple according to the minimum Hamming distance criterion, and finally realizing the separation of the session flow.
[0067] After the method of the present invention is iterated until convergence, all cluster centers are determined, which are recorded as a set C, and each cluster center is recorded as C j , (j=1,2…k). After that, for each received message group y, the minimum Hamming distance criterion is used for accurate classification according to formula (4), that is, each group is assigned to the category corresponding to the cluster center with the minimum Hamming distance. This method will systematically complete the accurate estimation of all headers of the received message set, and finally achieve the separation of session flows.
[0068]
[0069] Corresponding to the above method, this embodiment also proposes a session diversion system based on mean shift clustering, which includes a sliding window radius acquisition module, a candidate cluster center acquisition module, a cluster center determination module, a cluster center set acquisition module and a five-tuple estimation module, wherein:
[0070] The sliding window radius acquisition module is used to determine the sliding window radius of each cluster of the message grouping by using the elbow rule.
[0071] The candidate cluster center acquisition module is used to use the majority decision mechanism to make the selected cluster center drift to the new cluster center continuously until the number of groups within the radius of the sliding window no longer increases, and the candidate cluster center is obtained.
[0072] The cluster center determination module is used to calculate the Hamming distance between the candidate cluster center and the cluster centers in the existing cluster center set. If it is greater than the set threshold, the candidate cluster center is added to the existing cluster center set; otherwise, it is merged into the existing cluster center with the nearest distance.
[0073] The cluster center set acquisition module is used to continue selecting one as a new initial cluster center from the message groups that have not yet been selected as cluster centers, and repeat the above steps until all message groups have been traversed, and finally a complete cluster center set is obtained.
[0074] The five-tuple estimation module is used to calculate the Hamming distance between each received packet and the cluster center in the cluster center set, complete the five-tuple estimation according to the minimum Hamming distance criterion, and finally realize the separation of the session flow.
[0075] Embodiment 2
[0076] This implementation uses the network traffic in the CIC-IDS-2017 dataset to verify the proposed method. The dataset is preprocessed and screened around the TCP / IP / UDP mainstream communication protocol architecture. The error-free TCP / IP / UDP messages that are truly used for communication are used as the input data of the binary symmetric channel (BSC). A total of 248 types of five-tuples are extracted, and the relevant threshold is set to 10. The reason why the threshold is set to 10 here is that through statistics and analysis of a large amount of data, in normal communication situations, the Hamming distance between most of the five-tuples is above 10. Therefore, the condition for hard merging the candidate cluster center with the existing cluster center is set to be that the Hamming distance between the candidate cluster center and the closest cluster center in the existing cluster center set is less than 10.
[0077] In order to verify the good performance of this method, the session diversion capabilities (error estimation probability of quintuples) of different methods are compared. After the message packets pass through the BSC channel, the quintuples of all received packets are estimated for fault tolerance using different methods. The estimated value of each quintuple is compared with its original value to obtain the error estimation probability of the quintuple, and the following definition is made: When any bit in the estimated value is different from the original value, it is considered that the quintuple estimation is wrong. Figure 4 The compared methods include: the maximum a posteriori probability criterion estimation method based on the relationship between the checksum and the serial number and the method proposed in this paper.
[0078] from Figure 4 It can be seen from the figure that the proposed method can effectively deal with complex error patterns under high bit error conditions. -1 The estimation of the five-tuple and the diversion of the session flow can still be achieved under the condition of . The reason is that the maximum a posteriori probability criterion estimation method based on the relationship between the checksum and the sequence number only uses the packets that pass the checksum, while the method proposed in this paper makes full use of all the received noisy five-tuples, avoiding the problem that the traditional checksum method is limited by its inherent design principle and error tolerance threshold under high error conditions, thus affecting the ability to identify the message fields.
[0079] Unless otherwise specifically stated, the relative steps, numerical expressions and values of the components and steps set forth in these embodiments do not limit the scope of the present invention.
[0080] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0081] The units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person of ordinary skill in the art may use different methods to implement the described functions for each specific application, but such implementation is not considered to be beyond the scope of the present invention.
[0082] Those skilled in the art will appreciate that all or part of the steps in the above method can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, such as a read-only memory, a disk or an optical disk. Optionally, all or part of the steps in the above embodiment can also be implemented using one or more integrated circuits, and accordingly, each module / unit in the above embodiment can be implemented in the form of hardware or in the form of software function modules. The present invention is not limited to any specific form of combination of hardware and software.
[0083] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A session diversion method based on mean shift clustering, characterized in that: Include: First, the elbow rule is used to determine the sliding window radius of each cluster of the message grouping; Then, the majority decision mechanism is used to make the selected cluster center drift to the new cluster center continuously until the number of groups within the radius of the sliding window no longer increases, and the candidate cluster center is obtained; Then calculate the Hamming distance between the candidate cluster center and the cluster center in the existing cluster center set. If it is greater than the set threshold, the candidate cluster center is added to the existing cluster center set, otherwise it is merged into the existing cluster center with the closest distance; Continue to select one from the message groups that have not been selected as the cluster center as a new initial cluster center, repeat the above steps until all message groups have been traversed, and finally obtain a complete set of cluster centers; Finally, the Hamming distance between each received packet and the cluster center in the cluster center set is calculated, and the estimation of the five-tuple is completed according to the minimum Hamming distance criterion, and finally the separation of the session flow is achieved.
2. The session diversion method based on mean shift clustering according to claim 1, characterized in that: The process of calculating the sliding window radius of each cluster of message grouping is: After determining the size of a sliding window radius r within the legal value range, the mean shift clustering algorithm is executed to obtain k clustering results, i.e., k grouping categories; Calculate the average bit error rate of a packet class Estimate the average bit error rate for all packet categories and calculate the channel matching degree M under the sliding window radius r c ; For all r values within the legal value range, the above channel matching degree M is performed. c Calculation of Make the channel matching degree M c The curve changes with r; The r value near the inflection point in the channel matching degree growth curve is determined as the optimal sliding window radius.
3. The conversation diversion method based on mean shift clustering according to claim 2 is characterized in that: Average bit error rate The calculation formula is as follows: Among them, N i represents the total number of packets contained in the ith cluster, pe represents the bit error rate, L represents the bit length of the quintuple in the packet, k is the number of clusters, Dn(x,y) represents the Hamming distance between two sequences x and y, C i is the i-th cluster center, a ij A five-tuple representing the j-th packet group in the i-th cluster.
4. The method for session diversion based on mean shift clustering according to claim 3, characterized in that: The channel matching degree M under the sliding window radius r c The calculation formula is as follows:
5. The method for session diversion based on mean shift clustering according to claim 1, characterized in that: The cluster center is updated using the majority decision mechanism, and the updated value of the bit is as follows: Where X is all possible values of each bit, X = [0, 1]; N is the number of all samples in the sliding window; I is the indicative function, y i is the value of all samples at the same position.
6. The method for session diversion based on mean shift clustering according to claim 1, characterized in that: The estimation of the five-tuple based on the minimum Hamming distance criterion includes: For each received message group y, the minimum Hamming distance criterion is used for classification according to the following formula, that is, each group is assigned to the category corresponding to the cluster center with the minimum Hamming distance: Among them, C represents the cluster center set, C j represents the jth cluster center.
7. A session diversion system based on mean shift clustering, characterized in that: It includes a sliding window radius acquisition module, a candidate cluster center acquisition module, a cluster center determination module, a cluster center set acquisition module and a quintuple estimation module, wherein: A sliding window radius acquisition module is used to determine the sliding window radius of each cluster of the message grouping by using the elbow rule; The candidate cluster center acquisition module is used to use the majority decision mechanism to make the selected cluster center drift to the new cluster center continuously until the number of groups within the radius of the sliding window no longer increases, and the candidate cluster center is obtained; The cluster center determination module is used to calculate the Hamming distance between the candidate cluster center and the cluster centers in the existing cluster center set. If the Hamming distance is greater than a set threshold, the candidate cluster center is added to the existing cluster center set; otherwise, it is merged into the existing cluster center with the closest distance. The cluster center set acquisition module is used to continue to select one as a new initial cluster center from the message groups that have not been selected as cluster centers, and repeat the above steps until all message groups have been traversed, and finally a complete cluster center set is obtained; The five-tuple estimation module is used to calculate the Hamming distance between each received packet and the cluster center in the cluster center set, complete the five-tuple estimation according to the minimum Hamming distance criterion, and finally realize the separation of the session flow.
Citation Information
Patent Citations
Processing method and processing system
CN115277571A
Clustering calculation device, clustering calculation method, clustering calculation program, and computer readable recording medium recorded with the program
JP2010175614A
System and method for automated network monitoring and detection of network anomalies
US20180020015A1
Management and analysis of related concurent communication sessions
US20220086393A1
Cited By
Intelligent connector data analysis method and system
CN119646547A
A Method and System for Intelligent Analysis of Connector Data
CN119646547B