Traffic control method and related equipment
By dynamically adjusting the flow control rules using preset status locks in traffic control, the business interruption problem caused by system iteration or restart in the existing technology is solved, and flexible traffic control is achieved without interrupting services.
Patent Information
- Application Number
- CN202510916868.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-03
- Publication Date
- 2025-09-05
AI Technical Summary
The existing traffic control scheme relies on system iteration or restart to load new control policies, resulting in business continuity interruption.
By responsive to the flow control instructions, the initial flow rate is obtained and the control is controlled based on the preset flow control pipeline, and the flow control rules are dynamically adjusted using the preset state lock, including the control dimension, strategy and cycle, to avoid system restart.
It realizes dynamic adjustment of traffic control rules without interruption of business, ensuring business continuity and flexibility.
Smart Images

Figure CN120602418A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a flow control method and related equipment. Background Art
[0002] In distributed systems, traffic migration control is a key step in ensuring system stability and business continuity. However, existing traffic control solutions have significant technical issues.
[0003] Existing traffic control solutions, such as database-based feature on / off control, rely on system iterations or restarts to load new control policies, leading to interruptions in business continuity. Implementing traffic control without disrupting business operations is an urgent technical challenge.
[0004] The above content is only used to assist in understanding the technical solution of this application and does not constitute an admission that the above content is related technology. Summary of the Invention
[0005] The main purpose of this application is to provide a traffic control method and related equipment, aiming to solve the technical problem of how to achieve traffic control without interrupting business.
[0006] To achieve the above objectives, the present application proposes a flow control method, which includes:
[0007] Responding to a traffic control instruction, obtaining an initial traffic flow;
[0008] Based on the preset traffic control pipeline, the initial traffic is controlled to obtain a traffic control result, wherein the traffic control rules in the preset traffic control pipeline can be dynamically adjusted based on the preset state lock, and the traffic control rules include control dimensions, control strategies and control cycles.
[0009] In one embodiment, before the step of controlling the initial traffic based on the preset traffic control channel and obtaining the traffic control result, the step further includes:
[0010] Based on the traffic control instruction, obtain the target traffic control rule and close the preset state lock, wherein the preset state lock is used to allow traffic transmission or block traffic transmission;
[0011] Obtaining the current traffic control rules in the current traffic control pipeline, and determining whether the target traffic control strategy is consistent with the current traffic control rules;
[0012] If they are consistent, the current flow control pipeline is set as the preset flow control pipeline and the preset status lock is opened;
[0013] If they are inconsistent, the current traffic control rule is replaced with the target traffic control policy, the current traffic control pipeline after the replacement of the traffic control policy is set as the preset traffic control pipeline, and the preset status lock is opened.
[0014] In one embodiment, the initial traffic is transmitted through a FIFO waiting queue, and the preset state lock is used to control whether the FIFO waiting queue allows the traffic to be transmitted, and the preset state lock and the FIFO waiting queue are constructed based on a ReentrantLock mechanism.
[0015] In one embodiment, the step of controlling the initial traffic based on the preset traffic control pipeline to obtain a traffic control result further includes:
[0016] Reading a target traffic control rule in a preset traffic control pipeline, wherein the target traffic control rule includes a traffic dimension sub-rule, a traffic control strategy sub-rule, and a traffic control period sub-rule;
[0017] Determining a first flow in the initial flow based on the flow dimension sub-rule;
[0018] Based on the traffic control strategy sub-rule and the traffic control period sub-rule, the first traffic is controlled to obtain a traffic control result.
[0019] In one embodiment, the control dimensions include business stages, business categories, and business scenarios. The step of determining the first flow in the initial flow based on the flow dimension sub-rules further includes:
[0020] Determine the business stage, business category, and business scenario corresponding to the initial traffic;
[0021] Based on the traffic dimension sub-rules, the business stage, the business category and the business scenario, the first traffic in the initial traffic is determined.
[0022] In one embodiment, the control strategy includes a traffic feature control sub-strategy, a traffic threshold control sub-strategy, and a traffic switch control sub-strategy. The step of controlling the first traffic based on the traffic control strategy sub-rules and the traffic control period sub-rules to obtain a traffic control result further includes:
[0023] Read the traffic feature control sub-policy, traffic threshold control sub-policy, and traffic switch control sub-policy in the traffic control policy sub-rules;
[0024] Determining a target flow in the first flow based on one or more of the flow feature control sub-strategy, the flow threshold control sub-strategy, and the flow switch control sub-strategy;
[0025] Based on the flow control period sub-rule, the flow switch is controlled to control the target flow and obtain a flow control result.
[0026] In one embodiment, the step of controlling the first traffic based on the traffic control policy sub-rule and the traffic control period sub-rule to obtain a traffic control result further includes:
[0027] Read the control effective date and control expiration date in the traffic control cycle sub-rule;
[0028] Based on the control effective date, the control expiration date and the traffic control policy sub-rules, the first traffic is controlled to obtain a traffic control result.
[0029] In addition, to achieve the above objectives, the present application also proposes a flow control device, which includes:
[0030] an acquisition module, configured to acquire an initial flow rate in response to a flow control instruction;
[0031] A control module is used to control the initial traffic based on a preset traffic control pipeline to obtain a traffic control result, wherein the traffic control rules in the preset traffic control pipeline can be dynamically adjusted based on a preset state lock, and the traffic control rules include control dimensions, control strategies and control cycles.
[0032] In one embodiment, the flow control device further includes a setting module, and the setting module includes:
[0033] a first acquiring unit, configured to acquire a target traffic control rule based on the traffic control instruction and disable a preset state lock, wherein the preset state lock is configured to allow or block traffic transmission;
[0034] A second acquisition unit is configured to acquire a current traffic control rule in a current traffic control pipeline and determine whether the target traffic control policy is consistent with the current traffic control rule;
[0035] A setting unit, configured to set the current flow control pipeline as the preset flow control pipeline and unlock the preset state lock if the two are consistent;
[0036] The replacement unit is used to replace the current traffic control rule with the target traffic control policy if there is inconsistency, set the current traffic control pipeline after the traffic control policy is replaced as the preset traffic control pipeline, and open the preset state lock.
[0037] In one embodiment, the setting module is further configured to implement:
[0038] The initial traffic is transmitted through the FIFO waiting queue, and the preset state lock is used to control whether the FIFO waiting queue is allowed to transmit traffic. The preset state lock and the FIFO waiting queue are constructed based on the ReentrantLock mechanism.
[0039] In one embodiment, the control module further includes:
[0040] A first reading unit is configured to read a target traffic control rule in a preset traffic control pipeline, wherein the target traffic control rule includes a traffic dimension sub-rule, a traffic control strategy sub-rule, and a traffic control period sub-rule;
[0041] a first determining unit, configured to determine a first flow in the initial flow based on the flow dimension sub-rule;
[0042] The first control unit is used to control the first traffic based on the traffic control strategy sub-rule and the traffic control period sub-rule to obtain a traffic control result.
[0043] In one embodiment, the control module further includes:
[0044] A second determining unit is used to determine the business stage, business category and business scenario corresponding to the initial traffic;
[0045] The third determining unit is used to determine the first flow in the initial flow based on the flow dimension sub-rule, the business stage, the business category and the business scenario.
[0046] In one embodiment, the control module further includes:
[0047] The second reading unit is used to read the traffic feature control sub-policy, traffic threshold control sub-policy and traffic switch control sub-policy in the traffic control policy sub-rules;
[0048] a fourth determining unit, configured to determine a target flow in the first flow based on one or more of the flow feature control sub-strategy, the flow threshold control sub-strategy, and the flow switch control sub-strategy;
[0049] The second control unit is used to control the flow switch based on the flow control period sub-rule to control the target flow and obtain a flow control result.
[0050] In one embodiment, the control module further includes:
[0051] The third reading unit is used to read the control effective date and control expiration date in the traffic control period sub-rule;
[0052] The third control unit is used to control the first traffic based on the control effective date, the control expiration date and the traffic control policy sub-rule to obtain a traffic control result.
[0053] In addition, to achieve the above-mentioned purpose, the present application also proposes a traffic control device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the computer program is configured to implement the steps of the traffic control method as described above.
[0054] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the traffic control method described above are implemented.
[0055] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the traffic control method described above.
[0056] One or more technical solutions proposed in this application have at least the following technical effects:
[0057] The present application proposes a traffic control method and related equipment, which relate to the field of data processing technology. Compared with the related technology, in the existing traffic control scheme, the feature switch control scheme based on the database relies on system iteration or restart to load new control strategies, resulting in business continuity interruption, in the present application, first, in response to the traffic control instruction, the initial traffic is obtained, and then, based on the preset traffic control pipeline, the initial traffic is controlled to obtain the traffic control result, wherein the traffic control rules in the preset traffic control pipeline can be dynamically adjusted based on the preset state lock, and the traffic control rules include control dimensions, control strategies and control cycles. The present application dynamically adjusts the rules in the traffic control pipeline based on the preset state lock without restarting, thereby ensuring business continuity. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0060] Figure 1A flow chart illustrating the first embodiment of the flow control method of this application;
[0061] Figure 2 A flow chart illustrating the second embodiment of the flow control method of this application;
[0062] Figure 3 A flow chart showing the third embodiment of the flow control method of this application;
[0063] Figure 4 This is a schematic diagram of the module structure of the flow control device according to an embodiment of the present application;
[0064] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the traffic control method in the embodiment of the present application.
[0065] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0066] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not intended to limit the present application.
[0067] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0068] The main solutions of the embodiments of this application are:
[0069] In this embodiment, for ease of description, the following description is made with the flow control device as the execution entity.
[0070] Due to related technologies: In existing traffic control solutions, database-based feature switching control solutions rely on system iteration or restart to load new control policies, resulting in interruptions to business continuity. How to implement traffic control without interrupting business is an urgent technical problem to be solved.
[0071] The present application provides a solution that: first, in response to a traffic control instruction, obtains initial traffic; then, based on a preset traffic control pipeline, controls the initial traffic to obtain a traffic control result, wherein the traffic control rules in the preset traffic control pipeline can be dynamically adjusted based on a preset state lock, and the traffic control rules include control dimensions, control strategies, and control cycles. The present application dynamically adjusts the rules in the traffic control pipeline based on the preset state lock without the need for restart, thereby ensuring business continuity.
[0072] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, mobile phone, etc., or an electronic device or traffic control device capable of implementing the above functions. The following uses the traffic control device as an example to illustrate this embodiment and the following embodiments.
[0073] Based on this, the embodiment of the present application provides a flow control method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the traffic control method of this application.
[0074] In this embodiment, the traffic control method includes steps S10 to S20:
[0075] Step S10, in response to the flow control instruction, obtaining the initial flow;
[0076] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, mobile phone, etc., or an electronic device or traffic control device capable of implementing the above functions. The following uses the traffic control device as an example to illustrate this embodiment and the following embodiments.
[0077] It's important to note that traffic control instructions are external control signals or commands. In computer networks, communication systems, or some resource management systems, traffic control instructions are issued by system administrators to manage and regulate network and data traffic. For example, in network communications, when network bandwidth is limited or when the priority of certain users or services needs to be adjusted, the system will issue traffic control instructions.
[0078] Initial traffic refers to the system's traffic state before traffic control instructions are executed. This traffic state can be data transmission volume on a network, material flow on a production line, or customer flow in a service system. It serves as a starting point for subsequent traffic control operations.
[0079] In this embodiment, the system needs to detect, measure, or read the current traffic flow status. For example, in an intelligent transportation system, sensors are used to obtain the initial traffic flow on the road so that the duration of traffic lights can be adjusted according to traffic control instructions to optimize traffic flow.
[0080] In this embodiment, when the system receives a traffic control instruction, it detects or reads the current traffic status to subsequently manage and regulate the traffic according to the instruction. This is very important in many scenarios that require dynamic traffic adjustment, such as network bandwidth allocation, intelligent traffic management, and industrial production process control.
[0081] Step S20, based on the preset traffic control pipeline, the initial traffic is controlled to obtain the traffic control result, wherein the traffic control rules in the preset traffic control pipeline can be dynamically adjusted based on the preset state lock, and the traffic control rules include control dimensions, control strategies and control cycles.
[0082] A traffic control pipeline is a predefined traffic processing channel or path. It is a logical structure used to classify, process, and control traffic. For example, in network traffic management, a traffic control pipeline can be a virtual channel used to distinguish different types of traffic (such as video traffic, voice traffic, and general data traffic). A preset traffic control pipeline indicates that this traffic control pipeline is predefined, and the system will process traffic according to this preset pipeline.
[0083] Traffic management and control refers to the control and management of traffic, such as limiting traffic size, adjusting traffic priority, and allocating traffic resources.
[0084] Traffic control results are the final output of traffic control operations. After control, the state of traffic (such as size, priority, distribution, etc.) will change, and these changes are the results of traffic control.
[0085] Traffic control rules are the specific operational basis for traffic control and determine how traffic is controlled. Rules can include various contents, such as traffic restrictions and priority settings.
[0086] A preset state lock is a locking mechanism used to lock or unlock a traffic control pipeline under specific conditions. For example, when the system detects an abnormal state, a state lock can be used to lock the current traffic control pipeline, preventing traffic transmission.
[0087] Dynamic adjustment means that traffic control rules are not fixed but can be adjusted in real time based on system operating status or other conditions. This dynamism enables the traffic control system to better adapt to different scenarios and needs.
[0088] Traffic control dimensions refer to the scope or angle of traffic control. For example, traffic control can be performed by traffic type (video, voice, etc.), user group (regular users, VIP users, etc.), or time (peak hours, off-peak hours, etc.).
[0089] A control strategy refers to a specific control method or measure, such as limiting traffic volume, adjusting priority, or discarding some traffic.
[0090] The control period refers to the time range during which traffic control is executed. For example, control operations can be executed periodically, such as hourly, daily, or weekly.
[0091] In this embodiment, the initial traffic is managed through a preset traffic control pipeline. The rules in the traffic control pipeline can be dynamically adjusted according to the preset state lock to adapt to different operating states. Traffic control rules include three main aspects: control dimensions (determining from which angles to control), control strategies (specifically how to control), and control cycles (within what time range to control). In this way, the system can flexibly control traffic to achieve goals such as optimizing resource allocation and improving system performance.
[0092] The present application proposes a traffic control method and related equipment, which relate to the field of data processing technology. Compared with the related technology, in the existing traffic control scheme, the feature switch control scheme based on the database relies on system iteration or restart to load new control strategies, resulting in business continuity interruption, in the present application, first, in response to the traffic control instruction, the initial traffic is obtained, and then, based on the preset traffic control pipeline, the initial traffic is controlled to obtain the traffic control result, wherein the traffic control rules in the preset traffic control pipeline can be dynamically adjusted based on the preset state lock, and the traffic control rules include control dimensions, control strategies and control cycles. The present application dynamically adjusts the rules in the traffic control pipeline based on the preset state lock without restarting, thereby ensuring business continuity.
[0093] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above embodiment 1 can be referred to the above introduction and will not be described in detail later. Figure 2 Before step S20, the traffic control method further includes steps A100 to A400:
[0094] Step A100: Based on the traffic control instruction, obtain the target traffic control rule and close the preset state lock, wherein the preset state lock is used to allow or block traffic transmission;
[0095] It should be noted that target traffic control rules are pre-defined rules in the system that are related to the current traffic control instructions. These rules determine how to control traffic, such as how much traffic is allowed to pass through and under what conditions to allow or block traffic.
[0096] In this embodiment, the system needs to retrieve the rules that match the current instruction from its rule base or configuration. This step is to determine the specific traffic control measures that need to be implemented.
[0097] A preset state lock is a mechanism used to control whether traffic can be transmitted. It is similar to a switch that can be in either the "on" or "off" state. When the state lock is on, traffic transmission is allowed; when the state lock is off, traffic transmission is blocked.
[0098] Close: This means that the status lock is set to "Closed". This means that traffic transmission will be blocked, or the traffic control system will enter a mode that restricts traffic transmission.
[0099] In this embodiment, upon receiving a traffic control instruction, the traffic control system disables the status lock to prevent traffic transmission. This allows for traffic restriction, maintenance, or temporary interruption of traffic as required by the traffic control instruction. This mechanism enables the traffic control system to flexibly adjust the state of traffic transmission based on instructions, while also providing a fast and effective means of traffic control through the status lock.
[0100] Step A200: obtaining the current traffic control rules in the current traffic control pipeline, and determining whether the target traffic control policy is consistent with the current traffic control rules;
[0101] It should be noted that the current traffic control pipeline refers to the traffic control channel or path currently in use in the system. The traffic control pipeline is the logical path for traffic transmission and management, which defines how traffic flows in the system and how it is processed.
[0102] Current traffic control rules refer to the rules that are actually in effect in the current traffic control pipeline. These rules determine how current traffic is controlled, such as limiting traffic size, setting priorities, and allowing or disallowing certain types of traffic.
[0103] In this embodiment, the system needs to read the rules currently in use in the traffic control pipeline from its configuration or storage. This step is to understand the actual control status of the current traffic.
[0104] Determining consistency involves comparing the target traffic control policy with the current traffic control rules. The system checks that the target policy and current rules are identical in various aspects, such as control dimensions (whether they target the same traffic type, user group, or time range), control strategies (whether they use the same restrictions, priority adjustments, or traffic allocation methods), and control cycles (whether they are effective within the same time range).
[0105] If the target traffic shaping policy and the current traffic shaping rules are identical in all relevant respects, they are considered consistent. If there are any differences, such as the target policy requiring higher traffic priority while the current rules limit the traffic size, they are inconsistent.
[0106] Step A300: If they are consistent, the current flow control channel is set as the preset flow control channel and the preset state lock is unlocked;
[0107] In step A400, if there is inconsistency, the current traffic control rule is replaced with the target traffic control policy, the current traffic control pipeline after the traffic control policy is replaced is set as the preset traffic control pipeline, and the preset state lock is opened.
[0108] It is understood that if the two are consistent, the current traffic control rules already meet the desired policy and the system can continue to operate; if the two are inconsistent, the system may need to adjust the current traffic control rules to make them meet the requirements of the target traffic control policy. This mechanism ensures the flexibility and adaptability of the traffic control system, and can dynamically adjust traffic management policies according to different needs and conditions.
[0109] It should be noted that the initial traffic is transmitted through the FIFO waiting queue, and the preset state lock is used to control whether the FIFO waiting queue is allowed to transmit traffic. The preset state lock and the FIFO waiting queue are constructed based on the ReentrantLock mechanism.
[0110] It's important to note that FIFO stands for "First-In-First-Out," a data structure in which the data that enters the queue first is processed first. In traffic control systems, FIFO queues are used to temporarily store and manage traffic data, ensuring that traffic is processed in the order it enters.
[0111] In this embodiment, after traffic enters the system, it is placed in a FIFO queue and waits to be processed and transmitted in a first-in, first-out order. This approach ensures that the order in which traffic is processed is fair and predictable.
[0112] The open state allows traffic to be transmitted from the FIFO waiting queue.
[0113] The closed state prevents traffic from being transmitted from the FIFO waiting queue, and the traffic in the queue will be temporarily "frozen".
[0114] In this embodiment, the preset state lock is used to determine whether the traffic in the FIFO queue can be processed and transmitted. This provides a flexible flow control method for the system, which can suspend or resume traffic transmission as needed.
[0115] The ReentrantLock mechanism is a reentrant locking mechanism widely used in multithreaded programming. It allows a thread to acquire the same lock multiple times without causing deadlock. ReentrantLock provides more flexible lock control than traditional synchronized methods, such as support for tryLock and setting lock timeouts.
[0116] Preset state locks and FIFO wait queues can use the advanced features provided by ReentrantLock to implement more complex synchronization and control logic. For example:
[0117] Thread safety: ReentrantLock ensures that operations on FIFO queues and state locks are safe in a multi-threaded environment, without data races or state inconsistencies.
[0118] Flexible lock control: With ReentrantLock, the system can implement more complex lock logic, such as pausing queue processing under certain conditions, or releasing the lock after a timeout.
[0119] It is understood that in this embodiment, after traffic enters the system, it will be placed in a FIFO queue and wait for processing in a first-in, first-out order. Through the state lock, the system can flexibly control whether traffic can be transmitted from the queue, thereby pausing and resuming traffic.
[0120] It's understandable that the implementation of the preset state lock and FIFO queue is based on the ReentrantLock mechanism, leveraging its thread-safe and flexible lock control features to ensure reliable and flexible flow control in a multi-threaded environment. This enables the flow control system to efficiently manage traffic while providing powerful concurrency control capabilities through the ReentrantLock mechanism.
[0121] Based on the first and second embodiments of the present application, in the third embodiment of the present application, the same or similar contents as those in the above-mentioned first and second embodiments can be referred to the above introduction and will not be repeated later.
[0122] On this basis, please refer to Figure 3 , the step S20 further includes steps B100 to B300:
[0123] Step B100: Read the target traffic control rule in the preset traffic control pipeline, wherein the target traffic control rule includes a traffic dimension sub-rule, a traffic control strategy sub-rule, and a traffic control period sub-rule;
[0124] In this embodiment, the system retrieves the target traffic control rule from its configuration or storage. This step is to obtain the specific rule content for subsequent traffic control operations.
[0125] Traffic dimension sub-rules are rules that classify and manage traffic from different perspectives or scopes. They determine the scope and targets of traffic control. For example, they can be based on traffic type (distinguishing between video traffic, audio traffic, and general data traffic), user group (distinguishing between ordinary users, VIP users, and enterprise users), time range (distinguishing between peak and off-peak traffic), and geographic location (distinguishing between traffic in different regions).
[0126] It can be understood that through the traffic dimension sub-rules, the system can carry out refined management of different types of traffic to ensure the rationality and fairness of resource allocation.
[0127] Traffic control policy sub-rules refer to specific traffic control methods or measures. They determine how traffic is handled, such as limiting traffic size, adjusting priorities, and discarding certain traffic. Examples include limiting traffic size (setting a maximum transmission rate for traffic), adjusting priorities (assigning higher priority to certain types of traffic), discarding traffic (discarding some traffic if it exceeds a limit), and redirecting traffic (redirecting traffic to another path or server).
[0128] It is understandable that traffic control policy sub-rules are the core part of traffic control, which directly determines the behavior and status of traffic.
[0129] The traffic control period sub-rule is the time range during which a traffic control rule takes effect. It determines when the traffic control rule begins and ends. For example, traffic control rules take effect from 8:00 AM to 6:00 PM daily as business hours, or the control period can be dynamically adjusted based on system load or user behavior.
[0130] It is understandable that through the traffic control period sub-rules, the system can flexibly adjust the traffic control strategy to adapt to different time and scenario requirements.
[0131] It can be understood that through the combination of traffic dimension sub-rules, traffic control strategy sub-rules and traffic control cycle sub-rules, the traffic control system can achieve refined management and dynamic adjustment of traffic to meet different business needs and system operation status.
[0132] Step B200: determining a first flow in the initial flow based on the flow dimension sub-rule;
[0133] The first traffic refers to the specific portion of the initial traffic that is filtered out according to the traffic dimension sub-rule. This may be traffic that meets certain conditions or characteristics. For example, if the traffic dimension sub-rule is "Filter out all video traffic," then the "first traffic" is all video traffic in the initial traffic. If the traffic dimension sub-rule is "Filter out traffic during peak hours," then the "first traffic" is the traffic generated during peak hours within the initial traffic.
[0134] In this embodiment, the system obtains the content of the traffic dimension sub-rule to understand from which angles or ranges the traffic needs to be filtered. Furthermore, the system analyzes the initial traffic and checks whether each part of the traffic meets the conditions of the traffic dimension sub-rule. The system filters out the traffic part that meets the traffic dimension sub-rule from the initial traffic. This part of the traffic is called the "first traffic". In this way, the traffic control system can manage the traffic in a refined manner, classify and process the traffic according to different dimensions, so as to achieve more efficient traffic control and resource allocation. For example, assuming that the traffic dimension sub-rule is "filter out all video traffic", and the initial traffic includes the following types: video traffic, audio traffic and ordinary data traffic, the system will filter out "video traffic" from the initial traffic according to the traffic dimension sub-rule, and this part of the traffic is the "first traffic".
[0135] Specifically, the control dimensions include business stages, business categories, and business scenarios. The step of determining the first flow in the initial flow based on the flow dimension sub-rules further includes steps B210 to B220:
[0136] Step B210, determining the service stage, service category, and service scenario corresponding to the initial traffic;
[0137] A business stage refers to a specific phase in a business process where traffic is located. Business processes are typically divided into multiple stages, each corresponding to a different operation or state. For example, in an e-commerce system, business stages may include: browsing (users browsing products on the website), ordering (users submitting orders), payment (users completing payments), shipping (merchants shipping goods), and after-sales (users requesting refunds or after-sales processing).
[0138] In this embodiment, the system needs to identify the service phase that the initial traffic is in. This is usually achieved by analyzing the characteristics of the traffic (such as the requested URL, carried parameters, user behavior, etc.).
[0139] It is understood that in this embodiment, by determining the business phase, the system can adopt different control strategies for traffic in different phases. For example, traffic in the payment phase may require higher priority and stricter protection, while traffic in the browsing phase may be appropriately restricted to save resources.
[0140] Business categories refer to the type of business or business area to which traffic belongs. Business categories are macro-categories of businesses, such as e-commerce (involving product browsing, ordering, and payment), finance (involving stock trading and bank transfers), video (involving video playback and live streaming), and social (involving user interaction and push notifications).
[0141] In this embodiment, by determining the major business categories, the system can classify and manage different types of business traffic. For example, financial traffic may require higher security and stability, while video traffic may require greater bandwidth and lower latency.
[0142] A business scenario refers to the specific business context or scenario in which traffic occurs. A business scenario further refines business stages and categories, describing the specific purpose or behavior of traffic. Examples include e-commerce (promotional events, daily shopping), finance (large-value transfers, small-value payments), and video (HD video playback, SD video playback).
[0143] It is understood that in this embodiment, by determining the business scenario, the system can manage traffic in a more refined manner. For example, in a promotional activity scenario, the system may need to increase bandwidth and server resources, while in a daily shopping scenario, resources can be appropriately reduced.
[0144] In this embodiment, the traffic control system determines the corresponding business stage, business category and business scenario by analyzing the characteristics of the initial traffic. The specific process is as follows: First, the system analyzes the characteristics of the traffic and identifies the stage in the business process where the traffic is located (such as browsing, ordering, payment, etc.). Then, the system further analyzes the characteristics of the traffic and identifies the business type to which the traffic belongs (such as e-commerce, finance, video, etc.). Furthermore, based on the specific characteristics of the traffic, the system identifies the specific business context in which the traffic is located (such as promotional activities, large transfers, high-definition video playback, etc.). Through these three steps, the system can fully understand the business attributes of the traffic, thereby allocating appropriate resources and control strategies to the traffic, ensuring the efficient operation of the system and user experience.
[0145] For example, suppose the initial traffic comes from an e-commerce platform. By analyzing the traffic characteristics, the system determines that the user corresponding to the traffic is submitting an order, so the business phase is "order phase." Because the traffic comes from the e-commerce platform, the business category is "e-commerce." Because the traffic occurs during a promotional event, the business scenario is "promotional event scenario."
[0146] In this embodiment, through this information, the system can allocate higher priority and more resources to this part of the traffic to ensure that users have a smooth ordering experience during the promotion period.
[0147] Step B220: Determine the first flow in the initial flow based on the flow dimension sub-rules, the business stage, the business category and the business scenario.
[0148] It can be understood that in this embodiment, the traffic control system screens out the traffic part that meets all conditions from the initial traffic by comprehensively analyzing the traffic dimension sub-rules, business stages, business categories and business scenarios.
[0149] Step B300: Based on the traffic control strategy sub-rule and the traffic control period sub-rule, control the first traffic and obtain a traffic control result.
[0150] It is understood that in this embodiment, the system obtains the content of the traffic control policy sub-rule to understand the specific control measures to be taken on the traffic. At the same time, the system obtains the content of the traffic control period sub-rule to understand the time range when the traffic control policy is effective.
[0151] Furthermore, the system applies the traffic control policy sub-rule to the first flow within the specified time range based on the traffic control period sub-rule. The system records and provides feedback on the traffic status after the control operation, such as whether the flow is restricted or the priority is adjusted. In this way, the traffic control system can flexibly and finely manage and dynamically adjust traffic to meet different business needs and system operating conditions.
[0152] For example, suppose the primary traffic is video traffic during a promotion on an e-commerce platform. The system controls it according to the following rules:
[0153] Traffic control policy sub-rule: Limit the transmission rate of video traffic to 1 MB per second.
[0154] Traffic control period sub-rule: This policy takes effect from 10:00 to 12:00 every day.
[0155] The system limits the transmission rate of this portion of video traffic to 1MB per second between 10:00 AM and 12:00 PM daily. The resulting traffic control results show that the video traffic transmission rate is successfully limited to 1MB per second during the control period and returns to normal outside of the control period.
[0156] It is understandable that through this management and control method, the system can optimize resource allocation during promotional activities to ensure a balance between user experience and system performance.
[0157] Specifically, the control strategy includes a traffic feature control sub-strategy, a traffic threshold control sub-strategy, and a traffic switch control sub-strategy. The step of controlling the first traffic based on the traffic control strategy sub-rules and the traffic control cycle sub-rules to obtain the traffic control result also includes steps B310 to B330:
[0158] Step B310: Read the traffic feature control sub-policy, traffic threshold control sub-policy, and traffic switch control sub-policy in the traffic control policy sub-rules;
[0159] Step B320: determining a target flow in the first flow based on one or more of the flow feature control sub-strategy, the flow threshold control sub-strategy, and the flow switch control sub-strategy;
[0160] Step B330: Based on the traffic control period sub-rule, control the traffic switch to control the target traffic and obtain a traffic control result.
[0161] Traffic feature control sub-policies refer to control rules defined based on certain traffic characteristics, such as traffic type, protocol type, user ID, device type, etc. These characteristics are used to identify and classify traffic.
[0162] It is understood that through the traffic feature control sub-policy, the system can identify traffic that meets specific characteristics and then conduct targeted control on it. For example, it can identify all traffic from mobile devices or all traffic using the HTTPS protocol.
[0163] Traffic threshold control sub-policies are defined based on traffic volume (such as bandwidth usage, data transfer volume, request frequency, etc.). These thresholds are used to limit the volume or frequency of traffic.
[0164] It is understandable that through the traffic threshold control sub-strategy, the system can quantitatively manage traffic, such as limiting the traffic of a certain user or service to no more than a certain value, or limiting the request frequency to prevent system overload.
[0165] Traffic on / off control sub-policies are rules that control whether traffic passes through a switch (e.g., enable or disable). This policy is often used to quickly enable or disable certain traffic to respond to emergencies or perform maintenance.
[0166] It can be understood that through the traffic switch control sub-strategy, the system can flexibly control the transmission status of traffic, such as shutting down certain traffic when the system load is too high, or disabling the traffic of specific services during maintenance.
[0167] In this embodiment, the system can determine the target traffic that needs to be further controlled based on one or more conditions in the traffic feature control sub-strategy, the traffic threshold control sub-strategy, and the traffic switch control sub-strategy. By comprehensively considering the traffic characteristics, traffic size, and switch status, the system can more accurately identify the traffic portion that needs to be controlled. For example: if the traffic feature control sub-strategy requires that all video traffic be screened out, and the traffic threshold control sub-strategy requires that the traffic size exceed 100KB / s, then the target traffic is the traffic in the first traffic that meets these two conditions. If the traffic switch control sub-strategy requires that the traffic of a specific service be shut down, then the target traffic is all traffic of that service.
[0168] It can be understood that in this way, the traffic control system can flexibly and dynamically manage and control traffic to meet different business needs and system operating conditions.
[0169] Specifically, the step of controlling the first traffic based on the traffic control strategy sub-rule and the traffic control period sub-rule to obtain the traffic control result further includes steps C100 to C200:
[0170] Step C100: Read the control effective date and control expiration date in the traffic control period sub-rule;
[0171] Step C200: Based on the control effective date, the control expiration date and the traffic control policy sub-rules, the first traffic is controlled to obtain a traffic control result.
[0172] The traffic control period sub-rule is part of a traffic control rule and is used to define the time range in which the traffic control policy takes effect. It determines when the traffic control policy begins and ends.
[0173] Through the traffic control period sub-rules, the system can flexibly control the effective time of the traffic control policy to adapt to different business needs and system operating status.
[0174] The effective date is the specific date on which the traffic control policy takes effect. For example, a traffic control policy might take effect on June 20, 2025. The system will begin enforcing the traffic control policy after the effective date to ensure that traffic control operations begin at the correct time.
[0175] The expiration date is the specific date when a traffic control policy expires. For example, a traffic control policy might expire on June 25, 2025. The system stops enforcing the traffic control policy after the expiration date to ensure that traffic control operations end at the correct time.
[0176] In this embodiment, the system determines the effective time range of the traffic control policy based on the control effective date and the control expiration date. The traffic control policy will only be applied within this time range.
[0177] For example, if the control effective date is June 20, 2025, and the control expiration date is June 25, 2025, the traffic control policy will only take effect between June 20, 2025 and June 25, 2025.
[0178] In addition, it should be noted that the traffic control method proposed in this application can be applied to a single embodiment or to multiple embodiments in a distributed system.
[0179] In a single embodiment, the traffic control device responds to the traffic control instruction and adjusts the single traffic control pipeline in the single system based on the traffic control rules to control the single system to control the traffic and obtain the traffic control instruction. When the traffic control device controls the single system to control the traffic, it can be real-time control or a preset control cycle.
[0180] The traffic control method is applied to a single embodiment scenario, which can be:
[0181] During large-scale promotional events, an e-commerce company's server system faces enormous traffic pressure. To ensure stable system operation and prevent server crashes or slow responses due to excessive traffic, the company needs to expand the database and, in turn, manage traffic.
[0182] First, a professional traffic control device is deployed at the front end of the e-commerce company's server system. This device can monitor and analyze the traffic entering the system in real time.
[0183] Then, based on experience from previous promotions and system performance assessments, traffic control rules are set. For example, traffic control is initiated when the traffic entering the system exceeds 10,000 requests per second.
[0184] After the promotion began, the traffic control device monitored a sharp increase in traffic through the product browsing pipeline in real time, exceeding the preset threshold (10,000 requests / second). This automatically triggered traffic control instructions. Based on the traffic control rules, the traffic control device adjusted the product browsing pipeline, redirecting traffic exceeding the threshold to a new server to ensure stable system operation. By enabling the traffic control device to control individual traffic control pipelines within a single system in real time and on a pre-set basis, the e-commerce company's server system operated stably during the promotion, with no system crashes or extended freezes caused by excessive traffic. Users enjoyed a positive shopping experience, and the promotion ran smoothly.
[0185] In many implementations, the existence of multiple instances can lead to traffic distribution errors due to differences in the time it takes for control policies to be loaded into the cache or received. To address this, a control date element has been added to the control model. By presetting the control start date (using a common reference standard, rather than the time the control policy is loaded into the cache), the control policy is delayed until a future date, thereby avoiding time differences in control effectiveness between multiple instances.
[0186] Specifically, the traffic control device responds to the traffic control instruction and performs the same traffic control on multiple distributed systems. First, the traffic control device determines the traffic control period (start time and end time, where the start time and end time are both at a certain moment in the future). Then, the traffic control device sets the traffic control period for multiple distributed systems. Furthermore, each subsystem in the multiple distributed systems executes the traffic control strategy at the same time based on the pre-set traffic control period and with reference to the same time standard, to ensure that multiple devices perform traffic control at the same time and avoid confusion in traffic distribution.
[0187] The traffic control method is applied to multiple scenarios, which can be:
[0188] A large internet finance company recently launched a new wealth management product sales business, which involves multiple distributed systems, including user registration, fund management, product display, and order processing. Due to the complexity of the business and its high stability requirements, traffic control was required for these distributed systems to ensure smooth operation during the initial launch and avoid system crashes or data corruption caused by excessive traffic.
[0189] The specific implementation process is as follows:
[0190] Deploy a high-performance traffic control device in the company's data center. The device can communicate with multiple distributed systems and has powerful policy management and execution capabilities.
[0191] First, we developed a traffic control strategy based on the expected traffic volume and system performance assessment during the initial launch phase. For example, we limited the traffic received by each distributed system to no more than 500 requests per second and prioritized different types of traffic (such as user registration traffic, product query traffic, and order submission traffic) based on business priorities.
[0192] The traffic control device then determines the traffic control period, starting at 9:00 AM on the day the service goes online and ending at 5:00 PM on the same day. This time range is based on the estimated peak traffic period during the initial launch of the service.
[0193] Furthermore, a control date element is added to the control model, setting the effective time of the control policy to 9:00 AM on the day the business goes online. This time is a unified reference standard, rather than being determined based on the time when each distributed system loads the control policy cache.
[0194] Finally, the traffic control device distributes the traffic control policy, including the control date, to multiple distributed systems simultaneously. After receiving the policy, each subsystem simultaneously executes the traffic control policy at 9:00 AM based on the pre-set traffic control period and the unified reference time standard.
[0195] At 9:00 AM on the day of the service launch, all distributed systems, including the user registration system, fund management system, product display system, and order processing system, simultaneously began implementing traffic control policies. Each system controlled traffic according to the established traffic limits and priority rules, ensuring orderly traffic distribution and avoiding traffic dislocation caused by time differences in control implementation between multiple instances.
[0196] As can be seen, by introducing a control date element and establishing a unified control cycle, the traffic control equipment successfully coordinated the simultaneous execution of traffic control policies across multiple distributed systems. During the initial rollout, each system operated stably, traffic distribution was orderly, and no system failures or data errors caused by excessive traffic or control errors occurred. This effectively mitigated time differences between instances, ensuring that multiple distributed systems could simultaneously implement traffic control and ensuring a smooth rollout of new services.
[0197] It should be noted that the above examples are only used to understand this application and do not constitute a limitation on the traffic control method of this application. More simple transformations based on this technical concept are all within the scope of protection of this application.
[0198] This application also provides a flow control device, please refer to Figure 4 , the flow control device includes:
[0199] An acquisition module 10, configured to acquire an initial flow rate in response to a flow control instruction;
[0200] The control module 20 is used to control the initial traffic based on a preset traffic control pipeline to obtain a traffic control result, wherein the traffic control rules in the preset traffic control pipeline can be dynamically adjusted based on a preset state lock, and the traffic control rules include control dimensions, control strategies and control cycles.
[0201] In one embodiment, the flow control device further includes a setting module, and the setting module includes:
[0202] a first acquiring unit, configured to acquire a target traffic control rule based on the traffic control instruction, and disable a preset state lock, wherein the preset state lock is configured to allow or block traffic transmission;
[0203] A second acquisition unit is configured to acquire a current traffic control rule in a current traffic control pipeline and determine whether the target traffic control policy is consistent with the current traffic control rule;
[0204] A setting unit, configured to set the current flow control pipeline as the preset flow control pipeline and unlock the preset state lock if the two are consistent;
[0205] The replacement unit is used to replace the current traffic control rule with the target traffic control policy if there is inconsistency, set the current traffic control pipeline after the traffic control policy is replaced as the preset traffic control pipeline, and open the preset state lock.
[0206] In one embodiment, the setting module is further configured to implement:
[0207] The initial traffic is transmitted through the FIFO waiting queue, and the preset state lock is used to control whether the FIFO waiting queue is allowed to transmit traffic. The preset state lock and the FIFO waiting queue are constructed based on the ReentrantLock mechanism.
[0208] In one embodiment, the control module further includes:
[0209] A first reading unit is configured to read a target traffic control rule in a preset traffic control pipeline, wherein the target traffic control rule includes a traffic dimension sub-rule, a traffic control strategy sub-rule, and a traffic control period sub-rule;
[0210] a first determining unit, configured to determine a first flow in the initial flow based on the flow dimension sub-rule;
[0211] The first control unit is used to control the first traffic based on the traffic control strategy sub-rule and the traffic control period sub-rule to obtain a traffic control result.
[0212] In one embodiment, the control module further includes:
[0213] A second determining unit is used to determine the business stage, business category and business scenario corresponding to the initial traffic;
[0214] The third determining unit is used to determine the first flow in the initial flow based on the flow dimension sub-rule, the business stage, the business category and the business scenario.
[0215] In one embodiment, the control module further includes:
[0216] The second reading unit is used to read the traffic feature control sub-policy, traffic threshold control sub-policy and traffic switch control sub-policy in the traffic control policy sub-rules;
[0217] a fourth determining unit, configured to determine a target flow in the first flow based on one or more of the flow feature control sub-strategy, the flow threshold control sub-strategy, and the flow switch control sub-strategy;
[0218] The second control unit is used to control the flow switch based on the flow control period sub-rule to control the target flow and obtain a flow control result.
[0219] In one embodiment, the control module further includes:
[0220] The third reading unit is used to read the control effective date and control expiration date in the traffic control period sub-rule;
[0221] The third control unit is used to control the first traffic based on the control effective date, the control expiration date and the traffic control policy sub-rule to obtain a traffic control result.
[0222] The flow control device provided in this application utilizes the flow control method described in the aforementioned embodiments to address the technical issues surrounding flow control. Compared to related technologies, the beneficial effects of the flow control device provided in this application are the same as those of the flow control method described in the aforementioned embodiments. Other technical features of the flow control device are the same as those disclosed in the aforementioned embodiments and are not further elaborated upon here.
[0223] The present application provides a traffic control device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the traffic control method in the above-mentioned embodiment one.
[0224] Reference below Figure 5, which shows a schematic diagram of the structure of a traffic control device suitable for implementing the embodiments of the present application. The traffic control device in the embodiments of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The traffic control device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.
[0225] like Figure 5 As shown, the traffic control device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 1002 or programs loaded from a storage device 1003 into a random access memory (RAM) 1004. RAM 1004 also stores various programs and data required for the operation of the traffic control device. The processing device 1001, ROM 1002, and RAM 1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the traffic control device to communicate with other devices wirelessly or wired to exchange data. Although the figure shows a traffic control device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.
[0226] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0227] The flow control device provided in this application, using the flow control method in the above-mentioned embodiment, can solve the technical problem. Compared with the related art, the beneficial effects of the flow control device provided in this application are the same as the beneficial effects of the flow control method provided in the above-mentioned embodiment, and the other technical features of the flow control device are the same as those disclosed in the above-mentioned embodiment, and are not further described here.
[0228] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0229] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
[0230] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the traffic control method in the above-mentioned embodiment.
[0231] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0232] The computer-readable storage medium may be included in the flow control device; or it may exist independently without being assembled into the flow control device.
[0233] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the traffic control device, the traffic control device:
[0234] Responding to a traffic control instruction, obtaining an initial traffic flow;
[0235] Based on the preset traffic control pipeline, the initial traffic is controlled to obtain a traffic control result, wherein the traffic control rules in the preset traffic control pipeline can be dynamically adjusted based on the preset state lock, and the traffic control rules include control dimensions, control strategies and control cycles.
[0236] Computer program code for performing the operations of the present application may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0237] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.
[0238] The modules described in the embodiments of the present application may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.
[0239] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-mentioned traffic control method, which can solve the technical problems of traffic control. Compared with related technologies, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the traffic control method provided in the above-mentioned embodiments, and will not be elaborated here.
[0240] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned traffic control method when executed by a processor.
[0241] The computer program product provided in this application can solve the technical problem of traffic control. Compared with the related art, the beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the traffic control method provided in the above embodiment, and will not be repeated here.
[0242] The above description is only part of the embodiments of the present application and does not limit the scope of protection of the present application. All equivalent structural transformations made by using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the scope of protection of the present application.
Claims
1. A flow control method, characterized in that: The flow control method includes: Responding to a traffic control instruction, obtaining an initial traffic flow; Based on the preset traffic control pipeline, the initial traffic is controlled to obtain a traffic control result, wherein the traffic control rules in the preset traffic control pipeline can be dynamically adjusted based on the preset state lock, and the traffic control rules include control dimensions, control strategies and control cycles.
2. The flow control method according to claim 1, wherein: Before the step of controlling the initial flow based on the preset flow control pipeline to obtain the flow control result, the method further includes: Based on the traffic control instruction, obtain the target traffic control rule and close the preset state lock, wherein the preset state lock is used to allow traffic transmission or block traffic transmission; Obtaining the current traffic control rules in the current traffic control pipeline, and determining whether the target traffic control strategy is consistent with the current traffic control rules; If they are consistent, the current flow control pipeline is set as the preset flow control pipeline and the preset status lock is opened; If they are inconsistent, the current traffic control rule is replaced with the target traffic control policy, the current traffic control pipeline after the replacement of the traffic control policy is set as the preset traffic control pipeline, and the preset status lock is opened.
3. The flow control method according to claim 2, wherein: The initial traffic is transmitted through the FIFO waiting queue, and the preset state lock is used to control whether the FIFO waiting queue is allowed to transmit traffic. The preset state lock and the FIFO waiting queue are constructed based on the ReentrantLock mechanism.
4. The flow control method according to claim 1, wherein: The step of controlling the initial flow based on the preset flow control pipeline to obtain a flow control result further includes: Reading a target traffic control rule in a preset traffic control pipeline, wherein the target traffic control rule includes a traffic dimension sub-rule, a traffic control strategy sub-rule, and a traffic control period sub-rule; Determining a first flow in the initial flow based on the flow dimension sub-rule; Based on the traffic control strategy sub-rule and the traffic control period sub-rule, the first traffic is controlled to obtain a traffic control result.
5. The flow control method according to claim 4, wherein: The control dimensions include business stages, business categories, and business scenarios. The step of determining the first flow in the initial flow based on the flow dimension sub-rules further includes: Determine the business stage, business category, and business scenario corresponding to the initial traffic; Based on the traffic dimension sub-rules, the business stage, the business category and the business scenario, the first traffic in the initial traffic is determined.
6. The flow control method according to claim 4, wherein: The control strategy includes a traffic feature control sub-strategy, a traffic threshold control sub-strategy, and a traffic switch control sub-strategy. The step of controlling the first traffic based on the traffic control strategy sub-rules and the traffic control period sub-rules to obtain a traffic control result further includes: Read the traffic feature control sub-policy, traffic threshold control sub-policy, and traffic switch control sub-policy in the traffic control policy sub-rules; Determining a target flow in the first flow based on one or more of the flow feature control sub-strategy, the flow threshold control sub-strategy, and the flow switch control sub-strategy; Based on the flow control period sub-rule, the flow switch is controlled to control the target flow and obtain a flow control result.
7. The flow control method according to claim 4, wherein: The step of controlling the first traffic based on the traffic control strategy sub-rule and the traffic control period sub-rule to obtain a traffic control result further includes: Read the control effective date and control expiration date in the traffic control cycle sub-rule; Based on the control effective date, the control expiration date and the traffic control policy sub-rules, the first traffic is controlled to obtain a traffic control result.
8. A flow control device, characterized in that: The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the traffic control method according to any one of claims 1 to 7.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the traffic control method according to any one of claims 1 to 7 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the traffic control method according to any one of claims 1 to 7 are implemented.