Network traffic distribution control method and device, medium and equipment
By acquiring and sorting the input time and port processing rate of network traffic data, giving priority to distributing early data and estimating the output time, the problem of unbalanced allocation of network ports in traditional methods is solved, and efficient network traffic distribution and processing is achieved.
Patent Information
- Application Number
- CN202411528212.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-10-30
AI Technical Summary
Traditional network traffic distribution methods fail to effectively consider the dynamic changes in traffic data, resulting in unbalanced distribution of network ports, data congestion or idleness, reducing network transmission efficiency and stability.
By obtaining the input time, data volume and port processing rate of the target traffic data, sorting and prioritizing the distribution of early data, combining the data queue and processing rate to estimate the output end time, selecting the optimal output port for distribution.
It improves the efficiency of network traffic distribution, reduces data queueing waiting time, and ensures fast processing and efficient distribution of network interactions.
Smart Images

Figure CN119276798A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a network traffic distribution control method, device, medium and equipment. Background Art
[0002] Nowadays, the management of network traffic has become crucial. With the development of the digital age and the increasing number of network applications, the data traffic in the network has shown the characteristics of diversity and high traffic. Network traffic data needs to be processed and transmitted through different ports. How to reasonably distribute traffic data plays an important role in the transmission process of network data.
[0003] Traditional network traffic distribution methods are often relatively simple, such as those based on static routing or simple load balancing strategies, which do not fully consider the characteristics of traffic data itself and the characteristics of dynamic changes. When facing complex network environments and diverse traffic data, if reasonable distribution control cannot be performed based on the real-time situation of traffic data, some ports may be congested while other ports are idle or underutilized. This unbalanced traffic distribution will not only reduce network transmission efficiency and operational stability, increase data transmission delays, but may also affect the quality of network services.
[0004] Therefore, how to improve the efficiency of network traffic distribution has become an urgent problem to be solved. Summary of the invention
[0005] In view of the above technical problems, the technical solution adopted by the present invention is a network traffic distribution control method, which includes the following steps:
[0006] S100, obtaining N target traffic data, the data volume corresponding to each target traffic data, the data input time and a number of target ports, and the data processing rate and initial data volume corresponding to each target port, wherein N is an integer greater than 1.
[0007] S200, according to the data input time corresponding to each target flow data and a number of target ports, obtain the data input queues corresponding to N target flow data and the 0th target flow data queue corresponding to each target port.
[0008] S300, initializing i=1.
[0009] S400, according to several target ports corresponding to each target traffic data, the output port corresponding to the i-1th target traffic data and the i-1th target traffic data queue corresponding to each target port, the i-th target traffic data queue corresponding to each target port is obtained.
[0010] S500, for any target port, based on the i-th target traffic data queue corresponding to the current target port, the data volume corresponding to each target traffic data, the data processing rate corresponding to the current target port and the initial data volume, obtain the output end time corresponding to each target traffic data in the i-th target traffic data queue corresponding to the current target port at the current target port.
[0011] S600, acquiring the output port corresponding to the i-th target flow data according to the output end time corresponding to each corresponding target port of the i-th target flow data in the data input queue.
[0012] S700, according to the output port corresponding to the i-th target flow data, update i=i+1, return to execute step S400, until i=N, and obtain the output ports corresponding to the 1st to Nth target flow data respectively.
[0013] S800, distribute each target flow data to the corresponding output port.
[0014] The present invention also provides a non-transitory computer-readable storage medium, in which at least one instruction or at least one program is stored, and the at least one instruction or at least one program is loaded and executed by a processor to implement the above-mentioned network traffic distribution control method.
[0015] The present invention also provides an electronic device, comprising a processor and the above-mentioned non-transitory computer-readable storage medium.
[0016] The present invention has at least the following beneficial effects: sorting the target traffic data according to the data input time corresponding to the target traffic data in order from early to late, giving priority to port screening and distribution control for target traffic data input earlier, avoiding the backlog of early data by subsequent data while waiting for processing, reducing the queuing waiting time of early data, thereby accelerating the network interaction process, and accurately obtaining the target traffic data queue corresponding to each target port in each iterative step, and determining the output end time of each target traffic data in the i-th target traffic data queue corresponding to any target port at the port by comprehensively considering factors such as the target traffic data queue, data volume, port data processing rate and initial data volume, so as to achieve accurate estimation of the processing time of the target traffic data, thereby selecting the optimal output port to achieve efficient distribution and rapid processing of the target traffic data, thereby improving the efficiency of network traffic distribution. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0018] Figure 1 A flowchart of a network traffic distribution control method provided in Example 1 of the present invention. DETAILED DESCRIPTION
[0019] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0020] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It is understood that, where appropriate, the above-mentioned terms used to distinguish similar objects can be interchanged so that the present invention can also implement other embodiments other than the above-mentioned illustrated embodiments or described embodiments. In addition, the terms "including" and "having" and any variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0021] Embodiment 1
[0022] This embodiment provides a network traffic distribution control method, the network traffic distribution control method includes the following steps: Figure 1 As shown:
[0023] S100, obtaining N target traffic data, the data volume corresponding to each target traffic data, the data input time and a number of target ports, and the data processing rate and initial data volume corresponding to each target port, wherein N is an integer greater than 1.
[0024] Among them, target traffic data refers to various data generated and transmitted between the network user end and the server end, which needs to be reasonably transmitted through the traffic distribution method. The target traffic data can include data packet header information and data payload, wherein the data packet header information contains key information such as source IP address, destination IP address, source port, destination port, protocol type (such as TCP, UDP), etc., which is used to determine the source, destination and transmission method of data in the network. Data payload is the core content of network traffic data, that is, the data actually to be transmitted, which can be various types of data such as text, images, audio, video, application data, etc. Taking online video services as an example, video stream data is the data payload part of network traffic data. The size and format of the data payload depends on the specific application scenario and the network service adopted.
[0025] For example, target traffic data may include data generated when users visit websites, use mobile applications, and so on. For example, when users browse products on e-commerce websites, the data generated by each click and search operation of the user will form network traffic. These data include user request information, such as instructions for requesting to view a certain product detail page, and its data content includes the user's IP address, request time, requested webpage URL, etc. Target traffic data may also include relevant data such as response data and push data generated by the server. For example, for online game servers, the server needs to continuously send game scene update data, other players' operation data, and other data to the player client. The size, frequency, and importance of the data vary. When transmitted in the network, network traffic is formed, and it needs to be reasonably transmitted to the client through traffic distribution methods.
[0026] Data input time refers to the time it takes to call the target traffic data to be output from the port, and can represent the order in which the target traffic data is screened and processed by the port.
[0027] The data processing rate refers to the amount of data that the corresponding port can process per unit time. It is usually measured in units such as bits per second (bps), kilobits per second (kbps), megabits per second (Mbps) or gigabits per second (Gbps), reflecting the data transmission and processing capabilities of the corresponding port.
[0028] The initial data volume refers to the amount of unprocessed data in the traffic data being processed by each port when the first target traffic data is called for distribution and output. Correspondingly, before processing the gradually input new target traffic data, the port needs to first process the data corresponding to the initial data volume.
[0029] In a specific implementation, a number of target ports corresponding to each target flow data are obtained by the following steps:
[0030] S10, obtaining N target flow data, device information corresponding to each target flow data, a number of preset distribution rules, and a preset field name combination and a preset port corresponding to each preset distribution rule.
[0031] S20: For any target flow data, extract all initial field names corresponding to the target flow data and first intermediate flow data corresponding to each initial field name.
[0032] S30, according to all the initial field names and the first intermediate flow data corresponding to each initial field name, all the initial field name combinations corresponding to the target flow data and the second intermediate flow data corresponding to each initial field name combination are acquired.
[0033] S40, according to each preset field name combination, the preset distribution rule corresponding to each preset field name combination, each initial field name combination and the second intermediate traffic data corresponding to each initial field name combination, filter out the target distribution rule corresponding to each second intermediate traffic data from all the preset distribution rules.
[0034] S50, matching each second intermediate traffic data with the corresponding target distribution rule, and obtaining a hit result between each second intermediate traffic data and the corresponding target distribution rule.
[0035] S60, acquiring the target port corresponding to each second intermediate traffic data according to the hit result between each second intermediate traffic data and the corresponding target distribution rule, and the preset port corresponding to each target distribution rule.
[0036] S70, acquiring a plurality of target ports corresponding to the target flow data according to the target port corresponding to each second intermediate flow data.
[0037] Among them, the device information may include the device number, slot number and board number, which are used to identify the physical transmission line status of the target flow data. When the target flow data is transmitted on the physical line, the device number can be used to track the device path through which the target flow data passes, the slot number can help determine the specific module path through which the target flow data passes, and the board number can indicate the processing path of the target flow data inside the device.
[0038] The preset distribution rules and their corresponding preset field name combinations are used to determine whether the target traffic data complies with the output rules of the corresponding port. The specific preset distribution rules and the corresponding preset field name combinations can be set by the implementer according to actual conditions.
[0039] For example, the preset distribution rules in this embodiment may include distribution rules based on quintuples, and the corresponding preset field name combination may include source IP address, destination IP address, source port, destination port and protocol type. Based on the distribution rules of feature codes, the corresponding preset field name combination may include source IP address feature code, destination IP address feature code, source port feature code, destination port feature code, network layer protocol feature code, transport layer protocol feature code, application layer protocol feature code, text content feature code and binary content feature code. Based on the distribution rules of authentication accounts, the corresponding preset field name combination may include account type, authentication status, authentication method, department and account authority level. Based on the distribution rules of audio and video, the corresponding preset field name combination may include protocol type and audio and video encoding format. Based on the distribution rules of attachment types carried by HTTP messages, the corresponding preset field name combination may include data type and file extension name. Based on the distribution rules of domain names, the corresponding preset field name combination may include domain names and domain name suffixes. Based on the distribution rules of models, the corresponding preset field name combination may include model identifiers and model parameters.
[0040] Therefore, field extraction and corresponding data extraction are performed on the target traffic data to obtain all initial field names corresponding to the target traffic data and the first intermediate traffic data corresponding to each initial field name as filtering preset distribution rules, thereby determining the target port to control data distribution transmission.
[0041] The first intermediate flow data refers to data representing the specific content of the corresponding initial field name.
[0042] Each preset distribution rule may correspond to a single or multiple field names. Therefore, this embodiment can randomly combine all the initial field names to obtain the initial field name combination for matching with the preset field name combination corresponding to the preset distribution rule, so as to filter out the target distribution rule corresponding to the target traffic data from the preset distribution rules.
[0043] At the same time, according to the first intermediate traffic data corresponding to each initial field name, the first intermediate traffic data corresponding to all the initial field names in each initial field name combination are combined, and the second intermediate traffic number corresponding to each initial field name combination is obtained, which is used to match the corresponding target distribution rule as the basis for controlling the distribution of the target traffic data.
[0044] The specific content of the target distribution rules includes requirements for traffic data. Taking the distribution rules based on authenticated accounts as an example, the specific content may be that the account type is a personal account, the authentication status is authenticated, the authentication method is mobile phone number authentication, the department is Department A, and the account authority level is general authority.
[0045] Therefore, each second intermediate traffic data is matched with the corresponding target distribution rule to determine whether each second intermediate traffic data meets the requirements of the corresponding target distribution rule, thereby obtaining a hit result between each second intermediate traffic data and the corresponding target distribution rule.
[0046] The hit result includes a hit and a miss. Correspondingly, if the second intermediate flow data meets the requirements in the corresponding target distribution rule, the hit result between the second intermediate flow data and the corresponding target distribution rule is determined to be a hit, and the target flow data can be output through the preset port corresponding to the target distribution rule. If the second intermediate flow data does not meet the requirements in the corresponding target distribution rule, the hit result between the second intermediate flow data and the corresponding target distribution rule is determined to be a miss, and the target flow data does not need to be output through the preset port corresponding to the target distribution rule.
[0047] In a specific implementation, S40 includes the following steps:
[0048] S401, for any initial field name combination, match the current initial field name combination with each preset field name combination, and obtain a matching result between the current initial field name combination and each preset field name combination, wherein the matching result includes a match and a mismatch.
[0049] S402, for any preset field name combination, if the matching result between the current initial field name combination and the current preset field name combination is a match, the preset distribution rule corresponding to the current preset field name combination is determined as the target distribution rule corresponding to the second intermediate traffic data corresponding to the current initial field name combination.
[0050] S403, traverse all initial field name combinations and all preset field name combinations to obtain a target distribution rule corresponding to each second intermediate traffic data.
[0051] Among them, when all the field names in the initial field name combination are consistent with all the field names in the current preset field name combination, it can be determined that the matching result between the current initial field name combination and the current preset field name combination is a match, and the preset distribution rule corresponding to the current preset field name combination can be determined as the target distribution rule corresponding to the second intermediate flow data corresponding to the current initial field name combination, so that the target distribution rule can be used to perform a hit judgment on the corresponding second intermediate flow data as the basis for distributing the target flow data, which can ensure that the target flow data is accurately distributed to the appropriate processing port, thereby improving the distribution accuracy of the network flow distribution system and avoiding efficiency problems and safety hazards caused by blind distribution.
[0052] In a specific implementation, the hit result includes a hit and a miss, and S60 includes the following steps:
[0053] S601, for any second intermediate traffic data, if the hit result between the current second intermediate traffic data and the corresponding target distribution rule is a hit, the preset port corresponding to the target distribution rule corresponding to the current second intermediate traffic data is determined as the target port corresponding to the current second intermediate traffic data.
[0054] S602, traverse all the second intermediate flow data, and obtain the target port corresponding to each second intermediate flow data.
[0055] S200, according to the data input time corresponding to each target flow data and a number of target ports, obtain the data input queues corresponding to N target flow data and the 0th target flow data queue corresponding to each target port.
[0056] In a specific implementation, S200 includes the following steps:
[0057] S210, sorting the N target flow data in order of data input time from early to late, and obtaining data input queues corresponding to the N target flow data.
[0058] S220, according to the target port corresponding to each target flow data, obtain all target flow data corresponding to each target port.
[0059] S230, for any target port, sort all target flow data corresponding to the current target port in order of data input time from earliest to latest, and obtain the 0th target flow data queue corresponding to the current target port.
[0060] As described above, the target traffic data is sorted according to the data input time corresponding to the target traffic data from early to late, and the port screening and distribution control are performed preferentially on the target traffic data input earlier, thereby avoiding the backlog of early data by subsequent data while waiting for processing, reducing the queuing waiting time of early data, and thus accelerating the network interaction process.
[0061] S300, initializing i=1.
[0062] S400, according to a number of target ports corresponding to each target traffic data, an output port corresponding to the i-1th target traffic data and an i-1th target traffic data queue corresponding to each target port, the i-th target traffic data queue corresponding to each target port is obtained.
[0063] In a specific implementation, when i=1, the 0th target flow data and the output port corresponding to the 0th target flow data are both empty.
[0064] Among them, when i=1, it is clear that the output ports corresponding to the 0th target flow data and the 0th target flow data are both empty, which serves as the initial state of the entire process and provides a benchmark for subsequent iterative operations.
[0065] In a specific implementation, S400 includes the following steps:
[0066] S410, determining the i-1th target flow data queue corresponding to the output port corresponding to the i-1th target flow data as the i-th target flow data queue corresponding to the output port corresponding to the i-1th target flow data.
[0067] S420, according to a number of target ports corresponding to each target flow data and an output port corresponding to the i-1th target flow data, a target port other than the output port corresponding to the i-1th target flow data is determined as a non-output port corresponding to the i-1th target flow data.
[0068] S430, delete the i-1th target traffic data from the i-1th target traffic data queue corresponding to the non-output port corresponding to the i-1th target traffic data, and obtain the i-th target traffic data queue corresponding to the non-output port corresponding to the i-1th target traffic data.
[0069] Among them, when transitioning from the i-1 step to the i-th step, for the output port corresponding to the previous target traffic data, its queue will naturally continue to the next iteration step when there is no new operation impact. For the non-output port corresponding to the previous target traffic data, the target traffic data queue corresponding to the non-output port is updated by removing the target traffic data that has been processed at other ports (i.e., the output port corresponding to the i-1th target traffic data), so as to ensure that the queue data of each port accurately reflects the current traffic processing situation, so that the target traffic data queue corresponding to each target port can be accurately obtained in each iteration step (i from 1 to N), which provides an important data basis for determining the output end time of each target traffic data at the port and other subsequent traffic data distribution control operations, thereby improving the efficiency of network traffic distribution and the quality of network services.
[0070] S500, for any target port, based on the i-th target traffic data queue corresponding to the current target port, the data volume corresponding to each target traffic data, the data processing rate corresponding to the current target port and the initial data volume, obtain the output end time corresponding to each target traffic data in the i-th target traffic data queue corresponding to the current target port at the current target port.
[0071] In a specific implementation, S500 includes the following steps:
[0072] S510, for any target traffic data in the i-th target traffic data queue corresponding to the current target port, based on the i-th target traffic data queue corresponding to the current target port and the data volume corresponding to each target traffic data, the sum of the data volume corresponding to any target traffic data, the data volume corresponding to all target traffic data sorted before any target traffic data in the i-th target traffic data queue, and the initial data volume corresponding to the current target port is determined as the reference data volume corresponding to any target traffic data.
[0073] S520, obtaining the output end time corresponding to any target flow data at the current target port according to the reference data volume and the data processing rate corresponding to the current target port.
[0074] The ratio of the reference data volume to the data processing rate corresponding to the current target port is determined as the output end time corresponding to any target flow data at the current target port.
[0075] As mentioned above, by comprehensively considering factors such as the target traffic data queue, data volume, port data processing rate and initial data volume, the output end time of each target traffic data in the i-th target traffic data queue corresponding to any target port at the port is determined, which is of great significance for accurately controlling the processing and distribution order of the target traffic data at each port, and can achieve accurate estimation of the processing time of the target traffic data, providing a data basis for improving the efficiency of network traffic distribution.
[0076] S600, acquiring the output port corresponding to the i-th target flow data according to the output end time corresponding to each corresponding target port of the i-th target flow data in the data input queue.
[0077] In a specific implementation, S600 includes the following steps:
[0078] S610, comparing the output end time corresponding to the i-th target flow data in the data input queue at each corresponding target port, and determining the target port corresponding to the minimum output end time as the output port corresponding to the i-th target flow data.
[0079] Since the data processing rate, initial data volume and current target flow data queue of each target port are different, the processing end time of the same target flow data at different target ports may be different.
[0080] By comparing these output end times, the target port corresponding to the smallest output end time is determined as the output port corresponding to the i-th target traffic data, so as to select the target port that can complete the processing and output of the i-th target traffic data as quickly as possible, thereby minimizing the transmission delay of the target traffic data in the network and improving the overall processing efficiency of the network traffic.
[0081] In the above, by comprehensively considering the output end time corresponding to the target flow data at each target port, the optimal output port is selected to achieve efficient distribution and rapid processing of the target flow data, thereby improving the efficiency of network flow distribution.
[0082] S700, according to the output port corresponding to the i-th target flow data, update i=i+1, return to execute step S400, until i=N, and obtain the output ports corresponding to the 1st to Nth target flow data respectively.
[0083] Among them, after determining the output port corresponding to the i-th target traffic data, by updating the value of i to i+1 and then returning to execute step S400, the 1st to N-th target traffic data can be processed in sequence, and in each iteration, the output port of the next target traffic data is recalculated based on the previous calculation results and the current network status, including the data processing rate of each port, the data volume of each target traffic data, and the input time and other factors, to ensure that the entire network traffic distribution control process covers all target traffic data.
[0084] S800, distribute each target flow data to the corresponding output port.
[0085] Among them, according to the output port corresponding to each target traffic data, the target traffic data is distributed to the corresponding port, realizing the final distribution of the target traffic data and ensuring that each target traffic data can reach the port that is most suitable for processing it, thereby realizing efficient network traffic processing.
[0086] In a specific implementation, S800 further includes the following steps:
[0087] S810, obtaining device information corresponding to each target traffic data and a rule number corresponding to each preset distribution rule.
[0088] S820: Obtain a rule number corresponding to each output port according to the preset port and the rule number corresponding to each preset distribution rule.
[0089] S830, for any target traffic data, obtain the target distribution data corresponding to the output port according to the current target traffic data, the device information corresponding to the current target traffic data and the rule number corresponding to the output port corresponding to the current target traffic data.
[0090] S840, distribute the target distribution data corresponding to each output port to the corresponding output port.
[0091] In a specific implementation, S830 includes the following steps:
[0092] S831, obtaining a preset data combination template, wherein the data combination template includes a first position corresponding to target traffic data, a second position corresponding to device information, and a third position corresponding to a rule number.
[0093] S832, fill the current target traffic data, the device information corresponding to the current target traffic data and the rule number corresponding to the output port corresponding to the current target traffic data into the data combination template, and obtain the target distribution data corresponding to the output port.
[0094] Among them, the rule number corresponding to the output port can accurately determine the type of traffic processed by each output port, avoid misdistribution of traffic data, and ensure that each output port receives traffic data that meets its processing capabilities and business needs.
[0095] Different devices may have different processing power, storage capacity, and network interface speeds.
[0096] Therefore, by distributing the target traffic data together with the device information and the rule number corresponding to the output port to the output port, the traffic data distribution can be better matched with the performance and characteristics of the device, and the target traffic data can be reasonably allocated to the port corresponding to the efficient processing device. At the same time, it is convenient for network management personnel to clearly understand what kind of traffic data sent from which device is distributed to which port according to what rules, thereby improving the operating efficiency and reliability of the entire network system.
[0097] In the above, the target traffic data are sorted according to the data input time corresponding to the target traffic data from early to late, and the port screening and distribution control are performed preferentially on the target traffic data input earlier, so as to avoid the backlog of early data by subsequent data while waiting for processing, reduce the queuing waiting time of early data, and thus accelerate the network interaction process, and accurately obtain the target traffic data queue corresponding to each target port in each iteration step, and determine the output end time of each target traffic data in the i-th target traffic data queue corresponding to any target port at the port by comprehensively considering factors such as the target traffic data queue, data volume, port data processing rate and initial data volume, so as to realize accurate estimation of the processing time of the target traffic data, thereby selecting the optimal output port to realize efficient distribution and rapid processing of the target traffic data, and improve the efficiency of network traffic distribution.
[0098] It should be noted that the information interaction, execution process and other contents between the above modules are based on the same concept as the embodiment of the method of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0099] Embodiment 2
[0100] Embodiment 2 of the present invention provides a non-transitory computer-readable storage medium, wherein at least one instruction or at least one program is stored in the non-transitory computer-readable storage medium, and the at least one instruction or at least one program is loaded and executed by a processor to implement the steps:
[0101] S100, obtaining N target traffic data, the data volume corresponding to each target traffic data, the data input time and a number of target ports, and the data processing rate and initial data volume corresponding to each target port, wherein N is an integer greater than 1.
[0102] S200, according to the data input time corresponding to each target flow data and a number of target ports, obtain the data input queues corresponding to N target flow data and the 0th target flow data queue corresponding to each target port.
[0103] S300, initializing i=1.
[0104] S400, according to a number of target ports corresponding to each target traffic data, an output port corresponding to the i-1th target traffic data and an i-1th target traffic data queue corresponding to each target port, the i-th target traffic data queue corresponding to each target port is obtained.
[0105] S500, for any target port, based on the i-th target traffic data queue corresponding to the current target port, the data volume corresponding to each target traffic data, the data processing rate corresponding to the current target port and the initial data volume, obtain the output end time corresponding to each target traffic data in the i-th target traffic data queue corresponding to the current target port at the current target port.
[0106] S600, acquiring the output port corresponding to the i-th target flow data according to the output end time corresponding to each corresponding target port of the i-th target flow data in the data input queue.
[0107] S700, according to the output port corresponding to the i-th target flow data, update i=i+1, return to execute step S400, until i=N, and obtain the output ports corresponding to the 1st to Nth target flow data respectively.
[0108] S800, distribute each target flow data to the corresponding output port.
[0109] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronization link DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0110] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0111] Embodiment 3
[0112] A third embodiment of the present invention provides an electronic device, which includes a processor and the non-transitory computer-readable storage medium in the fifth embodiment of the present invention.
[0113] The above are only preferred embodiments of the present invention, and are not intended to limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not intended to limit the present invention. Any technician familiar with the profession can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still fall within the scope of the technical solution of the present invention.
Claims
1. A network traffic distribution control method, characterized in that: The network traffic distribution control method comprises the following steps: S100, obtaining N target flow data, the data volume corresponding to each target flow data, the data input time and a number of target ports, and the data processing rate and initial data volume corresponding to each target port, wherein N is an integer greater than 1; S200, acquiring the data input queues corresponding to the N target flow data and the 0th target flow data queue corresponding to each target port according to the data input time and a number of target ports corresponding to each target flow data; S300, initializing i=1; S400, according to a number of target ports corresponding to each target flow data, an output port corresponding to the i-1th target flow data, and an i-1th target flow data queue corresponding to each target port, an i-th target flow data queue corresponding to each target port is obtained; S500, for any target port, according to the i-th target traffic data queue corresponding to the current target port, the data volume corresponding to each target traffic data, the data processing rate corresponding to the current target port and the initial data volume, obtain the output end time corresponding to each target traffic data in the i-th target traffic data queue corresponding to the current target port at the current target port; S600, acquiring the output port corresponding to the i-th target flow data according to the output end time corresponding to each corresponding target port of the i-th target flow data in the data input queue; S700, according to the output port corresponding to the i-th target flow data, update i=i+1, return to execute step S400, until i=N, and obtain the output ports corresponding to the 1st to Nth target flow data respectively; S800, distribute each target flow data to the corresponding output port.
2. The network traffic distribution control method according to claim 1, characterized in that: The target ports corresponding to each target traffic data are obtained through the following steps: S10, obtaining N target traffic data, device information corresponding to each target traffic data, a number of preset distribution rules, and a preset field name combination and a preset port corresponding to each preset distribution rule; S20, for any target flow data, extracting all initial field names corresponding to the target flow data and first intermediate flow data corresponding to each initial field name; S30, acquiring all initial field name combinations corresponding to the target flow data and second intermediate flow data corresponding to each initial field name combination according to all initial field names and first intermediate flow data corresponding to each initial field name combination; S40, according to each preset field name combination, the preset distribution rule corresponding to each preset field name combination, each initial field name combination and the second intermediate traffic data corresponding to each initial field name combination, filter out the target distribution rule corresponding to each second intermediate traffic data from all the preset distribution rules; S50, matching each second intermediate flow data with a corresponding target distribution rule, and obtaining a hit result between each second intermediate flow data and the corresponding target distribution rule; S60, acquiring a target port corresponding to each second intermediate flow data according to a hit result between each second intermediate flow data and a corresponding target distribution rule, and a preset port corresponding to each target distribution rule; S70, acquiring a plurality of target ports corresponding to the target flow data according to the target port corresponding to each second intermediate flow data.
3. The network traffic distribution control method according to claim 2, characterized in that: S800 also includes the following steps: S810, obtaining device information corresponding to each target traffic data and a rule number corresponding to each preset distribution rule; S820, acquiring a rule number corresponding to each output port according to the preset port and the rule number corresponding to each preset distribution rule; S830, for any target traffic data, according to the current target traffic data, the device information corresponding to the current target traffic data, and the rule number corresponding to the output port corresponding to the current target traffic data, obtain the target distribution data corresponding to the output port; S840, distribute the target distribution data corresponding to each output port to the corresponding output port.
4. The network traffic distribution control method according to claim 1, characterized in that: S200 includes the following steps: S210, sorting the N target flow data in order of data input time from earliest to latest, and acquiring data input queues corresponding to the N target flow data; S220, acquiring all target flow data corresponding to each target port according to the target port corresponding to each target flow data; S230, for any target port, sort all target flow data corresponding to the current target port in order of data input time from earliest to latest, and obtain the 0th target flow data queue corresponding to the current target port.
5. The network traffic distribution control method according to claim 1, characterized in that: When i=1, the output ports corresponding to the 0th target flow data and the 0th target flow data are both empty.
6. The network traffic distribution control method according to claim 5, characterized in that: S400 includes the following steps: S410, determining the i-1th target flow data queue corresponding to the output port corresponding to the i-1th target flow data as the i-th target flow data queue corresponding to the output port corresponding to the i-1th target flow data; S420, according to a number of target ports corresponding to each target flow data and an output port corresponding to the i-1th target flow data, determining a target port other than the output port corresponding to the i-1th target flow data as a non-output port corresponding to the i-1th target flow data; S430, delete the i-1th target traffic data from the i-1th target traffic data queue corresponding to the non-output port corresponding to the i-1th target traffic data, and obtain the i-th target traffic data queue corresponding to the non-output port corresponding to the i-1th target traffic data.
7. The network traffic distribution control method according to claim 1, characterized in that: S500 includes the following steps: S510, for any target traffic data in the i-th target traffic data queue corresponding to the current target port, according to the i-th target traffic data queue corresponding to the current target port and the data volume corresponding to each target traffic data, the sum of the data volume corresponding to the any target traffic data, the data volume corresponding to all target traffic data in the i-th target traffic data queue that are sorted before the any target traffic data, and the initial data volume corresponding to the current target port is determined as the reference data volume corresponding to the any target traffic data; S520: Obtain the output end time corresponding to any target flow data at the current target port according to the reference data volume and the data processing rate corresponding to the current target port.
8. The network traffic distribution control method according to claim 1, characterized in that: S600 includes the following steps: S610, comparing the output end time corresponding to the i-th target traffic data in the data input queue at each corresponding target port, and determining the target port corresponding to the minimum output end time as the output port corresponding to the i-th target traffic data.
9. A non-transitory computer-readable storage medium, wherein at least one instruction or at least one program is stored in the non-transitory computer-readable storage medium, characterized in that: The at least one instruction or the at least one program is loaded and executed by the processor to implement the network traffic distribution control method as described in any one of claims 1-8.
10. An electronic device, characterized in that: The invention comprises a processor and the non-transitory computer-readable storage medium as claimed in claim 9.
Citation Information
Patent Citations
Network traffic control method and network equipment thereof
CN107196877A
Network traffic control method and device, network equipment and storage medium
CN116506370A
Network flow control method and device, electronic equipment and storage medium
CN117938768A
Traffic control method based on service awareness
CN118433127A
Deterministic forwarding method and device of service flow, electronic equipment and storage medium
CN118827565A