Session offloading method and system based on mean shift clustering
Through the mean shift clustering algorithm, the sliding window and majority decision mechanism are used to update the cluster center, which solves the performance loss problem in the traditional session flow separation method and achieves accurate session flow separation and performance improvement under high bit error rate conditions.
Patent Information
- Application Number
- CN202411329506.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-09-24
AI Technical Summary
Traditional session flow separation methods only use packets that have passed verification, which results in a partial performance loss. In particular, the performance is significantly degraded under high bit error rate conditions, and all data packets cannot be effectively utilized.
A session splitting method based on mean shift clustering is adopted. The sliding window radius is determined by the elbow rule, the cluster center is updated using the majority decision mechanism, and the Hamming distance is calculated to achieve accurate estimation of the quintuple.
Under high bit error rate conditions, it can fully utilize all data packets to improve the performance of session flow diversion, and the bit error rate range is expanded from 10-3 to 10-1, ensuring accurate separation of session flows.
Smart Images

Figure CN119233362B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of communication network session offloading, and in particular to a session offloading 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 demodulated and decoded 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 (Cyclic Redundancy Check (CRC) and Checksum check are widely used) in data packets at multiple layers 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 retransmission mechanisms at the link layer and 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] Furthermore, some internet services cannot utilize retransmission mechanisms. These services fall into two categories: traditional one-way broadcast and multicast communications for the general public. These services, intended for human users, lack feedback mechanisms and cannot be retransmitted. Second, IoT services, such as 5G-V2X (vehicle-to-everything) networks and industrial internet networks, require stringent high reliability and low latency. Retransmission is impractical in these scenarios. Communication errors and increased latency can pose significant risks, even endangering human life. Therefore, incorporating effective error correction mechanisms into the protocol reception and processing flow from the link layer to the application layer at the terminal receiver, without changing the protocol standard or processing architecture, at minimal cost, not only complements existing error detection and retransmission mechanisms but also plays a significant role in further improving reliability and reducing transmission latency.
[0004] Research on fault-tolerant processing of protocol control mainly includes fault-tolerant frame delimiting, handling of error-containing quintuples for session stream separation, and reassembly of separated session streams. Given that protocol control information primarily resides in the header fields of IP packets, this research can directly enhance the fault-tolerant decoding capabilities of IP packets and improve communication reliability.
[0005] The core of the session flow separation technology is to identify the five-tuple field in the packet header, and divide the packets with the same five-tuple identifier into the same session flow. Some documents understand the session flow separation problem from the perspective of channel decoding, and propose a maximum a posteriori (MAP) estimation method based on the relationship between checksum and sequence number. The method uses the data packets that pass the check to obtain the correct five-tuple set and estimate the prior probability, and then estimates the data packets that do not pass 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 pass the check to study, and directly discards the packets that do not pass the check. Since all packets are not fully utilized, part of the performance is lost. It is worth noting that the check pass rate of each layer is greatly reduced as the error rate increases, and when the error rate reaches a certain threshold, the number of available data packets will be greatly reduced (for example, the IP layer check pass rate is only 20% at 10 -2 , and even approximately 0 at 10 -1 , which seriously affects the performance of the method. SUMMARY
[0006] The present application aims to solve the problem of the traditional session flow separation method that only uses the packets that pass the check and loses part of the performance, and proposes a session flow separation method and system based on mean shift clustering, which can fully utilize all data packets and greatly improve the separation performance.
[0007] To achieve the above purpose, the technical scheme adopted is:
[0008] A session flow separation method based on mean shift clustering, comprising:
[0009] Firstly, the elbow rule is used to determine the sliding window radius of each cluster of message packets;
[0010] Then, a majority decision mechanism is used to make the selected cluster center continuously drift to a new cluster center until the number of packets within the sliding window radius no longer increases, and a candidate cluster center is obtained;
[0011] Next, the Hamming distance between the candidate cluster center and the cluster centers in the existing cluster center set is calculated. If the Hamming distance is greater than the set threshold, the candidate cluster center is added to the existing cluster center set; otherwise, it is merged into the nearest existing cluster center;
[0012] Continue to select one from the message packets that have not been selected as the cluster center as a new initial cluster center, and repeat the above steps until all message packets have been traversed, and finally obtain a complete cluster center set;
[0013] Finally, the Hamming distance between each received packet and the cluster centers in the cluster center set is calculated, and the quintet estimation is completed according to the minimum Hamming distance criterion, so as to realize the separation of the session flow.
[0014] According to the session separation method based on the mean shift clustering of the application, further, the process of calculating the sliding window radius of each cluster of the message packet is as follows:
[0015] After the size of the sliding window radius r in the legal value range is determined, the mean shift clustering algorithm is executed to obtain k cluster results, i.e., k packet categories;
[0016] The average bit error rate of a packet category is calculated
[0017] The average bit error rate of all packet categories is estimated, and the channel matching degree M c under the sliding window radius r value is calculated.
[0018] The calculation of the channel matching degree M c under all r values in the legal value range is performed.
[0019] The curve of the channel matching degree M c with the change of r is made.
[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 separation method based on the mean shift clustering of the application, further, the calculation formula of the average bit error rate is as follows:
[0022]
[0023] Wherein, N i represents the total number of packets contained in the i-th cluster, pe represents the bit error rate, L represents the bit length of the quintet 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, and a ij represents the quintet of the j-th message packet in the i-th cluster.
[0024] According to the session separation method based on the mean shift clustering of the application, further, the calculation formula of the channel matching degree M c under the sliding window radius r value is as follows:
[0025]
[0026] According to the session splitting method based on mean shift clustering of the present invention, a majority decision mechanism is further 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 conversation splitting method based on mean shift clustering of the present invention, further, completing the estimation of the quintuple according to the minimum Hamming distance criterion includes:
[0030] For each received message group y, the minimum Hamming distance criterion is used to classify it 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, 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 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 group using the elbow rule;
[0035] The candidate cluster center acquisition module is used to use the majority decision mechanism to continuously drift the selected cluster center to a new cluster center until the number of groups within the sliding window radius no longer increases, thus obtaining the candidate cluster center;
[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 the set threshold, the candidate cluster center is added to the existing cluster center set; otherwise, it is merged into the nearest existing cluster center.
[0037] The cluster center set acquisition module is used to continue selecting one of the message groups that has not yet been selected as a cluster center as a new initial cluster center, 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] To overcome the performance loss inherent in existing session flow separation methods, which utilize only validated received packets, this paper proposes a session flow splitting method based on mean-shift clustering. By applying a clustering algorithm, this method accurately identifies the number of session flows and their corresponding quintuple information from a large number of error-containing packets. This process not only effectively corrects erroneous quintuple data but also ensures accurate session flow separation. This method fully utilizes all data packets, significantly improving splitting performance.
[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 error rate applicable range from 10 -3 Expanded 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. 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 This 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 This is an example diagram of the cluster center drifting to the new cluster center in the first embodiment of the present invention;
[0046] Figure 4 5-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 embodiments of the present invention. Unless otherwise defined, technical or scientific terms used in the present invention should be given the common meanings understood by people with ordinary skills in the relevant field.
[0048] Example 1
[0049] like Figure 1 As shown, this embodiment discloses a session diversion method based on mean shift clustering, which includes the following steps:
[0050] Step S101: Determine the sliding window radius of each cluster of message groups using the elbow rule.
[0051] Assuming that the sliding window radius is r, the larger the sliding window is, the fewer the number of clusters is, and the two are inversely proportional. Therefore, 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 i-th 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 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 D in the received quintuple, is a random variable and obeys the binomial distribution with parameters 104 and pe, D ~ B(104,pe), with probability The law of large numbers states that the binomial distribution tends toward a normal distribution as the number of trials n increases. In the quintuple error-tolerance estimation problem, with n = 104, the probability distribution of the number of erroneous bits in the quintuple can be approximated as a normal distribution. The greater the number of samples within the sliding window radius, the faster the convergence of the cluster center. Therefore, when calculating the channel matching degree, the value of r should range from the r value corresponding to covering 50% of the noisy quintuples when the correct quintuple is used as the cluster center to the r value corresponding to covering 90% of the noisy quintuples. This refinement of the search space can enhance the algorithm's adaptability and accuracy to complex channel conditions. The final value of r is determined near the inflection point in the channel matching degree growth curve.
[0058] The algorithm for determining the optimal sliding window radius is shown in the following table and the flowchart is as follows: Figure 2 shown.
[0059]
[0060] Step S102: Utilize the majority decision mechanism to make the selected cluster center continuously drift to the new cluster center (such as Figure 3 As shown in the figure), the number of groups within the sliding window radius (i.e., cluster radius) no longer increases, and the candidate cluster 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: Calculate 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 the set threshold, add the candidate cluster center to the existing cluster center set; otherwise, merge it into the nearest existing cluster center.
[0065] Step S104: Continue to select one from the message groups that have not yet 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 obtain a complete set of cluster centers.
[0066] Step S105 : Calculate the Hamming distance between each received packet and the cluster center in the cluster center set, complete the estimation of the quintuple according to the minimum Hamming distance criterion, and finally realize the separation of the conversation flow.
[0067] After the method of the present invention is iterated until convergence, all cluster centers are determined, which are recorded as set C, and each cluster center is recorded as C j , (j = 1, 2…k). Then, for each received packet y, the minimum Hamming distance criterion is used according to formula (4) to accurately classify it, that is, each packet is assigned to the category corresponding to the cluster center with the smallest Hamming distance. This method systematically completes the accurate estimation of all headers in the received packet set, ultimately achieving 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 quintuple estimation module, wherein:
[0070] The sliding window radius acquisition module is used to determine the sliding window radius of each cluster of the message group using the elbow rule.
[0071] The candidate cluster center acquisition module is used to use the majority decision mechanism to continuously drift the selected cluster center to a new cluster center until the number of groups within the sliding window radius no longer increases, thereby obtaining a candidate cluster center.
[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 the Hamming distance is greater than the set threshold, the candidate cluster center is added to the existing cluster center set; otherwise, it is merged into the nearest existing cluster center.
[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, repeating the above steps until all message groups have been traversed, and finally obtaining a complete cluster center set.
[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] Example 2
[0076] The CIC-IDS-2017 dataset is selected in the embodiment to verify the method. The dataset is preprocessed around the mainstream communication protocol architecture of TCP / IP / UDP, and the error-free TCP / IP / UDP packets actually used for communication are selected as the input data of the binary symmetric channel (BSC), and 248 types of five-tuples are extracted. The relevant threshold is set to 10. The reason for setting the threshold to 10 is that, through statistical analysis of a large amount of data, the Hamming distance between most five-tuples in the normal communication situation is more than 10, so the condition for hard merging the candidate cluster center with the existing cluster center is set to the Hamming distance between the candidate cluster center and the nearest cluster center in the existing cluster center set is less than 10.
[0077] In order to verify the good performance of the method, the session flow ability (error estimation probability of five-tuple) of different methods is compared. After the packet is transmitted through the BSC channel, the five-tuple of all received packets is estimated by different methods. The estimated value of each five-tuple is compared with the original value to obtain the error estimation probability of the five-tuple, and the following definition is made: when there is any bit difference between the estimated value and the original value, it is considered that the five-tuple estimation error occurs. Figure 4 The comparison method in the prior art includes: maximum a posteriori probability criterion estimation method based on checksum sequence number relationship and the method proposed in the present application.
[0078] From Figure 4 It can be seen from the above table that the method proposed in the present application can effectively deal with the error complex mode under high error condition, and can still realize the estimation of five-tuple and the separation of session flow when the channel error rate is 10 -1 The reason is that the maximum a posteriori probability criterion estimation method based on checksum sequence number relationship only uses the packets passed by the checksum, while the method proposed in the present application fully uses all the received noisy five-tuples, and avoids the problem that the traditional checksum method is limited by its inherent design principle and error tolerance threshold, thereby affecting the packet field recognition ability under high error condition.
[0079] Unless otherwise specified, the relative steps, numerical expressions and numerical values of the components and steps described in the embodiments do not limit the scope of the present application.
[0080] The embodiments in the present specification are described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same and similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, 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 in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described in terms of function in the above description. 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 performed by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a magnetic disk, or an optical disk. Alternatively, all or part of the steps in the above embodiment can be implemented using one or more integrated circuits. Accordingly, each module / unit in the above embodiment can be implemented in the form of hardware or software functional modules. The present invention is not limited to any specific combination of hardware and software.
[0083] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-described embodiments within the technical scope disclosed by the present invention, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.
Claims
1. A conversation 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 packet groups. The sliding window radius is calculated as follows: 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 channel matching degree M c The curve changes with r; the r value near the inflection point in the channel matching growth curve is determined as the optimal sliding window radius; 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 sliding window radius no longer increases, and the candidate cluster center is obtained; Then 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 closest distance. Continue to select one from the message groups that have not yet been selected as cluster centers as a new initial cluster center, and repeat the above steps until all message groups have been traversed and a complete set of cluster centers is finally obtained; 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 conversation diversion method based on mean shift clustering according to claim 1, 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.
3. The conversation diversion method based on mean shift clustering according to claim 2, characterized in that: The channel matching degree M under the value of the sliding window radius r c The calculation formula is as follows:
4. The conversation diversion method 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.
5. The conversation diversion method based on mean shift clustering according to claim 2, characterized in that: The estimation of the quintuple according to the minimum Hamming distance criterion includes: For each received message group y, the minimum Hamming distance criterion is used to classify it 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.
6. A conversation 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: The sliding window radius acquisition module is used to determine the sliding window radius of each cluster of the message group using the elbow rule. The sliding window radius calculation process is as follows: 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; the average bit error rate of a certain grouping category is calculated. 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 channel matching degree M c The curve changes with r; the r value near the inflection point in the channel matching growth curve is determined as the optimal sliding window radius; The candidate cluster center acquisition module is used to use the majority decision mechanism to continuously drift the selected cluster center to a new cluster center until the number of groups within the sliding window radius no longer increases, thus obtaining the candidate cluster center; 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 the set threshold, the candidate cluster center is added to the existing cluster center set; otherwise, it is merged into the nearest existing cluster center. The cluster center set acquisition module is used to continue selecting one of the message groups that has not yet been selected as a cluster center as a new initial cluster center, 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