Traffic processing methods, gateway device, electronic device, and storage medium
By splitting and distributing input traffic to the target processor, the problems of poor stability and low accuracy of large-traffic data processing in the prior art are solved, and higher processing stability and accuracy are achieved.
Patent Information
- Application Number
- PCT/CN2024/120120
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-10-23
- Filing Date
- 2024-09-20
- Publication Date
- 2025-05-01
AI Technical Summary
The prior art has poor processing stability and low accuracy when processing large-flow data, and it is easy to cause the same traffic data to be distributed to different processor cores for processing, resulting in inaccurate processing results.
By segmenting the network card when it receives the input traffic, a sub-data stream is obtained, and the target processor set corresponding to the sub-data stream is determined from the multiple processor sets, the sub-data stream is further divided, and a plurality of first data packets are obtained, and these data packets are then sent to the target processor for processing.
By splitting and distributing the input traffic, the data processing volume of the processor set and the target processor is reduced, processing stability and accuracy are improved, and each data packet is processed by the appropriate processor, thereby improving the overall performance of traffic data processing.
Smart Images

Figure CN2024120120_01052025_PF_FP_ABST
Abstract
Description
Traffic processing method, gateway device, electronic device and storage medium Technical Field
[0001] The present disclosure relates to the field of traffic data processing in the field of cloud networks, and in particular to a traffic processing method, a gateway device, an electronic device, and a storage medium. Background Art
[0002] Currently, traffic data processing is primarily achieved through a CPU-based network card model. However, this model encounters bottlenecks in processing large flows, resulting in poor stability. Furthermore, this model can send the same traffic data to different processor cores for processing, resulting in low accuracy in traffic data processing.
[0003] To address the above-mentioned problems, no effective solutions have been proposed so far.
[0004] Summary of the Invention
[0005] The embodiments of the present disclosure provide a traffic processing method, a gateway device, an electronic device, and a storage medium to at least solve the technical problems of low processing accuracy and poor processing stability in the related art for processing traffic data.
[0006] According to one aspect of an embodiment of the present disclosure, a traffic processing method is provided, including: in response to input traffic received by a network card, splitting the input traffic to obtain at least one sub-data stream; determining a target processor set corresponding to the sub-data stream from a plurality of processor sets, wherein different target processor sets are used to process different sub-data streams; splitting the sub-data stream to obtain a plurality of first data packets; determining a target processor corresponding to a first data packet from a plurality of processors included in the target processor set, wherein different target processors are used to process different first data packets; and sending the first data packet to the target processor.
[0007] According to another aspect of an embodiment of the present disclosure, a traffic processing method is also provided, including: responding to an input instruction acting on an operation interface, displaying multiple first data packets received by the network card on the operation interface, wherein the first data packet is a data packet obtained by splitting at least one data stream, and the sub-data stream is a data stream obtained by splitting the input traffic, and the input traffic is received by the network card; responding to a processing instruction acting on the operation interface, displaying a target processor corresponding to the first data packet on the operation interface, wherein the first data packet is processed by the target processor, the target processor is a processor determined from multiple processors included in a target processor set, the target processor set is a processor set corresponding to the sub-data stream determined from multiple processor sets, different target processor sets are used to process different sub-data streams, and different target processors are used to process different first data packets.
[0008] According to another aspect of an embodiment of the present disclosure, a traffic processing device is also provided, including: a first processing module is configured to split the input traffic in response to the input traffic received by the network card to obtain at least one sub-data stream; a first determination module is configured to determine a target processor set corresponding to the sub-data stream from a plurality of processor sets, wherein different target processor sets are used to process different sub-data streams; a second processing module is configured to split the sub-data stream to obtain a plurality of first data packets; a second determination module is configured to determine a target processor corresponding to the first data packet from a plurality of processors included in the target processor set, wherein different target processors are used to process different first data packets; and a sending module is configured to send the first data packet to the target processor.
[0009] According to another aspect of an embodiment of the present disclosure, a traffic processing device is also provided, including: a first display module is configured to respond to an input instruction acting on an operation interface, and display multiple first data packets received by the network card on the operation interface, wherein the first data packet is a data packet obtained by splitting at least one data stream, and the sub-data stream is a data stream obtained by splitting the input traffic, and the input traffic is received by the network card; a second display module is configured to respond to a processing instruction acting on the operation interface, and display a target processor corresponding to the first data packet on the operation interface, wherein the first data packet is processed by the target processor, the target processor is a processor determined from multiple processors included in a target processor set, the target processor set is a processor set corresponding to the sub-data stream determined from multiple processor sets, different target processor sets are used to process different sub-data streams, and different target processors are used to process different first data packets.
[0010] According to another aspect of an embodiment of the present disclosure, a gateway device is also provided, including: multiple processor sets, wherein different processor sets are used to process different data streams, and different processors in the same processor set are used to process different data packets; a network card, connected to the multiple processor sets, for splitting input traffic to obtain at least one sub-data stream, determining a target processor set corresponding to the sub-data stream from the multiple processor sets, splitting the sub-data stream to obtain multiple first data packets, determining a target processor corresponding to the first data packet from the multiple processors included in the target processor set, and sending the first data packet to the target processor.
[0011] According to another aspect of an embodiment of the present disclosure, an electronic device is provided, including: a memory storing an executable program; and a processor for running the program, wherein any one of the above methods is executed when the program is run.
[0012] According to another aspect of an embodiment of the present disclosure, a computer-readable storage medium is further provided, the computer-readable storage medium including a stored executable program, wherein when the executable program runs, the device where the storage medium is located is controlled to execute any of the above methods.
[0013] In an embodiment of the present disclosure, in response to input traffic received by a network card, the input traffic is split to obtain at least one sub-data stream; a target processor set corresponding to the sub-data stream is determined from a plurality of processor sets; the sub-data stream is split to obtain a plurality of first data packets; a target processor corresponding to the first data packet is determined from a plurality of processors included in the target processor set; and the first data packet is sent to the target processor. It is easy to notice that by splitting the input traffic to obtain sub-data streams and splitting the sub-data streams to obtain data packets, not only the data processing capacity of the processor set can be reduced, but also the data processing capacity of the target processor in the target processor set can be reduced, thereby improving the processing stability and processing accuracy of the target processor set. In addition, different first data packets in the same sub-data stream are processed by different processors in the same target processor set. By having a one-to-one correspondence between the first data packet and the target processor, the purpose of accurately processing the first data packet is further achieved, thereby achieving the technical effect of improving the processing accuracy and processing stability of the flow data processing, thereby solving the technical problems of low processing accuracy and poor processing stability of the flow data processing in the related art.
[0014] It is easy to note that the above general description and the following detailed description are only for the purpose of exemplifying and explaining the present disclosure, and do not constitute a limitation of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The exemplary embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation of the present disclosure. In the drawings:
[0016] FIG1 is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a traffic processing method according to an embodiment of the present disclosure;
[0017] FIG2 is a block diagram of a computing environment according to an embodiment of the present disclosure;
[0018] FIG3 is a structural block diagram of a service grid according to an embodiment of the present disclosure;
[0019] FIG4 is a flow chart of a traffic processing method according to Example 1 of the present disclosure;
[0020] FIG5 is a schematic diagram of an optional interactive interface according to Example 1 of the present disclosure;
[0021] FIG6 is a schematic diagram of an optional traffic processing method according to Example 1 of the present disclosure;
[0022] FIG7 is a flow chart of an optional traffic processing method according to Example 1 of the present disclosure;
[0023] FIG8 is a flow chart of a traffic processing method according to Embodiment 2 of the present disclosure;
[0024] FIG9 is a schematic diagram of an optional operation interface according to Example 2 of the present disclosure;
[0025] FIG10 is a schematic diagram of a flow processing device according to Example 3 of the present disclosure;
[0026] FIG11 is a schematic diagram of a flow processing device according to Example 4 of the present disclosure;
[0027] FIG12 is a structural block diagram of a computer terminal according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the embodiments described are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present disclosure.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device 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.
[0030] First, some nouns or terms that appear in the description of the embodiments of the present disclosure are subject to the following explanations:
[0031] Gateway Server (Gate Way, GW): Used to provide a simple and effective unified application programming interface (API) routing management method for microservice architecture.
[0032] Server Network Interface Card (NIC): used to connect servers to network devices such as switches.
[0033] Network forwarding session: It is a series of related interaction processes between a single client and a web server over a period of time, used to record the user's status.
[0034] Polling: Only one task ID is retained in the polling request interface. You only need to send the task ID to obtain the status of the current task. If a result is returned, the polling is completed. If no result is returned, the polling is continued after a while. This is used to solve the problem of excessive server pressure.
[0035] Elephant flow: The process of transmitting large amounts of data continuously over network links. This refers to high-speed (high bandwidth) and long-duration flows. Examples include virtual machine migration, data migration, and video storage.
[0036] Example 1
[0037] According to an embodiment of the present disclosure, a traffic processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0038] The method embodiment provided in the first embodiment of the present disclosure can be executed in a mobile terminal, a computer terminal, or a similar computing device. Figure 1 is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a traffic processing method according to an embodiment of the present disclosure. As shown in Figure 1, the computer terminal 10 (or mobile device) may include one or more (illustrated by 102a, 102b, ..., 102n in the figure) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a Universal Serial Bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that the structure shown in Figure 1 is merely illustrative and does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 may also include more or fewer components than shown in Figure 1, or have a configuration different from that shown in Figure 1.
[0039] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry." The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuitry may be a single, independent processing module, or may be incorporated in whole or in part into any of the other components of the computer terminal 10 (or mobile device). As described in the embodiments of the present disclosure, the data processing circuitry serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0040] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the traffic processing method in the embodiment of the present disclosure. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implementing the above-mentioned traffic processing method. The memory 104 may include a high-speed random access memory and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0041] The transmission device 106 is configured to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by the communications provider of the computer terminal 10. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is configured to communicate with the Internet wirelessly.
[0042] The display may be, for example, a touch screen liquid crystal display (LCD), which enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0043] The hardware structure block diagram shown in FIG1 can be used not only as an exemplary block diagram of the above-mentioned computer terminal 10 (or mobile device), but also as an exemplary block diagram of the above-mentioned server. In an optional embodiment, FIG2 shows in a block diagram an embodiment of using the computer terminal 10 (or mobile device) shown in FIG1 as a computing node in a computing environment 201. FIG2 is a structural block diagram of a computing environment according to an embodiment of the present disclosure. As shown in FIG2, the computing environment 201 includes multiple (210-1, 210-2, ..., shown in the figure) computing nodes (such as servers) running on a distributed network. The computing nodes all contain local processing and memory resources, and the end user 202 can remotely run applications or store data in the computing environment 201. Applications can be provided as multiple services 220-1, 220-2, 220-3 and 220-4 in the computing environment 201, representing services "A", "D", "E" and "H" respectively.
[0044] End user 202 can provide and access services through a web browser or other software application on a client. In some embodiments, the provisioning and / or request of end user 202 can be provided to the ingress gateway 230. The ingress gateway 230 may include a corresponding agent to handle the provisioning and / or request for services (one or more services provided in the computing environment 201).
[0045] Services are provided or deployed based on various virtualization technologies supported by the computing environment 201. In some embodiments, services can be provided based on virtual machine (VM)-based virtualization, container-based virtualization, and / or similar methods. Virtual machine-based virtualization can be to simulate a real computer by initializing a virtual machine, executing programs and applications without directly contacting any actual hardware resources. While the virtual machine virtualizes the machine, according to container-based virtualization, a container can be started to virtualize the entire operating system (OS) so that multiple workloads can run on a single operating system instance.
[0046] In one embodiment based on container virtualization, several containers of a service can be assembled into a Pod (e.g., a Kubernetes Pod). For example, as shown in Figure 2, service 220-2 can be equipped with one or more Pods 240-1, 240-2, ..., 240-N (collectively referred to as Pods). The Pod may include a proxy 245 and one or more containers 242-1, 242-2, ..., 242-M (collectively referred to as containers). One or more containers in the Pod process requests related to one or more corresponding functions of the service, and the proxy 245 generally controls network functions related to the service, such as routing, load balancing, etc. Other services can also be equipped with similar Pods.
[0047] During operation, executing a user request from end user 202 may require invoking one or more services in computing environment 201. Executing one or more functions of one service may require invoking one or more functions of another service. As shown in FIG2 , service "A" 220-1 receives a user request from end user 202 from ingress gateway 230. Service "A" 220-1 may invoke service "D" 220-2, and service "D" 220-2 may request service "E" 220-3 to execute one or more functions.
[0048] This computing environment can be a cloud computing environment, where resource allocation is managed by the cloud service provider, allowing for feature development without having to worry about implementing, adjusting, or scaling servers. This computing environment allows developers to execute code in response to events without building or maintaining complex infrastructure. Services can be partitioned to perform a set of functions that can scale independently and automatically, rather than scaling a single hardware device to handle the potential load.
[0049] In another alternative embodiment, FIG3 shows a block diagram of an embodiment using the computer terminal 10 (or mobile device) shown in FIG1 as a service grid. FIG3 is a block diagram of the structure of a service grid according to an embodiment of the present disclosure. As shown in FIG3, the service grid 300 is primarily used to facilitate secure and reliable communication between multiple microservices. Microservices refer to the decomposition of an application into multiple smaller services or instances, which are distributed and run on different clusters / machines.
[0050] As shown in Figure 3, microservices may include application service instance A and application service instance B, which form the functional application layer of service grid 300. In one embodiment, application service instance A runs as a container / process 308 on a machine / workload container group 314 (Pod), and application service instance B runs as a container / process 310 on a machine / workload container group 316 (Pod).
[0051] In one implementation, application service instance A may be a product query service, and application service instance B may be a product ordering service.
[0052] As shown in Figure 3, application service instance A and grid proxy (sidecar) 303 coexist in machine workload container group 614, while application service instance B and grid proxy 305 coexist in machine workload container 314. Grid proxy 303 and grid proxy 305 form the data plane layer (dataplane) of service grid 300. Grid proxy 303 and grid proxy 305 run as container / process 304 and container / process 306, respectively, and can receive requests 312 for product query services. Bidirectional communication is possible between grid proxy 303 and application service instance A, and between grid proxy 305 and application service instance B. Furthermore, bidirectional communication is possible between grid proxy 303 and grid proxy 305.
[0053] In one embodiment, the traffic of application service instance A is routed to the appropriate destination via grid proxy 303, and the network traffic of application service instance B is routed to the appropriate destination via grid proxy 305. It should be noted that the network traffic mentioned herein includes, but is not limited to, Hypertext Transfer Protocol (HTTP), Representational State Transfer (REST), the high-performance, general-purpose open source framework (Google Remote Procedure Call, gRPC), the open source in-memory data structure storage system (Redis), and other forms.
[0054] In one embodiment, the data plane layer's functionality can be extended by writing custom filters for the proxy (Envoy) in service mesh 300. The service mesh proxy configuration can be designed to enable the service mesh to correctly proxy service traffic, enabling service interoperability and service governance. Mesh proxy 303 and mesh proxy 305 can be configured to perform at least one of the following functions: service discovery, health checking, routing, load balancing, authentication and authorization, and observability.
[0055] As shown in Figure 3 , the service grid 300 also includes a control plane layer. The control plane layer can be comprised of a set of services running in a dedicated namespace, hosted by a managed control plane component 301 within a machine / workload container group (machine / pod) 302. As shown in Figure 3 , managed control plane component 301 communicates bidirectionally with grid agent 303 and grid agent 305. Managed control plane component 301 is configured to perform certain control and management functions. For example, managed control plane component 301 receives telemetry data transmitted by grid agent 303 and grid agent 305 and can further aggregate this telemetry data. Managed control plane component 301 can also provide user-oriented application programming interfaces (APIs) for these services, making it easier to manipulate network behavior and provide configuration data to grid agent 303 and grid agent 305.
[0056] In the above operating environment, the present disclosure provides a traffic processing method as shown in Figure 4. Figure 4 is a flow chart of a traffic processing method according to embodiment 1 of the present disclosure. As shown in Figure 4, the method may include the following steps:
[0057] Step S402 : In response to input traffic received by the network card, the input traffic is split to obtain at least one sub-data stream.
[0058] The aforementioned network card can be a network card in a gateway device that is capable of receiving input traffic and splitting the received input traffic. The network card can receive network traffic transmitted on the network and forward the received network traffic to other networks or clients. When splitting the input traffic, the user can set the specific conditions based on actual needs. For example, the input traffic can be split based on the session type of the input traffic to obtain multiple sub-data streams of different session types. For another example, the input traffic can be split based on the data volume of the input traffic to obtain multiple sub-data streams of different data volumes, but the present invention is not limited thereto. In this embodiment, the input traffic is split based on the session type as an example.
[0059] In an optional embodiment, after receiving input traffic forwarded by the gateway device, the network card may first split the input traffic based on the session type of the input traffic to obtain at least one sub-data stream to ensure correct and stable processing of the input traffic. For another example, the input traffic may be split based on the data volume of the input traffic to obtain at least one sub-data stream.
[0060] Step S404: determining a target processor set corresponding to the sub-data stream from the multiple processor sets, wherein different target processor sets are used to process different sub-data streams.
[0061] The aforementioned multiple processor sets may be processor sets in a gateway device for processing sub-data streams, wherein different processor sets are used to process sub-data streams of different session types, and different processor sets may include multiple different processors. The specific type of the processor set is not limited in this embodiment, and the user may set it according to actual needs. For example, it may be a set of multiple central processing units (CPUs), but is not limited thereto. The aforementioned target processor set may be a processor set corresponding to a sub-data stream, and is used to process the corresponding sub-data stream.
[0062] In an optional embodiment, after obtaining multiple sub-data streams, the target processor set corresponding to the sub-data stream can be determined based on the sub-data stream. For example, when there are 3 sub-data streams of different session types and 10 different processor sets, the identification information of the 3 sub-data streams of different session types can be marked respectively to obtain the identification information of the 3 sub-data streams (for example, it can be ID, but not limited to this). At the same time, the identification information of the processor sets can also be marked respectively to obtain the identification information of the 10 processor sets (for example, it can be ID, but not limited to this). At this time, a sub-data stream can be selected and the sub-data stream can be matched with the 10 processor sets respectively to determine the target processor set. For example, the processor set with ID number 1 can be judged first based on the sub-data stream. When the processor set with ID number 1 can process the sub-data stream accurately, quickly and stably, it indicates that the processing capacity of the processor set matches the sub-data stream. At this time, the processor set with ID number 1 can be determined as the target processor set of the sub-data stream. For another example, when the processor set with ID number 1 cannot process the sub-data stream accurately, quickly and stably, it indicates that the processor set with ID number 1 does not match the sub-data stream. At this time, the processor set with ID number 2 can be selected according to the order of ID numbers, and then the processor set with ID number 2 can be re-judged based on the sub-data stream. When the processor set with ID number 2 can process the sub-data stream accurately, quickly and stably, it indicates that the processing capability of the processor set matches the sub-data stream. At this time, the processor set with ID number 2 can be determined as the target processor set of the sub-data stream, and so on, until the target processor set of the sub-data stream is determined.
[0063] For another example, the user can establish a mapping relationship between the session type of the sub-data stream and the processor set in advance. After obtaining 3 sub-data streams and 10 processor sets, the processor set that matches the session type can be directly determined based on the mapping relationship, and then the target processor set corresponding to the sub-data stream can be obtained. For another example, after obtaining multiple sub-data streams with different data volumes, the multiple sub-data streams with different data volumes can be matched with the data volumes that can be processed by multiple processor sets based on the data volume to determine the target processing set, but this is not limited to this. It should be noted that the matching process based on data volume is the same as the matching process based on session type mentioned above, and will not be repeated here.
[0064] Step S406: split the sub-data stream to obtain multiple first data packets.
[0065] In an optional embodiment, after obtaining the sub-data stream, the sub-data stream may be randomly divided to obtain multiple first data packets, or the sub-data stream may be evenly divided to obtain multiple first data packets, but the present invention is not limited thereto.
[0066] Step S408 : determining a target processor corresponding to the first data packet from a plurality of processors included in the target processor set, wherein different target processors are used to process different first data packets.
[0067] The target processor mentioned above may be a processor corresponding to the first data packet in the target processor set.
[0068] In an optional embodiment, when the sub-data stream includes five first data packets and the target processor set includes eight processors, the five first data packets can first be tagged with IDs, and the eight processors can also be tagged with IDs. Then, one first data packet can be selected, and then the first data packet can be matched with each of the eight processors to determine the target processor. For example, the processor with ID number 1 can first be judged based on the first data packet. When the processor with ID number 1 can accurately, quickly, and stably process the first data packet, it indicates that the processing capability of the processor matches the first data packet. At this time, the processor with ID number 1 can be determined as the target processor set for the first data packet. For another example, when the processor with ID number 1 cannot accurately, quickly and stably process the first data packet, it indicates that the processor with ID number 1 does not match the first data packet. At this time, the processor with ID number 2 can be selected according to the order of ID numbers, and then the processor with ID number 2 can be re-judged based on the first data packet. When the processor with ID number 2 can accurately, quickly and stably process the first data packet, it indicates that the processing capability of the processor matches the first data packet. At this time, the processor with ID number 2 can be determined as the target processor for the first data packet, and so on, until the target processor set for the first data packet is determined. For another example, the user can also establish a mapping relationship between the first data packet and the processor in advance. Based on the preset relationship, the target processor corresponding to the first data packet can be directly determined first, and then the first data packet can be processed by the target processor subsequently. For another example, after obtaining multiple first data packets, the target processor that can process the corresponding data volume accurately, quickly and stably can be determined from the target processor set based on the data volume of the first data packet, and then the first data packet can be processed by the target processor subsequently, but it is not limited to this. It should be noted that the matching process based on data volume is the same as the matching process based on Session type described above, and will not be described in detail here.
[0069] Step S410: Send a first data packet to a target processor.
[0070] In an optional embodiment, after determining the first data packet and the target processor corresponding to the first data packet, the first data packet can be sent to the target processor, which can process the first data packet. For example, the target processor can parse the first data packet and then repackage it. The network protocols before and after packaging may be different. For another example, the target processor can also verify the first data packet to determine whether the first data packet can be forwarded, but the present invention is not limited to this.
[0071] In another optional embodiment, in order to ensure that the input traffic can be processed stably, when the network card receives the input traffic, it can first split the input traffic based on the session type of the input traffic to obtain at least one sub-data stream, and then mark the sub-data stream with an ID, and mark the multiple processor sets with IDs, and then select a sub-data stream and judge the sub-data stream with multiple processor sets respectively. For example, the processor set with ID number 1 can be judged based on the sub-data stream. When the processor set with ID number 1 can process the sub-data stream accurately, quickly and stably, it indicates that the processing capability of the processor set matches the sub-data stream. At this time, the processor set with ID number 1 can be determined as the target processor set of the sub-data stream. Then, in order to ensure that the sub-data stream can be processed correctly, the processor set can be randomly selected. At least one sub-data stream is divided into multiple first data packets, but it is not limited to this. At least one sub-data stream can also be divided evenly into multiple first data packets. Then, the first data packets and multiple processors can be marked with IDs, and the target processor can be determined based on the processing performance and session type of the processor. The target processor can also be directly determined based on the mapping relationship. For example, a first data packet can be selected, and the processor with ID number 1 can be judged based on the first data packet. When the processor with ID number 1 can process the first data packet accurately, quickly and stably, it indicates that the processing capability of the processor matches the first data packet. At this time, the processor with ID number 1 can be determined as the target processor of the first data packet. Finally, the corresponding first data packet can be sent to the target processor, and the target processor processes the corresponding first data packet.
[0072] In an embodiment of the present disclosure, in response to input traffic received by a network card, the input traffic is split to obtain at least one sub-data stream; a target processor set corresponding to the sub-data stream is determined from a plurality of processor sets; the sub-data stream is split to obtain a plurality of first data packets; a target processor corresponding to the first data packet is determined from a plurality of processors included in the target processor set; and the first data packet is sent to the target processor. It is easy to notice that by splitting the input traffic to obtain sub-data streams and splitting the sub-data streams to obtain data packets, not only the data processing capacity of the processor set can be reduced, but also the data processing capacity of the target processor in the target processor set can be reduced, thereby improving the processing stability and processing accuracy of the target processor set. In addition, different first data packets in the same sub-data stream are processed by different processors in the same target processor set. By having a one-to-one correspondence between the first data packet and the target processor, the purpose of accurately processing the first data packet is further achieved, thereby achieving the technical effect of improving the processing accuracy and processing stability of the flow data processing, thereby solving the technical problems of low processing accuracy and poor processing stability of the flow data processing in the related art.
[0073] In the above-mentioned embodiment of the present disclosure, the input traffic is divided to obtain at least one sub-data stream, including: parsing the input traffic to obtain at least one preset session information carried in the input traffic; and dividing the input traffic based on the preset session information to obtain sub-data streams, wherein the preset session information corresponding to the same sub-data stream is the same.
[0074] The above-mentioned preset session information may be Session information, but is not limited thereto.
[0075] In an optional embodiment, after obtaining input traffic, the network card can first parse the content of the input traffic to obtain at least one preset session information carried by the input traffic, and then split the input traffic based on the at least one preset session information obtained by the parsing to obtain at least one sub-data stream, wherein the preset session information between different sub-data streams is different, and the preset session information carried by the sub-data stream is the same as the corresponding preset session information.
[0076] In the above-mentioned embodiment of the present disclosure, multiple processors in the target processor set share the same preset session information. By dividing the input traffic into multiple sub-data streams, the scope can be narrowed, and multiple processors can handle the same problem task. In addition, the processor core speed can be reduced, competition can be reduced, and performance can be more stable.
[0077] In an optional embodiment, the target processor set processes the sub-data stream, and the multiple processors in the target processor set process the multiple first data packets obtained after the sub-data stream is split. Because the sub-data stream carries the same preset session information, the multiple first data packets obtained after the sub-data stream is split also carry the same preset session information. Therefore, the multiple processors that process the multiple first data packets carrying the same preset session information share the same preset session information.
[0078] In the above-mentioned embodiment of the present disclosure, determining a target processor set corresponding to a sub-data flow from a plurality of processor sets includes: determining traffic data of the sub-data flow and the processing performance of the processor set; matching the traffic data and the processing performance to determine the target processor set, wherein the processing performance of the target processor set matches the traffic.
[0079] The above-mentioned processing performance includes at least one of the following: processing time, processing speed, processing efficiency, processing accuracy, etc.
[0080] In an optional embodiment, after obtaining at least one sub-data stream, the network card can first determine the traffic data of the sub-data stream and the processing performance of the processor set. Secondly, the traffic data can be matched with the processing performance. For example, it can be determined whether the processing time, processing speed, and processing accuracy of the processor set for the traffic data can meet the user's requirements. If the user's requirements are met, it can be determined that the processing performance of the processor set matches the traffic of the corresponding sub-data stream, and then the processor set can be determined as the target processor set corresponding to the sub-data stream. It should be noted that the user's specific requirements are not limited in this embodiment, and the user can set them according to actual needs. In this embodiment, when the user requires a processing time of less than 0.1ms and a processing accuracy greater than 99%, if the processor set's processing time for the traffic data is greater than or equal to 0.1ms, or the processing accuracy is less than or equal to 99%, it can be determined that the processing performance of the processor set does not meet the user's requirements.
[0081] In the above-mentioned embodiment of the present disclosure, determining the target processor corresponding to the first data packet from the multiple processors included in the target processor set includes one of the following: determining the target processor from the multiple processors based on the data volume of the first data packet; randomly determining the target processor from the multiple processors; polling the multiple processors to determine the target processor.
[0082] In an optional embodiment, after obtaining multiple first data packets, a processor that can accurately, correctly and stably process the data volume can be determined from multiple processors based on the data volume of the first data packets to obtain a target processor.
[0083] In another optional embodiment, after obtaining multiple first data packets, because the data volume of the first data packets is small and multiple processors in the target processor set can accurately, correctly and stably process the first data packets, the target processor can be randomly determined from the multiple processors.
[0084] In another optional embodiment, after obtaining multiple first data packets, multiple processors can be polled based on the multiple first data packets. For example, first, corresponding identifiers (IDs) can be assigned to the multiple first data packets, and corresponding IDs can be assigned to the multiple processors, wherein the ID of the first data packet and the ID of the processor have the same serial number. Secondly, the multiple processors can be polled based on the IDs of different data packets respectively, and then the target processor can be determined.
[0085] In the above embodiment of the present disclosure, the method further includes: determining multiple original processors configured for the network card; and grouping the multiple original processors based on properties of the multiple original processors to obtain multiple processor sets.
[0086] The aforementioned attributes may include, but are not limited to, the type, structure, number of processor cores, connection relationships, etc. of the original processor.
[0087] In an optional embodiment, multiple original processors configured for the network card can be first determined, that is, the processors in the gateway device can be first determined, and then the multiple original processors can be grouped based on the properties of the original processors to obtain multiple processor sets. For example, the original processors can be grouped based on their type, structure, and connection relationship. Original processors of the same type can be grouped together to obtain multiple processor sets. Original processors with the same structure can also be grouped together to obtain multiple processor sets. Original processors with the same connection relationship can also be grouped together to obtain multiple processor sets. Different processor sets can process different session types of sub-data streams.
[0088] In the above-mentioned embodiment of the present disclosure, based on the properties of the multiple original processors, the multiple original processors are grouped to obtain multiple processor sets, including: based on the properties of the multiple original processors, the multiple original processors are tested to obtain test results of the multiple original processors, wherein the test results are used to characterize the processing performance of the multiple original processors; based on the test results of the multiple original processors, the multiple original processors are grouped to obtain multiple processor sets.
[0089] In an optional embodiment, the processing performance of the multiple original processors can be tested based on the properties of the multiple original processors to obtain processing performance test results for the multiple original processors. Then, the multiple original processors can be grouped based on the processing performance test results to obtain multiple processor sets. For example, multiple processors with the same processing performance can be grouped together to obtain multiple processor sets. Alternatively, multiple processors with processing performance within the same range can be grouped together to obtain multiple processor sets, but the present invention is not limited thereto.
[0090] In the above embodiment of the present disclosure, the method also includes: receiving a second data packet returned by the target processor, wherein the second data packet is used to represent the data packet obtained by the target processor parsing and repackaging the first data packet; combining the second data packets based on the order of multiple first data packets to obtain a combined data stream; integrating the combined data streams based on the order of the sub-data streams to obtain output traffic; and forwarding the output traffic through the network card.
[0091] In an optional embodiment, when the target processor completes parsing of the first data packet, it will first repackage the parsed first data packet to obtain a second data packet. Secondly, after obtaining the second data packet, the second data packet can be combined based on the order of multiple first data packets to obtain a combined data stream, and the combined data stream can be integrated based on the order of sub-data streams, that is, a complete output flow can be obtained. Finally, the output flow can be forwarded to the receiving client through the network card, wherein the number of sending clients and receiving clients can be one or more. The specific number is not limited in this embodiment, and the user can set it according to actual needs.
[0092] In the above-mentioned embodiment of the present disclosure, after determining the target processor set corresponding to the sub-data stream from multiple processor sets, the method also includes: displaying the set identification information of the sub-data stream and the target processor set on the interactive interface; responding to the first confirmation instruction acting on the interactive interface, determining the target processor corresponding to the first data packet from the multiple processors included in the target processor set; responding to the first modification instruction acting on the interactive interface, determining the target processor corresponding to the first data packet from the multiple processors included in the modification processor set corresponding to the first modification instruction.
[0093] The above-mentioned set identification information may include but is not limited to: the identification number (ID) of the target processor set. The above-mentioned first confirmation instruction may be an instruction capable of determining the target processor generated in response to the user's operation on the confirmation button in the interactive interface. The above-mentioned first modification instruction may be an instruction capable of determining the target processor generated in response to the user's operation on the modification button in the interactive interface. Figure 5 is a schematic diagram of an optional interactive interface according to Example 1 of the present disclosure. As shown in Figure 5, the interactive interface includes: a display area, a confirmation button and a modification button. The interactive interface can first display the set identification information of the sub-data stream and the target processor set in the display area, and secondly, in response to the user's operation on the confirmation button, a first confirmation instruction can be generated. Based on the first confirmation instruction, the target processor corresponding to the first data packet can be determined from the multiple processors included in the target processor set, and then in response to the user's operation on the modification button, a first modification instruction can be generated. Based on the first modification instruction, the target processor corresponding to the first data packet can be determined from the multiple processors included in the modification processor set corresponding to the first modification instruction.
[0094] In the above embodiment of the present disclosure, after determining the target processor corresponding to the first data packet from the multiple processors included in the target processor set, the method also includes: displaying the first data packet and device identification information of the target processor on the interactive interface; sending the first data packet to the target processor in response to the second confirmation instruction acting on the interactive interface; and sending the first data packet to the modification processor corresponding to the second modification instruction in response to the second modification instruction acting on the interactive interface.
[0095] The device identification information may include, but is not limited to, an identification number (ID) of the target processor. The second confirmation instruction may be an instruction for sending the first data packet to the target processor, generated in response to a user pressing a confirmation button in the interactive interface. The second modification instruction may be an instruction for sending the first data packet to the modification processor, generated in response to a user pressing a modification button in the interactive interface.
[0096] In an optional embodiment, the interactive interface can first display the first data packet and the device identification information of the target processor in the display area, and then generate a second confirmation instruction in response to the user's operation of the confirmation button, and send the first data packet to the target processor in response to the second confirmation instruction, and then generate a second modification instruction in response to the user's operation of the modification button, and send the first data packet to the modification processor corresponding to the second modification instruction in response to the second modification instruction.
[0097] FIG6 is a schematic diagram of an optional traffic processing method according to Embodiment 1 of the present disclosure. As shown in FIG6 , after receiving traffic, the network card first divides the traffic data into a stream-by-stream segment to obtain a first sub-data stream, and determines a processor group corresponding to the first sub-data stream, such as the first group, the second group, and the nth group in FIG6 . Secondly, the first sub-data stream can be divided packet by packet to obtain multiple first data packets, and processors corresponding to the multiple first data packets are selected, such as the first group, the second group, and the nth group in FIG6 . Taking the content of the first group as an example for explanation, first, the first sub-data stream in the first group is divided packet by packet to obtain multiple first data packets. Secondly, the multiple first data packets are matched with multiple processors. When the matching is successful, the corresponding first data packets are processed by the processors. In the same group, multiple processors share a session. After the multiple processors complete processing the first data packets, they will repack the first data packets to obtain a second data packet, and recombine the second data packets based on the order of the first data packets to obtain a second sub-data stream. Then, the second sub-data streams can be re-integrated and re-sorted based on the order of the input traffic data to obtain output traffic, and finally, the output traffic can be sent through the network card.
[0098] It's important to note that the purpose of segmenting incoming traffic is to narrow the scope and process the workload within a single group. This allows multiple processors to handle the same task, reducing core speed, reducing contention, and achieving more stable performance. By grouping processors and sharing sessions, the random distribution of traffic can be converted into secondary processing, thereby improving the accuracy of traffic data processing. The number of processor groups is determined based on actual machine model testing to ensure that each group meets performance standards.
[0099] As shown in Figure 6, after the processors are grouped, the flow segmentation + packet segmentation is combined to first group by flow, and then segment by packet within the group, so as to achieve traffic segmentation support for the stateful gateway.
[0100] FIG7 is a flow chart of an optional traffic processing method according to Embodiment 1 of the present disclosure. As shown in FIG7 , the method may include the following steps:
[0101] Step S71, the network card receives input traffic;
[0102] Step S72: Split the input traffic flow by flow to obtain sub-data flows and processor groups;
[0103] Step S73: within the same group, the sub-data streams are segmented packet by packet to obtain a first data packet and processor identification information (ID);
[0104] Step S74, sending the first data packet to the corresponding processor;
[0105] Step S75: The processor processes the first data packet based on the shared session;
[0106] Step S76, the processor sends the parsed and integrated sub-data streams to the network card;
[0107] Step S77: The network card reorders the sub-data streams to obtain output traffic;
[0108] Step S78: The network card sends the output traffic to the client.
[0109] It should be noted that by eliminating traffic hotspots through packet-by-packet splitting, the problem of elephant flows can be avoided and the level of safe operations can be improved. In addition, reordering and preserving the order can ensure that the traffic data is not disordered, and thus can ensure that there will be no disorder problems on the end-to-end functional side. Moreover, through the packet-by-packet + flow-by-flow approach, based on the critical point, the performance degradation problem of shared sessions can be eliminated. The present disclosure can solve the problem of disordered traffic data by deploying the reordering and preserving order in the direction of traffic sending on the device.
[0110] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0111] It should be noted that for the aforementioned method embodiments, for simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present disclosure is not limited by the order of the actions described, because according to the present disclosure, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present disclosure.
[0112] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present disclosure.
[0113] Example 2
[0114] The present disclosure also provides a traffic processing method as shown in Figure 8. Figure 8 is a flow chart of a traffic processing method according to embodiment 2 of the present disclosure. As shown in Figure 8, the method may include the following steps:
[0115] Step S802: In response to an input instruction on the operation interface, displaying multiple first data packets received by the network card on the operation interface, wherein the first data packets are data packets obtained by segmenting at least one data stream, and the sub-data streams are data streams obtained by segmenting input traffic, the input traffic being received by the network card;
[0116] Step S804, in response to the processing instruction acting on the operation interface, the target processor corresponding to the first data packet is displayed on the operation interface, wherein the first data packet is processed by the target processor, the target processor is a processor determined from multiple processors included in the target processor set, the target processor set is a processor set corresponding to the sub-data stream determined from multiple processor sets, different target processor sets are used to process different sub-data streams, and different target processors are used to process different first data packets.
[0117] FIG9 is a schematic diagram of an optional operation interface according to Embodiment 2 of the present disclosure. As shown in FIG9 , the operation interface includes: a display area, an input button, and a processing button. When a user operates the input button on the operation interface, an input instruction can be generated based on the corresponding operation. In response to the input instruction, multiple first data packets received by the network card can be displayed on the operation interface, wherein the first data packet is a data packet obtained by splitting at least one data stream, and the sub-data stream is a data stream obtained by splitting input traffic, and the input traffic is received by the network card; secondly, when the user operates the processing button on the operation interface, a processing instruction can be generated based on the corresponding operation, and then the target processor corresponding to the first data packet can be displayed on the operation interface, wherein the first data packet is processed by the target processor, which is a processor determined from multiple processors included in a target processor set, and the target processor set is a processor set corresponding to the sub-data stream determined from the multiple processor sets, and different target processor sets are used to process different sub-data streams, and different target processors are used to process different first data packets. It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0118] It should be noted that for the aforementioned method embodiments, for simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present disclosure is not limited by the order of the actions described, because according to the present disclosure, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present disclosure.
[0119] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present disclosure.
[0120] Example 3
[0121] According to an embodiment of the present disclosure, a traffic processing device for implementing the above-mentioned traffic processing method is also provided. Figure 10 is a schematic diagram of a traffic processing device according to Example 3 of the present disclosure. As shown in Figure 10, the device includes: a first processing module 1002, a first determination module 1004, a second processing module 1006, a second determination module 1008 and a sending module 1010.
[0122] Among them, the first processing module is configured to split the input traffic in response to the input traffic received by the network card to obtain at least one sub-data stream; the first determination module is configured to determine the target processor set corresponding to the sub-data stream from multiple processor sets, wherein different target processor sets are used to process different sub-data streams; the second processing module is configured to split the sub-data stream to obtain multiple first data packets; the second determination module is configured to determine the target processor corresponding to the first data packet from the multiple processors included in the target processor set, wherein different target processors are used to process different first data packets; the sending module is configured to send the first data packet to the target processor.
[0123] In the above embodiment of the present disclosure, the first processing module includes: a parsing unit and a segmentation unit.
[0124] The parsing unit is configured to parse the input traffic to obtain at least one preset session information carried in the input traffic; the splitting unit is configured to split the input traffic based on the preset session information to obtain sub-data streams, wherein the preset session information corresponding to the same sub-data stream is the same.
[0125] In the above embodiments of the present disclosure, multiple processors in the target processor set share the same preset session information.
[0126] In the above embodiment of the present disclosure, the first determination module includes: a first determination unit and a matching unit.
[0127] The first determination unit is configured to determine the traffic data of the sub-data flow and the processing performance of the processor set; the matching unit is configured to match the traffic data and the processing performance to determine the target processor set, wherein the processing performance of the target processor set matches the traffic.
[0128] In the above embodiment of the present disclosure, the second determining module includes one of the following: a second determining unit, a third determining unit, and a polling unit.
[0129] Among them, the second determination unit is configured to determine the target processor from multiple processors based on the data volume of the first data packet; the third determination unit is configured to randomly determine the target processor from multiple processors; and the polling unit is configured to poll multiple processors to determine the target processor.
[0130] In the above embodiment of the present disclosure, the device further includes: a third determination module and a grouping module.
[0131] The third determining module is configured to determine a plurality of original processors configured for the network card; and the grouping module is configured to group the plurality of original processors based on properties of the plurality of original processors to obtain a plurality of processor sets.
[0132] In the above embodiments of the present disclosure, the grouping module includes: a testing unit and a grouping unit.
[0133] The testing unit is configured to test the multiple original processors based on the properties of the multiple original processors to obtain test results of the multiple original processors, wherein the test results are used to characterize the processing performance of the multiple original processors; the grouping unit is configured to group the multiple original processors based on the test results of the multiple original processors to obtain multiple processor sets.
[0134] In the above embodiment of the present disclosure, the device further includes: a receiving module, a combining module, an integrating module and a forwarding module.
[0135] Among them, the receiving module is configured to receive a second data packet returned by the target processor, wherein the second data packet is used to represent the data packet obtained by the target processor parsing and repackaging the first data packet; the combining module is configured to combine the second data packet based on the order of multiple first data packets to obtain a combined data stream; the integration module is configured to integrate the combined data stream based on the order of the sub-data streams to obtain output traffic; and the forwarding module is configured to forward the output traffic through the network card.
[0136] In the above embodiment of the present disclosure, after determining the target processor set corresponding to the sub-data stream from the multiple processor sets, the apparatus further includes: a first display module, a fourth determination module and a fifth determination module.
[0137] Among them, the first display module is configured to display the collection identification information of the sub-data stream and the target processor set on the interactive interface; the fourth determination module is configured to respond to the first confirmation instruction acting on the interactive interface, and determine the target processor corresponding to the first data packet from the multiple processors included in the target processor set; the fifth determination module is configured to respond to the first modification instruction acting on the interactive interface, and determine the target processor corresponding to the first data packet from the multiple processors included in the modification processor set corresponding to the first modification instruction.
[0138] In the above embodiment of the present disclosure, after determining the target processor corresponding to the first data packet from the multiple processors included in the target processor set, the apparatus further includes: a second display module, a data packet sending module, and a modified data packet sending module.
[0139] Among them, the second display module is configured to display the first data packet and the device identification information of the target processor on the interactive interface; the data packet sending module is configured to respond to the second confirmation instruction acting on the interactive interface and send the first data packet to the target processor; the modified data packet sending module is configured to respond to the second modification instruction acting on the interactive interface and send the first data packet to the modification processor corresponding to the second modification instruction.
[0140] It should be noted that the first processing module, the first determination module, the second processing module, the second determination module, and the sending module correspond to steps S402 to S410 in Example 1. The examples and application scenarios implemented by the five modules and the corresponding steps are the same, but are not limited to the contents disclosed in Example 1. It should be noted that the modules or units can be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The modules can also be part of a device and can be run in the computer terminal 10 provided in Example 1.
[0141] It should be noted that the preferred implementation scheme involved in the above embodiments of the present disclosure is the same as the solution provided in Example 1, as well as the application scenario and implementation process, but is not limited to the solution provided in Example 1.
[0142] Example 4
[0143] According to an embodiment of the present disclosure, a traffic processing device for implementing the above-mentioned traffic processing method is also provided. Figure 11 is a schematic diagram of a traffic processing device according to embodiment 4 of the present disclosure. As shown in Figure 11, the device includes: a first display module 1102 and a second display module 1104.
[0144] In which, the first display module is configured to respond to an input instruction on the operation interface, and display multiple first data packets received by the network card on the operation interface, wherein the first data packet is a data packet obtained by splitting at least one data stream, and the sub-data stream is a data stream obtained by splitting the input traffic, and the input traffic is received by the network card; the second display module is configured to respond to a processing instruction on the operation interface, and display the target processor corresponding to the first data packet on the operation interface, wherein the first data packet is processed by the target processor, the target processor is a processor determined from multiple processors included in the target processor set, and the target processor set is a processor set corresponding to the sub-data stream determined from multiple processor sets, different target processor sets are used to process different sub-data streams, and different target processors are used to process different first data packets.
[0145] It should be noted that the first display module 1102 and the second display module 1104 correspond to steps S8802 to S804 in Example 2. The examples and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units can be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above-mentioned modules can also be part of the device and can be run in the computer terminal 10 provided in Example 1.
[0146] It should be noted that the preferred implementation scheme involved in the above embodiments of the present disclosure is the same as the solution provided in Example 1, as well as the application scenario and implementation process, but is not limited to the solution provided in Example 1.
[0147] Example 5
[0148] According to another aspect of an embodiment of the present disclosure, a gateway device is also provided, including: multiple processor sets, wherein different processor sets are used to process different data streams, and different processors in the same processor set are used to process different data packets; a network card, connected to the multiple processor sets, for splitting input traffic to obtain at least one sub-data stream, determining a target processor set corresponding to the sub-data stream from the multiple processor sets, splitting the sub-data stream to obtain multiple first data packets, determining a target processor corresponding to the first data packet from the multiple processors included in the target processor set, and sending the first data packet to the target processor.
[0149] Example 6
[0150] The embodiment of the present disclosure may provide an electronic device, which may be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal may also be replaced by a terminal device such as a mobile terminal.
[0151] Optionally, in this embodiment, the computer terminal may be located in at least one network device among a plurality of network devices of a computer network.
[0152] In this embodiment, the above-mentioned electronic device can execute the program code of the following steps in the traffic processing method: in response to the input traffic received by the network card, split the input traffic to obtain at least one sub-data stream; determine the target processor set corresponding to the sub-data stream from multiple processor sets, wherein different target processor sets are used to process different sub-data streams; split the sub-data stream to obtain multiple first data packets; determine the target processor corresponding to the first data packet from the multiple processors included in the target processor set, wherein different target processors are used to process different first data packets; and send the first data packet to the target processor.
[0153] Optionally, the electronic device may further execute the program code of the following steps: parsing the input traffic to obtain at least one preset session information carried in the input traffic; dividing the input traffic based on the preset session information to obtain sub-data streams, wherein the preset session information corresponding to the same sub-data stream is the same.
[0154] Optionally, multiple processors in the target processor set share the same preset session information.
[0155] Optionally, the electronic device may also execute the program code of the following steps: determining the traffic data of the sub-data stream and the processing performance of the processor set; matching the traffic data and the processing performance to determine the target processor set, wherein the processing performance of the target processor set matches the traffic.
[0156] Optionally, the electronic device may further execute a program code of one of the following steps: determining a target processor from a plurality of processors based on the data volume of the first data packet; randomly determining a target processor from a plurality of processors; or polling a plurality of processors to determine a target processor.
[0157] Optionally, the electronic device may further execute program codes of the following steps: determining multiple original processors configured for the network card; and grouping the multiple original processors based on properties of the multiple original processors to obtain multiple processor sets.
[0158] Optionally, the electronic device may also execute the program code of the following steps: based on the properties of the multiple original processors, testing the multiple original processors to obtain test results of the multiple original processors, wherein the test results are used to characterize the processing performance of the multiple original processors; based on the test results of the multiple original processors, grouping the multiple original processors to obtain multiple processor sets.
[0159] Optionally, the electronic device may also execute the program code of the following steps: receiving a second data packet returned by the target processor, wherein the second data packet is used to represent a data packet obtained by parsing and repackaging the first data packet by the target processor; combining the second data packets based on the order of multiple first data packets to obtain a combined data stream; integrating the combined data streams based on the order of the sub-data streams to obtain output traffic; and forwarding the output traffic through the network card.
[0160] Optionally, the electronic device may also execute the program code for the following steps: displaying the set identification information of the sub-data stream and the target processor set on an interactive interface; determining the target processor corresponding to the first data packet from the multiple processors included in the target processor set in response to a first confirmation instruction acting on the interactive interface; and determining the target processor corresponding to the first data packet from the multiple processors included in the modified processor set corresponding to the first modification instruction in response to a first modification instruction acting on the interactive interface.
[0161] Optionally, the above-mentioned electronic device can also execute the program code of the following steps: displaying the first data packet and the device identification information of the target processor on the interactive interface; sending the first data packet to the target processor in response to the second confirmation instruction acting on the interactive interface; and sending the first data packet to the modification processor corresponding to the second modification instruction in response to the second modification instruction acting on the interactive interface.
[0162] Optionally, Figure 12 is a block diagram of a computer terminal according to an embodiment of the present disclosure. As shown in Figure 12, the computer terminal A may include: one or more (only one is shown in the figure) processors 1202, a memory 1204, a storage controller, and a peripheral interface, wherein the peripheral interface is connected to a radio frequency module, an audio module, and a display.
[0163] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the traffic processing method and device in the embodiments of the present disclosure. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the above-mentioned traffic processing method. The memory may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely located relative to the processor, and these remote memories may be connected to terminal A via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0164] The processor can call the information and application programs stored in the memory through the transmission device to perform the following steps: in response to the input traffic received by the network card, split the input traffic to obtain at least one sub-data stream; determine the target processor set corresponding to the sub-data stream from multiple processor sets, wherein different target processor sets are used to process different sub-data streams; split the sub-data stream to obtain multiple first data packets; determine the target processor corresponding to the first data packet from the multiple processors included in the target processor set, wherein different target processors are used to process different first data packets; and send the first data packet to the target processor.
[0165] Optionally, the processor may also execute the program code of the following steps: parsing the input traffic to obtain at least one preset session information carried in the input traffic; dividing the input traffic based on the preset session information to obtain sub-data streams, wherein the preset session information corresponding to the same sub-data stream is the same.
[0166] Optionally, multiple processors in the target processor set share the same preset session information.
[0167] Optionally, the processor may also execute the following program code: determining the traffic data of the sub-data stream and the processing performance of the processor set; matching the traffic data and the processing performance to determine the target processor set, wherein the processing performance of the target processor set matches the traffic.
[0168] Optionally, the processor may also execute program code of one of the following steps: determining a target processor from a plurality of processors based on the data volume of the first data packet; randomly determining a target processor from a plurality of processors; or polling a plurality of processors to determine a target processor.
[0169] Optionally, the processor may further execute program codes of the following steps: determining multiple original processors configured for the network card; and grouping the multiple original processors based on attributes of the multiple original processors to obtain multiple processor sets.
[0170] Optionally, the processor may also execute program code for the following steps: testing the multiple original processors based on the properties of the multiple original processors to obtain test results of the multiple original processors, wherein the test results are used to characterize the processing performance of the multiple original processors; and grouping the multiple original processors based on the test results of the multiple original processors to obtain multiple processor sets.
[0171] Optionally, the processor may also execute the program code of the following steps: receiving a second data packet returned by the target processor, wherein the second data packet is used to represent the data packet obtained by parsing and repackaging the first data packet by the target processor; combining the second data packets based on the order of multiple first data packets to obtain a combined data stream; integrating the combined data streams based on the order of the sub-data streams to obtain output traffic; and forwarding the output traffic through the network card.
[0172] Optionally, the above-mentioned processor can also execute the program code of the following steps: displaying the collection identification information of the sub-data stream and the target processor set on the interactive interface; responding to the first confirmation instruction acting on the interactive interface, determining the target processor corresponding to the first data packet from the multiple processors included in the target processor set; responding to the first modification instruction acting on the interactive interface, determining the target processor corresponding to the first data packet from the multiple processors included in the modification processor set corresponding to the first modification instruction.
[0173] Optionally, the above-mentioned processor can also execute the program code of the following steps: displaying the first data packet and the device identification information of the target processor on the interactive interface; sending the first data packet to the target processor in response to the second confirmation instruction acting on the interactive interface; and sending the first data packet to the modification processor corresponding to the second modification instruction in response to the second modification instruction acting on the interactive interface.
[0174] According to an embodiment of the present disclosure, a method is provided for slicing input traffic received by a network card to obtain at least one sub-data stream; determining a target processor set corresponding to the sub-data stream from a plurality of processor sets; slicing the sub-data stream to obtain a plurality of first data packets; determining a target processor corresponding to the first data packet from a plurality of processors included in the target processor set; and sending the first data packet to the target processor. It is easy to note that by slicing the input traffic to obtain sub-data streams and slicing the sub-data streams to obtain data packets, not only the data processing load of the processor set can be reduced, but also the data processing load of the target processor in the target processor set can be reduced, thereby improving the processing stability and accuracy of the target processor set. In addition, different first data packets in the same sub-data stream are processed by different processors in the same target processor set. By having a one-to-one correspondence between the first data packet and the target processor, the purpose of accurately processing the first data packet is further achieved, thereby achieving the technical effect of improving the processing accuracy and stability of the flow data processing, thereby solving the technical problems of low processing accuracy and poor processing stability of the flow data processing in the related art.
[0175] Those skilled in the art will appreciate that the structure shown in FIG12 is merely illustrative, and the computer terminal may also be a smartphone (such as an Android phone, iOS phone, etc.), a tablet computer, a PDA, a mobile internet device (MID), a PAD, or other terminal device. FIG12 does not limit the structure of the above-mentioned electronic devices. For example, the computer terminal A may include more or fewer components (such as a network interface, a display device, etc.) than those shown in FIG12, or may have a configuration different from that shown in FIG12.
[0176] A person skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0177] Example 7
[0178] The embodiment of the present disclosure further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the traffic processing method provided in the first embodiment.
[0179] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0180] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: in response to input traffic received by the network card, splitting the input traffic to obtain at least one sub-data stream; determining a target processor set corresponding to the sub-data stream from a plurality of processor sets, wherein different target processor sets are used to process different sub-data streams; splitting the sub-data stream to obtain a plurality of first data packets; determining a target processor corresponding to the first data packet from a plurality of processors included in the target processor set, wherein different target processors are used to process different first data packets; and sending the first data packet to the target processor.
[0181] Optionally, in this embodiment, the storage medium is further configured to store program code for executing the following steps: parsing the input traffic to obtain at least one preset session information carried in the input traffic; dividing the input traffic based on the preset session information to obtain sub-data streams, wherein the preset session information corresponding to the same sub-data stream is the same.
[0182] Optionally, multiple processors in the target processor set share the same preset session information.
[0183] Optionally, in this embodiment, the storage medium is also configured to store program code for performing the following steps: determining the traffic data of the sub-data flow and the processing performance of the processor set; matching the traffic data and the processing performance to determine the target processor set, wherein the processing performance of the target processor set matches the traffic.
[0184] Optionally, in this embodiment, the storage medium is also configured to store program code for performing one of the following steps: determining a target processor from a plurality of processors based on the data volume of the first data packet; randomly determining a target processor from a plurality of processors; or polling a plurality of processors to determine a target processor.
[0185] Optionally, in this embodiment, the storage medium is further configured to store program codes for executing the following steps: determining multiple original processors configured for the network card; and grouping the multiple original processors based on attributes of the multiple original processors to obtain multiple processor sets.
[0186] Optionally, in this embodiment, the storage medium is also configured to store program code for executing the following steps: based on the properties of the multiple original processors, testing the multiple original processors to obtain test results of the multiple original processors, wherein the test results are used to characterize the processing performance of the multiple original processors; based on the test results of the multiple original processors, grouping the multiple original processors to obtain multiple processor sets.
[0187] Optionally, in this embodiment, the storage medium is further configured to store program code for executing the following steps: receiving a second data packet returned by the target processor, wherein the second data packet is used to represent a data packet obtained by parsing and repackaging the first data packet by the target processor; combining the second data packets based on the order of multiple first data packets to obtain a combined data stream; integrating the combined data streams based on the order of the sub-data streams to obtain output traffic; and forwarding the output traffic through the network card.
[0188] Optionally, in this embodiment, the storage medium is also configured to store program code for executing the following steps: displaying the set identification information of the sub-data stream and the target processor set on the interactive interface; in response to a first confirmation instruction acting on the interactive interface, determining the target processor corresponding to the first data packet from the multiple processors included in the target processor set; in response to a first modification instruction acting on the interactive interface, determining the target processor corresponding to the first data packet from the multiple processors included in the modification processor set corresponding to the first modification instruction.
[0189] Optionally, in this embodiment, the storage medium is also configured to store program code for executing the following steps: displaying the first data packet and device identification information of the target processor on the interactive interface; sending the first data packet to the target processor in response to a second confirmation instruction acting on the interactive interface; and sending the first data packet to the modification processor corresponding to the second modification instruction in response to the second modification instruction acting on the interactive interface.
[0190] The serial numbers of the above-mentioned embodiments of the present disclosure are for description only and do not represent the advantages or disadvantages of the embodiments.
[0191] In the above embodiments of the present disclosure, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0192] In the several embodiments provided in the present disclosure, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0193] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0194] In addition, the functional units in the various embodiments of the present disclosure may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0195] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0196] The above is only a preferred embodiment of the present disclosure. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present disclosure. These improvements and modifications should also be regarded as within the scope of protection of the present disclosure.
Claims
1. A traffic processing method, comprising: In response to input traffic received by the network card, the input traffic is split to obtain at least one sub-data stream; Determine a target processor set corresponding to the sub-data stream from a plurality of processor sets, wherein different target processor sets are used to process different sub-data streams; Splitting the sub-data stream to obtain a plurality of first data packets; Determining a target processor corresponding to the first data packet from a plurality of processors included in the target processor set, wherein different target processors are used to process different first data packets; The first data packet is sent to the target processor.
2. The method according to claim 1, wherein: The input traffic is divided to obtain at least one sub-data stream, including: Parsing the input traffic to obtain at least one preset session information carried in the input traffic; The input traffic is divided based on the preset session information to obtain the sub-data streams, wherein the preset session information corresponding to the same sub-data stream is the same.
3. The method according to claim 2, wherein: The multiple processors in the target processor set share the same preset session information.
4. The method according to claim 1, wherein: Determining a target processor set corresponding to the sub-data stream from a plurality of processor sets includes: Determining traffic data of the sub-data streams and processing performance of the processor set; The traffic data and the processing performance are matched to determine the target processor set, wherein the processing performance of the target processor set matches the traffic.
5. The method according to claim 1, wherein: Determining a target processor corresponding to the first data packet from a plurality of processors included in the target processor set includes one of the following: determining the target processor from the plurality of processors based on the data volume of the first data packet; randomly determining the target processor from among the plurality of processors; The multiple processors are polled to determine the target processor.
6. The method according to claim 1, wherein: The method further comprises: determining a plurality of original processors configured for the network card; The plurality of original processors are grouped based on the attributes of the plurality of original processors to obtain the plurality of processor sets.
7. The method according to claim 6, wherein: The plurality of original processors are grouped based on the attributes of the plurality of original processors to obtain the plurality of processor sets, including: Based on the properties of the multiple original processors, the multiple original processors are tested to obtain test results of the multiple original processors, wherein the test results are used to characterize the processing performance of the multiple original processors; The multiple original processors are grouped based on the test results of the multiple original processors to obtain the multiple processor sets.
8. The method according to claim 1, wherein: The method further comprises: receiving a second data packet returned by the target processor, wherein the second data packet is used to represent a data packet obtained by parsing and repackaging the first data packet by the target processor; Based on the order of the plurality of first data packets, combining the second data packets to obtain a combined data stream; Based on the order of the sub-data flows, the combined data flows are integrated to obtain output traffic; The output traffic is forwarded through the network card.
9. The method according to claim 1, wherein: After determining a target processor set corresponding to the sub-data stream from a plurality of processor sets, the method further comprises: Displaying the set identification information of the sub-data stream and the target processor set on an interactive interface; In response to a first confirmation instruction acting on the interactive interface, determining the target processor corresponding to the first data packet from a plurality of processors included in the target processor set; In response to a first modification instruction acting on the interactive interface, the target processor corresponding to the first data packet is determined from a plurality of processors included in a modification processor set corresponding to the first modification instruction.
10. The method according to claim 1, wherein: After determining the target processor corresponding to the first data packet from the plurality of processors included in the target processor set, the method further includes: Displaying the first data packet and device identification information of the target processor on an interactive interface; In response to a second confirmation instruction acting on the interactive interface, sending the first data packet to the target processor; In response to a second modification instruction acting on the interactive interface, the first data packet is sent to a modification processor corresponding to the second modification instruction.
11. The method according to claim 4, wherein: The processing performance includes at least one of the following: processing time, processing speed, processing efficiency, and processing accuracy.
12. A traffic processing method, comprising: In response to an input instruction on the operation interface, a plurality of first data packets received by the network card are displayed on the operation interface, wherein the first data packets are data packets obtained by segmenting at least one data stream, and the sub-data streams are data streams obtained by segmenting input traffic, and the input traffic is received by the network card; In response to a processing instruction acting on the operation interface, the first data is displayed on the operation interface. The invention relates to a target processor corresponding to a data packet, wherein the first data packet is processed by the target processor, the target processor is a processor determined from a plurality of processors included in a target processor set, the target processor set is a processor set corresponding to the sub-data stream determined from a plurality of processor sets, different target processor sets are used to process different sub-data streams, and different target processors are used to process different first data packets.
13. A flow processing device, comprising: The first processing module is configured to split the input traffic received by the network card in response to the input traffic to obtain at least one sub-data flow; The first determination module is configured to determine a target processor set corresponding to the sub-data stream from a plurality of processor sets, wherein different target processor sets are used to process different sub-data streams; The second processing module is configured to divide the sub-data stream into multiple first data packets; The second determination module is configured to determine a target processor corresponding to the first data packet from a plurality of processors included in the target processor set, wherein different target processors are used to process different first data packets; The sending module is configured to send the first data packet to the target processor.
14. The flow processing device according to claim 13, wherein: The first processing module comprises: The parsing unit is configured to parse the input traffic to obtain at least one preset session information carried in the input traffic; The segmentation unit is configured to segment the input traffic based on the preset session information to obtain the sub-data streams, wherein the preset session information corresponding to the same sub-data stream is the same.
15. The flow processing device according to claim 14, wherein: The multiple processors in the target processor set share the same preset session information.
16. The flow processing device according to claim 13, wherein: The first determining module includes: The first determination unit is configured to determine the flow data of the sub-data flow and the processing performance of the processor set; The matching unit is configured to match the traffic data with the processing performance to determine the target processor set, wherein the processing performance of the target processor set matches the traffic.
17. A flow processing device, comprising: The first display module is configured to respond to an input instruction on the operation interface and display a plurality of first data packets received by the network card on the operation interface, wherein the first data packet is a data packet obtained by segmenting at least one data stream, and the sub-data stream is a data stream obtained by segmenting an input flow, and the input flow is received by the network card; The second display module is configured to respond to the processing instruction acting on the operation interface and display the target processor corresponding to the first data packet on the operation interface, wherein the first data packet is displayed by the target processor. The target processor is used for processing, the target processor is a processor determined from multiple processors included in the target processor set, the target processor set is a processor set corresponding to the sub-data stream determined from multiple processor sets, different target processor sets are used to process different sub-data streams, and different target processors are used to process different first data packets.
18. A gateway device, comprising: A plurality of processor sets, wherein different processor sets are used to process different data streams, and different processors in the same processor set are used to process different data packets; A network card is connected to the multiple processor sets, and is used to split the input traffic to obtain at least one sub-data stream, determine the target processor set corresponding to the sub-data stream from the multiple processor sets, split the sub-data stream to obtain multiple first data packets, determine the target processor corresponding to the first data packet from the multiple processors included in the target processor set, and send the first data packet to the target processor.
19. An electronic device comprising: A memory storing an executable program; A processor, configured to run the program, wherein the program executes the method according to any one of claims 1 to 12 when running.
20. A computer-readable storage medium comprising a stored executable program, wherein: When the executable program is running, the device where the storage medium is located is controlled to execute the method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Method and system for processing data streams
CN102761487A
A parallel method for agglomerative clustering of non-stationary data
CN105247487A
A parallel method for agglomerative clustering of non-stationary data
WO2014194086A1
Apparatus and method for data processing, chip, computer device, and medium
WO2022247193A1