Message processing method, electronic equipment, storage medium and program product
By using the user-space VPP module to process messages and utilizing query and message processing components to determine identification information and processing methods, the problem of low efficiency in traditional message processing is solved, achieving efficient message processing and security control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-14
- Publication Date
- 2026-03-10
AI Technical Summary
Traditional message processing methods repeatedly copy messages between kernel mode and user mode, resulting in low processing efficiency and making it difficult to meet the network communication needs of high concurrency and high traffic scenarios.
The user-space VPP module processes packets, uses a query component to match IP addresses to determine identification information, and the packet processing component determines the target processing method, including dropping, passing, or forwarding, reducing the packet copying process.
It improves message processing efficiency, reduces processing latency, meets the needs of high-speed network communication, and achieves high-performance message sending and receiving capabilities.
Smart Images

Figure CN121644459A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of network communication, and particularly relates to a message processing method, an electronic device, a computer readable storage medium and a computer program product. BACKGROUND
[0002] In the whole process of network communication, message processing is a core link that determines the data transmission efficiency and system response capability. From data generation to final delivery to the target device, each message needs to go through a series of complex operations such as parsing, routing judgment, rule matching, etc. The timeliness of these processing processes directly affects the stability of network services and user experience.
[0003] The traditional message processing method copies the message and sends it to the kernel space of the message processing device (such as a router) for parsing and rule matching operations, etc. After completing the processing, the message is copied again and switched to the user state. In the case of network services that need to process a large number of messages, the message needs to be repeatedly copied between the kernel state and the user state, occupying additional memory and kernel resources, and consuming a large amount of computing power. Ultimately, it shows low message processing efficiency, which is difficult to meet the network communication needs in high concurrency and large flow scenarios. SUMMARY
[0004] The present application aims to at least solve one of the technical problems existing in the prior art. To this end, the present application provides a message processing method, an electronic device, a computer readable storage medium and a computer program product, which processes messages through a VPP module in the user state, does not rely on the kernel for message processing, can reduce a large number of message copying processes, and effectively improves the processing efficiency of messages.
[0005] In a first aspect, the present application provides a message processing method, comprising: The IP address of the current message is matched with a preset database through a query component of a VPP module arranged in the user state to determine the identification information of the current message; The target value range where the identification information is located is determined through a message processing component of the VPP module, and the target processing mode of the current message is determined based on the target value range and executed; The target value range includes at least one preset value range, the target processing mode is a first mode or a second mode, the preset value range corresponds to the first mode or the second mode, the first mode includes discarding, and the second mode includes passing or forwarding.
[0006] In a second aspect, the present application provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to realize the above message processing method.
[0007] In a third aspect, the present application provides a computer readable storage medium, having stored thereon a computer program, which, when executed by a processor, implements the packet processing method.
[0008] In a fourth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a processor, implements the packet processing method.
[0009] The packet processing method, the electronic device, the computer readable storage medium and the computer program product provided by the embodiments of the present application match the IP address of the current packet with the preset database through the query component of the VPP module to obtain corresponding identification information, the packet processing component of the VPP module determines the target value range and the target processing mode according to the identification information, and discards, passes or forwards the current packet according to the target processing mode. The VPP module has high performance in receiving and transmitting packets, and by adding the query component and the packet processing component, the processing logic of the packet is determined, and then the packet is processed.
[0010] In this way, the packet processing does not depend on the kernel, which can reduce a large number of packet copying processes, effectively improve the processing efficiency of the packet, reduce the processing delay, and meet the demand of high-speed network communication.
[0011] Additional aspects and advantages of the embodiments of the present application will be in part apparent and in part pointed out hereinafter in the description of the embodiments of the present application. BRIEF DESCRIPTION OF DRAWINGS
[0012] The above and / or additional aspects and advantages of the present application will become apparent and be readily appreciated from the description of the embodiments, given in conjunction with the following drawings, in which: Figure 1 is an application scenario diagram of the packet processing method provided by the embodiments of the present application; Figure 2 is a first flowchart of the packet processing method provided by the embodiments of the present application; Figure 3 is a second flowchart of the packet processing method provided by the embodiments of the present application; Figure 4 is a third flowchart of the packet processing method provided by the embodiments of the present application; Figure 5 is a fourth flowchart of the packet processing method provided by the embodiments of the present application; Figure 6 is a packet configuration and packet processing diagram of the packet processing method provided by the embodiments of the present application; Figure 7 is a fifth flowchart of the packet processing method provided by the embodiments of the present application; Figure 8 is a sixth flowchart of a packet processing method provided by an embodiment of the present application; Figure 9 is a seventh flowchart of a packet processing method provided by an embodiment of the present application; Figure 10 is an eighth flowchart of a packet processing method provided by an embodiment of the present application; Figure 11 is a ninth flowchart of a packet processing method provided by an embodiment of the present application; Figure 12 is a tenth flowchart of a packet processing method provided by an embodiment of the present application; Figure 13 is a module schematic diagram of a packet processing apparatus provided by an embodiment of the present application; and Figure 14 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0013] Embodiments of the present application are described in detail below, examples of the embodiments of the present application are shown in the accompanying drawings, wherein the same or similar notations represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary, only for explaining the present application, and cannot be understood as a limitation of the present application.
[0014] Please refer to Figure 1 , Figure 1 is an application scenario diagram of a packet processing method provided by an embodiment of the present application. The application scenario provided by the present application includes a packet processing system, the packet processing system includes a first device, a packet processing device and a second device, and the packet processing method provided by the present application can be executed by the packet processing device.
[0015] The first device and the second device are both devices that can send or receive packets. The first device and the second device can communicate packets through the packet processing device.
[0016] The packet sent by the first device or the second device is transmitted to the packet processing device through a network (such as a network cable, Bluetooth, optical fiber, etc.) for processing.
[0017] After receiving the packet, the first device or the second device can parse the packet according to the corresponding protocol (such as Internet Control Message Protocol ICMP, User Datagram Protocol UDP), then extract the original data in the packet and complete the service response (such as displaying web page content, storing accepted files, feeding back interaction results, etc.).
[0018] Optionally, the first device and the second device each include a network card, and the message sent by the first device or the second device is converted into an electrical signal or an optical signal conforming to a physical layer standard by a network card driver, and then is transmitted to the network through a network cable, wireless, or other media, while a frame header and a frame tail containing a target MAC address are added to ensure that the message can be recognized by other network cards in the network; the network card of the first device or the second device listens to the signals in the network in real time, recognizes the corresponding message conforming to the device itself, and receives the message.
[0019] Optionally, the first device and the second device can be a smart phone, a notebook computer, a desktop computer, a server, an Internet of Things sensor, or the like, and the embodiments of the present application do not limit this.
[0020] The message processing device is an intermediate device that filters, forwards, and processes the received message. The message processing device processes the message according to a preset rule (such as a routing table, an Access Control List (ACL) policy, or the like), and then discards or sends the processed message to the first device or the second device.
[0021] The message processing device includes a VPP module, i.e., a Vector Packet Processing module, which is an extensible high-performance network data plane framework with high-performance message processing capability, and can bypass the kernel to directly access the network card of the first device or the second device to process the message. The VPP module includes a query component and a message processing component.
[0022] The query component stores a preset database, and can determine the corresponding country code or region code according to the IP address of the message, and determine the corresponding identification information according to the corresponding country code or region code. Optionally, the query component can replace the IP address in the message with the corresponding identification information.
[0023] The message processing component determines the processing mode of the message according to a preset rule (such as a routing table, an ACL rule, or the like), discards, passes, or forwards, so as to realize accurate control of network access permission and guarantee network security.
[0024] In an optional embodiment, the message processing device includes a configuration module (such as a smart phone, a computer, or the like). After the configuration module communicates with the VPP module, the configuration module can display a user graphical interface, the user graphical interface can display a management control plane of the VPP module, and the user performs clicking, inputting, dragging, or the like on the management control plane in the user graphical interface to realize configuration of the VPP module.
[0025] Optionally, the packet processing device can be a combination of a router and a smartphone, a combination of a switch and a computer, a combination of a firewall and a smartphone, a combination of a load balancer and a computer, etc., and the present application does not limit this.
[0026] Based on the above technical background and related scene introduction, the present application embodiment provides a packet processing method, which will be described in detail as follows. Please refer to Figure 2 The packet processing method provided by the present application embodiment is realized by step 011 and step 012, which will be described in detail as follows.
[0027] Step 011: matching the IP address of the current packet with the preset database through the query component of the VPP module arranged in the user mode, to determine the identification information of the current packet; Wherein, the current packet refers to the packet to be processed.
[0028] Wherein, the IP address (Internet Protocol Address) is a unique digital identifier allocated to network devices in the Internet.
[0029] Optionally, the IP address can be in IPv4 format (such as 123.12.1.1) or IPv6 format (such as 1000:0100:0010:0001).
[0030] Wherein, the preset database is a mapping database associating IP addresses with region codes (such as strings), for example, a GeoIP database, an IP2Location database.
[0031] Wherein, the identification information is information used to identify the group where the source device of the packet is located, similar to ID.
[0032] Specifically, the query component matches the IP address of the current packet with the stored IP addresses in the preset database, which can determine the geographical information corresponding to the device sending the current packet, and the corresponding region code. The query component can further obtain the identification information corresponding to the current packet according to the group where the region code is located and the identification information corresponding to the group.
[0033] Step 012: determining the target value range where the identification information is located through the packet processing component of the VPP module, and determining the target processing mode of the current packet based on the target value range and executing; Wherein, the target value range includes at least one preset value range, the target processing mode is a first mode or a second mode, the preset value range corresponds to the first mode or the second mode, the first mode includes discarding, and the second mode includes passing or forwarding.
[0034] The preset value range is a value or character range set based on experience or customized by a user.
[0035] Specifically, the multiple processing manners are the same, but the identification information is integrated in one preset value range, and the current message is processed according to a target processing manner corresponding to a target value range in which the identification information of the current message is located, so that the configuration management can be simplified, repeated operations can be reduced, the calculation pressure of rule matching of the message processing component can be reduced, and processing delay caused by too many preset value ranges can be avoided.
[0036] In this way, the message is processed by the user-mode VPP module, so that the message can be avoided to be switched between the user mode and the kernel mode, a large number of message copying processes can be reduced, and the processing efficiency of the message can be effectively improved.
[0037] In an optional embodiment, referring to Figure 3 , step 011 includes: Step 0111: determining a target sub-database matched with the IP address of the current message, the target sub-database being any sub-database; Step 0112: determining preset identification information corresponding to the target sub-database, the preset identification information being the identification information of the current message.
[0038] The sub-database is a mapping combination of an associated IP address and a region code corresponding to the same preset identification information in the preset database. The preset database includes multiple sub-databases, and each sub-database has corresponding preset identification information.
[0039] In an optional embodiment, the sub-database corresponds to at least one region, the region corresponds to at least one IP address, and each sub-database is generated based on a region code of the corresponding at least one region.
[0040] The region code is a standardized code used to identify a geographical region, for example, CN, US, etc.
[0041] One or more regions correspond to one sub-database, and correspond to one preset identification information, so that a unified processing manner can be configured for messages of a region group, without the need to set each region separately, repeated operations can be reduced, the rule maintenance cost can be reduced, and network management and control of a specific region can be ensured.
[0042] The preset identification information is identification information set based on experience or customized by a user. For example, the preset identification information is 1, 2, 3, or a, b, c, etc.
[0043] Specifically, by analyzing the IP address of the current message, the corresponding region code is determined, and the sub-database storing the region code is the target sub-database. The preset identification information corresponding to the target sub-database is the identification information of the current message. In this way, the message processing mode of a specific region can be uniformly managed, repeated operations can be reduced, and the processing efficiency of the message can be improved.
[0044] In an optional embodiment, referring to Figure 4 , step 0111 comprises: Step 01111: determining the region code corresponding to the IP address of the current message; Step 01112: determining the target sub-database matching the region code of the current message.
[0045] Specifically, the IP address corresponding to the current message is searched in the preset database. For example, the IP address of the current message is converted into a binary representation, and an efficient search algorithm (such as binary search) is used to locate the corresponding IP address segment in the preset database. The geographic location information corresponding to the IP address is determined, and the region code is extracted therefrom, which is the region code of the current message. The sub-database storing the region code of the current message is the target sub-database matching the current message.
[0046] For example, the region code corresponding to the IP of the current message is A, the preset database includes two sub-databases, namely a first sub-database and a second sub-database; the region codes in the first sub-database are A, B, and C, and the preset identification information corresponding to the first sub-database is 1; the region codes in the second sub-database are D, E, and F, and the preset identification information corresponding to the second sub-database is 2; then the target sub-database corresponding to the current message is the first sub-database, and the identification information of the current message is 1.
[0047] In this way, the target sub-database of the current message and the corresponding preset identification information can be quickly and accurately determined.
[0048] In an optional embodiment, referring to Figure 5 , the message processing method further comprises steps 013, 014, and / or 015, and / or 016, which are described below.
[0049] Step 013: displaying a message configuration interface; Step 014: configuring the first mode or the second mode corresponding to each preset value range based on a first configuration operation received by the message configuration interface; and / or Step 015: configuring the preset identification information corresponding to each sub-database based on a second configuration operation received by the message configuration interface; and / or Step 016: configuring the region codes in the sub-database based on a third configuration operation received by the message configuration interface.
[0050] The first configuration operation is an operation for configuring a processing mode corresponding to each preset value range. The second configuration operation is an operation for configuring preset identification information corresponding to each sub-database. The third configuration operation is an operation for configuring a region code contained in the sub-database.
[0051] Specifically, the first configuration operation, the second configuration operation, and the third configuration operation can be customized by a user. After the configuration module is communicatively connected (such as a network cable connection, a Wi-Fi connection, etc.) with the VPP module, a message configuration interface is displayed on the configuration module. After the corresponding first configuration operation, and / or the second configuration operation, and / or the third configuration operation are input at the corresponding positions of the message configuration interface, the new configuration is saved and issued to the VPP module, so that the VPP module automatically loads the new configuration, and the VPP module processes the current message according to the new message processing method.
[0052] In an alternative embodiment, please refer to Figure 6 , Figure 6 is a message configuration and message processing schematic diagram provided by the embodiment of the present application. The configuration module includes a message configuration interface and a resource management component. The user inputs the customized first configuration operation, and / or the second configuration operation, and / or the third configuration operation into the message configuration interface, and the message configuration interface loads the corresponding configuration to the resource management component. The resource management component generates preset identification information corresponding to each sub-database in the preset database. Each sub-database and the corresponding generated preset identification information are sent to the query component of the VPP module for use. The resource management component also sets the first mode or the second mode corresponding to each preset identification range, and then sends it to the message processing component of the VPP module for use.
[0053] The solid arrows in the figure represent the flow process of the message: the message sending device network card transmits the current message to the query component of the VPP module of the message processing device in a set form (such as a network cable, an optical fiber), and the identification information of the current message is obtained by querying, which replaces the IP address of the current message; and then it is sent to the message processing component, which determines the corresponding target processing mode (discard, pass or forward) according to the target value range of the identification information of the current message. In the case of the second mode (pass or forward) of the target processing mode, the current message is sent out and received by the target device network card.
[0054] In this way, the user can customize the filtering rules of the message, adapt to individual needs, and improve the security of the network.
[0055] In an alternative embodiment, please refer to Figure 7Step 011 comprises: Step 0113: matching at least one of the source IP address and the target IP address of the current packet with the preset database through the query component of the VPP module arranged in the user mode to determine the identification information of the current packet.
[0056] The source IP address is an address identifying the sending source of the packet, i.e., the unique logical address of the device generating and sending the packet in the network; and the target IP address is an address identifying the receiving terminal of the packet, i.e., the network logical address of the device to which the packet is finally sent.
[0057] Specifically, the IP address of the current packet includes the source IP address and the target IP address, and is located in the header of the packet. By matching the region code corresponding to the source IP address or the target IP address with the region code in the preset database, the identification information of the current packet is determined, and thus the corresponding processing mode is determined. The packet from a malicious IP can be discarded, external specific IP access to the internal network is blocked, or the request sent to a high-risk address or a sensitive server is prohibited, the invasion of virus flow is blocked, data leakage and network attack are avoided, access control is realized, and the overall security of the network is ensured.
[0058] By matching the region code corresponding to the source IP address and the target IP address with the region code in the preset database, the identification information of the current packet is determined, and thus the corresponding processing mode is determined. Precise access control can be realized, network access rights can be regulated, and the security of the device and data can be improved.
[0059] In an optional embodiment, referring to Figure 8 Step 0113 comprises step 01131 and step 01132, and step 012 comprises step 0121, which are specifically described as follows.
[0060] Step 01131: matching the source IP address of the current packet with the preset database to determine the first identification information of the current packet; Step 01132: matching the target IP address of the current packet with the preset database to determine the second identification information of the current packet; The first identification information is the identification information corresponding to the source IP address; and the second identification information is the identification information corresponding to the target IP address.
[0061] Specifically, the identification information includes first identification information and second identification information. The corresponding region code is obtained by analyzing the source IP address, and a sub-database in which the region code exists is determined as a corresponding target sub-database. The preset identification information corresponding to the target sub-database is the first identification information. The corresponding region code is obtained by analyzing the target IP address, and a sub-database in which the region code exists is determined as a corresponding target sub-database. The preset identification information corresponding to the target sub-database is the second identification information.
[0062] Step 0121: determining a first target value range in which the first identification information is located and a second target value range in which the second identification information is located, and determining and executing a target processing mode of the current message based on the first target value range and the second target value range.
[0063] The first target value range is a preset value range configured for verifying the first identification information, and the second target value range is a preset value range configured for verifying the second identification information.
[0064] Specifically, the target processing mode of the current message is determined and executed according to at least one of the first target value range and the second target value range. Data leakage or malicious connection can be avoided, a two-way security barrier can be constructed, precise permission control can be realized, and the overall message processing efficiency can be improved.
[0065] In an optional embodiment, referring to Figure 9 , step 0121 includes: Step 01211: in the case where the target processing mode corresponding to the first target value range or the second target value range is a first mode, processing the current message in the first mode; Step 01212: in the case where the target processing mode corresponding to the first target value range and the second target value range is a second mode, processing the current message in the second mode.
[0066] Specifically, the first mode is discarding the message. If any target processing mode is the first mode, the message will be intercepted. Only when the target processing modes corresponding to the source IP address and the target IP address are both the second mode (passing or forwarding), the message will be processed in the second mode.
[0067] In this way, double security protection can be realized, intrusion messages from malicious source IPs can be blocked, requests sent to high-risk target IPs can be intercepted, more comprehensive permission control can be realized, permission vulnerabilities can be avoided, invalid transmission can be reduced, and the processing efficiency of the message can be improved.
[0068] In an optional embodiment, referring to Figure 10 , the message processing method further includes steps 017, 018, and 019, which are described below.
[0069] Step 017: determining whether the target IP address is a preset local IP address; Step 018: if yes, determining that the second mode is passing through; Step 019: if no, determining that the second mode is forwarding.
[0070] The preset local IP address refers to an IP address belonging to a current local area network (such as an enterprise intranet) where the message processing device is located.
[0071] Specifically, by judging whether the target IP address of the message is a preset local IP address, it is determined whether the device receiving the message is located in the current local area network. In the case where the target IP address is a preset local IP address, it indicates that the device receiving the message is located in the current local area network, and the message can be directly passed through and delivered to the device receiving the message. In the case where the target IP address is not a preset local IP address, it indicates that the device receiving the message is not in the current local area network, and the message needs to be forwarded to the gateway or the next message forwarding device to continue to the network where the target IP is located.
[0072] In this way, the transmission path can be clearly determined, the delay and bandwidth consumption can be reduced, and the processing efficiency of the message can be improved.
[0073] In an optional embodiment, referring to Figure 11 , the message processing method further includes steps 020 and 021, which are described in detail below.
[0074] Step 020: determining the priority of each message based on the identification information corresponding to each message; Step 021: processing each message in turn according to the priority from high to low.
[0075] Specifically, different identification information of the message is set to have a priority level (such as three priority levels: high, medium and low), and the messages are processed in turn according to the priority from high to low, which can ensure that the high-priority message occupies network resources first and is processed first, and the low-priority message waits until the high-priority message is processed.
[0076] For example, the identification information of the first message is 1, and the identification information of the second message is 2; the priority of the identification information 1 is set to high, and the priority of the identification information 2 is set to low in the message processing component of the VPP module. Then the first message is processed first, and the second message is processed second.
[0077] In this way, it can avoid ordinary messages from occupying resources, ensure efficient processing of critical business messages, and improve the overall utilization efficiency of the network and the user experience.
[0078] In an optional embodiment, referring to Figure 12The packet processing method further includes step 022, which is described below.
[0079] Step 022: After the preset database is updated, triggering the VPP module to read the updated preset database.
[0080] Specifically, in the case of IP home change of the device sending the packet, the region code corresponding to the IP address is updated in the preset database. To avoid packet processing errors, the VPP module is triggered to read the new preset database after the preset database is updated, to ensure real-time accuracy of the region corresponding to the IP address and the accuracy of packet processing.
[0081] In this way, the preset database can be updated without restarting the VPP module, which can dynamically adapt to network changes and thus improve the accuracy and efficiency of packet processing.
[0082] According to the method described in the above embodiments, the embodiments of the present application also provide a packet processing device for executing the steps in the above packet processing method. Please refer to Figure 13 , Figure 13 is a module schematic diagram of the packet processing device 200 provided by the embodiments of the present application. The packet processing device 200 includes: The determining module 201 is configured to match the IP address of the current packet with the preset database through the query component of the VPP module arranged in the user mode, to determine the identification information of the current packet. The processing module 202 is configured to determine the target value range where the identification information is located through the packet processing component of the VPP module, and determine the target processing mode of the current packet based on the target value range and execute it.
[0083] It should be noted that the specific details of each module unit in the above packet processing device have been described in detail in the embodiments of the above packet processing method, which will not be repeated here.
[0084] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, which works with other related parts to achieve a predetermined target, and can be implemented entirely or partially by using software, hardware (such as processing circuitry or memory) or a combination thereof. Similarly, one processor (or multiple processors or memory) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an overall module or unit that includes the functions of the module or unit.
[0085] In an alternative embodiment, the packet processing apparatus in the embodiments of the present application can be implemented in hardware, such as an electronic device or a component in an electronic device, for example, an integrated circuit or a chip; or implemented in software, such as an application installed in an electronic device.
[0086] The embodiments of the present application also provide an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable in the processor. The processor implements each process of the embodiments of the packet processing method when executing the program, and achieves the same technical effects. To avoid repetition, details are not described herein.
[0087] Optionally, the electronic device can be a combination of a router and a smart phone, a combination of a switch and a computer, a combination of a firewall and a smart phone, a combination of a load balancer and a computer, etc. The embodiments of the present application do not limit the electronic device.
[0088] In an alternative embodiment, please refer to Figure 14 , Figure 14 is a structural schematic diagram of the electronic device provided by the embodiments of the present application. The electronic device 300 includes a processor 301 and a memory 302. The memory 302 stores a computer program 303 executable in the processor 301. The program 303 is executed by the processor 301 to implement each process of the embodiments of the packet processing method, and achieve the same technical effects. To avoid repetition, details are not described herein.
[0089] The embodiments of the present application also provide a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement each process of the embodiments of the packet processing method, and achieve the same technical effects. To avoid repetition, details are not described herein.
[0090] The processor can be the processor in the electronic device in the above embodiments. The computer readable storage medium can be a computer readable only memory ROM, a random access memory RAM, a magnetic disc or an optical disc, etc.
[0091] Computer-readable media can include computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), flash memory or other solid state memory technology, CD-ROM, Digital Versatile Disc (DVD), or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Computer storage media does not, however, include communication media.
[0092] The embodiment of the present application further provides a computer program product comprising a computer program which, when executed by a processor, implements the packet processing method described above. The processor can be the processor in the electronic device in the above embodiment. The computer program, when executed by the processor, implements each process of the embodiment of the packet processing method described above, and achieves the same technical effects. To avoid repetition, no further description is given here.
[0093] It can be understood that in the detailed description of the present application, data related to the identity or characteristics of the user is involved, and when the above embodiments of the present application are applied to specific products or technologies, the user's permission or consent is required, and the collection, use and processing of the relevant data need to comply with relevant laws, regulations and standards in relevant countries and regions.
[0094] In the description of the present specification, the description of the terms "certain embodiments", "in an example", "exemplarily" and the like means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, the person skilled in the art can combine and combine the different embodiments or examples described in the present specification and the features of the different embodiments or examples without contradiction.
[0095] Any processes or methods described in the flow charts or otherwise described herein can be understood as representing code, code modules, or portions of code that include executable instructions for performing specific logical functions or steps, and the preferred embodiments of the application include additional implementations that can not be described in detail, such as can be understood by those of ordinary skill in the art, in which the functions described are performed by a different order of steps, or by substantially simultaneous execution of the steps, or by a different arrangement of the steps, or by a combination of these approaches, as will be understood by those of ordinary skill in the art.
[0096] While the embodiments of the application have been shown and described with reference to certain embodiments thereof, it will be understood by those of ordinary skill in the art that various changes, modifications, substitutions, and alterations can be made hereto without departing from the principles and spirit of the application, and it is intended that the application be limited only by the scope of the claims and the equivalents thereof.
Claims
1. A method of processing a packet, the method comprising: The application comprises: An IP address of a current packet is matched with a preset database through a query component of a VPP module arranged in a user mode to determine identification information of the current packet; A target value range in which the identification information is located is determined through a packet processing component of the VPP module, and a target processing mode of the current packet is determined based on the target value range and executed; The target value range comprises at least one preset value range, the target processing mode is a first mode or a second mode, the preset value range corresponds to the first mode or the second mode, the first mode comprises discarding, and the second mode comprises passing or forwarding.
2. The packet processing method of claim 1, wherein, The preset database comprises a plurality of sub-databases, each of which has corresponding preset identification information, the IP address of the current packet is matched with the preset database through the query component of the VPP module arranged in the user mode to determine the identification information of the current packet, which comprises: A target sub-database matched with the IP address of the current packet is determined, the target sub-database being any of the sub-databases; The preset identification information corresponding to the target sub-database is determined as the identification information of the current packet.
3. The packet processing method of claim 2, wherein, The target sub-database matched with the IP address of the current packet is determined, which comprises: A region code corresponding to the IP address of the current packet is determined; The target sub-database matched with the region code of the current packet is determined.
4. The packet processing method of claim 2, wherein, Each of the sub-databases is generated based on a region code of at least one region corresponding thereto.
5. The method of claim 2-4, wherein, The application further comprises: A packet configuration interface is displayed; A first mode or a second mode corresponding to each of the preset value ranges is configured based on a first configuration operation received by the packet configuration interface; And / or Preset identification information corresponding to each of the sub-databases is configured based on a second configuration operation received by the packet configuration interface; And / or A region code in the sub-databases is configured based on a third configuration operation received by the packet configuration interface.
6. The packet processing method of any of claims 1-5, wherein, The IP address comprises a source IP address and a target IP address, the IP address of the current packet is matched with the preset database through the query component of the VPP module arranged in the user mode to determine the identification information of the current packet, which comprises: At least one of the source IP address and the target IP address of the current packet is matched with the preset database through the query component of the VPP module arranged in the user mode to determine the identification information of the current packet.
7. The packet processing method of claim 6, wherein, The identification information comprises first identification information and second identification information, at least one of the source IP address and the target IP address of the current packet is matched with the preset database through the query component of the VPP module arranged in the user mode to determine the identification information of the current packet, which comprises: The source IP address of the current packet is matched with the preset database to determine the first identification information of the current packet; The target IP address of the current packet is matched with the preset database to determine the second identification information of the current packet; The target value range includes a first target value range and a second target value range, the determining the target value range where the identification information is located, and determining the target processing mode of the current packet based on the target value range and executing, includes: Determining the first target value range where the first identification information is located and the second target value range where the second identification information is located, and determining the target processing mode of the current packet based on the first target value range and the second target value range and executing.
8. The packet processing method of claim 7, wherein, The determining the target processing mode of the current packet based on the first target value range and the second target value range and executing, includes: In the case that the target processing mode corresponding to the first target value range or the second target value range is the first mode, processing the current packet in the first mode; In the case that the target processing mode corresponding to the first target value range and the second target value range is the second mode, processing the current packet in the second mode.
9. The packet processing method of any of claims 6-8, wherein, Further includes: Determining whether the target IP address is a preset local IP address; If yes, determining the second mode as passing; If no, determining the second mode as forwarding.
10. The packet processing method of claim 1, wherein, Further includes: Based on the identification information corresponding to each packet, respectively determining the priority of each packet; Processing each packet in turn according to the priority of each packet from high to low.
11. The packet processing method of claim 1, wherein, Further includes: After the preset database is updated, triggering the VPP module to read the updated preset database.
12. An electronic device, comprising: The computer program is executed by the processor to realize the packet processing method of any one of claims 1-11.
13. A computer readable storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to realize the packet processing method of any one of claims 1-11.
14. A computer program product, characterised in that, The computer program is executed by the processor to realize the packet processing method of any one of claims 1-11.