Access request data processing method, device and server
By dynamically adjusting the firewall rules and using the decision-making model to process the feature vectors of historical access requests, the problem of omissions and false positives in the existing firewall rules when detecting network attacks is solved, the accurate identification and processing of network attacks is achieved, and the system is improved. Data security.
Patent Information
- Application Number
- CN202410447166.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-15
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-04-15
AI Technical Summary
Existing firewall rules are prone to false negatives and false positives when detecting network attacks, and due to rapid changes in attack patterns, firewall rules are fixed and remain unchanged, exacerbating the problem of false negatives and false positives and affecting system data security.
By obtaining historical access requests, use preset feature processing rules and decision-making models (including state representation network and action value network) to process historical feature vectors, and dynamically adjust firewall rules to accurately identify network attack risks and handle them in a timely manner.
It effectively reduces the false negative rate and false positive rate of network attack detection, accurately identifies and processes access requests with network attack risks, and improves system data security.
Smart Images

Figure CN118041708B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data technology, and in particular to a method, device and server for processing data of access requests. Background Art
[0002] In Internet scenarios, web applications, web sites, etc. are often subject to many network attacks.
[0003] Based on the existing methods, most of them require technical personnel to pre-set fixed firewall rules based on personal knowledge and experience; then use the firewall rules to detect access requests received by Web applications or web pages; when an access request belonging to a network attack is detected, the access request is processed accordingly according to the firewall rules.
[0004] However, when the above method is implemented, it is affected by the subjective factors of the technicians, which leads to the fact that the firewall rules set are sometimes not accurate and reasonable enough, which in turn leads to problems such as missed reports and false reports when detecting network attacks based on the above firewall rules. In addition, in the real business environment, network attacks, web applications, web sites, etc. are constantly evolving rapidly, while the firewall rules used are often fixed. As a result, after the firewall rules are used continuously for a period of time, the above problems such as missed reports and false reports will become more serious, further affecting the data security of the system.
[0005] To address the above problems, no effective solution has been proposed yet. Summary of the invention
[0006] This specification provides a data processing method, device and server for access requests. By intelligently and dynamically adjusting firewall rules, it can effectively reduce the missed alarm rate and false alarm rate during network attack detection, accurately identify access requests that pose a risk of network attacks, and promptly and specifically process such access requests, thereby better protecting the data security of the system.
[0007] This specification provides a method for processing access request data, including:
[0008] Get the historical access requests in the previous time period;
[0009] According to the preset feature processing rules, the historical access requests of the previous time period are processed to obtain the corresponding historical feature vector of the previous time period;
[0010] The historical feature vectors of the previous time period are processed by a preset decision model to obtain a corresponding decision result; wherein the preset decision model at least includes a state representation network and an action value network; the state representation network is used to map the historical feature vectors of the previous time period into a corresponding state representation; the action value network is used to determine a plurality of candidate decision actions and a reward value corresponding to each candidate decision action according to the state representation; the preset decision model is obtained through multiple rounds of iterative training according to preset training rules;
[0011] According to the decision results, determine the candidate decision actions that meet the requirements as the target decision actions;
[0012] According to the target decision action, the firewall rules of the system are adjusted to obtain the firewall rules of the current time period; wherein the firewall rules of the current time period are used to detect and process the access requests received in the current time period.
[0013] In one embodiment, the preset decision model includes at least one of the following: a firewall rule decision model for SQL injection attacks, a firewall rule decision model for cross-site scripting attacks, and a firewall rule decision model for cross-site request forgery attacks.
[0014] In one embodiment, when the preset decision model includes a firewall rule decision model for SQL injection attacks, the historical access requests of the previous time period are processed according to the preset feature processing rules to obtain the corresponding historical feature vector of the previous time period, including:
[0015] According to the preset feature processing rules, the first feature is determined by detecting whether there is an SQL keyword in the historical access request of the previous time period; the second feature is determined and obtained according to the request length of the historical access request of the previous time period; and the number of specified characters contained in the historical access request of the previous time period is counted as the third feature;
[0016] According to the first feature and the second feature, a corresponding cross feature is obtained through feature cross processing;
[0017] According to the first feature and the third feature, a corresponding aggregate feature is obtained through feature aggregation processing;
[0018] The cross features and the aggregate features are used in combination to generate a corresponding historical feature vector for the previous time period.
[0019] In one embodiment, the method further comprises:
[0020] Binarization is performed on the second feature to obtain a binarized second feature;
[0021] Accordingly, according to the first feature and the second feature, through feature cross processing, corresponding cross features are obtained, including:
[0022] According to the first feature and the binarized second feature, a corresponding cross feature is obtained through feature cross processing.
[0023] In one embodiment, according to the target decision action, the firewall rules of the system are adjusted, including:
[0024] Based on the target decision action, adjust the system's firewall rules in at least one of the following ways:
[0025] In the preset firewall rule set, a first type of firewall rule is determined; and a state parameter of the first type of firewall rule is set to be enabled;
[0026] In the preset firewall rule set, a second type of firewall rule is determined; and a state parameter of the second type of firewall rule is set to disabled;
[0027] In the preset firewall rule set, a third type of firewall rule is determined; and the third type of firewall rule is modified, and a state parameter of the modified third type of firewall rule is set to be enabled.
[0028] In one embodiment, the method further comprises:
[0029] Constructing an initial decision model; wherein the initial decision model at least includes an initial state representation network and an initial action value network; the initial action value network is at least connected to an initial first Q network structure;
[0030] Connecting the initial decision model with the preset firewall rule set; and configuring the preset action selection rules for the initial decision model;
[0031] Obtaining a test sample request; and processing the test sample request according to a preset feature processing rule to obtain a corresponding test sample feature vector;
[0032] According to the preset training rules, the initial decision model is trained for multiple rounds of iterations using the test sample feature vectors and the test sample requests to obtain a preset decision model that meets the requirements.
[0033] In one embodiment, according to a preset training rule, the initial decision model is trained for multiple rounds of iterations using the test sample feature vector and the test sample request, including:
[0034] Perform the current round of iterative training according to the preset training rules in the following manner:
[0035] Get the decision model of the previous round;
[0036] Using the decision model of the previous round to process the feature vector of the test sample of the previous round, determine the decision action of the current round; wherein the feature vector of the test sample of the previous round is generated according to the test sample request of the previous round;
[0037] Determine the firewall rules for the current round based on the decision actions of the current round;
[0038] According to the firewall rules of the current round, detect and process the test sample request of the current round to obtain the detection and processing result of the current round;
[0039] Generate feedback data for the current round based on the detection and processing results of the current round;
[0040] According to the feedback data of the current round, the model parameters of the decision model of the previous round are adjusted to obtain the decision model of the current round.
[0041] In one embodiment, adjusting the model parameters of the decision model of the previous round according to the feedback data of the current round includes:
[0042] Check whether the current round meets the preset reset conditions;
[0043] When it is determined that the current round meets the preset reset condition, the network parameters of the state representation network and the action value network in the decision model of the previous round, as well as the network parameters of the second Q network structure are adjusted according to the feedback data of the current round; wherein the second Q network structure corresponds to the first Q network structure; and the second Q network structure is not connected to the decision model of the previous round;
[0044] The adjusted second Q network structure is copied to the first Q network structure to obtain the decision model of the current round.
[0045] In one embodiment, when detecting whether the current round meets a preset reset condition, the method further includes:
[0046] When it is determined that the current round does not meet the preset reset conditions, the network parameters of the state representation network and the action value network in the decision model of the previous round, as well as the network parameters of the second Q network structure are adjusted according to the feedback data of the current round to obtain the decision model of the current round.
[0047] In one embodiment, the method further comprises:
[0048] The test sample feature vector of the previous round, the test sample request of the current round, and the feedback data of the current round are obtained and combined as an experience data; and the experience data is stored in a preset buffer area.
[0049] This specification also provides a data processing device for access request, including:
[0050] The acquisition module is used to obtain the historical access requests in the previous time period;
[0051] A processing module, used to process the historical access requests of the previous time period according to a preset feature processing rule, and obtain the corresponding historical feature vector of the previous time period;
[0052] A decision module, used to process the historical feature vectors of the previous time period using a preset decision model to obtain a corresponding decision result; wherein the preset decision model at least includes a state representation network and an action value network; the state representation network is used to map the historical feature vectors of the previous time period into a corresponding state representation; the action value network is used to determine a plurality of candidate decision actions and a reward value corresponding to each candidate decision action according to the state representation; the preset decision model is obtained through multiple rounds of iterative training according to preset training rules;
[0053] A determination module is used to determine a candidate decision action that meets the requirements as a target decision action based on the decision result;
[0054] The adjustment module is used to adjust the firewall rules of the system according to the target decision action to obtain the firewall rules of the current time period; wherein the firewall rules of the current time period are used to detect and process the access requests received in the current time period.
[0055] The present specification also provides a server, comprising a processor and a memory for storing processor executable instructions, wherein the processor implements the relevant steps of the data processing method for the access request when executing the instructions.
[0056] The present specification also provides a computer-readable storage medium on which computer instructions are stored. When the instructions are executed by a processor, the relevant steps of the data processing method for access requests are implemented.
[0057] The present specification also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the relevant steps of the data processing method for access requests are implemented.
[0058] Based on the data processing method, device and server of the access request provided in this specification, before specific implementation, it is possible to first obtain a preset decision model with better effect through multiple rounds of iterative training according to the preset training rules. During specific implementation, the historical access request of the previous time period can be obtained first; and according to the preset feature processing rules, the historical access request of the previous time period is processed to obtain the corresponding historical feature vector of the previous time period; then the historical feature vector of the previous time period is processed by the preset decision model to obtain the corresponding decision result; and according to the decision result, the firewall rules of the system are dynamically adjusted to obtain the firewall rules of the current time period that are adapted; and then the firewall rules of the current time period can be used to detect and process the access requests received by the system in the current time period. By first using the preset decision model to process the historical feature vector of the previous time period obtained based on the historical access request of the previous time period, learn and determine the more appropriate decision result according to the latest network attack mode and characteristics of the most recent time period; then according to the decision result, the firewall rules of the system are intelligently and dynamically adjusted to obtain the firewall rules of the current time period that are adapted to the current access traffic scenario; and then the firewall rules of the current time period can be used to detect and process the access requests received in the current time period. This can effectively reduce the missed alarm rate and false alarm rate during network attack detection, accurately identify access requests that pose a risk of network attacks, and promptly and specifically handle such access requests, thereby better protecting the system's data security. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the embodiments of this specification, the drawings required for use in the embodiments will be briefly introduced below. The drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0060] Figure 1 is a flowchart of a method for processing access request data provided by an embodiment of this specification;
[0061] Figure 2 It is a schematic diagram of an embodiment of a method for processing access request data provided by an embodiment of this specification in a scenario example;
[0062] Figure 3 It is a schematic diagram of an embodiment of a method for processing access request data provided by an embodiment of this specification in a scenario example;
[0063] Figure 4 It is a schematic diagram of an embodiment of a method for processing access request data provided by an embodiment of this specification in a scenario example;
[0064] Figure 5 It is a schematic diagram of an embodiment of a method for processing access request data provided by an embodiment of this specification in a scenario example;
[0065] Figure 6 It is a schematic diagram of an embodiment of a method for processing access request data provided by an embodiment of this specification in a scenario example;
[0066] Figure 7 It is a schematic diagram of an embodiment of a method for processing access request data provided by an embodiment of this specification in a scenario example;
[0067] Figure 8 is a flowchart of a method for processing access request data provided by an embodiment of this specification;
[0068] Fig. 9 It is a schematic diagram of the structure of a server provided by an embodiment of this specification;
[0069] Fig.10 is a schematic diagram of the structure of a data processing device for access requests provided by an embodiment of the present specification;
[0070] Fig.11 It is a schematic diagram of an embodiment of a method for processing access request data provided by an embodiment of this specification in a scenario example;
[0071] Fig.12 It is a schematic diagram of an embodiment of a method for processing access request data provided by an embodiment of this specification in a scenario example;
[0072] Fig.13 It is a schematic diagram of an embodiment of a method for processing data of an access request provided by an embodiment of this specification, in a scenario example. DETAILED DESCRIPTION
[0073] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0074] It should be noted that the information and data involved in this manual are all information and data authorized by the user or fully authorized by the relevant parties; and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant information and data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users or relevant parties to choose to authorize or refuse.
[0075] It should also be noted that in the embodiments of this specification, certain software, components, models and other existing solutions in the industry may be mentioned. They should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of this application, but it does not mean that the applicant has or will necessarily use the solution.
[0076] See also Figure 1 As shown, the embodiment of this specification provides a method for processing data of access requests. The method can be specifically applied to a server or a network security device (for example, Web Application Firewall, WAF). When implemented specifically, the method may include the following contents:
[0077] S101: Obtain historical access requests in the previous time period;
[0078] S102: Processing historical access requests in the previous time period according to a preset feature processing rule to obtain a corresponding historical feature vector of the previous time period;
[0079] S103: Using a preset decision model to process the historical feature vectors of the previous time period to obtain a corresponding decision result; wherein the preset decision model at least includes a state representation network and an action value network; the state representation network is used to map the historical feature vectors of the previous time period into a corresponding state representation; the action value network is used to determine a plurality of candidate decision actions and a reward value corresponding to each candidate decision action according to the state representation; the preset decision model is obtained through multiple rounds of iterative training according to preset training rules;
[0080] S104: According to the decision result, determine the candidate decision action that meets the requirements as the target decision action;
[0081] S105: According to the target decision action, the firewall rules of the system are adjusted to obtain the firewall rules of the current time period; wherein the firewall rules of the current time period are used to detect and process the access requests received in the current time period.
[0082] Among them, the above-mentioned preset decision model can be specifically understood as a neural network model that is obtained through multiple rounds of iterative training based on preset training rules and can learn and determine and output the preferred decision action for adjusting the firewall rules for access requests based on the feature vector of access requests in a time period input according to the specific characteristics of the access traffic scenario, which matches the access traffic scenario represented by the access requests in the time period.
[0083] Based on the above embodiments, the preset decision model can be used to automatically determine the matching target decision action by processing the historical feature vector of the previous time period extracted based on the historical access requests of the previous time period; and then the target decision action can be used to intelligently and dynamically adjust the firewall rules of the system; and the access requests received in the current time period are detected and processed according to the firewall rules of the current time period obtained after adjustment. In this way, new network attack patterns and characteristics can be automatically learned, and the firewall rules used can be adaptively and dynamically adjusted; and then, according to the dynamically adjusted firewall rules, access requests with network attack risks can be accurately identified and discovered, and such risky access requests can be timely and targetedly processed, effectively reducing the missed alarm rate and false alarm rate during network attack detection.
[0084] In some embodiments, for details, please refer to Figure 2 As shown, the data processing method of the access request can be specifically applied to the risk control server side of the trading platform. The risk control server is deployed with a preset prediction model and a preset firewall rule set.
[0085] The trading platform may be an online service platform of a trading institution. A user may use a client to send a corresponding access request to perform specific transaction business data processing through the trading platform.
[0086] The above-mentioned risk control server may specifically include a background system server applied to one side of the trading platform, which can realize functions such as data transmission and data processing. Specifically, the risk control server may be, for example, an electronic device with data calculation, storage and network interaction functions. Alternatively, the risk control server may also be a software program running in the electronic device to provide support for data processing, storage and network interaction. In this embodiment, the number of servers included in the risk control server is not specifically limited. The risk control server may specifically be one server, or several servers, or a server cluster formed by several servers.
[0087] In specific implementation, the trading platform will receive a large number of access requests (for example, http access requests, etc.). The risk control server can perform real-time network attack risk detection on the access requests received by the trading platform according to the corresponding firewall rules; and based on the detection results, when it is determined that the access request has a network attack risk, it will then perform targeted processing on the access request according to the corresponding firewall rules, for example, intercepting the access request; or setting a risk tag for the access request and releasing the access request, etc.
[0088] In specific implementation, the risk control server can automatically obtain the historical access requests of the previous time period at every preset time period (for example, every 24 hours); and according to the preset feature processing rules, by processing the historical access requests of the previous time period, obtain the historical feature vector of the previous time period that can reflect the characteristics of the latest access traffic scenario.
[0089] Next, the risk control server can call the preset decision model to process the historical feature vectors of the previous time period, analyze and combine the latest access traffic scenario characteristics (for example, the latest quantity distribution characteristics of access requests received by the trading platform, the latest attack mode of the network attack suffered by the trading platform, the latest attack type characteristics of the network attack suffered by the trading platform, etc.), determine and output the corresponding decision results.
[0090] Furthermore, the risk control server can intelligently and dynamically adjust the firewall rules according to the preferred target decision action indicated by the decision result and based on the preset firewall rule set, to obtain adjusted firewall rules that are compatible with the current latest access traffic scenario as the firewall rules for the current time period; then, based on the above-mentioned firewall rules for the current time period, the access requests received by the trading platform in the current time period are automatically detected for network attack risks, and corresponding processing is performed in a timely manner.
[0091] According to the above method, the risk control server can automatically learn the latest attack modes and characteristics of network attacks encountered by the trading platform at preset time intervals, and at the same time combine the latest operating status characteristics of the trading platform, and intelligently and adaptively adjust the firewall rules used dynamically, so that the firewall rules used are always adapted to the latest access traffic scenarios; thereby, the monitoring server can accurately identify and discover access requests with network attack risks based on the above adaptive and dynamically adjusted firewall rules, and promptly and effectively process the above access requests with network attack risks, thereby better protecting the data security of the trading platform.
[0092] In some embodiments, the above-mentioned acquisition of historical access requests in the previous time period may include: acquiring the system access request log at each preset time period; and filtering the historical access requests in the previous time period from the system access request log according to the time when the access request was received. The specific duration of the above-mentioned preset time period may be set according to the current operating status characteristics of the system and specific security requirements.
[0093] In some embodiments, the preset decision model may specifically include at least one of the following: a firewall rule decision model for SQL injection attacks, a firewall rule decision model for cross-site scripting attacks (for example, which can be abbreviated as XSS), a firewall rule decision model for cross-site request forgery attacks (for example, which can be abbreviated as CSRF), etc.
[0094] The above-mentioned SQL injection attack may specifically refer to a network attack that inserts or adds SQL code to the input parameters of an application and then passes these parameters to a backend SQL server for parsing and execution. The above-mentioned SQL (Structured Query Language) specifically refers to a structured query language.
[0095] The above-mentioned cross-site scripting attack may specifically refer to a network attack that exploits loopholes left when a web page is developed, injects malicious instruction codes into the web page, and causes the user to load and execute the web page maliciously created by the attacker.
[0096] The above-mentioned cross-site request forgery attack may specifically refer to a network attack that forces a user to perform unintended operations on a currently logged-in Web application.
[0097] It should be noted that the types of network attacks listed above are only schematic illustrations. In specific implementation, according to specific application scenarios and processing requirements, the above-mentioned preset decision model may also include a firewall rule decision model for other types of network attacks. This specification does not limit this.
[0098] Specifically, different types of network attacks often have different attack modes, attack characteristics, etc. Accordingly, the firewall rules used when detecting and processing different types of network attacks will also be different.
[0099] The above-mentioned firewall rule decision rule model for SQL injection attacks can be specifically understood as a neural network model trained for network attacks of this type according to preset training rules, which can intelligently and adaptively automatically decide to adjust the firewall rules for SQL injection attacks.
[0100] The above-mentioned firewall rule decision rule model for cross-site scripting attacks can be specifically understood as a neural network model that is trained for network attacks of this type according to preset training rules, and can automatically make decisions and adjust firewall rules regarding cross-site scripting attacks in an intelligent and adaptive manner.
[0101] The above-mentioned firewall rule decision rule model for cross-site request forgery attacks can be specifically understood as a neural network model that is trained for network attacks of this type according to preset training rules, and can automatically make decisions and adjust firewall rules for cross-site request forgery attacks in an intelligent and adaptive manner.
[0102] Before specific implementation, according to preset training rules, combined with attack modes and attack features of different types of network attacks, preset decision models for different types of network attacks can be trained for different types of network attacks. This specification mainly takes the firewall rule decision model for SQL injection attacks as an example. For the training method and usage method of other types of preset decision models, reference can be made to the embodiment of the firewall rule decision model for SQL injection attacks. This specification does not elaborate on this.
[0103] In some embodiments, when the preset decision model includes a firewall rule decision model for SQL injection attacks, refer to Figure 3 As shown, the above process, according to the preset feature processing rules, processes the historical access requests of the previous time period to obtain the corresponding historical feature vector of the previous time period. When implemented specifically, the following contents may be included:
[0104] S1: According to a preset feature processing rule, determine the first feature by detecting whether there is an SQL keyword in the historical access request in the previous time period; determine and obtain the second feature according to the request length of the historical access request in the previous time period; and count the number of specified characters contained in the historical access request in the previous time period as the third feature;
[0105] S2: According to the first feature and the second feature, a corresponding cross feature is obtained through feature cross processing;
[0106] S3: Obtain corresponding aggregated features through feature aggregation processing according to the first feature and the third feature;
[0107] S4: Combining the cross features and the aggregate features to generate a corresponding historical feature vector for the previous time period.
[0108] The above-mentioned preset feature processing rules may correspond to the network attack type, and may be used to process and extract the feature vector of the corresponding attack type.
[0109] Based on the above embodiment, the historical feature vectors corresponding to SQL injection attacks that can more accurately and finely reflect the attack mode and attack features of SQL injection attacks can be extracted by processing the historical access requests of the previous time period according to the above preset feature processing rules. Similarly, the historical feature vectors corresponding to cross-site scripting attacks or cross-site request forgery attacks can be extracted by processing the historical access requests of the previous time period using the preset feature processing rules corresponding to cross-site scripting attacks or cross-site request forgery attacks.
[0110] In some embodiments, during specific implementation, it can be determined whether there is an SQL keyword in the historical access request of the previous time period by searching whether there is a matching field in the historical access request of the previous time period according to a preset SQL keyword table. When it is determined that there is at least one SQL keyword in the historical access request of the previous time period, a first value (for example, 1) is generated as the first feature; on the contrary, when it is determined that there is no SQL keyword in the historical access request of the previous time period, a second value (for example, 0) is generated as the first feature.
[0111] The preset SQL keywords may specifically include multiple risky SQL keywords.
[0112] Specifically, a preset SQL keyword table can be constructed in the following manner: obtain historical access requests; filter out historical access requests that only have the risk of SQL injection attacks from the historical access requests as positive sample requests, and filter out historical access requests that do not have the risk of network attacks as negative sample requests; perform field extraction processing on each positive sample request to obtain a corresponding positive sample field group, and perform field extraction processing on each negative sample request to obtain a corresponding negative sample field group; perform clustering processing on the positive sample field group to obtain common fields and combine them to obtain a first keyword group, and perform clustering processing on the negative sample fields to obtain common fields and combine them to obtain a second keyword group; compare the second keyword group with the first keyword group to determine repeated keywords; remove repeated keywords from the first keyword group; and construct a preset SQL keyword table based on the removed first keyword group.
[0113] Similarly, the historical access requests in the previous time period may be retrieved according to the preset special character table, and the number of designated characters included in the historical access requests in the previous time period may be counted as the third feature.
[0114] The above-mentioned preset special character table may include multiple special characters, for example, "," and ";". The construction method of the above-mentioned preset special character table may refer to the preset SQL keyword table, which will not be described in detail in this specification.
[0115] During specific implementation, the request length of historical access requests in the previous time period may be directly determined as the second feature.
[0116] In specific implementation, considering the interaction between the first feature and the second feature when reflecting SQL injection attacks, the first feature and the second feature can be multiplied according to the preset feature processing rules to achieve feature cross processing, and the obtained product is used as the cross feature. The cross feature obtained in this way can characterize the specific data values of the first feature and the second feature to a certain extent, and can also characterize the potential interaction relationship between the first feature and the second feature.
[0117] In specific implementation, considering the interaction between the first feature and the third feature when reflecting SQL injection attacks, the feature aggregation processing can be implemented by adding the first feature and the second feature according to the preset feature processing rules, and the obtained sum is used as the aggregate feature. The aggregate feature obtained in this way can characterize the specific data values of the first feature and the third feature to a certain extent, and can also characterize the potential combination relationship between the first feature and the third feature.
[0118] In specific implementation, the above cross-features and aggregated features may be combined to obtain a corresponding historical feature vector. In addition, the above cross-features, aggregated features, and the first feature and / or the second feature may also be combined to obtain a relatively more comprehensive historical feature vector.
[0119] During specific implementation, for different types of network attacks and processing requirements, one or more of the following features can be extracted from the historical access requests of the previous time period as the first feature, the second feature, and the third feature according to the preset feature processing rules: traffic type, source IP, target IP, transport layer protocol, and load characteristics; and then the above features are combined according to the preset feature processing rules to obtain the corresponding historical feature vector.
[0120] In some embodiments, when the method is specifically implemented, it may further include the following: binarizing the second feature to obtain the binarized second feature;
[0121] Correspondingly, the above-mentioned obtaining the corresponding cross feature through feature cross processing according to the first feature and the second feature may include: obtaining the corresponding cross feature through feature cross processing according to the first feature and the binarized second feature.
[0122] Based on the above embodiment, after obtaining the second feature, the second feature can be binarized to unify the data value of the second feature to a scale that is compatible with the first feature and the third feature, so as to avoid errors in the generated feature vector due to the data value of the second feature being too large or too small.
[0123] When performing the binarization process, the data value of the second feature can be numerically compared with a preset request length threshold (for example, 100 fields); based on the comparison result, when it is determined that the data value of the second feature is greater than or equal to the preset request length threshold, the data value of the second feature is modified to 1 as the second feature after binarization; conversely, when it is determined that the data value of the second feature is less than the preset request length threshold, the data value of the second feature is modified to 0 as the second feature after binarization.
[0124] In addition, in some cases, the data value of the second feature can be mapped to a numerical range greater than or equal to 0 and less than or equal to 1 according to the corresponding mapping rule to implement normalization processing and obtain the normalized second feature. In this case, the corresponding cross feature can be obtained by feature cross processing based on the first feature and the normalized second feature.
[0125] In some embodiments, during specific implementation, the historical feature vector of the previous time period can be used as a model input and input into a preset decision model; and the preset decision model is run to obtain an output decision result; based on the decision result, the decision action with the highest reward value among multiple candidate decision actions for the current access traffic scenario (i.e., the preferred decision action) can be determined as the target decision action.
[0126] The above-mentioned preset decision model at least includes: a state representation network and an action value network. Furthermore, the above-mentioned action value network is at least connected to a first Q network structure and a preset firewall rule set.
[0127] Furthermore, the preset firewall rule set may specifically include pre-configured firewall rules that can cover various dimensions. The first Q network structure may be specifically understood as a reward model for predicting and evaluating the effect of the candidate decision action output by the action value network; and determining the reward value matching the candidate decision action based on the evaluation result.
[0128] When the preset decision model is specifically run, the state representation network can first map the historical feature vector of the previous time period input into the corresponding state representation; and then transmit the state representation to the action value network.
[0129] The action value network receives and learns the latest access traffic scenario characteristics based on the state representation, and predicts multiple matching candidate decision actions; then uses the first Q network to predict the reward value of each candidate decision action; finally, the action value network outputs multiple candidate decision actions and the corresponding reward values as the corresponding decision results.
[0130] In specific implementation, the action value network can use the first Q network to predict the effect of each candidate decision action in detecting and handling network attacks after implementation, and obtain the corresponding prediction results; then determine the reward value of each candidate decision action based on the prediction results. For example, the first Q network increases the corresponding reward value when it is determined that the accuracy of detecting network attacks after the implementation of the candidate decision action is high according to the prediction results; on the contrary, when it is determined that the accuracy of detecting network attacks after the implementation of the candidate decision action is low, the corresponding reward value is deducted. For another example, the first Q network increases the corresponding reward value when it is determined that the detected network attacks are handled more timely and accurately after the implementation of the candidate decision action according to the prediction results; on the contrary, when it is determined that there are errors or delays in handling the detected network attacks after the implementation of the candidate decision action, the corresponding reward value is deducted. Finally, the action value network will count and give the final reward value of each candidate decision action through the first Q network.
[0131] Furthermore, according to the decision determination, a candidate decision action with the highest reward value can be screened out from multiple candidate decision actions as a target decision action that meets the requirements.
[0132] In some embodiments, the above-mentioned decision-making action based on the target to adjust the firewall rules of the system may include the following when implemented:
[0133] Based on the target decision action, adjust the system's firewall rules in at least one of the following ways:
[0134] In the preset firewall rule set, a first type of firewall rule is determined; and a state parameter of the first type of firewall rule is set to be enabled;
[0135] In the preset firewall rule set, a second type of firewall rule is determined; and a state parameter of the second type of firewall rule is set to disabled;
[0136] In the preset firewall rule set, a third type of firewall rule is determined; and the third type of firewall rule is modified, and a state parameter of the modified third type of firewall rule is set to be enabled.
[0137] The firewall rules of the above system may specifically refer to the firewall rules of the system that are currently enabled.
[0138] Specifically, for example, according to the target decision action, the firewall rule that was previously in the enabled state is determined as the second type of firewall rule, and the state parameter of the firewall rule is changed from enabled to disabled. For another example, according to the target decision action, the firewall rule that was previously in the disabled state is determined as the first type of firewall rule, and the state parameter of the firewall rule is changed from disabled to enabled. For another example, according to the target decision action, the firewall rule that was previously in the disabled or enabled state is determined as the third type of firewall rule; according to the target decision action, the rule parameters such as condition parameters and threshold parameters in the firewall rule are modified; after the modification is completed, the state parameter of the firewall rule is set to enabled, etc.
[0139] Based on the above embodiments, the firewall rules of the system can be flexibly adjusted in a variety of adjustment ways according to the target decision action to obtain firewall rules that match the current access traffic scenario and have relatively good effects.
[0140] In some embodiments, the above-mentioned preset firewall rule set may specifically include multiple firewall rule sets for different types of network attacks, for example, a firewall rule set for SQL injection attacks, a firewall rule set for cross-site scripting attacks, and a firewall rule set for cross-site request forgery attacks.
[0141] Specifically, the above-mentioned preset firewall rule set at least includes corresponding network attack detection rules and corresponding network attack processing rules.
[0142] In some embodiments, before specific implementation, a preset firewall rule set can be constructed in the following manner: collect corresponding network attack detection records and processing records; cluster the detection records and processing records respectively to determine common rules for detection and common rules for processing, and combine them to obtain a corresponding preset firewall rule set.
[0143] In some embodiments, see Figure 4 As shown, after adjusting the firewall rules of the system according to the target decision action to obtain the firewall rules of the current time period, during specific implementation, the method may further include the following contents:
[0144] S1: According to the firewall rules of the current time period, detect whether the access request in the current time period has a network attack risk, and obtain the corresponding detection result;
[0145] S2: Based on the detection result, if it is determined that the access request in the current time period has a network attack risk, the access request is processed accordingly according to the firewall rules of the current time period.
[0146] In some embodiments, see Figure 5 As shown, before specific implementation, the method may further include the following contents:
[0147] S1: constructing an initial decision model; wherein the initial decision model at least includes an initial state representation network and an initial action value network; the initial action value network is at least connected to an initial first Q network structure;
[0148] S2: Connecting the initial decision model with the preset firewall rule set; and configuring the preset action selection rules for the initial decision model;
[0149] S3: Obtain a test sample request; and process the test sample request according to a preset feature processing rule to obtain a corresponding test sample feature vector;
[0150] S4: According to the preset training rules, the initial decision model is trained for multiple rounds of iterations using the test sample feature vector and the test sample request to obtain a preset decision model that meets the requirements.
[0151] Based on the above embodiments, a decision model with smaller error and better effect can be obtained by performing multiple rounds of iterative training according to preset training rules, as a preset decision model that meets the requirements.
[0152] Among them, the above-mentioned preset training rules can specifically be a model training rule suitable for firewall rule adjustment in the field of network security, which is improved based on a deep reinforcement learning algorithm (Deep Reinforcement Learning) (for example, Deep Q Network, DQN, etc.).
[0153] When constructing the initial decision model, the state space corresponding to the initial state representation network can be defined based on the initial state representation network and the preset feature processing rules; at the same time, the action space corresponding to the initial action value network can be defined based on the initial action value network and the preset firewall rule set. The mapping relationship between the state space and the action space can be constructed.
[0154] When constructing the initial action value network, two identical nonlinear change structures including at least three convolutional layers and two connection layers can be constructed first, which are respectively recorded as the first Q network structure and the second Q network structure; and the first Q network structure is connected to the initial action value network, while the second Q network structure is independent and not connected to the initial action value network. At the same time, a preset action selection rule can be configured for the initial decision model so that the initial action value network can choose to try as many decision actions as possible according to the preset action selection rule.
[0155] The first Q network structure is used to replace the Q function. The preset action selection rule may specifically include a selection rule based on the Epsilon-Greedy strategy. Based on the preset action selection rule, the meeting randomly selects actions with a certain probability (epsilon) to explore new actions; and then selects the action with the highest current reward value with a probability of 1-epsilon as the final recommended action.
[0156] In some embodiments, see Figure 6 As shown, according to the preset training rules, the initial decision model is trained for multiple rounds of iterations using the test sample feature vector and the test sample request. In specific implementation, the current round of iteration training can be performed according to the preset training rules in the following manner:
[0157] S1: Get the decision model of the previous round;
[0158] S2: using the decision model of the previous round to process the feature vector of the test sample of the previous round, and determine the decision action of the current round; wherein the feature vector of the test sample of the previous round is generated according to the test sample request of the previous round;
[0159] S3: Determine the firewall rules for the current round based on the decision actions of the current round;
[0160] S4: According to the firewall rules of the current round, detect and process the test sample request of the current round to obtain the detection and processing result of the current round;
[0161] S5: Generate feedback data of the current round according to the detection processing result of the current round;
[0162] S6: According to the feedback data of the current round, the model parameters of the decision model of the previous round are adjusted to obtain the decision model of the current round.
[0163] According to the above method, the iterative training of the current round can be completed to obtain the decision model of the current round.
[0164] After obtaining the decision model of the current round, check whether the end condition is met; if it is determined that the end condition is met, end the iterative training; and determine the decision model of the current round as a preset decision model that meets the requirements; if it is determined that the end condition is not met, repeat the above steps to continue the next round of iterative training until the end condition is met.
[0165] During specific implementation, a technician may serve as an observer and check the detection processing results of the current round in combination with the test sample request of the current round to obtain corresponding inspection results; and generate corresponding feedback data based on the inspection results.
[0166] Specifically, based on the corresponding feedback rules and according to the inspection results, it is determined whether the detection results when the current round of test sample requests are detected based on the current round of firewall rules to determine whether there is a risk of network attack are accurate; if the detection result is accurate, a corresponding first reward point is set; if the detection result is incorrect, a corresponding first penalty point is set; at the same time, based on the corresponding feedback rules and according to the inspection results, it is also possible to determine the accuracy and timeliness of the test sample requests with network attack risks based on the current round of firewall rules; if the accuracy is high and the timeliness is good, a corresponding second reward point is set; if the timeliness is poor (for example, processing is delayed), a corresponding second penalty point is set according to the delay situation; if the accuracy is poor (for example, misprocessing occurs), a corresponding third penalty point is set according to the degree of deviation in the processing; and then the above-mentioned reward points and penalty points are combined to obtain corresponding and more effective feedback data.
[0167] In specific implementation, the loss function value of the model can be calculated based on the above feedback data; and then the model parameters of the decision model of the previous round can be adjusted according to the loss function value to obtain the decision model of the current round.
[0168] During specific implementation, when determining whether the termination condition is met, it is possible to detect whether the number of rounds of the current round reaches the preset value of the preset number of iterative training rounds according to the preset training rules; when it is determined that the number of rounds of the current round reaches the preset value of the preset number of iterative training rounds, it can be determined that the termination condition is met.
[0169] During specific implementation, when determining whether the termination conditions are met, the current loss function value can also be calculated based on the current round of prediction model according to the preset training rules; then, it is detected whether the current loss function value is less than or equal to the preset loss function threshold; when it is determined that the current loss function value is less than or equal to the preset loss function threshold, it is determined that the termination conditions are met.
[0170] In specific implementation, when determining whether the end condition is met, multiple test sample requests can also be randomly selected from the test sample requests of the current round as verification test requests; then the verification test requests are processed according to the preset feature processing rules to obtain the corresponding verification feature vector; and the verification feature vector is processed using the decision model of the current round to obtain the corresponding verification decision action; the firewall rules of the system are adjusted according to the verification decision action to obtain the verification firewall rules; it is determined whether the difference value between the firewall rules of the current round and the verification firewall rules is less than or equal to the preset tolerance threshold; when it is determined that the difference value is less than or equal to the preset tolerance threshold, it is determined that the end condition is met; on the contrary, when it is determined that the difference value is greater than the preset tolerance threshold, it is determined that the end condition is not met.
[0171] In some embodiments, see Figure 7As shown, the above adjustment of the model parameters of the decision model of the previous round according to the feedback data of the current round may include the following contents during the specific implementation:
[0172] S1: Check whether the current round meets the preset reset conditions;
[0173] S2: When it is determined that the current round meets the preset reset condition, adjust the network parameters of the state representation network and the action value network in the decision model of the previous round, as well as the network parameters of the second Q network structure according to the feedback data of the current round; wherein the second Q network structure corresponds to the first Q network structure; and the second Q network structure is not connected to the decision model of the previous round;
[0174] S3: Copy the adjusted second Q network structure to the first Q network structure to obtain a decision model for the current round.
[0175] Among them, the above-mentioned satisfying the preset reset condition may specifically mean that the cumulative number of iterative training rounds from the last reset time to the current round reaches the preset reset round value.
[0176] The first Q network structure is connected to the action value network and directly participates in the operation of the prediction model; while the second Q network structure is not connected to the action network and is independent of the prediction model.
[0177] Specifically, for example, the preset reset round value may be 10 rounds. That is, since the last reset time, each time a round of iterative training is completed, the cumulative number of rounds increases by 1; when it is detected that the cumulative number of rounds reaches 10 up to the current round, it is determined that the preset reset condition is met.
[0178] In some embodiments, when detecting whether the current round meets the preset reset condition, the method may further include the following contents when implemented:
[0179] When it is determined that the current round does not meet the preset reset conditions, the network parameters of the state representation network and the action value network in the decision model of the previous round, as well as the network parameters of the second Q network structure are adjusted according to the feedback data of the current round to obtain the decision model of the current round.
[0180] Based on the above embodiment, when the model parameters are modified in each iterative training, when it is found that the current round does not meet the preset reset conditions, only the network parameters of the state representation network and the action value network in the decision model are adjusted, and the network parameters of the first Q network are not adjusted, but the network parameters of the second Q network that is not connected to the action value network and does not participate in the operation of the prediction model are adjusted. In this way, during the period when the preset reset conditions are not met, the first Q network that directly participates in the operation of the prediction model can be fixed, and only the second Q network can be updated to simplify the complexity of model training and reduce the amount of related data processing. When it is found that the current round meets the preset reset conditions, the network parameters of the state representation network, the network parameters of the action value network, and the network parameters of the second Q network structure in the decision model are adjusted, and then the adjusted latest second Q network structure is directly copied to the first Q network structure to achieve the adjustment and update of the first Q network structure. In this way, the first Q network structure can be adjusted and updated regularly when the preset reset conditions are met, so that the update of the decision model can be completed at a relatively low data processing cost, making the iterative training process relatively more stable.
[0181] In some embodiments, the method may further include the following when implemented:
[0182] The test sample feature vector of the previous round, the test sample request of the current round, and the feedback data of the current round are obtained and combined as an experience data; and the experience data is stored in a preset buffer area.
[0183] Specifically, when performing the current round of iterative training, one or more experience data can be randomly extracted from the preset cache area and added to the current round of iterative training to avoid the model training being too focused on the samples involved in the current round of iterative training, resulting in overfitting.
[0184] In addition, during multiple rounds of iterative training of the model, when a specific trigger event is detected (for example, the loss function value calculated in a round of iterative training is greater than a specific value, etc.), it can trigger the random extraction of multiple experience data from a preset cache area; and use the above multiple experience data to adaptively adjust the current model for training.
[0185] In some embodiments, after detecting and processing access requests received in the current time period according to the firewall rules of the current time period, the method, when implemented specifically, may also include: recording access requests in the current time period, and detection and processing results of access requests in the current time period.
[0186] Furthermore, the firewall rules for the next time period can be determined by using a preset prediction model based on the access requests in the current time period.
[0187] In addition, the detection and processing results of the recorded access requests can be checked and evaluated regularly to obtain corresponding feedback data; then the recorded access requests, the detection and processing results of the access requests, and the corresponding feedback data can be collected and utilized to train and update the currently used preset prediction model, so as to continuously improve the model accuracy of the used preset prediction model, so that the used preset prediction model can better match the current latest access traffic scenario.
[0188] Specifically, for example, at intervals of a specified time period (for example, 1 month), the access requests recorded in the most recent specified time period, the detection and processing results of the access requests, and the corresponding feedback data can be obtained to train and update the currently used preset prediction model, thereby realizing the regular update of the preset decision model during the application process.
[0189] As can be seen from the above, based on the data processing method of the access request provided by the embodiment of this specification, before specific implementation, it is possible to first obtain a preset decision model with better effect through multiple rounds of iterative training according to the preset training rules. During specific implementation, the historical access request of the previous time period can be obtained first; and according to the preset feature processing rules, the historical access request of the previous time period is processed to obtain the corresponding historical feature vector of the previous time period; then the historical feature vector of the previous time period is processed by the preset decision model to obtain the corresponding decision result; and according to the decision result, the firewall rules of the system are dynamically adjusted to obtain the firewall rules of the current time period that are adapted; and then the firewall rules of the current time period can be used to detect and process the access requests received by the system in the current time period. By first using the preset decision model to process the historical feature vector of the previous time period obtained based on the historical access request of the previous time period, learn and determine a more appropriate decision result based on the latest network attack mode and characteristics of the recent time period; then according to the decision result, the firewall rules of the system are intelligently and dynamically adjusted to obtain the firewall rules of the current time period that are adapted to the current access traffic scenario; and then the firewall rules of the current time period can be used to detect and process the access requests received in the current time period. This can effectively reduce the missed alarm rate and false alarm rate of network attack detection, accurately identify and discover access requests that pose a risk of network attacks, and promptly and specifically handle such access requests, thereby better protecting the data security of the system.
[0190] See also Figure 8 As shown, this specification also provides another method for processing access request data. When the method is implemented specifically, it may include the following steps:
[0191] S801: Obtain historical access requests in the previous time period;
[0192] S802: Process the historical access requests of the previous time period according to the preset feature processing rules to obtain the corresponding historical feature vector of the previous time period;
[0193] S803: Use a comprehensive decision model to process the historical feature vectors of the previous time period to obtain a corresponding comprehensive decision result; wherein the comprehensive decision model at least includes a preset first decision model, a preset second decision model and a preset third decision model in parallel; the preset first decision model, the preset second decision model and the preset third decision model are respectively a firewall rule decision model for SQL injection attacks, a firewall rule decision model for cross-site scripting attacks, and a firewall rule decision model for cross-site request forgery attacks; the comprehensive decision model is obtained through multiple rounds of iterative training according to preset training rules;
[0194] S804: According to the comprehensive decision result, determine the candidate decision action that meets the requirements as the target decision action;
[0195] S805: According to the target decision action, the firewall rules of the system are adjusted to obtain the firewall rules of the current time period; wherein the firewall rules of the current time period are used to detect and process the access requests received in the current time period.
[0196] Among them, the preset feature processing rules include: feature processing rules for SQL injection attacks, feature processing rules for cross-site scripting attacks, and feature processing rules for cross-site request forgery attacks.
[0197] Accordingly, the obtained historical feature vectors for the previous time period may include: historical feature vectors for SQL injection attacks, historical feature vectors for cross-site scripting attacks, historical feature vectors for cross-site request forgery attacks, and other historical feature vectors.
[0198] In specific implementation, when generating the historical feature vector of the previous time period, the attack type of the network attack corresponding to each historical feature vector in the above multiple historical feature vectors will be marked.
[0199] After the preset decision model receives the input historical feature vectors of the previous time period, it can input multiple historical feature vectors into corresponding decision models for processing according to the marked attack types.
[0200] Correspondingly, the comprehensive decision results output by the preset decision model include: the first decision result for SQL injection attack output by the preset first decision model, the second decision result for cross-site scripting attack output by the preset second decision model, and the third decision result for cross-site request forgery attack output by the preset third decision model.
[0201] In specific implementation, the first decision result, the second decision result and the third decision result can be respectively determined and decided according to the corresponding target actions; then the first firewall rule subset for SQL injection attacks, the second firewall rule subset for cross-site scripting attacks, and the third firewall rule subset for cross-site request forgery attacks in the preset firewall rule set are adjusted respectively, so as to finally obtain the firewall rules for the current time period that can match the current latest access traffic scenario and can simultaneously detect and process multiple different types of network attacks.
[0202] Then, the access requests received in the current time period can be detected and processed according to the firewall rules of the current time period.
[0203] In some embodiments, the above-mentioned comprehensive decision model may include other decision models for other types of network attacks in addition to the preset first decision model, the preset second decision model and the preset third decision model.
[0204] Based on the above embodiments, a variety of different types of network attacks can be identified and discovered more comprehensively and accurately, and targeted processing can be carried out in a timely and effective manner, which can more comprehensively protect the data security of the system.
[0205] This specification also provides a server, which can be found at Fig. 9 The server may specifically include a network communication port 901, a processor 902 and a memory 903, and the above structures are connected through internal cables so that each structure can perform specific data interaction.
[0206] The network communication port 901 may be used to obtain historical access requests in the previous time period.
[0207] The processor 902 can be specifically used to process historical access requests of the previous time period according to preset feature processing rules to obtain the corresponding historical feature vector of the previous time period; use the preset decision model to process the historical feature vector of the previous time period to obtain the corresponding decision result; wherein the preset decision model at least includes a state representation network and an action value network; the state representation network is used to map the historical feature vector of the previous time period into a corresponding state representation; the action value network is used to determine multiple candidate decision actions and reward values corresponding to each candidate decision action according to the state representation; the preset decision model is obtained through multiple rounds of iterative training according to preset training rules; according to the decision result, determine the candidate decision action that meets the requirements as the target decision action; according to the target decision action, adjust the firewall rules of the system to obtain the firewall rules of the current time period; wherein the firewall rules of the current time period are used to detect and process the access requests received in the current time period.
[0208] The memory 903 may be specifically used to cache historical access requests, decision results, and preset firewall rule sets in the previous time period, and store corresponding instruction programs.
[0209] In this embodiment, the network communication port 901 can be a virtual port that is bound to different communication protocols so that different data can be sent or received. For example, the network communication port can be a port responsible for web data communication, a port responsible for FTP data communication, or a port responsible for email data communication. In addition, the network communication port can also be a physical communication interface or communication chip. For example, it can be a wireless mobile network communication chip, such as GSM, CDMA, etc.; it can also be a Wifi chip; it can also be a Bluetooth chip.
[0210] In this embodiment, the processor 902 may be implemented in any appropriate manner. For example, the processor may take the form of a microprocessor or a processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) executable by the (micro)processor, a logic gate, a switch, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, etc. This specification does not limit this.
[0211] In this embodiment, the memory 903 may include multiple levels. In a digital system, anything that can store binary data can be a memory; in an integrated circuit, a circuit with a storage function that has no physical form is also called a memory, such as RAM, FIFO, etc.; in a system, a storage device with a physical form is also called a memory, such as a memory stick, TF card, etc.
[0212] Based on the above algorithm, the relevant structural performance of the server can be effectively utilized, the data processing speed of the electronic device can be improved, and the data processing of the access request can be efficiently realized.
[0213] The embodiment of the present specification also provides a computer-readable storage medium based on the above-mentioned access request data processing method, wherein the computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed, the following are implemented: obtaining historical access requests of the previous time period; processing the historical access requests of the previous time period according to a preset feature processing rule to obtain the corresponding historical feature vector of the previous time period; processing the historical feature vector of the previous time period using a preset decision model to obtain a corresponding decision result; wherein the preset decision model at least includes a state representation network and an action value network; the state representation network is used to map the historical feature vector of the previous time period into a corresponding state representation; the action value network is used to determine a plurality of candidate decision actions and a reward value corresponding to each candidate decision action according to the state representation; the preset decision model is obtained through multiple rounds of iterative training according to preset training rules; according to the decision result, determining a candidate decision action that meets the requirements as a target decision action; according to the target decision action, adjusting the firewall rules of the system to obtain the firewall rules of the current time period; wherein the firewall rules of the current time period are used to detect and process the access requests received in the current time period.
[0214] In this embodiment, the storage medium includes but is not limited to a random access memory (RAM), a read-only memory (ROM), a cache, a hard disk (HDD) or a memory card. The memory may be used to store computer program instructions. The network communication unit may be an interface for network connection communication set in accordance with the standard specified by the communication protocol.
[0215] In this embodiment, the functions and effects specifically implemented by the program instructions stored in the computer-readable storage medium can be explained in comparison with other implementations and will not be described in detail here.
[0216] The embodiments of the present specification also provide a computer program product, which at least includes a computer program, and when the computer program is executed by a processor, the following method steps are implemented: obtaining historical access requests of the previous time period; processing the historical access requests of the previous time period according to a preset feature processing rule to obtain the corresponding historical feature vector of the previous time period; using a preset decision model to process the historical feature vector of the previous time period to obtain a corresponding decision result; wherein the preset decision model at least includes a state representation network and an action value network; the state representation network is used to map the historical feature vector of the previous time period into a corresponding state representation; the action value network is used to determine a plurality of candidate decision actions and a reward value corresponding to each candidate decision action according to the state representation; the preset decision model is obtained through multiple rounds of iterative training according to preset training rules; according to the decision result, a candidate decision action that meets the requirements is determined as a target decision action; according to the target decision action, the firewall rules of the system are adjusted to obtain the firewall rules of the current time period; wherein the firewall rules of the current time period are used to detect and process the access requests received in the current time period.
[0217] See also Fig.10 As shown, the embodiment of this specification also provides a data processing device for access requests, which may specifically include the following structural modules:
[0218] The acquisition module 1001 may be used to acquire historical access requests in the previous time period;
[0219] The processing module 1002 may be specifically configured to process the historical access requests of the previous time period according to a preset feature processing rule, and obtain the corresponding historical feature vector of the previous time period;
[0220] The decision module 1003 can be specifically used to process the historical feature vector of the previous time period using a preset decision model to obtain a corresponding decision result; wherein the preset decision model at least includes a state representation network and an action value network; the state representation network is used to map the historical feature vector of the previous time period into a corresponding state representation; the action value network is used to determine a plurality of candidate decision actions and a reward value corresponding to each candidate decision action according to the state representation; the preset decision model is obtained through multiple rounds of iterative training according to preset training rules;
[0221] The determination module 1004 may be specifically used to determine a candidate decision action that meets the requirements as a target decision action according to the decision result;
[0222] The adjustment module 1005 can be specifically used to adjust the firewall rules of the system according to the target decision action to obtain the firewall rules of the current time period; wherein the firewall rules of the current time period are used to detect and process the access requests received in the current time period.
[0223] In some embodiments, the preset decision model may specifically include at least one of the following: a firewall rule decision model for SQL injection attacks, a firewall rule decision model for cross-site scripting attacks, a firewall rule decision model for cross-site request forgery attacks, etc.
[0224] In some embodiments, when the preset decision model includes a firewall rule decision model for SQL injection attacks, the processing module 1002 may be implemented in the following manner according to the preset feature processing rules to process the historical access requests of the previous time period to obtain the corresponding historical feature vector of the previous time period: according to the preset feature processing rules, determine the first feature by detecting whether there are SQL keywords in the historical access requests of the previous time period; determine and obtain the second feature according to the request length of the historical access requests of the previous time period; count the number of specified characters contained in the historical access requests of the previous time period as the third feature; obtain the corresponding cross feature through feature cross processing based on the first feature and the second feature; obtain the corresponding aggregate feature through feature aggregation processing based on the first feature and the third feature; and generate the corresponding historical feature vector of the previous time period by combining the cross feature and the aggregate feature.
[0225] In some embodiments, when the processing module 1002 is implemented, it can also be used to: binarize the second feature to obtain the binarized second feature; and obtain the corresponding cross feature through feature cross processing based on the first feature and the binarized second feature.
[0226] In some embodiments, when the above-mentioned adjustment module 1005 is specifically implemented, the firewall rules of the system can be adjusted in the following manner according to the target decision action and in at least one of the following manners: in the preset firewall rule set, a first type of firewall rule is determined; and the state parameter of the first type of firewall rule is set to enabled; in the preset firewall rule set, a second type of firewall rule is determined; and the state parameter of the second type of firewall rule is set to disabled; in the preset firewall rule set, a third type of firewall rule is determined; and the third type of firewall rule is modified, and the state parameter of the modified third type of firewall rule is set to enabled.
[0227] In some embodiments, the device may further include a training module for constructing an initial decision model; wherein the initial decision model includes at least an initial state representation network and an initial action value network; the initial action value network is at least connected to an initial first Q network structure; the initial decision model is connected to a preset firewall rule set; and preset action selection rules are configured for the initial decision model; a test sample request is obtained; and the test sample request is processed according to preset feature processing rules to obtain a corresponding test sample feature vector; according to preset training rules, the initial decision model is iteratively trained using the test sample feature vector and the test sample request to obtain a preset decision model that meets the requirements.
[0228] In some embodiments, when the above-mentioned training module is implemented, the iterative training of the current round in multiple rounds of iterative training can be performed according to the preset training rules in the following manner: obtaining the decision model of the previous round; using the decision model of the previous round to process the test sample feature vector of the previous round to determine the decision action of the current round; wherein the test sample feature vector of the previous round is generated according to the test sample request of the previous round; according to the decision action of the current round, the firewall rules of the current round are determined; according to the firewall rules of the current round, the test sample request of the current round is detected and processed to obtain the detection and processing results of the current round; according to the detection and processing results of the current round, feedback data of the current round is generated; according to the feedback data of the current round, the model parameters of the decision model of the previous round are adjusted to obtain the decision model of the current round.
[0229] In some embodiments, when the above-mentioned training module is implemented, the model parameters of the decision model of the previous round can be adjusted according to the feedback data of the current round in the following manner: detecting whether the current round meets the preset reset conditions; when it is determined that the current round meets the preset reset conditions, adjusting the network parameters of the state representation network and the action value network in the decision model of the previous round, as well as the network parameters of the second Q network structure according to the feedback data of the current round; wherein the second Q network structure corresponds to the first Q network structure; and the second Q network structure is not connected to the decision model of the previous round; and the adjusted second Q network structure is copied to the first Q network structure to obtain the decision model of the current round.
[0230] In some embodiments, when detecting whether the current round meets the preset reset conditions, the training module can also be used when it is implemented: when it is determined that the current round does not meet the preset reset conditions, adjust the network parameters of the state representation network and the action value network in the decision model of the previous round, as well as the network parameters of the second Q network structure according to the feedback data of the current round to obtain the decision model of the current round.
[0231] In some embodiments, when the training module is implemented, it can also be used to: obtain the test sample feature vector of the previous round, the test sample request of the current round, and the feedback data of the current round, and combine them as an experience data; and store the experience data in a preset cache area.
[0232] The present specification also provides another access request data processing device, including: an acquisition module, used to acquire historical access requests of the previous time period; a processing module, used to process the historical access requests of the previous time period according to a preset feature processing rule, and obtain the corresponding historical feature vector of the previous time period; a decision module, used to process the historical feature vector of the previous time period using a comprehensive decision model, and obtain the corresponding comprehensive decision result; wherein the comprehensive decision model at least includes a preset first decision model, a preset second decision model and a preset third decision model in parallel; the preset first decision model, the preset second decision model and the preset third decision model are respectively a firewall rule decision model for SQL injection attacks, a firewall rule decision model for cross-site scripting attacks, and a firewall rule decision model for cross-site request forgery attacks; the comprehensive decision model is obtained through multiple rounds of iterative training according to preset training rules; a determination module, used to determine a candidate decision action that meets the requirements as a target decision action according to the comprehensive decision result; an adjustment module, used to adjust the firewall rules of the system according to the target decision action, and obtain the firewall rules of the current time period; wherein the firewall rules of the current time period are used to detect and process the access requests received in the current time period.
[0233] It should be noted that the units, devices or modules described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. For the convenience of description, the above devices are described separately by functions divided into various modules. Of course, when implementing this specification, the functions of each module can be implemented in the same or more software and / or hardware, or the modules that implement the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0234] As can be seen from the above, the data processing device for access requests provided in the embodiments of this specification can effectively reduce the missed alarm rate and false alarm rate of network attack detection, accurately identify and discover access requests that pose a risk of network attacks, and promptly perform targeted processing on such access requests, thereby better protecting the data security of the system.
[0235] In a specific scenario example, the access request data processing method provided in this specification can be applied to realize automatic optimization and adjustment of Web application firewall rules.
[0236] In this scenario example, reinforcement learning can be combined with WAF rule (e.g., firewall rules of network security devices) optimization (to obtain preset training rules). The optimal strategy can be learned through the interaction between the agent (e.g., preset decision model) and the environment to obtain the maximum cumulative reward. In the WAF rule optimization process, the WAF system can be regarded as a reinforcement learning environment, with network traffic data (e.g., access requests) as the environment state and WAF rules as the agent's strategy. The agent can choose which rule to execute based on the current state, and then observe the feedback (reward) of the environment to update the strategy. The specific implementation can include the following steps.
[0237] S1: Feature extraction and conversion (i.e., processing access requests according to preset feature processing rules to extract corresponding feature vectors).
[0238] In this scenario, meaningful feature vectors can be extracted from the original network traffic data (e.g., historical access requests in the previous time period) through preprocessing. These feature vectors can be about traffic type, source IP, target IP, transport layer protocol, load characteristics, etc. Then the network traffic data is converted into a data form suitable for the input model (e.g., preset decision). For the specific process, please refer to Fig.11 shown.
[0239] The following takes SQL injection as an example to explain feature extraction and conversion in detail.
[0240] In this scenario, the following three features can be used to indicate whether an HTTP request has a SQL injection vulnerability:
[0241] Feature 1 (eg, the first feature): whether the request contains SQL keywords (a binary feature): 0 indicates that the request does not contain SQL keywords, and 1 indicates that the request contains SQL keywords.
[0242] Feature 2 (eg, second feature): request length (a numerical feature), used to indicate the length of the request.
[0243] Feature 3 (for example, feature three): the number of special characters (a numerical feature), which is used to indicate the number of special characters in the request, such as ', ", ";", etc.
[0244] In specific implementation, the above features may be transformed and combined in the following manner to obtain the required feature vectors.
[0245] The above feature conversion may specifically include: binarization and / or normalization.
[0246] The binarization, for example, may specifically be to binarize feature 2 (request length), assuming that requests with a length greater than 100 are marked as 1, and requests with a length less than 100 are marked as 0.
[0247] Normalization, for example, may be specifically normalizing feature 2 (request length) to convert the length into a value between 0 and 1.
[0248] The above-mentioned feature combination may specifically include: feature intersection and feature aggregation.
[0249] The feature intersection, for example, may be feature intersection of feature 1 (including SQL keywords) and feature 2 (request length) to generate a new combined feature, indicating whether the SQL keyword is included and the request length is greater than 100.
[0250] Feature aggregation, for example, can be feature aggregation of feature 1 (including SQL keywords) and feature 3 (the number of special characters), and the sum of the two features is calculated to obtain a new feature representing the number of requests containing SQL keywords.
[0251] As shown in Table 1, a table can be used to display the original value of each feature and the new feature value after transformation and combination.
[0252] Table 1
[0253]
[0254] In Table 1, each row can represent the feature information of an HTTP request. The original features include feature 1 (including SQL keywords), feature 2 (request length), and feature 3 (number of special characters). Then, feature 2 can be binarized and normalized to generate binarized feature 2 and normalized feature 2. Then, feature crossover and feature aggregation are performed to generate new features after feature crossover and new features after feature aggregation.
[0255] S2: Establish the DQN network structure (i.e., build the initial decision model according to the preset training rules).
[0256] In this scenario example, Deep Q Network (DQN) can be used as a reinforcement learning algorithm to build a state representation network and an action value network (to build an initial decision model). The state representation network is used to process feature vectors and map them to a state representation. The action value network is used to estimate the value (Q value) of each action and the expected reward of executing a certain rule. The following is a detailed description of the establishment of the DQN network structure using SQL injection attacks as an example.
[0257] S2-1: Define the state space.
[0258] Specifically, for SQL injection attack detection, the state space may include the following features: a binary feature of whether the HTTP request contains the SQL keyword (for example, 0 means not contained, 1 means contained). A normalized feature of the request length, which scales the request length to a value between 0 and 1. The process of defining the state space can be seen in Table 2.
[0259] Table 2
[0260]
[0261] S2-2: Define the state space.
[0262] Specifically, for WAF rule optimization, the action space may include the following operations: enabling or disabling specific WAF rules for SQL injection attacks; adjusting the matching threshold of WAF rules to allow or block specific types of SQL injection attacks, etc. The process of defining the state space can be seen in Table 3.
[0263] Table 3
[0264]
[0265] S2-3: Design the neural network structure (e.g., build an initial decision model).
[0266] In this example, a neural network can be used to approximate the Q function based on DQN. Specifically, a multi-layer fully connected neural network (for example, the first Q network structure) can be designed to achieve this goal. The input layer receives the feature vector of the state space as input, and the output layer is the Q value corresponding to each action.
[0267] S2-4: Set up the Experience Replay Buffer.
[0268] In this scenario example, during the training process, when interacting with the environment, each observed state, action, reward, and next state (corresponding to an experience data) can be stored in an experience replay buffer (e.g., a preset cache area).
[0269] S2-5: Train and update Q value.
[0270] In this scenario example, a batch of samples can be randomly sampled from the experience replay buffer, the target Q value (e.g., the first Q network) and the current Q value (e.g., the second Q network) can be calculated, and then the mean square error or other loss function can be used to update the neural network parameters so that the predicted Q value is closer to the target Q value.
[0271] S2-6: Set up the Epsilon-Greedy strategy (e.g., configure action selection rules).
[0272] In this scenario example, during the training process, you can use the Epsilon-Greedy strategy to select actions. For example, you can randomly select actions with a certain probability (epsilon) to explore new strategies; select the action with the highest current Q value with a probability of 1-epsilon to use the known optimal strategy.
[0273] S2-7: Determine the target Q network.
[0274] In this scenario example, the target Q network and the main Q network are introduced to improve the stability of training. The target Q network has the same structure as the main Q network, but its parameters are not updated in real time, but are copied from the main Q network periodically to reduce the variance of the target Q value estimation.
[0275] S3: Train the agent (i.e., iteratively train the initial decision model according to preset training rules).
[0276] In this scenario example, a reinforcement learning algorithm (e.g., preset training rules) can be used to enable the agent to continuously interact with the environment and learn the optimal rule selection strategy based on the reward signal. The training process involves a large number of iterations and sample sampling. The agent selects an action based on the current state and the action value network to classify the requests in the network traffic data as normal requests or malicious attacks. Then, by comparing with the actual results, the reward is calculated and the parameters in the action value network are updated using methods such as gradient descent. For specific rewards, please refer to Fig.12 shown.
[0277] Based on the above method, during the learning and training process, the mapping relationship between the state space and the corresponding action selection can be learned and established, as shown in Table 4.
[0278] Table 4
[0279]
[0280] S4: Adaptive function implementation.
[0281] In this scenario example, in order to achieve adaptive functions, the training data can be updated regularly and the DQN model can be retrained. Since network traffic and attack types change over time, the agent needs to adapt to new attack patterns and environmental changes. A cycle can be set, such as retraining at regular intervals or when a specific event is triggered, so that the WAF system can adapt to new attacks.
[0282] S5: Online deployment and application.
[0283] In this scenario example, the trained agent (e.g., a preset decision model) can be deployed online to the actual WAF system to detect and classify network traffic in real time. The WAF dynamically adjusts the firewall rules based on the output of the agent to implement an adaptive defense strategy. The agent can optimize itself over time to adapt to new attack types and changes in the network environment. Fig.13 shown.
[0284] In general, the application and implementation of reinforcement learning in WAF rule optimization involves building an intelligent agent, defining a reward function, selecting an appropriate reinforcement learning algorithm (such as DQN), and performing adaptive training. In this way, the WAF system can continuously learn and optimize defense rules and improve its ability to detect and defend against new types of attacks.
[0285] Through the above scenario examples, it is verified that the data processing method for access requests provided in this specification can effectively solve the limitations of traditional WAF rule sets and achieve adaptive defense against new network attacks. By learning actual network traffic data, WAF can continuously optimize rules, thereby reducing false positive and false negative rates and improving the ability to detect and prevent various network attacks. In addition, this technical solution can also provide more intelligent network security protection, enabling WAF to have a higher level of autonomous learning and adaptation capabilities, thereby improving the security and reliability of Web applications.
[0286] Although the present specification provides method operation steps as described in the embodiments or flow charts, more or fewer operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiments is only one way of executing the order of many steps and does not represent the only order of execution. When the device or client product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The terms "include", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, product or device including a series of elements includes not only those elements, but also other elements that are not explicitly listed, or also includes elements inherent to such a process, method, product or device. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or device including the elements. The words first, second, etc. are used to represent the name, and do not represent any particular order.
[0287] Those skilled in the art also know that, in addition to implementing the controller in a purely computer-readable program code, the controller can be made to implement the same function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered as a hardware component, and the devices for implementing various functions included therein can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules for implementing the method and structures within the hardware component.
[0288] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, classes, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer-readable storage media including storage devices.
[0289] Through the description of the above embodiments, it can be known that those skilled in the art can clearly understand that the present specification can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present specification can essentially be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a mobile terminal, a server, or a network device, etc.) to execute the methods described in each embodiment of the present specification or some parts of the embodiments.
[0290] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. This specification can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.
[0291] Although the present specification is described through embodiments, those skilled in the art will appreciate that there are many modifications and changes to the present specification without departing from the spirit of the present specification, and it is intended that the appended claims include these modifications and changes without departing from the spirit of the present specification.
Claims
1. A method for processing access request data, characterized in that: include: Get the historical access requests in the previous time period; According to the preset feature processing rules, the historical access requests of the previous time period are processed to obtain the corresponding historical feature vector of the previous time period; The historical feature vectors of the previous time period are processed by a preset decision model to obtain a corresponding decision result; wherein the preset decision model at least includes a state representation network and an action value network; the state representation network is used to map the historical feature vectors of the previous time period into a corresponding state representation; the action value network is used to determine a plurality of candidate decision actions and a reward value corresponding to each candidate decision action according to the state representation; the preset decision model is obtained through multiple rounds of iterative training according to preset training rules; According to the decision results, determine the candidate decision actions that meet the requirements as the target decision actions; According to the target decision action, the firewall rules of the system are adjusted to obtain the firewall rules of the current time period; wherein the firewall rules of the current time period are used to detect and process the access requests received in the current time period; In the case where the preset decision model includes a firewall rule decision model for SQL injection attacks, historical access requests of a previous time period are processed according to preset feature processing rules to obtain a corresponding historical feature vector of the previous time period, including: determining a first feature by detecting whether SQL keywords exist in historical access requests of the previous time period according to the preset feature processing rules; determining and obtaining a second feature according to the request length of the historical access requests of the previous time period; counting the number of specified characters contained in the historical access requests of the previous time period as a third feature; obtaining a corresponding cross feature through feature cross processing according to the first feature and the second feature; obtaining a corresponding aggregate feature through feature aggregation processing according to the first feature and the third feature; and generating a corresponding historical feature vector of the previous time period by combining the cross feature and the aggregate feature.
2. The method according to claim 1, characterized in that The method further comprises: Binarization is performed on the second feature to obtain a binarized second feature; Accordingly, according to the first feature and the second feature, through feature cross processing, corresponding cross features are obtained, including: According to the first feature and the binarized second feature, a corresponding cross feature is obtained through feature cross processing.
3. The method according to claim 1, characterized in that Adjust the system's firewall rules based on the target decision action, including: Based on the target decision action, adjust the system's firewall rules in at least one of the following ways: In the preset firewall rule set, a first type of firewall rule is determined; and a state parameter of the first type of firewall rule is set to be enabled; In the preset firewall rule set, a second type of firewall rule is determined; and a state parameter of the second type of firewall rule is set to disabled; In the preset firewall rule set, a third type of firewall rule is determined; and the third type of firewall rule is modified, and a state parameter of the modified third type of firewall rule is set to be enabled.
4. The method according to claim 1, characterized in that: The method further comprises: Constructing an initial decision model; wherein the initial decision model at least includes an initial state representation network and an initial action value network; the initial action value network is at least connected to an initial first Q network structure; Connecting the initial decision model with the preset firewall rule set; and configuring the preset action selection rules for the initial decision model; Obtaining a test sample request; and processing the test sample request according to a preset feature processing rule to obtain a corresponding test sample feature vector; According to the preset training rules, the initial decision model is trained for multiple rounds of iterations using the test sample feature vectors and the test sample requests to obtain a preset decision model that meets the requirements.
5. The method according to claim 4, characterized in that According to the preset training rules, the initial decision model is trained for multiple rounds of iterations using the test sample feature vector and the test sample request, including: Perform the current round of iterative training according to the preset training rules in the following manner: Get the decision model of the previous round; Using the decision model of the previous round to process the feature vector of the test sample of the previous round, determine the decision action of the current round; wherein the feature vector of the test sample of the previous round is generated according to the test sample request of the previous round; Determine the firewall rules for the current round based on the decision actions of the current round; According to the firewall rules of the current round, detect and process the test sample request of the current round to obtain the detection and processing result of the current round; Generate feedback data for the current round based on the detection and processing results of the current round; According to the feedback data of the current round, the model parameters of the decision model of the previous round are adjusted to obtain the decision model of the current round.
6. The method according to claim 5, characterized in that According to the feedback data of the current round, adjust the model parameters of the decision model of the previous round, including: Check whether the current round meets the preset reset conditions; When it is determined that the current round meets the preset reset condition, the network parameters of the state representation network and the action value network in the decision model of the previous round, as well as the network parameters of the second Q network structure are adjusted according to the feedback data of the current round; wherein the second Q network structure corresponds to the first Q network structure; and the second Q network structure is not connected to the decision model of the previous round; The adjusted second Q network structure is copied to the first Q network structure to obtain the decision model of the current round.
7. The method according to claim 6, characterized in that In the case of detecting whether the current round meets the preset reset condition, the method further includes: When it is determined that the current round does not meet the preset reset conditions, the network parameters of the state representation network and the action value network in the decision model of the previous round, as well as the network parameters of the second Q network structure are adjusted according to the feedback data of the current round to obtain the decision model of the current round.
8. The method according to claim 5, characterized in that The method further comprises: The test sample feature vector of the previous round, the test sample request of the current round, and the feedback data of the current round are obtained and combined as an experience data; and the experience data is stored in a preset buffer area.
9. A method for processing access request data, characterized in that: include: Get the historical access requests in the previous time period; According to the preset feature processing rules, the historical access requests of the previous time period are processed to obtain the corresponding historical feature vector of the previous time period; A comprehensive decision model is used to process the historical feature vectors of the previous time period to obtain a corresponding comprehensive decision result; wherein the comprehensive decision model at least includes a preset first decision model, a preset second decision model and a preset third decision model in parallel; the preset first decision model, the preset second decision model and the preset third decision model are respectively a firewall rule decision model for SQL injection attacks, a firewall rule decision model for cross-site scripting attacks, and a firewall rule decision model for cross-site request forgery attacks; the comprehensive decision model is obtained through multiple rounds of iterative training according to preset training rules; According to the comprehensive decision-making results, determine the candidate decision actions that meet the requirements as the target decision actions; According to the target decision action, the firewall rules of the system are adjusted to obtain the firewall rules of the current time period; wherein the firewall rules of the current time period are used to detect and process the access requests received in the current time period; Among them, corresponding to the preset first decision model, according to the preset feature processing rules, the historical access requests of the previous time period are processed to obtain the corresponding historical feature vector of the previous time period, including: according to the preset feature processing rules, the first feature is determined by detecting whether there is an SQL keyword in the historical access requests of the previous time period; the second feature is determined and obtained according to the request length of the historical access requests of the previous time period; the number of specified characters contained in the historical access requests of the previous time period is counted as the third feature; according to the first feature and the second feature, through feature cross-processing, a corresponding cross-feature is obtained; according to the first feature and the third feature, through feature aggregation processing, a corresponding aggregated feature is obtained; and the cross-feature and the aggregated feature are combined to generate the corresponding historical feature vector of the previous time period.
10. A data processing device for access request, characterized in that: include: The acquisition module is used to obtain the historical access requests in the previous time period; A processing module, used to process the historical access requests of the previous time period according to a preset feature processing rule, and obtain the corresponding historical feature vector of the previous time period; A decision module, used to process the historical feature vectors of the previous time period using a preset decision model to obtain a corresponding decision result; wherein the preset decision model at least includes a state representation network and an action value network; the state representation network is used to map the historical feature vectors of the previous time period into a corresponding state representation; the action value network is used to determine a plurality of candidate decision actions and a reward value corresponding to each candidate decision action according to the state representation; the preset decision model is obtained through multiple rounds of iterative training according to preset training rules; A determination module is used to determine a candidate decision action that meets the requirements as a target decision action based on the decision result; An adjustment module is used to adjust the firewall rules of the system according to the target decision action to obtain the firewall rules of the current time period; wherein the firewall rules of the current time period are used to detect and process the access requests received in the current time period; Wherein, in the case where the preset decision model includes a firewall rule decision model for SQL injection attacks, the processing module is specifically used to: determine the first feature by detecting whether there are SQL keywords in the historical access requests of the previous time period according to the preset feature processing rules; determine and obtain the second feature according to the request length of the historical access requests of the previous time period; count the number of specified characters contained in the historical access requests of the previous time period as the third feature; obtain the corresponding cross feature through feature cross processing according to the first feature and the second feature; obtain the corresponding aggregate feature through feature aggregation processing according to the first feature and the third feature; and generate the corresponding historical feature vector of the previous time period by combining the cross feature and the aggregate feature.
11. A server, characterized in that: The method comprises a processor and a memory for storing processor-executable instructions, wherein the processor implements the steps of the method according to any one of claims 1 to 8 or 9 when executing the instructions.
12. A computer-readable storage medium, characterized in that: Computer instructions are stored thereon, and when the instructions are executed by a processor, the steps of the method described in any one of claims 1 to 8 or 9 are implemented.
13. A computer program product, characterized in that The invention comprises a computer program, which implements the steps of the method according to any one of claims 1 to 8 or 9 when being executed by a processor.
