Traffic processing method, gateway device, electronic device and storage medium
By splitting the input traffic and determining the target processor for the processor set, the problems of poor stability and low accuracy of large-traffic data processing in the prior art are solved, and more efficient traffic data processing is achieved.
Patent Information
- Application Number
- CN202311383794.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-10-17
- Filing Date
- 2023-10-23
- Publication Date
- 2025-04-18
AI Technical Summary
The prior art has problems of poor processing stability and low accuracy when processing large traffic data, especially in elephant stream data processing.
By segmenting the input traffic, a sub-data stream is obtained, and the target processor set of the sub-data stream is determined from the multiple processor sets, the sub-data stream is further segmented, and a plurality of first data packets are obtained, and these data packets are then sent to the corresponding target processor.
This method can reduce the data processing volume of the processor set and the target processor, improve processing stability and accuracy, and ensure the accuracy and stability of traffic data processing.
Smart Images

Figure CN119854213A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of traffic data processing in the cloud network field, and more specifically, to a traffic processing method, a gateway device, an electronic device, and a storage medium. Background Technology
[0002] Currently, network interface card (NIC) models based on CPU forwarding are mainly used to process traffic data. However, existing models encounter bottlenecks when processing large volumes of traffic, resulting in poor stability in traffic data processing. Furthermore, existing models sometimes send the same traffic data to different processor cores for processing, which also leads to low accuracy in traffic data processing.
[0003] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0004] This application provides 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 related technologies for processing traffic data.
[0005] According to one aspect of the embodiments of this application, a traffic processing method is provided, comprising: in response to input traffic received by a network interface card (NIC), segmenting 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; segmenting 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.
[0006] According to another aspect of the embodiments of this application, a traffic processing method is also provided, comprising: responding to an input command applied to an operation interface, displaying a plurality of first data packets received by a network card on the operation interface, wherein the first data packet is a data packet obtained by segmenting at least one data stream, the sub-data stream is a data stream obtained by segmenting input traffic, and the input traffic is received by the network card; responding to a processing command applied to 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 a plurality of processors included in a target processor set, the target processor set is a set of processors corresponding to the sub-data streams determined from the 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.
[0007] According to another aspect of the embodiments of this application, a traffic processing apparatus is also provided, comprising: a first processing module, configured to segment input traffic in response to input traffic received by a network interface card (NIC) to obtain at least one sub-data stream; a first determining module, 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, configured to segment the sub-data stream to obtain a plurality of first data packets; a second determining module, 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, configured to send the first data packet to the target processor.
[0008] According to another aspect of the embodiments of this application, a traffic processing apparatus is also provided, comprising: a first display module, configured to respond to an input command applied to an operation interface and display a plurality of first data packets received by a 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 input traffic, and the input traffic is received by the network card; and a second display module, configured to respond to a processing command applied to 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 a plurality of processors included in a target processor set, the target processor set is a set of processors corresponding to sub-data streams 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.
[0009] According to another aspect of the embodiments of this application, a gateway device is also provided, including: 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 interface card (NIC), connected to the plurality of processor sets, used to segment the input traffic to obtain at least one sub-data stream, determine a target processor set corresponding to the sub-data stream from the plurality of processor sets, segment the sub-data stream to obtain a plurality of first data packets, determine a target processor corresponding to the first data packet from the plurality of processors included in the target processor set, and send the first data packet to the target processor.
[0010] According to another aspect of the embodiments of this application, an electronic device is also provided, including: a memory storing an executable program; and a processor for running the program, wherein the program executes the method of any one of the above when it runs.
[0011] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein, when the executable program is running, the device where the storage medium is located executes any of the above methods.
[0012] In this embodiment, in response to the input traffic received by the network interface card (NIC), the input traffic is segmented 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 segmented 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 readily apparent that by segmenting the input traffic to obtain sub-data streams and segmenting the sub-data streams to obtain data packets, not only can the data processing volume of the processor set be reduced, but also the data processing volume of the target processor in the target processor set can be reduced. Therefore, the processing stability and accuracy of the target processor set can be improved. Furthermore, different first data packets in the same sub-data stream are processed by different processors in the same target processor set. By establishing a one-to-one correspondence between the first data packet and the target processor, the goal of accurately processing the first data packet is further achieved. This realizes the technical effect of improving the processing accuracy and stability of traffic data processing, thereby solving the technical problems of low processing accuracy and poor processing stability in related technologies.
[0013] It is worth noting that the general description above and the detailed description that follow are merely for illustrative purposes and do not constitute a limitation on this application. Attached Figure Description
[0014] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0015] Figure 1 This is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a traffic processing method according to an embodiment of this application;
[0016] Figure 2 This is a structural block diagram of a computing environment according to an embodiment of this application;
[0017] Figure 3 This is a structural block diagram of a service mesh according to an embodiment of this application;
[0018] Figure 4 This is a flowchart of a traffic processing method according to Embodiment 1 of this application;
[0019] Figure 5 This is a schematic diagram of an optional interactive interface according to Embodiment 1 of this application;
[0020] Figure 6 This is a schematic diagram of an optional traffic processing method according to Embodiment 1 of this application;
[0021] Figure 7 This is a flowchart of an optional traffic processing method according to Embodiment 1 of this application;
[0022] Figure 8 This is a flowchart of a traffic processing method according to Embodiment 2 of this application;
[0023] Figure 9 This is a schematic diagram of an optional user interface according to Embodiment 2 of this application;
[0024] Figure 10 This is a schematic diagram of a flow processing device according to Embodiment 3 of this application;
[0025] Figure 11 This is a schematic diagram of a flow processing device according to Embodiment 4 of this application;
[0026] Figure 12 This is a structural block diagram of a computer terminal according to an embodiment of this application. Detailed Implementation
[0027] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0029] First, some nouns or terms that appear in the description of the embodiments of this application shall be interpreted as follows:
[0030] Gateway server (GW): Used to provide a simple and effective unified application programming interface (API) routing management method for microservice architecture.
[0031] Server Network Interface Card (NIC): Used for the connection between servers and network devices such as switches.
[0032] A network-forwarded session is a series of related interactions between a single client and a web server over a period of time, used to record the user's state.
[0033] Polling: The polling request interface only retains one task ID. You only need to send the task ID to get the status of the current task. If a result is returned, the polling ends. If no result is returned, wait for a while and then send the request again. This is used to solve the problem of excessive server pressure.
[0034] Elephant stream: A process of continuously transmitting large amounts of data over a network link. In other words, a high-speed (high bandwidth usage) and long-duration stream is an elephant stream. Examples include virtual machine migration, data migration, and video storage.
[0035] Example 1
[0036] According to an embodiment of this application, a traffic processing method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0037] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 This is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a traffic processing method according to an embodiment of this application. Figure 1As shown, the computer terminal 10 (or mobile device) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), 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 a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 Different configurations shown.
[0038] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0039] 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 embodiments of this application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the above-mentioned traffic processing method. The memory 104 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 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0040] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0041] The display can be, for example, a touchscreen liquid crystal display (LCD), which allows the user to interact with the user interface of the computer terminal 10 (or mobile device).
[0042] Figure 1 The hardware structure block diagram shown can serve not only as an exemplary block diagram of the aforementioned computer terminal 10 (or mobile device), but also as an exemplary block diagram of the aforementioned server. In one optional embodiment, Figure 2 The use of the above is illustrated in a block diagram. Figure 1 The computer terminal 10 (or mobile device) shown is an embodiment of a computing node in computing environment 201. Figure 2 This is a structural block diagram of a computing environment according to an embodiment of this application, such as... Figure 2 As shown, computing environment 201 includes multiple computing nodes (such as servers) running on a distributed network (represented as 210-1, 210-2, ..., in the diagram). Each computing node contains local processing and memory resources, and end user 202 can remotely run applications or store data within computing environment 201. Applications can be provided as multiple services 220-1, 220-2, 220-3, and 220-4 within computing environment 201, representing services "A", "D", "E", and "H", respectively.
[0043] 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 requests of end user 202 can be provided to ingress gateway 230. Ingress gateway 230 may include a corresponding agent to handle the provisioning and / or requests for services (one or more services provided in computing environment 201).
[0044] The services are provided or deployed based on various virtualization technologies supported by the computing environment 201. In some embodiments, services may be provided based on virtual machine (VM)-based virtualization, container-based virtualization, and / or similar methods. VM-based virtualization can simulate a real computer by initializing a virtual machine, executing programs and applications without directly accessing any actual hardware resources. While the machine is virtualized by a virtual machine, container-based virtualization can launch containers to virtualize an entire operating system (OS), allowing multiple workloads to run on a single OS instance.
[0045] 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, such as Figure 2 As shown, service 220-2 can be equipped with one or more Pods 240-1, 240-2, ..., 240-N (collectively referred to as Pods). A Pod can include a proxy 245 and one or more containers 242-1, 242-2, ..., 242-M (collectively referred to as containers). One or more containers within a Pod handle requests related to one or more corresponding functions of the service. Proxy 245 typically controls service-related network functions such as routing and load balancing. Other services can also be equipped with similar Pods.
[0046] During operation, executing a user request from end user 202 may require invoking one or more services in computing environment 201, and executing one or more functions of one service may require invoking one or more functions of another service. For example... Figure 2 As shown, service "A" 220-1 receives user requests from terminal user 202 from ingress gateway 230. Service "A" 220-1 can call service "D" 220-2, and service "D" 220-2 can request service "E" 220-3 to perform one or more functions.
[0047] The aforementioned computing environment can be a cloud computing environment, where resource allocation is managed by cloud services, allowing functionality development without needing to consider implementation, adjustment, or server scaling. This computing environment allows developers to execute event-responsive code without building or maintaining complex infrastructure. Services can be partitioned into a set of functions that can automatically and independently scale, rather than scaling a single hardware device to handle potential loads.
[0048] In another alternative embodiment, Figure 3 The use of the above is illustrated in a block diagram. Figure 1 The computer terminal 10 (or mobile device) shown is an embodiment of a service mesh. Figure 3This is a structural block diagram of a service mesh according to an embodiment of this application, such as... Figure 3 As shown, the service mesh 300 is mainly 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 across different clusters / machines.
[0049] like Figure 3 As shown, a microservice may include application service instance A and application service instance B, which together form the functional application layer of service mesh 300. In one implementation, application service instance A runs as a container / process 308 on machine / workload container group 314 (Pod), and application service instance B runs as a container / process 310 on machine / workload container group 316 (Pod).
[0050] In one implementation, application service instance A can be a product query service, and application service instance B can be a product order placement service.
[0051] like Figure 3 As shown, application service instance A and grid agent (sidecar) 303 coexist in machine workload container group 614, and application service instance B and grid agent 305 coexist in machine workload container 314. Grid agents 303 and 305 form the data plane layer of service mesh 300. Grid agents 303 and 305 run as containers / processes 304 and 306 respectively, and can receive requests 312 for product query services. Grid agent 303 and application service instance A can communicate bidirectionally, and grid agent 305 and application service instance B can also communicate bidirectionally. Furthermore, grid agents 303 and 305 can also communicate bidirectionally with each other.
[0052] In one implementation, traffic from application service instance A is routed to the appropriate destination via mesh proxy 303, and network traffic from application service instance B is routed to the appropriate destination via mesh proxy 305. It should be noted that the network traffic mentioned here includes, but is not limited to, Hypertext Transfer Protocol (HTTP), Representational State Transfer (REST), high-performance, general-purpose open-source frameworks (Google Remote Procedure Call, gRPC), and open-source in-memory data structure storage systems (Redis).
[0053] In one implementation, the functionality of the extended data plane layer can be achieved by writing custom filters for the proxy (Envoy) in service mesh 300. The service mesh proxy configuration can enable the service mesh to correctly proxy service traffic, achieving 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.
[0054] like Figure 3 As shown, the service mesh 300 also includes a control plane layer. This control plane layer can consist of a set of services running in a dedicated namespace, hosted by a managed control plane component 301 within machine / workload container groups (machine / Pods) 302. Figure 3 As shown, the managed control plane component 301 communicates bidirectionally with grid agents 303 and 305. The managed control plane component 301 is configured to perform various control and management functions. For example, it receives telemetry data transmitted from grid agents 303 and 305 and can further aggregate this telemetry data. In addition to these services, the managed control plane component 301 can also provide a user-facing application programming interface (API) to facilitate manipulation of network behavior and the provision of configuration data to grid agents 303 and 305.
[0055] Under the aforementioned operating environment, this application provides the following: Figure 4 The traffic processing method shown. Figure 4 This is a flowchart of a traffic processing method according to Embodiment 1 of this application, as follows: Figure 4 As shown, the method may include the following steps:
[0056] Step S402: In response to the input traffic received by the network card, the input traffic is segmented to obtain at least one sub-data stream.
[0057] The aforementioned network interface card (NIC) can be a NIC in a gateway device capable of receiving and segmenting input traffic. Through the NIC, network traffic transmitted in the network can be received and forwarded to other networks or clients. The specific conditions for segmenting input traffic can be set by the user according to actual needs. For example, input traffic can be segmented based on its session type to obtain multiple sub-data streams of different session types. Alternatively, it can be segmented based on the data volume of the input traffic to obtain multiple sub-data streams of different data volumes, but this is not limited to these methods. In this embodiment, session type is used as an example to segment the input traffic.
[0058] In one optional embodiment, after the network interface card (NIC) receives input traffic forwarded by the gateway device, in order to ensure correct and stable processing of the input traffic, it can first segment the input traffic based on the session type to obtain at least one sub-data stream. Alternatively, the input traffic can also be segmented based on its data volume to obtain at least one sub-data stream.
[0059] Step S404: 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.
[0060] The aforementioned multiple processor sets can be sets of processors in a gateway device used to process sub-data streams. Different processor sets are used to process sub-data streams of different session types, and each processor set contains multiple different processors. The specific type of processor set is not limited in this embodiment; users can set it according to their actual needs. For example, it can be a set of multiple Central Processing Units (CPUs), but it is not limited to this. The aforementioned target processor set can be a processor set corresponding to a sub-data stream, used to process the corresponding sub-data stream.
[0061] In one optional embodiment, after obtaining multiple sub-data streams, the target processor set corresponding to each sub-data stream can be determined based on the sub-data streams. For example, when there are 3 sub-data streams of different Session types and 10 different processor sets, the 3 sub-data streams of different Session types can first be labeled with identification information to obtain the identification information of the 3 sub-data streams (e.g., IDs, but not limited to this). Simultaneously, the processor sets can also be labeled with identification information to obtain the identification information of the 10 processor sets (e.g., IDs, but not limited to this). At this point, a sub-data stream can be selected and matched with each of the 10 processor sets to determine the target processor set. For example, the processor set with ID number 1 can first be judged based on the sub-data stream. If the processor set with ID number 1 can accurately, quickly, and stably process the sub-data stream, it indicates that the processing capability of the processor set matches the sub-data stream. At this point, the processor set with ID number 1 can be determined as the target processor set for the sub-data stream. For example, if 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. In this case, the processor set with ID number 2 can be selected according to the ID number order, and then the processor set with ID number 2 can be re-evaluated based on the sub-data stream. If 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. This process continues until the target processor set of the sub-data stream is determined.
[0062] For example, users can pre-establish a mapping relationship between the session type and the processor set of sub-data streams. Once three sub-data streams and ten processor sets are obtained, the processor set matching the session type can be directly determined based on the mapping relationship, thus obtaining the target processor set corresponding to the sub-data stream. Similarly, when multiple sub-data streams with different data volumes are obtained, the target processing set can be determined by matching these sub-data streams with the data volumes that multiple processor sets can process, based on the data volume. However, this is not the only possible approach. 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 elaborated upon here.
[0063] Step S406: The sub-data stream is segmented to obtain multiple first data packets.
[0064] In one optional embodiment, after obtaining the sub-data stream, the sub-data stream can be randomly divided to obtain multiple first data packets. Alternatively, the sub-data stream can be divided evenly to obtain multiple first data packets, but this is not the only option.
[0065] Step S408: 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.
[0066] The target processor mentioned above can be the processor corresponding to the first data packet from the set of target processors.
[0067] In one optional embodiment, when the sub-data stream contains 5 first data packets and the target processor set contains 8 processors, firstly, the 5 first data packets can be labeled with IDs, and the 8 processors can also be labeled with IDs. Secondly, one first data packet can be selected, and then the first data packet can be matched with each of the 8 processors to determine the target processor. For example, the processor with ID number 1 can 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 processor's processing capability 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 example, if the processor with ID number 1 cannot process the first data packet accurately, quickly, and stably, it indicates that the processor with ID number 1 does not match the first data packet. In this case, the processor with ID number 2 can be selected according to the ID number order, and then the processor with ID number 2 can be re-evaluated based on the first data packet. If the processor with ID number 2 can process the first data packet accurately, quickly, and stably, it indicates that the processor's processing capability matches the first data packet. At this point, the processor with ID number 2 can be determined as the target processor for the first data packet. This process continues until the set of target processors for the first data packet is determined. Alternatively, the user can pre-establish a mapping relationship between first data packets and processors. Based on this preset relationship, the target processor corresponding to the first data packet can be directly determined, and subsequently, the first data packet can be processed through the target processor. Furthermore, when multiple first data packets are obtained, the target processor capable of processing the corresponding data volume accurately, quickly, and stably can be determined from the set of target processors based on the data volume of the first data packet. The target processor can then be used to process the first data packet, but this is not the only possible approach. 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 repeated here.
[0068] Step S410: Send the first data packet to the target processor.
[0069] In one optional embodiment, after determining the first data packet and its corresponding target processor, the first data packet can be sent to the target processor for processing. For example, the target processor can parse the first data packet and then repackage it, where the network protocols before and after repackaging may be different. Alternatively, the target processor can also verify the first data packet to determine whether it can be forwarded, but this is not the only option.
[0070] In another optional embodiment, to ensure stable processing of input traffic, after the network card receives input traffic, it can first segment the input traffic based on the session type to obtain at least one sub-data stream. Secondly, it can assign IDs to the sub-data streams and multiple processor sets. Then, it can select a sub-data stream and compare it with multiple processor sets. For example, it can compare the processor set with ID 1 based on the sub-data stream. If the processor set with ID 1 can accurately, quickly, and stably process the sub-data stream, it indicates that the processing capability of the processor set matches the sub-data stream. At this point, the processor set with ID 1 can be determined as the target processor set for the sub-data stream. Then, to ensure correct processing of the sub-data stream, it can be randomly... At least one sub-data stream can be segmented to obtain multiple first data packets, but this is not limited to this. At least one sub-data stream can also be segmented evenly to obtain multiple first data packets. Then, the first data packets and multiple processors can be labeled with IDs, and the target processor can be determined based on the processor's processing performance and session type. Alternatively, the target processor can be determined directly based on a 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. If the processor with ID number 1 can accurately, quickly, and stably process the first data packet, it indicates that the processor's processing capability matches the first data packet. At this time, the processor with ID number 1 can be determined as the target processor for the first data packet. Finally, the corresponding first data packet can be sent to the target processor, and the target processor can process the corresponding first data packet.
[0071] In this embodiment, in response to the input traffic received by the network interface card (NIC), the input traffic is segmented 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 segmented 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 readily apparent that by segmenting the input traffic to obtain sub-data streams and segmenting the sub-data streams to obtain data packets, not only can the data processing volume of the processor set be reduced, but also the data processing volume of the target processor in the target processor set can be reduced. Therefore, the processing stability and accuracy of the target processor set can be improved. Furthermore, different first data packets in the same sub-data stream are processed by different processors in the same target processor set. By establishing a one-to-one correspondence between the first data packet and the target processor, the goal of accurately processing the first data packet is further achieved. This realizes the technical effect of improving the processing accuracy and stability of traffic data processing, thereby solving the technical problems of low processing accuracy and poor processing stability in related technologies.
[0072] In the above embodiments of this application, the input traffic is segmented 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 segmenting 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.
[0073] The aforementioned preset session information can be session information, but is not limited to it.
[0074] In one optional embodiment, after receiving the 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. Secondly, based on the parsed at least one preset session information, the input traffic can be segmented 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.
[0075] In the above embodiments of this application, 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, multiple processors can handle the same problem task, and the processor core speed can be reduced, reducing competition and making the performance more stable.
[0076] In one 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 segmented. Because the sub-data stream carries the same preset session information, after the sub-data stream is segmented into multiple first data packets, the multiple first data packets 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.
[0077] In the above embodiments of this application, determining the target processor set corresponding to a sub-data stream from multiple processor sets includes: 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 is matched with the traffic.
[0078] The aforementioned processing performance includes at least one of the following: processing time, processing speed, processing efficiency, and processing accuracy.
[0079] In one optional embodiment, after obtaining at least one sub-data stream, the network interface card (NIC) first determines the traffic data of the sub-data stream and the processing performance of the processor set. Then, it matches the traffic data with the processing performance. For example, it determines whether the processing time, processing speed, and processing accuracy of the processor set meet the user's requirements. If the user's requirements are met, it is determined that the processing performance of the processor set matches the traffic of the corresponding sub-data stream, and thus, the processor set is identified as the target processor set for the sub-data stream. It should be noted that the user's specific requirements are not limited in this embodiment; the user can set them according to their actual needs. In this embodiment, when the user requires a processing time of less than 0.1ms and a processing accuracy of greater than 99%, if the processor set's processing time for the traffic data is greater than or equal to 0.1ms, or its 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.
[0080] In the above embodiments of this application, determining the target processor corresponding to the first data packet from multiple processors included in the target processor set includes one of the following: determining the target processor from multiple processors based on the data volume of the first data packet; randomly determining the target processor from multiple processors; or polling multiple processors to determine the target processor.
[0081] In one optional embodiment, after obtaining multiple first data packets, a processor capable of accurately, error-free, and stably processing the data volume can be determined from multiple processors based on the data volume of the first data packets, thus obtaining a target processor.
[0082] In another alternative embodiment, after obtaining multiple first data packets, since the data volume of the first data packets is small and multiple processors in the target processor set can accurately, error-free and stably process the first data packets, the target processor can be randomly determined from the multiple processors.
[0083] In another optional embodiment, after obtaining multiple first data packets, multiple processors can be polled based on the multiple first data packets. For example, firstly, a corresponding identifier (ID) can be assigned to the multiple first data packets, and a corresponding ID can be assigned to the multiple processors. The ID of the first data packet and the ID of the processor have the same sequence number. Secondly, multiple processors can be polled based on the IDs of different data packets respectively, thereby determining the target processor.
[0084] In the above embodiments of this application, the method further includes: determining multiple raw processors configured for the network card; and grouping the multiple raw processors based on their attributes to obtain multiple processor sets.
[0085] The aforementioned attributes may include, but are not limited to, the type, architecture, number of processor cores, and interconnection relationships of the original processor.
[0086] In one optional embodiment, multiple raw processors configured for the network interface card (NIC) can first be determined; that is, the processors in the gateway device can first be determined. Then, these raw processors can be grouped based on their attributes to obtain multiple processor sets. For example, they can be grouped based on their type, structure, and connection relationship. Raw processors of the same type can be grouped together to obtain multiple processor sets; raw processors with the same structure can be grouped together to obtain multiple processor sets; and raw processors with the same connection relationship can be grouped together to obtain multiple processor sets. Different processor sets can handle different session types of sub-data streams.
[0087] In the above embodiments of this application, multiple original processors are grouped based on their attributes to obtain multiple processor sets, including: testing multiple original processors based on their attributes to obtain test results for multiple original processors, wherein the test results are used to characterize the processing performance of multiple original processors; and grouping multiple original processors based on their test results to obtain multiple processor sets.
[0088] In one optional embodiment, the processing performance of multiple raw processors can first be tested based on their attributes to obtain processing performance test results. Then, the multiple raw processors can be grouped based on these results to obtain multiple processor sets. For example, multiple processors with the same processing performance can be grouped together to obtain multiple processor sets, or multiple processors with processing performance within the same range can be grouped together to obtain multiple processor sets, but this is not limited to these methods.
[0089] In the above embodiments of this application, the method further includes: receiving a second data packet returned by the target processor, wherein the second data packet is used to characterize the data packet obtained by the target processor parsing and repackaging the first data packet; combining the second data packet based on the order of multiple first data packets to obtain a combined data stream; integrating the combined data stream based on the order of the sub-data streams to obtain output traffic; and forwarding the output traffic through the network interface card.
[0090] In one optional embodiment, after the target processor finishes parsing the first data packet, it first repackages the parsed first data packet to obtain a second data packet. Then, after obtaining the second data packet, it can be combined based on the order of multiple first data packets to obtain a combined data stream. The combined data stream can be integrated based on the order of the sub-data streams to obtain the complete output traffic. Finally, the output traffic can be forwarded to the receiving client through the network card. The number of sending clients and receiving clients can be one or more. The specific number is not limited in this embodiment, and users can set it according to their actual needs.
[0091] In the above embodiments of this application, after determining the target processor set corresponding to the sub-data stream from multiple processor sets, the method further includes: displaying set identification information of the sub-data stream and the target processor set on an interactive interface; responding to a first confirmation instruction acting on the interactive interface, determining the target processor corresponding to the first data packet from multiple processors included in the target processor set; and responding to a first modification instruction acting on the interactive interface, determining the target processor corresponding to the first data packet from multiple processors included in the modification processor set corresponding to the first modification instruction.
[0092] The aforementioned set identification information may include, but is not limited to, the identifier (ID) of the target processor set. The aforementioned first confirmation instruction may be an instruction generated in response to the user's action on the confirmation button in the interactive interface, capable of identifying the target processor. The aforementioned first modification instruction may be an instruction generated in response to the user's action on the modification button in the interactive interface, capable of identifying the target processor. Figure 5This is a schematic diagram of an optional interactive interface according to Embodiment 1 of this application, such as... Figure 5 As shown, the interactive interface includes a display area, a confirmation button, and a modification button. The interface first displays the set identifier information of the sub-data stream and the target processor set in the display area. Then, in response to the user's operation of the confirmation button, a first confirmation instruction is 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. Next, in response to the user's operation of the modification button, a first modification instruction is 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.
[0093] In the above embodiments of this application, after determining the target processor corresponding to the first data packet from the multiple processors included in the target processor set, the method further includes: displaying the device identification information of the first data packet and the target processor on the interactive interface; sending the first data packet to the target processor in response to a second confirmation command applied to the interactive interface; and sending the first data packet to the modification processor corresponding to the second modification command in response to a second modification command applied to the interactive interface.
[0094] The aforementioned device identification information may include, but is not limited to, the target processor's identifier (ID). The aforementioned second confirmation instruction may be an instruction generated in response to the user's action on the confirmation button in the interactive interface, used to send the first data packet to the target processor. The aforementioned second modification instruction may be an instruction generated in response to the user's action on the modification button in the interactive interface, used to send the first data packet to the modification processor.
[0095] In one optional embodiment, the interactive interface can first display a first data packet and the device identification information of the target processor in the display area. Then, in response to the user's operation of the confirmation button, a second confirmation instruction can be generated. In response to the second confirmation instruction, the first data packet can be sent to the target processor. Then, in response to the user's operation of the modify button, a second modification instruction can be generated. In response to the second modification instruction, the first data packet can be sent to the modification processor corresponding to the second modification instruction.
[0096] Figure 6 This is a schematic diagram of an optional traffic processing method according to Embodiment 1 of this application, as shown below. Figure 6 As shown, after the network card receives traffic, it first segments the traffic data into the first sub-data stream and determines the processor group corresponding to the first sub-data stream, such as... Figure 6 The first group, the second group, and the nth group are then used to further segment the first sub-data stream packet by packet, resulting in multiple first data packets. The processors corresponding to these multiple first data packets are then selected, such as... Figure 6As shown in the first, second, and nth groups, taking the content of the first group as an example, firstly, the first sub-data stream is segmented packet by packet in the first group to obtain multiple first data packets. Secondly, the multiple first data packets are matched with multiple processors. When a match is successful, the corresponding first data packet is processed by the processor. In the same group, multiple processors share a session. After the multiple processors have finished processing the first data packets, they will repackage the first data packets to obtain second data packets. The second data packets are then recombined based on the order of the first data packets to obtain the second sub-data stream. Then, the second sub-data stream can be re-integrated and sorted based on the order of the input traffic data to obtain the output traffic. Finally, the output traffic can be sent through the network card.
[0097] It's important to note that segmenting the input traffic is to narrow the scope, allowing the workload to be processed within a single group. This enables multiple processors to handle the same task, reducing core speed, minimizing contention, and improving performance stability. By grouping processors and sharing sessions, the random distribution of traffic can be transformed into secondary processing, thereby improving the accuracy of traffic data processing. The number of processor groups is determined through testing on specific machine models to ensure that each group meets performance standards.
[0098] like Figure 6 As shown, by grouping processors and then combining flow segmentation and packet segmentation, first grouping by flow and then segmenting by packet within each group, traffic segmentation support for stateful gateways is achieved.
[0099] Figure 7 This is a flowchart of an optional traffic processing method according to Embodiment 1 of this application, as follows: Figure 7 The method may include the following steps:
[0100] Step S71: The network card receives input traffic;
[0101] Step S72: The input traffic is segmented stream by stream to obtain sub-data streams and processor groups;
[0102] Step S73: Within the same group, the sub-data stream is segmented packet by packet to obtain the first data packet and the processor identification information (ID);
[0103] Step S74: Send the first data packet to the corresponding processor;
[0104] Step S75: The processor processes the first data packet based on the shared session;
[0105] In step S76, the processor sends the parsed and integrated sub-data stream to the network card;
[0106] Step S77: The network card reorders the sub-data streams to obtain the output traffic;
[0107] In step S78, the network card sends the output traffic to the client.
[0108] It should be noted that eliminating traffic hotspots through packet-by-packet segmentation avoids the "elephant flow" problem and improves operational security. Furthermore, reordering and preserving sequence ensures that traffic data remains in order, thus preventing out-of-order issues on the end-to-end functional side. Moreover, by using a packet-by-packet and flow-by-flow approach, performance degradation issues in shared sessions can be eliminated based on critical points. This application addresses the problem of out-of-order traffic data by implementing reordering and preserving sequence in the traffic transmission direction on the device.
[0109] 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 application 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.
[0110] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0111] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, they can also be implemented by hardware. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0112] Example 2
[0113] This application also provides, as follows: Figure 8 The traffic processing method shown. Figure 8 This is a flowchart of a traffic processing method according to Embodiment 2 of this application, as follows: Figure 8As shown, the method may include the following steps:
[0114] Step S802: In response to the input command applied to the operation interface, display multiple first data packets received by the network card on the operation interface. The first data packet is a data packet obtained by segmenting at least one data stream. The sub-data stream is a data stream obtained by segmenting the input traffic. The input traffic is received by the network card.
[0115] Step S804: In response to the processing instruction applied to the operation interface, the target processor corresponding to the first data packet is displayed on the operation interface. 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 set of processors corresponding to the sub-data streams 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.
[0116] Figure 9 This is a schematic diagram of an optional user interface according to Embodiment 2 of this application, such as... Figure 9 As shown, the operation interface includes a display area, input buttons, and processing buttons. When the user performs an operation on the input button on the operation interface, an input command can be generated based on the corresponding operation. In response to the input command, multiple first data packets received by the network card can be displayed on the operation interface. The first data packet is a data packet obtained by segmenting at least one data stream. The sub-data stream is a data stream obtained by segmenting the input traffic, which is received by the network card. Next, when the user performs an operation on the processing button on the operation interface, a processing command can be generated based on the corresponding operation. Then, the target processor corresponding to the first data packet can be displayed on the operation interface. 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 set of processors corresponding to the sub-data streams 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. 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 application 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.
[0117] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0118] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, they can also be implemented by hardware. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0119] Example 3
[0120] According to an embodiment of this application, a traffic processing apparatus for implementing the above-described traffic processing method is also provided. Figure 10 This is a schematic diagram of a flow processing device according to Embodiment 3 of this application, as shown below. Figure 10 As shown, the device includes: a first processing module 1002, a first determining module 1004, a second processing module 1006, a second determining module 1008, and a sending module 1010.
[0121] The first processing module is used to segment the input traffic received by the network card to obtain at least one sub-data stream; the first determining module is used 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 used to segment the sub-data stream to obtain multiple first data packets; the second determining module is used to determine the target processor corresponding to the first data packet from multiple processors included in the target processor set, wherein different target processors are used to process different first data packets; and the sending module is used to send the first data packet to the target processor.
[0122] In the above embodiments of this application, the first processing module includes: a parsing unit and a segmentation unit.
[0123] The parsing unit is used to parse the input traffic to obtain at least one preset session information carried in the input traffic; the segmentation unit is used to segment 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.
[0124] In the above embodiments of this application, multiple processors in the target processor set share the same preset session information.
[0125] In the above embodiments of this application, the first determining module includes: a first determining unit and a matching unit.
[0126] The first determining unit is used to determine the traffic data of the sub-data stream and the processing performance of the processor set; the matching unit is used to match the traffic data and the processing performance to determine the target processor set, wherein the processing performance of the target processor set is matched with the traffic.
[0127] In the above embodiments of this application, the second determining module includes one of the following: a second determining unit, a third determining unit, and a polling unit.
[0128] The second determining unit is used to determine the target processor from multiple processors based on the data volume of the first data packet; the third determining unit is used to randomly determine the target processor from multiple processors; and the polling unit is used to poll multiple processors to determine the target processor.
[0129] In the above embodiments of this application, the device further includes: a third determining module and a grouping module.
[0130] The third determining module is used to determine the multiple original processors configured for the network card; the grouping module is used to group the multiple original processors based on their attributes to obtain multiple processor sets.
[0131] In the above embodiments of this application, the grouping module includes: a test unit and a grouping unit.
[0132] The testing unit is used to test multiple original processors based on their attributes, and obtain test results for the multiple original processors. The test results are used to characterize the processing performance of the multiple original processors. The grouping unit is used to group the multiple original processors based on the test results, and obtain multiple processor sets.
[0133] In the above embodiments of this application, the device further includes: a receiving module, a combining module, an integrating module, and a forwarding module.
[0134] The receiving module is used to receive the 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 used to combine the second data packet according to the order of multiple first data packets to obtain the combined data stream; the integrating module is used to integrate the combined data stream according to the order of the sub-data streams to obtain the output traffic; and the forwarding module is used to forward the output traffic through the network card.
[0135] In the above embodiments of this application, after determining the target processor set corresponding to the sub-data stream from multiple processor sets, the device further includes: a first display module, a fourth determination module, and a fifth determination module.
[0136] The first display module is used to display the set identification information of the sub-data stream and the target processor set on the interactive interface; the fourth determination module is used to determine the target processor corresponding to the first data packet from the multiple processors included in the target processor set in response to the first confirmation command applied to the interactive interface; the fifth determination module is used to determine the target processor corresponding to the first data packet from the multiple processors included in the modified processor set corresponding to the first modification command in response to the first modification command applied to the interactive interface.
[0137] In the above embodiments of this application, after determining the target processor corresponding to the first data packet from the plurality of processors included in the target processor set, the device further includes: a second display module, a data packet sending module, and a modified data packet sending module.
[0138] The second display module is used 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 used to send the first data packet to the target processor in response to the second confirmation command applied to the interactive interface; and the modification data packet sending module is used to send the first data packet to the modification processor corresponding to the second modification command in response to the second modification command applied to the interactive interface.
[0139] It should be noted that the first processing module, first determining module, second processing module, second determining module, and sending module mentioned above correspond to steps S402 to S410 in Embodiment 1. The five modules and their corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules or units can be hardware or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above modules can also be part of a device and run in the computer terminal 10 provided in Embodiment 1.
[0140] It should be noted that the preferred implementation schemes involved in the above embodiments of this application are the same as the schemes, application scenarios and implementation processes provided in Embodiment 1, but are not limited to the schemes provided in Embodiment 1.
[0141] Example 4
[0142] According to an embodiment of this application, a traffic processing apparatus for implementing the above-described traffic processing method is also provided. Figure 11 This is a schematic diagram of a flow processing device according to Embodiment 4 of this application, as shown below. Figure 11 As shown, the device includes: a first display module 1102 and a second display module 1104.
[0143] The first display module is used to respond to input commands applied to the operation interface and display multiple first data packets received by the network card on the operation interface. The first data packet is a data packet obtained by segmenting at least one data stream. The sub-data stream is a data stream obtained by segmenting the input traffic, which is received by the network card. The second display module is used to respond to processing commands applied to the operation interface and display the target processor corresponding to the first data packet on the operation interface. 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 set of processors corresponding to the sub-data streams determined from the 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.
[0144] It should be noted that the first display module 1102 and the second display module 1104 mentioned above correspond to steps S8802 to S804 in Embodiment 2. The two modules and the corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules or units can be hardware components or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above modules can also be part of a device and run in the computer terminal 10 provided in Embodiment 1.
[0145] It should be noted that the preferred implementation schemes involved in the above embodiments of this application are the same as the schemes, application scenarios and implementation processes provided in Embodiment 1, but are not limited to the schemes provided in Embodiment 1.
[0146] Example 5
[0147] According to another aspect of the embodiments of this application, a gateway device is also provided, including: 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 interface card (NIC), connected to the plurality of processor sets, used to segment the input traffic to obtain at least one sub-data stream, determine a target processor set corresponding to the sub-data stream from the plurality of processor sets, segment the sub-data stream to obtain a plurality of first data packets, determine a target processor corresponding to the first data packet from the plurality of processors included in the target processor set, and send the first data packet to the target processor.
[0148] Example 6
[0149] Embodiments of this application may provide an electronic device, which may be any computer terminal device in a group of computer terminals. Optionally, in this embodiment, the aforementioned computer terminal may also be replaced with a mobile terminal or other terminal device.
[0150] 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.
[0151] 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, the input traffic is segmented 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, wherein different target processor sets are used to process different sub-data streams; the sub-data stream is segmented 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, wherein different target processors are used to process different first data packets; and the first data packet is sent to the target processor.
[0152] Optionally, the above-mentioned electronic device may also execute program code for the following steps: parsing the input traffic to obtain at least one preset session information carried in the input traffic; segmenting 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.
[0153] Optionally, multiple processors in the target processor set may share the same preset session information.
[0154] Optionally, the aforementioned electronic device may also execute program code for 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 processing performance to determine a target processor set, wherein the processing performance of the target processor set is matched with the traffic.
[0155] Optionally, the aforementioned electronic device may also execute program code for one of the following steps: determining a target processor from multiple processors based on the data volume of the first data packet; randomly determining a target processor from multiple processors; and polling multiple processors to determine the target processor.
[0156] Optionally, the aforementioned electronic device may also execute program code for the following steps: determining multiple raw processors configured for the network card; grouping the multiple raw processors based on their attributes to obtain multiple processor sets.
[0157] Optionally, the above-mentioned electronic device may also execute program code for the following steps: testing multiple original processors based on the attributes of multiple original processors to obtain test results for multiple original processors, wherein the test results are used to characterize the processing performance of multiple original processors; and grouping multiple original processors based on the test results to obtain multiple processor sets.
[0158] Optionally, the aforementioned electronic device may also execute program code for the following steps: receiving a second data packet returned by the target processor, wherein the second data packet is used to characterize 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 stream based on the order of the sub-data streams to obtain output traffic; and forwarding the output traffic through the network interface card.
[0159] Optionally, the above-mentioned electronic device may also execute program code for the following steps: displaying set identification information of sub-data stream and target processor set on the interactive interface; in response to a first confirmation command 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 command 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 command.
[0160] Optionally, the above-mentioned electronic device may also execute program code for the following steps: displaying a 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 a second confirmation command applied to the interactive interface; and sending the first data packet to the modification processor corresponding to the second modification command in response to a second modification command applied to the interactive interface.
[0161] Optionally, Figure 12 This is a structural block diagram of a computer terminal according to an embodiment of this application. Figure 12As shown, the computer terminal A may include: one or more (only one is shown in the figure) processors 1202, memory 1204, memory controller, and peripheral interfaces, wherein the peripheral interfaces are connected to a radio frequency module, an audio module, and a display.
[0162] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the traffic processing method and apparatus in this application embodiment. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the aforementioned 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 memory remotely located relative to the processor, and these remote memories can be connected to terminal A via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0163] The processor can invoke information and application programs stored in memory through the transmission device to perform the following steps: in response to input traffic received by the network interface card, segment the input traffic to obtain at least one sub-data stream; determine the 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; segment the sub-data stream to obtain a plurality of first data packets; determine the target processor corresponding to the first data packet from the plurality of 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.
[0164] Optionally, the processor may also execute program code that performs the following steps: parses the input traffic to obtain at least one preset session information carried in the input traffic; and segments 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.
[0165] Optionally, multiple processors in the target processor set may share the same preset session information.
[0166] Optionally, the processor may also execute program code that performs 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 processing performance to determine a target processor set, wherein the processing performance of the target processor set is matched with the traffic.
[0167] Optionally, the processor may also execute program code that performs one of the following steps: determining a target processor from multiple processors based on the data volume of the first data packet; randomly determining a target processor from multiple processors; and polling multiple processors to determine the target processor.
[0168] Optionally, the processor may also execute program code that performs the following steps: determines multiple raw processors configured for the network card; and groups the multiple raw processors based on their attributes to obtain multiple processor sets.
[0169] Optionally, the processor may also execute program code that performs the following steps: tests multiple original processors based on their attributes to obtain test results for multiple original processors, wherein the test results are used to characterize the processing performance of multiple original processors; and groups the multiple original processors based on the test results to obtain multiple processor sets.
[0170] Optionally, the processor may also execute program code that performs 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 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 stream based on the order of the sub-data streams to obtain output traffic; and forwarding the output traffic through the network interface card.
[0171] Optionally, the processor may also execute program code that performs the following steps: displaying set identification information of the sub-data stream and the target processor set on the interactive interface; in response to a first confirmation command applied to the interactive interface, determining the target processor corresponding to the first data packet from the multiple processors included in the target processor set; and in response to a first modification command applied to 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 command.
[0172] Optionally, the processor may also execute program code that performs the following steps: displaying a 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 a second confirmation command applied to the interactive interface; and sending the first data packet to the modification processor corresponding to the second modification command in response to a second modification command applied to the interactive interface.
[0173] This application provides a scheme that, in response to input traffic received by a network interface card (NIC), segments the input traffic to obtain at least one sub-data stream; determines a target processor set corresponding to the sub-data stream from a plurality of processor sets; segments the sub-data stream to obtain a plurality of first data packets; determines the target processor corresponding to the first data packet from the plurality of processors included in the target processor set; and sends the first data packet to the target processor. It is readily apparent that by segmenting the input traffic to obtain sub-data streams and segmenting the sub-data streams to obtain data packets, not only can the data processing volume of the processor set be reduced, but also the data processing volume of the target processors within the target processor set can be reduced. Therefore, the processing stability and accuracy of the target processor set can be improved. Furthermore, different first data packets within the same sub-data stream are processed by different processors within the same target processor set. By establishing a one-to-one correspondence between the first data packet and the target processor, the goal of accurately processing the first data packet is further achieved. This results in improved processing accuracy and stability for traffic data processing, thereby solving the technical problems of low processing accuracy and poor processing stability in related technologies.
[0174] It can be understood by those skilled in the art that Figure 12 The structure shown is for illustrative purposes only. The computer terminal can also be a smartphone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, and other terminal devices. Figure 12 This does not limit the structure of the aforementioned electronic device. For example, computer terminal A may also include components that are more... Figure 12 More or fewer components (such as network interfaces, display devices, etc.) shown in, or with Figure 12 Different configurations shown.
[0175] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0176] Example 7
[0177] Embodiments of this application also provide 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 Embodiment 1.
[0178] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.
[0179] 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, segmenting 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; segmenting 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.
[0180] Optionally, in this embodiment, the storage medium is further configured to store program code for performing the following steps: parsing the input traffic to obtain at least one preset session information carried in the input traffic; and segmenting 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.
[0181] Optionally, multiple processors in the target processor set may share the same preset session information.
[0182] Optionally, in this embodiment, the storage medium is further configured to store program code for performing 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 a target processor set, wherein the processing performance of the target processor set is matched with the traffic.
[0183] Optionally, in this embodiment, the storage medium is further 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 a first data packet; randomly determining a target processor from a plurality of processors; and polling the plurality of processors to determine the target processor.
[0184] Optionally, in this embodiment, the storage medium is further configured to store program code for performing the following steps: determining multiple raw processors configured for the network card; grouping the multiple raw processors based on their attributes to obtain multiple processor sets.
[0185] Optionally, in this embodiment, the storage medium is further configured to store program code for performing the following steps: testing multiple original processors based on their attributes to obtain test results for multiple original processors, wherein the test results are used to characterize the processing performance of multiple original processors; and grouping the multiple original processors based on the test results to obtain multiple processor sets.
[0186] Optionally, in this embodiment, the storage medium is further configured to store program code for performing the following steps: receiving a second data packet returned by the target processor, wherein the second data packet is used to characterize 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 the multiple first data packets to obtain a combined data stream; integrating the combined data stream based on the order of the sub-data streams to obtain output traffic; and forwarding the output traffic through the network interface card.
[0187] Optionally, in this embodiment, the storage medium is further configured to store program code for performing the following steps: displaying set identification information of the sub-data stream and the target processor set on the interactive interface; in response to a first confirmation command applied to the interactive interface, determining the target processor corresponding to the first data packet from the plurality of processors included in the target processor set; in response to a first modification command applied to the interactive interface, determining the target processor corresponding to the first data packet from the plurality of processors included in the modification processor set corresponding to the first modification command.
[0188] Optionally, in this embodiment, the storage medium is further configured to store program code for performing the following steps: displaying a 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 command applied to the interactive interface; and sending the first data packet to the modification processor corresponding to the second modification command in response to a second modification command applied to the interactive interface.
[0189] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0190] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0191] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0192] 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.
[0193] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0194] If the integrated unit is implemented as 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 this application, in essence, 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. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0195] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A traffic processing method, characterized in that: include: 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, characterized in that 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, characterized in that The multiple processors in the target processor set share the same preset session information.
4. The method according to claim 1, characterized in that: 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, characterized in that 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, characterized in that 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, characterized in that 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, characterized in that 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; Combining the second data packets based on the order of the plurality of first 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, characterized in that: 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, characterized in that 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. A traffic processing method, characterized in that: include: 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, a 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 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.
12. A gateway device, characterized in that: include: 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.
13. An electronic device, characterized in that: include: 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 11 when running.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is executed, the device where the storage medium is located is controlled to execute the method according to any one of claims 1 to 11.