Data processing method, device and related equipment based on traffic blocking
By introducing a traffic blocking module and a user interface module into the operating system kernel, and using preset traffic blocking rules to filter traffic information, the problem of low processing efficiency caused by multiple traffic filtering modules in the existing technology is solved and improved improve system performance.
Patent Information
- Application Number
- CN202210225624.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-09
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-03-09
AI Technical Summary
In the existing technology, there are a large number of rules in multiple traffic filtering modules, which results in low processing efficiency and poor system performance when filtering traffic information, especially when the traffic is large, the problem is excessive pressure.
Introduce the traffic blocking module and user interface module into the operating system kernel, filter traffic information through the preset traffic blocking rules of the user interface module, reduce the filtering pressure of the network protocol stack, and use dictionary tree storage rules to improve matching efficiency .
Through the traffic blocking module, the traffic information is filtered in advance, which reduces the data processing pressure of the network protocol stack, improves system performance, and significantly improves processing efficiency, especially when processing large amounts of traffic.
Smart Images

Figure CN114640515B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a data processing method, device and related equipment based on traffic blocking. Background Art
[0002] By using the built-in firewall mechanism of the system, users can effectively configure the filtering conditions of traffic information in the system to realize the function of the firewall. For example, in the prior art, the traffic information screening modules are sequentially distributed on the five key nodes of the network protocol stack, and the traffic information is screened by setting the screening rules of the screening modules. Obviously, there are a large number of rules in multiple traffic screening modules, and the processing efficiency is low when performing traffic information screening, which leads to poor system performance when the traffic is large. Therefore, how to improve the processing efficiency of traffic information screening and reduce the pressure on the network protocol stack needs to be solved urgently. Summary of the invention
[0003] In view of the problems existing in the prior art, the embodiments of the present disclosure provide a data processing method, apparatus and related equipment based on traffic blocking.
[0004] In a first aspect, the present disclosure provides a data processing method based on traffic blocking, which is applied to an operating system, wherein the kernel of the operating system is configured with a traffic blocking module and a user interface module, and the user interface module is used to configure traffic blocking rules; the method comprises: based on the traffic blocking module, receiving traffic information from a data link layer; according to the traffic blocking rules pre-set by the user interface module, obtaining released traffic information and sending it to a network protocol stack in the kernel; and performing data processing on the released traffic information.
[0005] According to a data processing method based on traffic blocking provided by the present disclosure, if the traffic blocking rule pre-set by the user interface module is a whitelist rule, obtaining the released traffic information is further as follows: verifying whether the traffic information is legal, and if so, determining whether the traffic information complies with the whitelist rule, and if so, the traffic information is released traffic information; if the traffic information does not comply with the whitelist rule, the traffic information is illegal traffic information, and the illegal traffic information is discarded.
[0006] According to a data processing method based on traffic blocking provided by the present disclosure, if the traffic blocking rule pre-set by the user interface module is a blacklist rule, then the obtaining of released traffic information is further: verifying whether the traffic information is legal, and if so, determining whether the traffic information complies with the blacklist rule, and if not, the traffic information is released traffic information; if the traffic information complies with the blacklist rule, the traffic information is illegal traffic information, and the illegal traffic information is discarded.
[0007] According to a data processing method based on traffic blocking provided by the present disclosure, the rules for traffic blocking rule configuration performed by the user are obtained through the following steps: based on the configuration interface corresponding to the user interface module, the rule configuration information is obtained; whether the rule configuration information is legal is verified, and if so, data processing is performed on the rules to be processed corresponding to the rule configuration information and the rules are stored.
[0008] According to a data processing method based on traffic blocking provided by the present disclosure, the storing of the rules specifically includes: storing the rules based on a dictionary tree.
[0009] In a second aspect, the present disclosure further provides a data processing device based on traffic blocking, comprising: a traffic blocking module and a user interface module set in an operating system kernel; the user interface module is used to configure traffic blocking rules; the traffic blocking module is used to receive traffic information from a data link layer, and obtain release traffic information based on the traffic blocking rules preset by the user interface module, and send the release traffic information to a network protocol stack for data processing. .
[0010] In a third aspect, the present disclosure further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned data processing methods based on traffic blocking are implemented.
[0011] In a fourth aspect, the present disclosure further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described data processing methods based on traffic blocking.
[0012] In a fifth aspect, the present disclosure further provides a computer program product, including a computer program, which implements the steps of the data processing method based on traffic blocking as described above when executed by a processor. In the data processing method, device and related equipment based on traffic blocking provided by the present disclosure, a traffic blocking module is used to obtain the released traffic information according to the traffic blocking rules pre-set by the user interface module. The released traffic information obtained in the network protocol stack is the filtered traffic information. The network protocol stack only needs to peel off the header of each layer in turn during the transmission process to the protocol stack until the raw data reaches the user.
[0013] From the description of the above working principle, it can be seen that since the traffic blocking module filters the traffic information in advance, the pressure of data screening does not need to be borne by multiple filtering devices distributed in the network protocol stack. For example, it does not need to be borne multiple times by multiple message filtering systems distributed in multiple key nodes of the network protocol stack of the operating system kernel in the prior art. Therefore, even if there is a large amount of traffic information that needs to be processed, it will be processed once by the traffic blocking module in advance, which reduces the data processing pressure of the network protocol stack and improves system performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the present disclosure or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0015] Figure 1 It is a structural block diagram of an operating system kernel in the data processing method based on traffic blocking provided by the present disclosure;
[0016] Figure 2 It is one of the flow charts of the data processing method based on traffic blocking provided by the present disclosure;
[0017] Figure 3 This is one of the flow charts of the step of obtaining the released flow information in the data processing method based on flow blocking provided by the present disclosure;
[0018] Figure 4 This is the second flow chart of the data processing method based on traffic blocking provided by the present disclosure;
[0019] Figure 5 This is the second flow chart of the step of obtaining the released flow information in the data processing method based on flow blocking provided by the present disclosure;
[0020] Figure 6 It is a flowchart of the configuration and data processing of the operating system of the data processing method provided by the present disclosure;
[0021] Figure 7 is a structural block diagram of a data processing system based on traffic blocking provided by the present disclosure;
[0022] Figure 8 It is a schematic diagram of the structure of an electronic device provided by the present disclosure. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the embodiments of the present disclosure.
[0024] The following is an explanation of the data processing method based on traffic blocking provided in an embodiment of the present disclosure.
[0025] The data processing method based on traffic blocking provided by the embodiment of the present disclosure is applied to an operating system, the kernel of which is configured with a traffic blocking module and a user interface module, and the user interface module is used to configure traffic blocking rules.
[0026] Reference Figure 1 In one embodiment, the operating system is Linux, and netfilter / iptables is the TCP / IP packet filtering system of the operating system. It has been integrated into the kernel since Linux 3.5 kernel version and has become a built-in firewall mechanism of the Linux kernel. Using netfilter / iptables, the user configures the filtering conditions of the TCP / IP packets to realize the firewall function.
[0027] Netfilter / iptables consists of two parts: netfilter and iptables. Netfilter runs in the kernel and is the packet processing module of the operating system kernel. The kernel filters incoming and outgoing packets through netfilter. The iptables tool works in user mode and is an interactive interface exposed to users. Users can configure packet filtering rules through iptables, including adding, modifying, and deleting filtering rules, and can also observe packet filtering conditions. However, there are a large number of rules in multiple traffic filtering modules, and the processing efficiency is low when performing traffic information filtering, which leads to poor system performance when the traffic is large.
[0028] In an embodiment of the present disclosure, the above-mentioned user interface module and traffic blocking module are added between the kernel interface and the network protocol stack, and the traffic blocking function is put in front. The traffic information is first filtered by the traffic blocking module, and the messages that need to be discarded are identified and discarded, and then the filtered traffic information is sent to the protocol stack for processing.
[0029] Specifically, the following steps are included: Figure 2 ,include:
[0030] Step S201: Based on the traffic blocking module, receive traffic information from the data link layer;
[0031] Specifically, the flow information is the information after the data link frame header is removed from the data packet, which can also be called a message. It should be noted that if the flow information is a correct message that complies with the TCP / IP protocol, then the flow information header information includes the five-tuple information corresponding to the flow information, namely, the protocol number, source IP, source port, destination IP, destination port and other information.
[0032] The data link layer is the second layer in the OSI reference model, between the physical layer and the network layer. The data link layer provides services to the network layer based on the services provided by the physical layer. Its most basic service is to reliably transmit data from the network layer to the target network layer of the adjacent node. To achieve this goal, the data link must have a series of corresponding functions, mainly: how to combine data into data blocks, which are called frames in the data link layer. Frames are the transmission units of the data link layer; how to control the transmission of frames on the physical channel, including how to handle transmission errors and how to adjust the sending rate to match the receiver; and provide management of the establishment, maintenance and release of data link paths between two network entities.
[0033] Step S203, according to the traffic blocking rules preset by the user interface module, obtain the released traffic information and send it to the network protocol stack in the kernel;.
[0034] The user interface module is used for users to configure traffic blocking rules. The user interface module commands work in user mode. Users can configure traffic blocking rules as needed, such as deleting, adding or modifying traffic blocking rules. The user interface module receives user interface module commands from user mode based on the operating system kernel interface and converts them into appropriate data structures, and saves the data structures corresponding to the rules to the traffic blocking module.
[0035] Traffic blocking rules can be based on blacklist rules or whitelist rules. The blacklist mechanism means that specific traffic specified by the user is rejected and discarded, while other traffic is released normally. The whitelist mechanism is the opposite of the blacklist. The user-specified traffic is released, and other unspecified traffic is discarded. The similarity between the blacklist and the whitelist is that unnecessary messages are discarded according to certain rules to achieve the purpose of traffic blocking.
[0036] Step S205: performing data processing on the released flow information.
[0037] Specifically, data processing is to strip off the header of each layer in turn, and finally reach the user's raw data. The network protocol stack is the TCP / IP protocol stack.
[0038] From the description of the above working principle, it can be seen that since the traffic blocking module filters the traffic information in advance, the pressure of data screening does not need to be borne by multiple filtering devices distributed in the network protocol stack. For example, it does not need to be borne multiple times by the five message filtering systems distributed in the five key nodes of the network protocol stack of the operating system kernel in the prior art. Therefore, even if there is a large amount of traffic information that needs to be processed, it will be processed once by the traffic blocking module in advance, which reduces the data processing pressure of the network protocol stack and improves system performance.
[0039] In an optional embodiment, if the traffic blocking rule preset by the user interface module is a whitelist rule, then refer to Figure 3 The step S103 of obtaining the release flow information is further as follows:
[0040] Step S301, check whether the flow information is legal, if so, determine whether the flow information complies with the whitelist rules, if so, the flow information is released flow information.
[0041] Verifying whether the traffic information is legal is to determine whether the traffic information is a correct message that complies with the TCP / IP protocol.
[0042] In an optional embodiment, step S301 further includes:
[0043] Step S3011: Check whether the flow information is legal. If so, extract the header information of the flow information to obtain the five-tuple information corresponding to the flow information.
[0044] Specifically, the five-tuple information is the protocol number information, source IP information, source port information, destination IP information, and destination port information corresponding to the traffic information.
[0045] Step S3013: Match the five-tuple information corresponding to the traffic information with the preset whitelist rules. If the five-tuple information hits the whitelist rules, the traffic information is released traffic information.
[0046] The hit is that the quintuple information corresponding to the traffic information is the same as the quintuple information corresponding to any one of the whitelist rules, that is, the quintuple information corresponding to the whitelist rule includes the quintuple information corresponding to the traffic information.
[0047] Step S303: If the traffic information does not comply with the whitelist rule, the traffic information is illegal traffic information and the illegal traffic information is discarded.
[0048] Illegal traffic information is traffic information not specified by the user.
[0049] Based on the above embodiment, if the traffic blocking rule preset by the user interface module is a blacklist rule, then refer to Figure 4The step S103 of obtaining the release flow information is further as follows:
[0050] Step S401: Check whether the traffic information is legal. If so, determine whether the traffic information complies with the blacklist rule. If not, the traffic information is released traffic information.
[0051] Verifying whether the traffic information is legal is to determine whether the traffic information is a correct message that complies with the TCP / IP protocol.
[0052] In an optional embodiment, step S401 further includes:
[0053] Step S4011: Check whether the flow information is legal. If so, extract the header information of the flow information to obtain the five-tuple information corresponding to the flow information.
[0054] Specifically, the five-tuple information is the protocol number information, source IP information, source port information, destination IP information, and destination port information corresponding to the traffic information.
[0055] Step S4013: Match the five-tuple information corresponding to the flow information with the preset blacklist rule. If the five-tuple information does not hit the blacklist rule, the flow information is released flow information.
[0056] The five-tuple information does not hit the blacklist rule because the five-tuple information corresponding to the traffic information is different from the five-tuple information corresponding to any one of the blacklist rules.
[0057] Step S403: If the flow information meets the blacklist rule, the flow information is illegal flow information and the illegal flow information is discarded.
[0058] The hit is that the quintuple information corresponding to the traffic information is the same as the quintuple information corresponding to any one of the blacklist rules, that is, the quintuple information corresponding to the blacklist rule includes the quintuple information corresponding to the traffic information.
[0059] Based on any of the above embodiments, refer to Figure 5 , the rules for users to configure traffic blocking rules are obtained through the following steps:
[0060] Step S501: Obtain rule configuration information based on the configuration interface corresponding to the user interface module.
[0061] The user performs configuration through the configuration interface corresponding to the user interface module, and the user interface module obtains rule configuration information through the configuration interface.
[0062] Step S503: Check whether the rule configuration information is legal. If so, perform data processing on the to-be-processed rules corresponding to the rule configuration information and store the rules.
[0063] It should be noted that the operation performed by the traffic blocking module after the user interface module sends the rule configuration information to the traffic blocking module for data processing and rule storage may, in a specific implementation, also be the user interface module performing data processing on the rule configuration information, that is, the data format is converted and stored in the user interface module and sent to the traffic blocking module for storage.
[0064] In an optional embodiment, the storage rule in step S503 specifically includes:
[0065] Based on dictionary tree storage rules.
[0066] Specifically, a dictionary tree, also known as a prefix tree or Trie tree in computer science, is an ordered tree used to store associative arrays, where the keys are usually strings. Unlike a binary search tree, the keys are not stored directly in the nodes, but are determined by the position of the nodes in the tree. All descendants of a node have the same prefix, which is the string corresponding to the node, and the root node corresponds to an empty string. In general, not all nodes have corresponding values, only the keys corresponding to leaf nodes and some internal nodes have relevant values.
[0067] The core idea of the trie tree design is to trade space for time, so the trie tree itself consumes more space. However, it uses the common prefix of the string as the storage basis to save storage space and speed up the search time. The trie tree has the characteristics of efficient insertion and search, and its query performance is independent of the number of strings in the set. It is suitable for scenarios that require a large number of searches. When implementing traffic blocking, a more efficient trie tree algorithm is used, which is different from netfilter and matches one by one in sequence. When there are a large number of matching rules, it effectively improves the matching performance and reduces system overhead.
[0068] Reference Figure 6 In a specific implementation, the method for configuring rules and processing data using the operating system of the data processing method based on traffic blocking provided by the embodiment of the present disclosure may include:
[0069] Step S601: The system starts, loads the traffic blocking module, and initializes the trie tree.
[0070] Step S602: Obtain rule configuration information based on the configuration interface corresponding to the user interface module.
[0071] Step S603: Perform a validity check on the rule configuration information based on the traffic blocking module and obtain a check result.
[0072] Wherein, step S603 specifically includes:
[0073] Step S6031: If the rule configuration information is legal, the configured rules are processed and stored in the trie tree;
[0074] Step S6033: If the rule configuration information is illegal, an error is returned to end the configuration.
[0075] Step S604: Based on the traffic blocking module, receive traffic information from the data link layer.
[0076] Step S605: According to the traffic blocking rule preset by the user interface module, the released traffic information is obtained and sent to the network protocol stack.
[0077] In an optional embodiment, if the traffic blocking rule preset by the user interface module is a whitelist rule, step S605 specifically includes:
[0078] Step S60511: Check whether the traffic information is legal. If so, determine whether the traffic information complies with the whitelist rule. If so, the traffic information is released traffic information.
[0079] Step S60513: If the traffic information does not comply with the whitelist rules, the traffic information is illegal traffic information and the illegal traffic information is discarded.
[0080] In another optional embodiment, step S605 specifically includes:
[0081] Step S60521: Check whether the traffic information is legal. If so, determine whether the traffic information complies with the blacklist rule. If not, the traffic information is released traffic information.
[0082] Step S60523: If the traffic information meets the blacklist rule, the traffic information is illegal traffic information and the illegal traffic information is discarded.
[0083] Step S606: Based on the network protocol stack, data processing is performed on the released traffic information.
[0084] The following is a description of a data processing device based on traffic blocking provided in an embodiment of the present disclosure. The data processing device based on traffic blocking described below and the data processing method based on traffic blocking described above can be referenced to each other.
[0085] Reference Figure 7The present disclosure also provides a data processing device based on traffic blocking, including: a traffic blocking module 73 and a user interface module 71 arranged in the operating system kernel; the user interface module 71 is used to configure traffic blocking rules; the traffic blocking module 73 is used to receive traffic information from the data link layer, and obtain released traffic information based on the traffic blocking rules pre-set by the user interface module, and send the released traffic information to the network protocol stack 75 for data processing.
[0086] Specifically, the user interface module 71 is used to configure the traffic blocking rules. The user interface module commands work in the user state. The user can configure the traffic blocking rules as needed, such as deleting, adding or modifying the traffic blocking rules. The user interface module receives the user interface module commands from the user state based on the operating system kernel interface and converts them into a suitable data structure, and saves the data structure corresponding to the rule to the traffic blocking module. The traffic blocking rules can be based on blacklist rules or whitelist rules. The blacklist mechanism means that the specific traffic specified by the user is refused to be released and discarded, while other traffic is released normally. The whitelist mechanism is the opposite of the blacklist. The traffic specified by the user is released, and other traffic that is not clearly specified is discarded. The similarity between the blacklist and the whitelist is that unnecessary messages are discarded according to certain rules to achieve the purpose of traffic blocking.
[0087] The flow information received by the flow blocking module 73 is the information after the data packet removes the data link frame header, which can also be called a message. It should be noted that if the flow information is a correct message that complies with the TCP / IP protocol, then the flow information header information includes the five-tuple information corresponding to the flow information, namely, the protocol number, source IP, source port, destination IP, destination port and other information. The data link layer is the second layer in the OSI reference model, between the physical layer and the network layer. The data link layer provides services to the network layer on the basis of the services provided by the physical layer. Its most basic service is to reliably transmit data from the network layer to the target machine network layer of the adjacent node. To achieve this goal, the data link must have a series of corresponding functions, mainly including: how to combine data into data blocks, which are called frames in the data link layer. Frames are the transmission units of the data link layer; how to control the transmission of frames on the physical channel, including how to handle transmission errors and how to adjust the sending rate to match the receiver; and provide management of establishing, maintaining and releasing data link paths between two network entities.
[0088] The traffic blocking module 73 is also used to send the released traffic information to the network protocol stack for data processing. The network protocol stack is a TCP / IP protocol stack.
[0089] From the above working principle, it can be seen that since the traffic blocking module filters the traffic information in advance, the pressure of data screening does not need to be borne by multiple filtering devices distributed in the network protocol stack, for example, it does not need to be borne multiple times by the five message filtering systems distributed in the five key nodes of the network protocol stack of the operating system kernel in the prior art. Therefore, even if there is a large amount of traffic information to be processed, it is processed once by the traffic blocking module in advance, which reduces the data processing pressure of the network protocol stack and improves the system performance.
[0090] In an optional embodiment, if the traffic blocking rule preset by the user interface module is a whitelist rule, the traffic blocking module 73 further includes:
[0091] The whitelist verification unit is used to verify whether the traffic information is legal. If so, it determines whether the traffic information complies with the whitelist rules. If so, the traffic information is released traffic information.
[0092] Verifying whether the traffic information is legal is to determine whether the traffic information is a correct message that complies with the TCP / IP protocol.
[0093] The discarding unit is used to discard the illegal traffic information if the traffic information does not conform to the whitelist rule.
[0094] Illegal traffic information is traffic information not specified by the user.
[0095] In an optional embodiment, the checking whitelist unit further includes:
[0096] The extraction subunit is used to verify whether the flow information is legal. If so, the header information of the flow information is extracted to obtain the five-tuple information corresponding to the flow information.
[0097] Specifically, the five-tuple information is the protocol number information, source IP information, source port information, destination IP information, and destination port information corresponding to the traffic information.
[0098] The matching subunit is used to match the five-tuple information corresponding to the flow information with the preset whitelist rules. If the five-tuple information hits the whitelist rules, the flow information is the released flow information.
[0099] The hit is that the quintuple information corresponding to the traffic information is the same as the quintuple information corresponding to any one of the whitelist rules, that is, the quintuple information corresponding to the whitelist rule includes the quintuple information corresponding to the traffic information.
[0100] Based on the above embodiment, if the traffic blocking rule preset by the user interface module is a blacklist rule, the traffic blocking module 73 further includes:
[0101] The blacklist verification unit is used to verify whether the traffic information is legal. If so, it determines whether the traffic information complies with the blacklist rules. If not, the traffic information is released traffic information.
[0102] Verifying whether the traffic information is legal is to determine whether the traffic information is a correct message that complies with the TCP / IP protocol.
[0103] The blacklist information discarding unit is used to discard the illegal traffic information if the traffic information meets the blacklist rule.
[0104] The hit is that the quintuple information corresponding to the traffic information is the same as the quintuple information corresponding to any one of the blacklist rules, that is, the quintuple information corresponding to the blacklist rule includes the quintuple information corresponding to the traffic information.
[0105] In an optional embodiment, the blacklist checking unit further comprises:
[0106] The extraction and acquisition unit is used to verify whether the flow information is legal. If so, the header information of the flow information is extracted to obtain the five-tuple information corresponding to the flow information.
[0107] Specifically, the five-tuple information is the protocol number information, source IP information, source port information, destination IP information, and destination port information corresponding to the traffic information.
[0108] The matching rule subunit is used to match the five-tuple information corresponding to the flow information with the preset blacklist rule. If the five-tuple information does not hit the blacklist rule, the flow information is the released flow information.
[0109] The five-tuple information does not hit the blacklist rule because the five-tuple information corresponding to the traffic information is different from the five-tuple information corresponding to any one of the blacklist rules.
[0110] Based on any of the above embodiments, the rules for the traffic blocking rule configuration by the user are obtained in the following manner:
[0111] Based on the configuration interface corresponding to the user interface module, obtain rule configuration information.
[0112] Specifically, the user performs configuration through the configuration interface corresponding to the user interface module, and the user interface module obtains the rule configuration information through the configuration interface.
[0113] Verify whether the rule configuration information is legal. If so, perform data processing on the pending rules corresponding to the rule configuration information and store the rules.
[0114] It should be noted that the operation performed by the traffic blocking module after the user interface module sends the rule configuration information to the traffic blocking module for data processing and rule storage may, in a specific implementation, also be the user interface module performing data processing on the rule configuration information, that is, the data format is converted and stored in the user interface module and sent to the traffic blocking module for storage.
[0115] Figure 8 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 8 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820 and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the data processing method based on traffic blocking.
[0116] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the embodiment of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0117] On the other hand, the present disclosure also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the data processing method based on traffic blocking provided by the above-mentioned methods.
[0118] On the other hand, the present disclosure further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the above-mentioned data processing methods based on traffic blocking.
[0119] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0120] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0121] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present disclosure.
Claims
1. A data processing method based on traffic blocking, applied to an operating system, characterized in that: The kernel of the operating system is configured with a traffic blocking module and a user interface module, the user interface module is used to configure traffic blocking rules; the user interface module command works in the user state, the user interface module receives the user interface module command from the user state based on the operating system kernel interface and converts it into a suitable data structure, and saves the data structure corresponding to the traffic blocking rule to the traffic blocking module; The method comprises: Based on the traffic blocking module, receiving traffic information from the data link layer; The traffic blocking module obtains the released traffic information according to the traffic blocking rules preset by the user interface module and sends it to the network protocol stack in the kernel; The released traffic information is processed via the network protocol stack.
2. The data processing method based on traffic blocking according to claim 1 is characterized in that: If the traffic blocking rule preset by the user interface module is a whitelist rule, then, The obtaining of the release flow information is further as follows: Verify whether the traffic information is legal, and if so, determine whether the traffic information complies with the whitelist rule, and if so, determine that the traffic information is released traffic information; If the traffic information does not comply with the whitelist rule, the traffic information is illegal traffic information and the illegal traffic information is discarded.
3. The data processing method based on traffic blocking according to claim 1 is characterized in that: If the traffic blocking rule preset by the user interface module is a blacklist rule, then, The obtaining of the release flow information is further as follows: Verify whether the traffic information is legal. If so, determine whether the traffic information complies with the blacklist rule. If not, determine that the traffic information is released traffic information. If the traffic information meets the blacklist rule, the traffic information is illegal traffic information and the illegal traffic information is discarded.
4. The data processing method based on traffic blocking according to any one of claims 2 or 3, characterized in that: The rules for the user to configure the traffic blocking rules are obtained through the following steps: Based on the configuration interface corresponding to the user interface module, obtain rule configuration information; Verify whether the rule configuration information is legal. If so, perform data processing on the to-be-processed rules corresponding to the rule configuration information and store the rules.
5. The data processing method based on traffic blocking according to claim 4 is characterized in that: The storing of the rules specifically includes: The rules are stored based on a dictionary tree.
6. A data processing device based on flow blocking, characterized in that: include: A traffic blocking module and a user interface module arranged in the operating system kernel; The user interface module command works in the user state. The user interface module receives the user interface module command from the user state based on the operating system kernel interface and converts it into a suitable data structure, and saves the data structure corresponding to the traffic blocking rule to the traffic blocking module; The user interface module is used to configure traffic blocking rules; The traffic blocking module is used to receive traffic information from the data link layer, obtain released traffic information based on the traffic blocking rules preset by the user interface module, and send the released traffic information to the network protocol stack for data processing.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the data processing method based on traffic blocking as described in any one of claims 1 to 5 are implemented.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the data processing method based on traffic blocking as described in any one of claims 1 to 5 are implemented.
9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the data processing method based on traffic blocking as claimed in any one of claims 1 to 5 are implemented.
