Self-adaptive bidirectional traffic shaping method and system suitable for service grid

By dynamically clustering and analyzing service traffic characteristics in the service grid, identifying key services and generating adaptive shaping strategies, the adaptability problem of traffic shaping strategies in cloud-native scenarios is solved, and accurate allocation of network resources and improved communication stability are achieved.

CN120729802AActive Publication Date: 2025-09-30HANGZHOU YUNTUANYU INFORMATION TECHNOLOGY CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202511180116.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-22
Publication Date
2025-09-30
Estimated Expiration
2045-08-22

AI Technical Summary

Technical Problem

Existing traffic shaping strategies cannot effectively adapt to the dynamic changes of the service grid in cloud-native scenarios, resulting in inaccurate network resource allocation, bandwidth waste or insufficient resources for key services, and difficulty in resisting deep learning analysis attacks.

Method used

By collecting metadata within a preset time window, identifying key services and forming a service cluster to be shaped, an adaptive shaping strategy is generated, and sending and receiving shaping agents are used to coordinate shaping at both ends of the communication, and the configuration file is dynamically updated to adapt to traffic changes.

Benefits of technology

It achieves precise allocation of network resources, reduces the impact of sudden traffic on the system, improves the stability and reliability of communication between services, reduces manual maintenance costs, and adapts to the dynamic changes of cloud-native applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120729802A_ABST
    Figure CN120729802A_ABST
Patent Text Reader

Abstract

The invention discloses a self-adaptive two-way traffic shaping method and system suitable for a service grid, and relates to the technical field of network security, the system can continuously perceive the change of a service state based on a metadata collection mechanism of a time window, and a configuration file of a shaping strategy is dynamically updated so as to realize the self-adaptive two-way traffic shaping of the service grid. According to the method and the system, rapid adaptation to scenes such as new service online and traffic mode change is realized, service traffic characteristics are analyzed through dynamic clustering, key services can be automatically identified, an optimal shaping strategy is formed, accurate distribution of network resources is realized, and the problem of bandwidth waste or insufficient key service resources caused by a traditional fixed strategy is effectively avoided. A sending / receiving double-agent architecture is adopted, and cooperative shaping is implemented at two communication ends. The sending end marks the shaping traffic through the head identifier, and the receiving end significantly reduces the impact of the burst traffic on the system through the differential processing of intelligent recombination and virtual / real requests, and improves the stability and reliability of communication between services.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of network security, and in particular relates to an adaptive bidirectional traffic shaping method and system suitable for a service grid. Background Art

[0002] "Cloud native," as an emerging paradigm, has gained widespread popularity due to its flexibility and scalability. Furthermore, service mesh, a typical cloud native technology, is also widely used for microservice governance. Unlike traditional monolithic applications, cloud native applications are decoupled into multiple microservices, which can be developed, deployed, and run independently. These microservices communicate with each other through remote calls exposed over the network. This creates a potential attack surface, allowing attackers to profile service behavior based on analysis of network traffic metrics. These traffic characteristics make microservices vulnerable to traffic analysis attacks, potentially leading to privacy leaks.

[0003] Existing work typically protects against side channels in network traffic by performing traffic shaping, primarily in the following ways. The first involves classifying traffic based on public information as indicators, as well as packet arrival and queuing times, into several categories derived from extensive research. Shaping strategies are then determined based on these indicators and other traffic characteristics. However, this approach requires upfront research and is costly. If the classification is incomplete, its applicability is limited. The second approach uses a pre-defined sensitivity to process application traffic within regular, fixed-length shaping intervals. During each shaping interval, application traffic is accumulated in a buffer whose length is the total traffic volume within that interval. Differential privacy shaping is then performed on the traffic in the buffer. The disadvantage is that the sensitivity must be customized, and higher sensitivity results in lower communication efficiency, making it difficult to determine an appropriate sensitivity that balances privacy and efficiency. The third approach analyzes the packet intervals of actual traffic and inserts dummy packets into these intervals. If no new actual packets arrive within the expected interval, a dummy packet is sent to "fill" the gap. However, this approach is vulnerable to attacks using deep learning analysis.

[0004] As can be seen from the above, among the feasible solutions for application traffic shaping, the shaping strategy adopted for application traffic is particularly important in the process of network side-channel defense. None of the three solutions mentioned above can fully meet the actual needs of cloud-native scenarios in terms of adaptability to cloud-native scenarios, hot policy updates, and policy effectiveness. Summary of the Invention

[0005] To address the aforementioned issues in the prior art, the present invention provides a method and system for adaptive bidirectional traffic shaping applicable to a service grid. The technical issues to be addressed by the present invention are achieved through the following technical solutions: The present invention provides an adaptive bidirectional traffic shaping method applicable to a service grid, comprising: Step 1: Collect metadata for each service within a preset time window; Step 2: Identify key services based on the metadata, and cluster all services according to traffic characteristics based on the key services to form a service cluster to be shaped; Step 3: Generate a shaping standard for the service cluster to be shaped based on the traffic characteristics, and generate a configuration file for the shaping policy according to the shaping standard; Step 4: Generate a corresponding shaping agent component for the service in the service cluster to be shaped, wherein the shaping agent component includes a sending shaping agent and a receiving shaping agent; Step 5: At the sending end, the sending shaping agent at the sending end shapes the sent traffic according to the configuration file and identifies the header of the shaped traffic. At the receiving end, when the receiving shaping agent at the receiving end receives the traffic, it determines whether it is shaped traffic. If so, it reassembles the same packets according to the header identification of the traffic and executes the service processing logic and generates a response returned to the receiving shaping agent at the sending end, wherein a virtual response is generated for the virtual request according to the configuration file, and the generated real response is shaped for the real request according to the configuration file; otherwise, the service processing logic is executed and a response is generated and returned to the receiving shaping agent at the sending end.

[0006] In one embodiment of the present invention, the metadata includes service name, log information, application service topology diagram and traffic between services.

[0007] In one embodiment of the present invention, step 2 includes: Step 2.1: Identify key services based on the metadata; Step 2.2: Determine the traffic characteristics of each service based on the metadata; Step 2.3: Calculate the similarity between each service and the key service using a clustering algorithm based on the traffic characteristics, and select a preset number of services based on the similarity to form the service cluster to be shaped with the key service as the cluster center.

[0008] In one embodiment of the present invention, the traffic characteristics include: time interval and packet size.

[0009] In one embodiment of the present invention, step 3 includes: Step 3.1: Calculate the confidence interval of the traffic characteristics of the service cluster to be shaped based on the traffic characteristics of each service in the service cluster to be shaped; Step 3.2: taking the maximum value in the confidence interval as the shaping standard of the service cluster to be shaped; Step 3.3: Generate a configuration file of the shaping strategy using a configuration file compiler according to the shaping standard.

[0010] In one embodiment of the present invention, the configuration file of the shaping policy includes: a namespace, a service name, and a shaping standard.

[0011] In one embodiment of the present invention, the sending shaping agent at the sending end shapes the sent traffic according to the configuration file, including: The sending shaping agent at the sending end performs at least one of cutting, filling, sending virtual packets and delaying sending on the sent traffic according to the configuration file, so that the sent traffic meets the shaping standard.

[0012] In one embodiment of the present invention, shaping the real response generated by the real request according to the configuration file includes: Perform at least one of cutting, padding, sending a virtual packet, and delaying sending on a real response generated by the real request according to the configuration file, so that the real response meets the shaping standard.

[0013] The present invention provides an adaptive bidirectional traffic shaping system applicable to a service grid, which is applicable to the adaptive bidirectional traffic shaping method applicable to a service grid described in any of the above embodiments. The system includes: Data collector, which collects metadata for each service within a preset time window; A shaping strategy generator is configured to identify key services based on the metadata, cluster all services according to traffic characteristics based on the key services to form a service cluster to be shaped, and generate a shaping standard for the service cluster to be shaped based on the traffic characteristics; A configuration file organizer, configured to generate a configuration file of a shaping strategy according to the shaping standard; A control plane, configured to generate a corresponding shaping agent component for the service in the service cluster to be shaped, and send the configuration file to the shaping agent component, wherein the shaping agent component includes a sending shaping agent and a receiving shaping agent; At the sending end, the sending shaping agent is used to shape the sent traffic according to the configuration file and mark the header of the shaped traffic, and the receiving shaping agent is used to receive the response returned by the receiving end; At the receiving end, the receiving shaping agent is used to determine whether the traffic is shaped when it is received. If so, the same packets are reassembled according to the header identifier of the traffic, and then the service processing logic is executed and a response is generated and returned to the sending end, wherein a virtual response is generated for the virtual request according to the configuration file, and the real response generated for the real request is shaped according to the configuration file; otherwise, the service processing logic is executed and a response is generated and returned to the sending end.

[0014] Compared with the prior art, the present invention has the following beneficial effects: The adaptive two-way traffic shaping method suitable for service grids of the present invention can automatically identify key services and form an optimal shaping strategy through dynamic clustering analysis of service traffic characteristics, thereby achieving accurate allocation of network resources and effectively avoiding bandwidth waste or insufficient key service resources caused by traditional fixed strategies. A sending / receiving dual-agent architecture is adopted to implement collaborative shaping at both ends of communication. The sending end marks the shaped traffic through header identification, and the receiving end significantly reduces the impact of burst traffic on the system through intelligent reorganization and differentiated processing of virtual / real requests, thereby improving the stability and reliability of communication between services. The metadata collection mechanism based on the time window enables the system to continuously perceive changes in service status, and by dynamically updating the configuration file of the shaping strategy, it can achieve rapid adaptation to scenarios such as the launch of new services and changes in traffic patterns, thereby reducing manual maintenance costs.

[0015] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the following preferred embodiments are specifically cited and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 This is a flow chart of an adaptive bidirectional traffic shaping method applicable to a service grid provided by an embodiment of the present invention; Figure 2 This is an example diagram of a service cluster to be shaped formed by clustering provided by an embodiment of the present invention; Figure 3 This is an example diagram before and after traffic shaping provided by an embodiment of the present invention; Figure 4 This is a schematic diagram of an adaptive bidirectional traffic shaping system suitable for a service grid provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0017] In order to further illustrate the technical means and effects adopted by the present invention to achieve the predetermined purpose of the invention, the following is a detailed description of an adaptive bidirectional traffic shaping method and system suitable for a service grid proposed in accordance with the present invention, in combination with the accompanying drawings and specific implementation methods.

[0018] The aforementioned and other technical contents, features, and effects of the present invention are clearly presented in the following detailed description of the specific embodiments in conjunction with the accompanying drawings. Through the description of the specific embodiments, a deeper and more specific understanding of the technical means and effects adopted by the present invention to achieve the intended purpose can be obtained. However, the accompanying drawings are provided for reference and illustration purposes only and are not intended to limit the technical solutions of the present invention.

[0019] In the first aspect, the embodiment of the present invention provides an adaptive bidirectional traffic shaping method applicable to a service grid, see Figure 1 , Figure 1 This is a flow chart of an adaptive bidirectional traffic shaping method applicable to a service grid provided by an embodiment of the present invention. Figure 1 As shown, the adaptive bidirectional traffic shaping method applicable to the service grid of this embodiment may include the following steps: Step 1: Collect metadata for each service within a preset time window.

[0020] In this embodiment, the metadata includes the service name, log information, the service topology of the application, and the traffic between services.

[0021] Optionally, you can use the instructions provided by Kubernetes (a container orchestration platform) and Istio (an open source service mesh) to collect metadata for each service in the application namespace within a preset time window.

[0022] Step 2: Identify key services based on metadata, and cluster all services according to traffic characteristics based on key services to form service clusters to be shaped.

[0023] Optionally, step 2 may include the following steps: Step 2.1: Identify key services based on metadata.

[0024] In this embodiment, services with characteristics such as sensitivity and high traffic volume can be identified as key services based on indicators such as service metadata, application service topology, and traffic volume between services.

[0025] For example, services containing the keywords "payment" and "Auth" in metadata, or services that call these keywords, can be identified as sensitive services. Services with high out-degree and in-degree in the application's service topology can be identified as critical services. High-traffic services, often those that handle high traffic volumes, are also classified as critical services.

[0026] Step 2.2: Determine the traffic characteristics of each service based on metadata.

[0027] In this embodiment, the traffic characteristics include: time interval and packet size.

[0028] Optionally, the traffic characteristics of each service in the application can be modeled as<interval,packet_size> .

[0029] Step 2.3: Calculate the similarity between each service and the key service through the clustering algorithm based on the traffic characteristics, and select a preset number of services based on the similarity to form a service cluster to be shaped with the key service as the cluster center.

[0030] Specifically, based on the traffic characteristics of the service, a clustering algorithm is used to calculate the similarity between it and the key service, and then a certain number of services are selected as similar services of the key service in descending order of similarity according to a preset number to form a service cluster to be shaped. Figure 2 shown.

[0031] Exemplarily, the clustering algorithm may be a K-Means clustering algorithm (K-means clustering algorithm) or a mean shift clustering algorithm.

[0032] Step 3: Generate shaping standards for the service cluster to be shaped based on traffic characteristics, and generate a configuration file for the shaping policy based on the shaping standards.

[0033] Optionally, step 3 may include the following steps: Step 3.1: Based on the traffic characteristics of each service in the service cluster to be shaped, calculate the confidence interval of the traffic characteristics of the service cluster to be shaped.

[0034] In this embodiment, according to the traffic characteristics of each service in the service cluster to be shaped<interval,packet_size> , the confidence interval of the traffic characteristics of the service cluster to be shaped is calculated and can be expressed as:<min_interval~max_interval, min_packet_size~max_packet_size> .

[0035] For example, the interval and packet_size data of a service cluster to be shaped are as follows: Cluster_A={ interval: [10, 15, 12, 18, 20, ...], / / time interval sample packet_size: [1024, 1500, 900, 1200, ...] / / Packet size sample } The process of calculating the confidence interval of the service cluster to be shaped is as follows: 1. Select the confidence level: Usually a 95% confidence level is selected (corresponding to a significance level of α = 0.05), indicating that there is a 95% confidence that the true parameter falls within this interval.

[0036] 2. Calculate the mean and standard deviation: Calculate the sample mean for the interval and packet_size of each service cluster to be shaped and the sample standard deviation , the specific calculation formula is as follows: ; ; Where, Indicates the number of services in the service cluster to be shaped. Indicates the Sample values ​​of services, when calculating the confidence interval of the time interval Indicates the When calculating the confidence interval of the packet size, the time interval of the service Indicates the The packet size of each service.

[0037] 3. Determining the critical value: large sample use The critical value of the 95% confidence level of the distribution is 1.96, which is used for small samples. distribution with degrees of freedom ,check The distribution table obtains the critical value.

[0038] 4. Calculate the confidence interval: The upper limit of the confidence interval is calculated according to the formula Calculated, the lower limit is based on the formula Calculated, represents the critical value, Indicates the number of services in the service cluster to be shaped.

[0039] Step 3.2: Take the maximum value in the confidence interval as the shaping standard for the service cluster to be shaped.

[0040] In this embodiment, the maximum value of the confidence interval is taken, that is,<max_interval, max_packet_size> As the shaping standard in the service cluster to be shaped.

[0041] Step 3.3: Generate a configuration file for the shaping policy using the configuration file composer based on the shaping standard.

[0042] In this embodiment, a shaping policy is formed according to the shaping standard and exists in the form of a configuration file. The configuration file of the shaping policy includes: a namespace, a service name, and a shaping standard.

[0043] For example, the configuration file of the shaping policy is: namespace: "your-namespace" service_group: "Cluster_A" traffic_shape: max_interval: 16.12# Unit: ms max_packet_size: 1500# Unit: Bytes It is understandable that the shaping criteria are related to the traffic characteristics of the service cluster to be shaped, and the metadata collected for each service within the preset time window will also change over time. Therefore, the generated shaping strategy can adapt to the dynamically changing traffic load and realize dynamic and adaptive shaping strategy updates.

[0044] Step 4: Generate corresponding shaping agent components for the services in the service cluster to be shaped. The shaping agent components include a sending shaping agent and a receiving shaping agent.

[0045] It should be noted that after the shaping policy is generated, a corresponding shaping proxy component will be generated for each service to be shaped according to the shaping policy configuration file. If a shaping proxy component already exists, only the shaping standard field will be updated.

[0046] Step 5: At the sending end, the sending shaping agent at the sending end shapes the sent traffic according to the configuration file and identifies the header of the shaped traffic. At the receiving end, when the receiving shaping agent at the receiving end receives the traffic, it determines whether it is shaped traffic. If so, it reassembles the same packets according to the header identification of the traffic and executes the service processing logic and generates a response returned to the receiving shaping agent at the sending end, wherein a virtual response is generated for the virtual request according to the configuration file, and the generated real response is shaped for the real request according to the configuration file; otherwise, the service processing logic is executed and a response is generated and returned to the receiving shaping agent at the sending end.

[0047] In this embodiment, the sending shaping agent at the sending end reads the configuration file of the shaping policy and shapes the sent traffic according to the shaping standards in the configuration file, mainly shaping the sending time interval and the packet size of the sent traffic.

[0048] Specifically, the sending shaping agent at the sending end performs at least one of cutting, filling, sending virtual packets and delaying sending on the sent traffic according to the configuration file, so that the sent traffic meets the shaping standard.

[0049] In this embodiment, the header of the shaped traffic is marked so that the receiving end can identify the shaped traffic.

[0050] Understandably, excessive traffic needs to be split and sent multiple times. Regarding time intervals, traffic initiated too quickly is evenly scheduled through a cache queue, ensuring it is sent at a fixed rate. When there's no actual communication, dummy traffic can be injected to ensure a uniform and stable traffic flow.

[0051] In this embodiment, when a receiving end receives traffic, the receiving shaping agent first determines whether it is shaped traffic. If so, it reassembles the traffic before passing it to the service processing logic. Specifically, it reassembles identical packets based on the identifiers in the traffic header. It should be noted that dummy packets cannot be passed and a dummy response must be sent to the sending end.

[0052] After the service processing logic is executed, a response needs to be sent to the sender. At this time, traffic shaping is also required to mask traffic characteristics. Specifically, a virtual response is generated for the virtual request according to the shaping policy. If it is a real request, the real response needs to be shaped by performing at least one of the following operations: cutting, padding, sending a virtual packet, and delaying the sending according to the shaping policy to make the real response meet the shaping standards. Figure 3 , Figure 3 This is an example diagram before and after traffic shaping provided by an embodiment of the present invention.

[0053] In this embodiment, traffic shaping can be implemented based on WebAssembly (WASM, a binary instruction format that can extend Istio's Envoy proxy). When a new shaping policy is generated, the WASM plug-in resources of Istio's Envoy proxy (an open source C++ implemented proxy) in the form of a sidecar container (a container group in which one or more auxiliary containers are run side by side in addition to the main application container) in each container group (the smallest deployable unit that can be created and managed in Kubernetes) are updated. Then, the shaping proxy will monitor this change and load the configuration file of the updated shaping policy. The entire process does not require a service restart, thereby ensuring the continuous and uninterrupted operation of the service.

[0054] The adaptive two-way traffic shaping method suitable for service grids of the present invention can automatically identify key services and form an optimal shaping strategy through dynamic clustering analysis of service traffic characteristics, thereby achieving accurate allocation of network resources and effectively avoiding bandwidth waste or insufficient key service resources caused by traditional fixed strategies. A sending / receiving dual-agent architecture is adopted to implement collaborative shaping at both ends of communication. The sending end marks the shaped traffic through header identification, and the receiving end significantly reduces the impact of burst traffic on the system through intelligent reorganization and differentiated processing of virtual / real requests, thereby improving the stability and reliability of communication between services. The metadata collection mechanism based on the time window enables the system to continuously perceive changes in service status, and by dynamically updating the configuration file of the shaping strategy, it can achieve rapid adaptation to scenarios such as the launch of new services and changes in traffic patterns, thereby reducing manual maintenance costs.

[0055] In addition, the adaptive bidirectional traffic shaping method suitable for service grid of the present invention implements the final shaping implementation logic based on WASM, and runs in the container group of the service in the form of a sidecar container. Its advantage is that it implements the shaping logic with 0 code intrusion into the original application while also ensuring hot updates of the shaping strategy. In order to adapt to the changing load of cloud-native applications, the dynamic and adaptive strategy update also greatly improves the efficiency of shaping.

[0056] In a second aspect, an embodiment of the present invention provides an adaptive bidirectional traffic shaping system applicable to a service grid, which is applicable to the adaptive bidirectional traffic shaping method applicable to a service grid provided in the first aspect. Figure 4 , Figure 4 is a schematic diagram of an adaptive bidirectional traffic shaping system applicable to a service grid provided by an embodiment of the present invention, such as Figure 4 As shown, the adaptive bidirectional traffic shaping system for service grids in this embodiment includes: a data collector, a shaping policy generator, a configuration file orchestrator, a control plane, a sending shaping agent, and a receiving shaping agent. In this embodiment, the data collector, shaping policy generator, and configuration file orchestrator constitute the behavior analysis engine, while the sending shaping agent and the receiving shaping agent constitute the shaping agent component. The behavior analysis engine interacts with the control plane, monitoring metrics such as traffic flow, performing data analysis to generate corresponding shaping policies and orchestrate corresponding configuration files. These policies are then distributed to the shaping agent component via the control plane, and the shaping agent component performs traffic shaping based on the configuration files.

[0057] Specifically, a data collector is used to collect metadata for each service within a preset time window; a shaping policy generator is used to identify key services based on the metadata, cluster all services according to traffic characteristics based on the key services to form a service cluster to be shaped, and generate shaping standards for the service cluster to be shaped based on the traffic characteristics; a configuration file orchestrator is used to generate a configuration file for the shaping policy based on the shaping standards; a control plane is used to generate corresponding shaping agent components for the services in the service cluster to be shaped, and send the configuration files to the shaping agent components, wherein the shaping agent components include a sending shaping agent and a receiving shaping agent; at the sending end, the sending shaping agent is used to shape the sent traffic according to the configuration file and identify the header of the shaped traffic, and the receiving shaping agent is used to receive the response returned by the receiving end; at the receiving end, the receiving shaping agent is used to determine whether the received traffic is shaped traffic, and if so, reassemble the same packets according to the header identifier of the traffic, execute service processing logic, and generate a response returned to the sending end, wherein a virtual response is generated according to the configuration file for a virtual request, and the generated real response is shaped according to the configuration file for a real request; otherwise, the service processing logic is executed and a response is generated and returned to the sending end.

[0058] Optionally, the control plane can be implemented with the help of Kubernetes and Istio.

[0059] For the specific content and corresponding beneficial effects of the adaptive bidirectional traffic shaping system suitable for service grid, please refer to the relevant content of the adaptive bidirectional traffic shaping method suitable for service grid provided in the first aspect, which will not be repeated here.

[0060] It should be noted that, in this document, relational terms such as first and second are used solely to distinguish one entity or operation from another, and do not necessarily require or imply any actual relationship or order between these entities or operations. Furthermore, the terms "comprise," "include," or any other variations thereof are intended to encompass non-exclusive inclusion, such that an article or device comprising a list of elements includes not only those elements but also other elements not explicitly listed. Without further limitation, an element defined by the phrase "comprising a..." does not preclude the presence of additional identical elements in the article or device comprising the element. Terms such as "connected" or "connected" are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. References to orientations or positional relationships, such as "upper," "lower," "left," and "right," are based on the orientations or positional relationships shown in the accompanying drawings and are intended solely to facilitate description and simplify the description of the present invention. They do not indicate or imply that the device or element referred to must have, be constructed, or operate in a specific orientation, and are therefore not to be construed as limiting the present invention.

[0061] In the description of this specification, the reference terms "one embodiment," "some embodiments," "example," "specific example," or "some examples" mean that the specific features or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features or characteristics described can be combined in any suitable manner in one or more embodiments or examples. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification.

[0062] The above is a further detailed description of the present invention in conjunction with specific preferred embodiments, and the specific implementation of the present invention should not be considered to be limited to these descriptions. For those skilled in the art of the present invention, without departing from the concept of the present invention, several simple deductions or substitutions can be made, which should be considered to fall within the scope of protection of the present invention.

Claims

1. An adaptive bidirectional traffic shaping method suitable for a service grid, characterized in that: include: Step 1: Collect metadata for each service within a preset time window; Step 2: Identify key services based on the metadata, and cluster all services according to traffic characteristics based on the key services to form a service cluster to be shaped; Step 3: Generate a shaping standard for the service cluster to be shaped based on the traffic characteristics, and generate a configuration file for the shaping policy according to the shaping standard; Step 4: Generate a corresponding shaping agent component for the service in the service cluster to be shaped, wherein the shaping agent component includes a sending shaping agent and a receiving shaping agent; Step 5: At the sending end, the sending shaping agent at the sending end shapes the sent traffic according to the configuration file and identifies the header of the shaped traffic. At the receiving end, when the receiving shaping agent at the receiving end receives the traffic, it determines whether it is shaped traffic. If so, it reassembles the same packets according to the header identifier of the traffic, executes the service processing logic, and generates a response and returns it to the receiving shaping agent at the sending end, wherein a virtual response is generated for the virtual request according to the configuration file, and the generated real response is shaped for the real request according to the configuration file. Otherwise, the service processing logic is executed and a response is generated and returned to the receiving shaping agent of the sending end.

2. The adaptive bidirectional traffic shaping method for service grid according to claim 1, characterized in that: The metadata includes service name, log information, application service topology, and traffic between services.

3. The adaptive bidirectional traffic shaping method for service grid according to claim 1, characterized in that: The step 2 includes: Step 2.1: Identify key services based on the metadata; Step 2.2: Determine the traffic characteristics of each service based on the metadata; Step 2.3: Calculate the similarity between each service and the key service using a clustering algorithm based on the traffic characteristics, and select a preset number of services based on the similarity to form the service cluster to be shaped with the key service as the cluster center.

4. The adaptive bidirectional traffic shaping method applicable to a service grid according to claim 3, characterized in that: The traffic characteristics include: time interval and packet size.

5. The adaptive bidirectional traffic shaping method applicable to a service grid according to claim 1, characterized in that: The step 3 comprises: Step 3.1: Calculate the confidence interval of the traffic characteristics of the service cluster to be shaped based on the traffic characteristics of each service in the service cluster to be shaped; Step 3.2: taking the maximum value in the confidence interval as the shaping standard of the service cluster to be shaped; Step 3.3: Generate a configuration file of the shaping strategy using a configuration file compiler according to the shaping standard.

6. The adaptive bidirectional traffic shaping method applicable to a service grid according to claim 5, characterized in that: The configuration file of the shaping strategy includes: namespace, service name and shaping standard.

7. The adaptive bidirectional traffic shaping method for service grid according to claim 6, characterized in that: The sending shaping agent at the sending end shapes the sent traffic according to the configuration file, including: The sending shaping agent at the sending end performs at least one of cutting, filling, sending virtual packets and delaying sending on the sent traffic according to the configuration file, so that the sent traffic meets the shaping standard.

8. The adaptive bidirectional traffic shaping method applicable to a service grid according to claim 6, characterized in that: The real response generated by the real request is shaped according to the configuration file, including: Perform at least one of cutting, padding, sending a virtual packet, and delaying sending on a real response generated by the real request according to the configuration file, so that the real response meets the shaping standard.

9. An adaptive bidirectional traffic shaping system suitable for a service grid, characterized in that: The method for adaptive bidirectional traffic shaping applicable to a service grid according to any one of claims 1 to 8 comprises: Data collector, which collects metadata for each service within a preset time window; A shaping strategy generator is configured to identify key services based on the metadata, cluster all services according to traffic characteristics based on the key services to form a service cluster to be shaped, and generate a shaping standard for the service cluster to be shaped based on the traffic characteristics; A configuration file organizer, configured to generate a configuration file of a shaping strategy according to the shaping standard; A control plane, configured to generate a corresponding shaping agent component for the service in the service cluster to be shaped, and send the configuration file to the shaping agent component, wherein the shaping agent component includes a sending shaping agent and a receiving shaping agent; At the sending end, the sending shaping agent is used to shape the sent traffic according to the configuration file and mark the header of the shaped traffic, and the receiving shaping agent is used to receive the response returned by the receiving end; At the receiving end, the receiving shaping agent is used to determine whether the traffic is shaped when it is received. If so, the same packets are reassembled according to the header identifier of the traffic, and then the service processing logic is executed and a response is generated and returned to the sending end, wherein a virtual response is generated for the virtual request according to the configuration file, and the real response generated for the real request is shaped according to the configuration file; otherwise, the service processing logic is executed and a response is generated and returned to the sending end.

Citation Information

Patent Citations

  • Device shaping in a communications network

    CN110089146A

  • TSN network medium system for realizing precise flow control

    CN118474039A

  • Traffic shaping method and system based on deep learning and antagonism strategy

    CN119383017A

  • System and method for recognizing and assigning application-specific flows

    US20070192507A1

  • Method and apparatus for managing admission and routing in multi-hop 802.11 networks taking into consideration traffic shaping at intermediate hops

    US20080144497A1