A data processing method, device, computer equipment and storage medium

The method addresses the inability of existing systems to detect zero-day vulnerabilities by filtering and analyzing token sequences in communication data packets, enhancing security by intercepting malicious requests.

CN114826628BActive Publication Date: 2024-12-06TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110076066.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-20
Publication Date
2024-12-06
Estimated Expiration
2041-01-20

AI Technical Summary

Technical Problem

Existing security defense systems fail to detect unknown vulnerabilities, such as zero-day vulnerabilities, in communication data packets, leading to increased security risks during data transmission.

Method used

A data processing method that involves extracting communication data packets from service requests, filtering strings using a vulnerability rule library, encoding and decoding token sequences, and determining similarity to identify unknown vulnerabilities, thereby intercepting potentially malicious requests.

Benefits of technology

Effectively detects and intercepts unknown vulnerabilities, reducing security risks during data transmission by identifying zero-day attacks through advanced pattern recognition and similarity analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114826628B_ABST
    Figure CN114826628B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a data processing method, device, computer equipment and storage medium, the method comprising: extracting a communication data packet from an acquired target service request, detecting a target string in the communication data packet based on a historical vulnerability string in a vulnerability rule base, and obtaining a target detection result; if the target detection result indicates that there is no historical vulnerability string matching the target string in the vulnerability rule base, filtering the target string to obtain an access token sequence; encoding the access token sequence to obtain a target semantic vector, decoding the target semantic vector to obtain a decoded token sequence; determining the similarity between the access token sequence and the decoded token sequence, and when the similarity does not meet the similarity condition, determining that the target vulnerability string exists in the communication data packet, and intercepting the target service request. By adopting the embodiment of the present application, attacks of unknown vulnerabilities can be perceived to reduce security risks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data processing method, apparatus, computer equipment and storage medium. Background Art

[0002] The current security defense scheme (e.g., intrusion detection / prevention system, firewall, etc.) means that the computer device can detect the communication data packet (i.e., traffic data packet) carried by the received service request based on the rule signature to obtain the detection result. The detection result can be used to determine whether there is an attack of a known vulnerability in the communication data packet. In other words, the computer device can detect the communication data packet (e.g., communication data packet X) received in real time based on the known vulnerabilities included in the vulnerability rule base to determine whether there is an attack of a known vulnerability in the communication data packet X.

[0003] This means that existing security defense solutions can detect known vulnerabilities. However, when the communication data packets received in real time contain unknown vulnerabilities (e.g., zero-day vulnerabilities) for which there are no official patches, the computer device will directly regard the communication data packets with unknown vulnerabilities (e.g., zero-day vulnerabilities) as legitimate data packets. Based on this, if the computer device continues to use the communication data packets that are mistakenly regarded as legitimate for data exchange, it will inevitably increase the security risk of data transmission. Summary of the invention

[0004] The embodiments of the present application provide a data processing method, apparatus, computer device, and storage medium, which can realize the perception and capture of unknown vulnerability attacks to reduce security risks during data transmission.

[0005] An embodiment of the present application provides a data processing method, including:

[0006] Obtain the target business request, extract the communication data packet from the target business request, detect the target string in the communication data packet based on the historical vulnerability string in the vulnerability rule library, and obtain the target detection result;

[0007] If the target detection result indicates that there is no historical vulnerability string matching the target string in the vulnerability rule library, the target string is filtered, and an access token sequence corresponding to the communication data packet is obtained based on the filtered target string;

[0008] Encoding the access token sequence to obtain a target semantic vector of the access token sequence, and decoding the target semantic vector to obtain a decoded token sequence corresponding to the communication data packet;

[0009] The similarity between the access token sequence and the decoding token sequence is determined. When the similarity does not satisfy the similarity condition, it is determined that the target vulnerability string exists in the communication data packet, and the target service request is intercepted.

[0010] An embodiment of the present application provides a data processing device, including:

[0011] A target request acquisition module is used to acquire a target service request, extract a communication data packet from the target service request, detect a target string in the communication data packet based on a historical vulnerability string in a vulnerability rule library, and obtain a target detection result;

[0012] An access sequence acquisition module is used to filter the target string if the target detection result indicates that there is no historical vulnerability string matching the target string in the vulnerability rule library, and obtain an access token sequence corresponding to the communication data packet based on the filtered target string;

[0013] A decoding sequence acquisition module is used to encode the access token sequence to obtain the target semantic vector of the access token sequence, and decode the target semantic vector to obtain a decoding token sequence corresponding to the communication data packet;

[0014] The similarity determination module is used to determine the similarity between the access token sequence and the decoding token sequence. When the similarity does not meet the similarity condition, it is determined that the target vulnerability string exists in the communication data packet and the target service request is intercepted.

[0015] Wherein, the target request acquisition module includes:

[0016] A target request receiving unit, configured to receive a target service request sent by a user terminal based on the communication connection relationship when establishing a communication connection relationship with the user terminal; the target service request carries a communication data packet;

[0017] A target character string determination unit is used to extract a communication data packet from a target service request, decapsulate the communication data packet, obtain service data information, and use the character string in the service data information as a target character string in the communication data packet;

[0018] The string matching unit is used to obtain a vulnerability rule library associated with a target business request, perform string matching on a target string with a historical vulnerability string in the vulnerability rule library, and use the result of the string matching as a target detection result.

[0019] Wherein, the access sequence acquisition module includes:

[0020] A vocabulary acquisition unit, configured to filter the target string if the target detection result indicates that there is no historical vulnerability string matching the target string in the vulnerability rule library, and obtain a vocabulary corresponding to the communication data packet based on the filtered target string;

[0021] The access sequence acquisition unit is used to determine the filtered character strings in the target character string based on the vocabulary, and obtain the access token sequence corresponding to the communication data packet based on the filtered character strings and the target character string.

[0022] The vocabulary acquisition unit includes:

[0023] A word segmentation processing subunit is used for obtaining a marking symbol in the target string, performing word segmentation processing on the target string based on the marking symbol, and obtaining n word segments associated with the target string if the target detection result indicates that there is no historical vulnerability string matching the target string in the vulnerability rule library; n is a positive integer;

[0024] The word segmentation frequency counting subunit is used to count the word segmentation frequency of the i-th word segmentation in the target string among the n word segmentations, and when the word segmentation frequency of the i-th word segmentation meets the frequency filtering condition, the i-th word segmentation is determined as the word segmentation to be filtered; i is a positive integer less than or equal to n;

[0025] The filtering subunit is used to filter the to-be-filtered words among the n words, and use all the filtered words as the target character string after filtering;

[0026] The vocabulary acquisition subunit is used to add the target character string after filtering to the character list, and use the added character list as the vocabulary corresponding to the communication data packet.

[0027] Wherein, the access sequence acquisition unit includes:

[0028] A filtered string determination subunit is used to use the filtered target string in the vocabulary as a key string, and in the target string, use the string other than the key string as a filtered string in the target string;

[0029] The to-be-replaced character determination subunit is used to determine the character position of the to-be-replaced character in the target character string by taking the filtered character string and the marking symbol as the to-be-replaced character;

[0030] The access sequence acquisition subunit is used to replace the characters to be replaced at the character positions in the target character string with placeholders, and determine the access token sequence corresponding to the communication data packet based on the replaced target character string.

[0031] Wherein, the decoding sequence acquisition module includes:

[0032] A target model acquisition unit, used to acquire a target network model associated with a communication data packet; the target network model includes a target encoding layer and a target decoding layer;

[0033] An encoding processing unit, configured to use the access token sequence as a target input sequence of a target network model, input the target input sequence into a target encoding layer, and encode the target input sequence through an encoder in the target encoding layer to obtain a target semantic vector corresponding to the target input sequence;

[0034] The decoding processing unit is used to input the target semantic vector into the target decoding layer, and the decoder in the target decoding layer decodes the target semantic vector to obtain a target output sequence corresponding to the target semantic vector, and uses the target output sequence as a decoding token sequence corresponding to the communication data packet.

[0035] Wherein, the encoding processing unit includes:

[0036] An input subunit, used to use the access token sequence as a target input sequence of the target network model, and input the target input sequence into the target encoding layer; the target input sequence includes m character strings; m is a positive integer;

[0037] The encoding processing subunit is used to obtain string A from m strings. x , through the encoder in the target encoding layer to the string A x Perform encoding processing to obtain string A x The corresponding semantic vector C x ; x is a positive integer less than or equal to m;

[0038] The target semantic vector determines the subunit for the string A x The corresponding semantic vector C x , and obtain m semantic vectors, which are used as the target semantic vectors corresponding to the target input sequence.

[0039] The device further comprises:

[0040] A sample sequence acquisition module is used to acquire a historical token sequence corresponding to a historical data packet in a historical service request, and use the historical token sequence as a sample token sequence for training an initial network model; the initial network model includes an initial encoding layer and an initial decoding layer;

[0041] A sample encoding module is used to use the sample token sequence as the sample input sequence of the initial network model, and input the sample input sequence into the initial encoding layer, and encode the sample input sequence through the encoder in the initial encoding layer to obtain a sample semantic vector corresponding to the sample input sequence;

[0042] A sample decoding module is used to input the sample semantic vector into the initial decoding layer, and the decoder in the initial decoding layer decodes the sample semantic vector to obtain a sample output sequence corresponding to the sample semantic vector;

[0043] The iterative training module is used to iteratively train the initial network model based on the sample input sequence and the sample output sequence, and use the initial network model after the iterative training as the target network model.

[0044] The sample sequence acquisition module includes:

[0045] A sample detection unit is used to obtain a historical data packet carried in a historical service request, and detect a historical string in the historical data packet based on a historical vulnerability string in a vulnerability rule base to obtain a sample detection result;

[0046] The sample sequence acquisition unit is used to obtain the historical token sequence corresponding to the historical data packet if the sample detection result indicates that there is no historical vulnerability string matching the historical string in the vulnerability rule library, and use the historical token sequence as a sample token sequence for training the initial network model.

[0047] Among them, the iterative training module includes:

[0048] A training result determination unit, used to iteratively train the initial network model based on the sample input sequence and the sample output sequence to obtain a model training result;

[0049] A transition model determination unit, configured to use the initial network model after iterative training as a transition network model when the model training result indicates that the model loss function of the initial network model after iterative training does not meet the model convergence condition;

[0050] The model parameter adjustment unit is used to adjust the model parameters of the transition network model based on the model loss function that does not meet the model convergence condition, until the adjusted transition network model meets the model convergence condition, and the transition network model that meets the model convergence condition is used as the target network model.

[0051] Wherein, the similarity determination module includes:

[0052] A similarity determination unit, configured to obtain a similarity determination rule, and determine the similarity between the access token sequence and the decoding token sequence based on the similarity determination rule;

[0053] A query unit, used to obtain a similarity threshold in the similarity condition, and when the similarity is less than the similarity threshold, determine that the similarity does not meet the similarity condition, and query the target business request in the white list; the white list includes one or more trusted requests;

[0054] The interception unit is used to determine that a target vulnerability string exists in a communication data packet and intercept the target service request if no trusted request identical to the target service request is found in the white list.

[0055] The device further comprises:

[0056] An alarm information generation module is used to generate an alarm prompt information based on a target service request when it is determined that a target vulnerability string exists in a communication data packet;

[0057] The alarm information sending module is used to send the alarm prompt information to the user terminal so that the user terminal outputs the alarm prompt information.

[0058] An embodiment of the present application provides a computer device, including: a processor and a memory;

[0059] The processor is connected to the memory, wherein the memory is used to store a computer program. When the computer program is executed by the processor, the computer device executes the method provided in the embodiment of the present application.

[0060] On the one hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and the computer program is suitable for being loaded and executed by a processor so that a computing device having the processor executes the method provided by the embodiment of the present application.

[0061] In one aspect, the present application provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in the present application.

[0062] In an embodiment of the present application, a computer device with a security defense function can detect the target string in the communication data packet carried by the target business request based on the historical vulnerability string in the vulnerability rule base (i.e., the rule feature corresponding to the known vulnerability type) when obtaining the target business request (the business request received in real time), so as to obtain the target detection result for the communication data packet, and the target detection result can be used to determine whether there is an attack of a known vulnerability in the communication data packet. For example, when the target detection result indicates that there is no historical vulnerability string matching the target string in the vulnerability rule base, the computer device can determine that there is no attack of a known vulnerability in the communication data packet, and then the target string can be filtered to obtain the access token sequence corresponding to the communication data packet. Further, the computer device can quickly obtain the decoding token sequence corresponding to the access token sequence, and then determine the similarity of the two token sequences, and can identify the presence of the target vulnerability string in the communication data packet (i.e., the rule feature corresponding to the unknown vulnerability type, for example, a zero-day vulnerability). It can be understood that when the similarity does not meet the similarity condition, the computer device can determine that there is a target vulnerability string in the communication data packet and intercept the target business request. In other words, when the computer device finds that there is no attack of a known vulnerability in the communication data packet, it can further determine whether there is a target vulnerability string belonging to a zero-day vulnerability in the communication data packet. If so, it can be determined that there is an unknown vulnerability in the target business request, thereby realizing the perception and capture of the unknown vulnerability attack in the communication data packet to reduce the security risk during data transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0064] Figure 1 It is a structural diagram of a network architecture provided by an embodiment of the present application;

[0065] Figure 2 This is a schematic diagram of a scenario for data interaction provided by an embodiment of the present application;

[0066] Figure 3 It is a flowchart of a data processing method provided in an embodiment of the present application;

[0067] Figure 4 is a structural diagram of a target network model provided in an embodiment of the present application;

[0068] Figure 5 It is a flowchart of a data processing method provided in an embodiment of the present application;

[0069] Figure 6 It is a flow chart of a method for training a model provided in an embodiment of the present application;

[0070] Figure 7 It is a schematic diagram of the overall architecture of a system provided in an embodiment of the present application;

[0071] Figure 8 is a structural schematic diagram of a data processing device provided in an embodiment of the present application;

[0072] Fig. 9 It is a schematic diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0073] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0074] The embodiments of the present application relate to cloud technology and cloud security. Among them, cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network in a wide area network or a local area network to realize the calculation, storage, processing, and sharing of data. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the application of cloud computing business model, which can form a resource pool, which is used on demand and is flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites, and more portal websites. With the high development and application of the Internet industry, each item may have its own identification mark in the future, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately, and all kinds of industry data need strong system backing support, which can only be achieved through cloud computing.

[0075] Cloud security refers to the general term for security software, hardware, users, organizations, and security cloud platforms based on cloud computing business model applications. Cloud security integrates emerging technologies and concepts such as parallel processing, grid computing, and unknown virus behavior judgment. Through a large number of networked clients, it monitors abnormal software behavior in the network, obtains the latest information on Trojans and malicious programs on the Internet, and sends it to the server for automatic analysis and processing, and then distributes virus and Trojan solutions to each client.

[0076] The main research directions of cloud security include: 1. Cloud computing security, which mainly studies how to ensure the security of the cloud itself and various applications on the cloud, including cloud computer system security, secure storage and isolation of user data, user access authentication, information transmission security, network attack protection, compliance auditing, etc.; 2. Cloudification of security infrastructure, which mainly studies how to use cloud computing to build and integrate security infrastructure resources and optimize security protection mechanisms, including building a large-scale security event, information collection and processing platform through cloud computing technology, realizing the collection and correlation analysis of massive information, and improving the control ability of security events and risk control capabilities of the entire network; 3. Cloud security services, which mainly studies various security services provided to users based on cloud computing platforms, such as antivirus services.

[0077] The data processing method in the embodiment of the present application also relates to the direction of machine learning in the field of artificial intelligence. It can be understood that the so-called artificial intelligence (AI) refers to a new technical science that uses digital computers or computer equipment controlled by data computers to simulate, extend and expand human intelligence theories, methods, technologies and application systems. In other words, artificial intelligence is a comprehensive technology of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that the machines have the functions of perception, reasoning and decision-making.

[0078] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. Basic artificial intelligence technologies generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operating / interactive systems, mechatronics, and other technologies. Artificial intelligence software technologies mainly include computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0079] Among them, machine learning (ML) is a multi-disciplinary interdisciplinary subject, involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.

[0080] See also Figure 1, Figure 1 Schematic diagram of a network architecture provided by an embodiment of the present application. Figure 1 As shown, the network architecture may include a server 10 and a user terminal cluster. The user terminal cluster may include one or more user terminals, and the number of user terminals is not limited here. Figure 1 As shown, it may specifically include user terminal 100a, user terminal 100b, user terminal 100c, ..., user terminal 100n. Figure 1 As shown, user terminal 100a, user terminal 100b, user terminal 100c, ..., user terminal 100n can be respectively connected to the server 10 through a network, so that each user terminal can exchange data with the server 10 through the network connection. The network connection here does not limit the connection method, and can be directly or indirectly connected through a wired communication method, directly or indirectly connected through a wireless communication method, or through other methods, which are not limited in this application.

[0081] Each user terminal in the user terminal cluster may include: a smart phone, a tablet computer, a laptop computer, a desktop computer, a wearable device, a smart home, a head-mounted device, and other smart terminals with data processing functions. Figure 1 Each user terminal in the user terminal cluster shown in the figure may be installed with a target application (ie, an application client, for example, xx browser). When the application client is running in each user terminal, it may be respectively connected to the above Figure 1 The servers 10 shown here interact with each other.

[0082] like Figure 1 As shown, the server 10 in the embodiment of the present application can be the server corresponding to the application client. The server 10 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0083] It is understandable that the server 10 can receive a service request (e.g., a target service request) sent by other devices. For example, the service request here can be an HTTP request, which refers to a request message from an application client to the server 10. The service request received by the server 10 can be Figure 1The service request may be sent directly by any user terminal in the user terminal cluster shown, or may be forwarded indirectly by other servers. The sender of the service request is not limited here. Figure 1 Select one user terminal from the multiple user terminals shown as the target user terminal. For example, the embodiment of the present application can Figure 1 The user terminal 100a shown is used as a target user terminal, and the target user terminal can be used to send a service request to the server 10. At this time, the target user terminal can implement data interaction with the server 10.

[0084] It should be understood that the computer device (for example, Figure 1 The server 10 shown in the figure can perform rule signature filtering on the historical business requests received by the computer device, and then perform offline training based on the filtered historical business requests, so as to obtain a target network model (e.g., Encoder-Decoder model). The core function of the target network model is to map a sequence (e.g., input sequence) to another sequence (e.g., output sequence). Among them, the target network model may include an encoding layer and a decoding layer. The encoder in the encoding layer can use the properties of some RNN compression representations to represent each string in the input sequence (e.g., source language sentences) as a vector, and then the semantic vector corresponding to the input sequence can be obtained. The decoder in the decoding layer can generate an output sequence corresponding to the semantic vector based on the semantic vector corresponding to the input sequence and the intermediate semantics of the sentence.

[0085] It is understandable that when the computer device (e.g., server 10) in the embodiment of the present application receives the target service request sent by the target user terminal (e.g., user terminal 100a), it can detect the target service request in combination with the rule signature to determine whether the communication data packet carried by the target service request has an attack of a known vulnerability. When the computer device does not detect the attack of a known vulnerability in the communication data packet, the computer device can use the pre-trained target network model to further determine whether the communication data packet has an attack of an unknown vulnerability. If so, it can achieve the perception capture of the attack of the unknown vulnerability to reduce the security risk during data transmission. It is understandable that the communication data packet carried by the target service request (e.g., HTTP request) refers to the traffic data packet monitored by the computer device through the bypass monitoring module. The traffic data packet here refers to the data packet composed of the traffic elements obtained after the target user terminal parses the traffic data according to the HTTP protocol. The vulnerability rule library here can include rule features corresponding to multiple known vulnerability types (e.g., historical vulnerability strings). The unknown vulnerabilities here refer to system vulnerabilities that have been discovered (possibly not disclosed) but for which the official has not yet had relevant patches. Such vulnerabilities can be called zero-day vulnerabilities, or 0day vulnerabilities.

[0086] For further understanding, please refer to Figure 2 , Figure 2 Schematic diagram of a scenario for data interaction provided by an embodiment of the present application. Figure 2 As shown, the computer device in the embodiment of the present application may be a server 20b with a security defense function, and the server 20b may be the above-mentioned Figure 1 The user terminal 20a in the embodiment of the present application may be a user terminal having a network connection relationship with the server 20b, and the user terminal 20a may be the above-mentioned Figure 1 Any user terminal in the user terminal cluster shown, for example, user terminal 100a.

[0087] Among them, the vulnerability rule library in the embodiment of the present application (such as Figure 2 The total number of historical vulnerability strings in the vulnerability rule base 2e) shown in FIG. 2 may be h, where h is a positive integer. Figure 2 As shown, the historical vulnerability character strings of the vulnerability rule base 2e may specifically include vulnerability character string 1, vulnerability character string 2, ..., vulnerability character string h.

[0088] It should be understood that the user corresponding to the user terminal 20a (for example, Figure 2When the user Y shown in the figure accesses a certain website or searches for certain business data (for example, text data, voice data, or image data, etc.) in an application client (for example, xx browser), a trigger operation can be performed on the application client to enter the business data information that needs to be accessed. The trigger operation here may include contact operations such as clicking and long pressing, and may also include non-contact operations such as voice and gestures, which are not limited here. At this time, the user terminal 20a can respond to the trigger operation and encapsulate the business data information entered by the user Y to obtain a communication data packet. Furthermore, the user terminal 20a can generate a business request (for example, a request to send to the server 20b) based on the communication data packet. Figure 2 In this embodiment of the present application, the service request (eg, service request 200p) received in real time by the server 20b may be referred to as a target service request.

[0089] When the server 20b receives the service request 200p, the server 20b can extract the communication data packet (for example, Figure 2 The communication data packet 200q shown in FIG. 10 ) can then obtain the character string in the communication data packet 200q (for example, Figure 2 The string 200z shown in the figure). In this embodiment of the present application, the string in the communication data packet received in real time can be called the target string. Further, the server 20b can detect the communication data packet 200q in combination with the rule signature to obtain the target detection result. In other words, the server 20b can be based on Figure 2 The historical vulnerability string in the vulnerability rule base 2e shown in the figure is used for the target string in the communication data packet 200q (for example, Figure 2 The target detection result can be used to indicate whether the communication data packet 200q has been attacked by a known vulnerability.

[0090] It is understandable that if the target detection result indicates that there is a historical vulnerability string (for example, vulnerability string 2) that matches the string 200z in the vulnerability rule library 2e, the server 20b can determine that there is an attack of a known vulnerability in the communication data packet 200q, and then the service request 200p can be determined as an illegal service request. At this time, the server 20b can intercept the service request 200p to prevent user Y from accessing the service data information corresponding to the service request 200p. It is understandable that the server 20b can also generate an alarm prompt information based on the service request 200p, and then send the alarm prompt information to the user terminal 20a, so that the user terminal 20a outputs the alarm prompt information to inform the user Y that he cannot access the service data information to be queried.

[0091] If the target detection result indicates that there is no historical vulnerability string matching the string 200z in the vulnerability rule library 2e, the server 20b can determine that there is no attack of unknown vulnerability in the communication data packet 200q. At this time, the server 20b can further determine whether there is an attack of unknown vulnerability in the communication data packet 200q. It can be understood that the server 20b can filter the string 200z to obtain the filtered string 200z (for example, Figure 2 Further, the server 20b can obtain the access token sequence of the communication data packet 200q based on the string 210z (for example, Figure 2 At this time, the server 20b can obtain a pre-trained target network model (for example, Figure 2 The network model 2w shown in the figure) can then encode the access token sequence A through the encoder in the encoding layer of the network model 2w to obtain the target semantic vector of the access token sequence A. Further, the server 20b can decode the target semantic vector through the decoder in the decoding layer of the network model 2w to obtain the decoding token sequence corresponding to the communication data packet 200q (for example, Figure 2 The decoding token sequence shown is B).

[0092] At this time, the server 20b can determine the similarity between the access token sequence A and the decoding token sequence B, and then determine the legitimacy of the business request 200p based on the similarity condition. The similarity condition means that the similarity is greater than the similarity threshold (for example, 95%). The similarity threshold here can be dynamically adjusted according to actual needs and is not limited here. When the similarity meets the similarity condition, the server 20b can determine that the business request 200p is a legitimate business request, and then based on the business request 200p, obtain the response data information corresponding to the business data information to be queried by user Y, and then send the response data information to the user terminal 20a so that the user terminal 20a can output the response data information.

[0093] Optionally, when the similarity does not meet the similarity condition, the server 20b may determine that there is a target vulnerability string in the communication data packet 200q, that is, there is an attack of an unknown vulnerability (e.g., a zero-day vulnerability) in the communication data packet 200q, and then the service request 200p may be regarded as an illegal service request. At this time, the server 20b may intercept the service request 200p to prevent user Y from accessing the service data information to be queried. Further, the server 20b may also generate an alarm prompt message for sending to the user terminal 20a based on the service request 200p to inform the user Y corresponding to the user terminal 20a that the service data information to be queried cannot be accessed.

[0094] It can be seen that when the server 20b in the embodiment of the present application receives the service request 200p sent by the user terminal 20a in real time, it can detect the service request 200p in combination with the rule signature to determine whether the communication data packet 200q in the service request 200p has an attack of a known vulnerability. When the attack of a known vulnerability is not detected in the communication data packet 200q, the server 20b can obtain the pre-trained network model 2w to further determine whether the communication data packet 200q has an attack of an unknown vulnerability. It can be understood that the server 20b can quickly determine the access token sequence A and the decoding token sequence B corresponding to the communication data packet 200q through the network model 2w, and then determine the similarity between the access token sequence A and the decoding token sequence B. When the similarity does not meet the similarity condition, the server 20b can determine that there is a target vulnerability string corresponding to an unknown vulnerability in the communication data packet 200q, and at the same time, the server 20b can intercept the service request 200p. In other words, when the server 20b determines that the target vulnerability string exists in the communication data packet 200q, the server 20b can realize the perception and capture of unknown vulnerability attacks, thereby reducing the security risk during data transmission. In addition, when the server 20b determines that the communication data packet 200q has an attack of an unknown vulnerability, it can immediately generate an alarm prompt information, thereby improving the efficiency of emergency response and quickly eliminating the security risk during data transmission.

[0095] Among them, when the computer device in the embodiment of the present application receives the target service request in real time, by combining the rule signature and the trained target network model, it is determined that there is a target vulnerability string corresponding to the unknown vulnerability in the communication data packet carried by the target service request. The specific implementation method can be referred to below Figure 3-Figure 7 The corresponding embodiment.

[0096] For further information, see Figure 3 , Figure 3 is a flow chart of a data processing method provided in an embodiment of the present application. Figure 3As shown, the method can be executed by a computer device with a security defense function, and the computer device can be the above Figure 1 The method may include at least the following steps S101 to S104:

[0097] Step S101, obtain a target service request, extract a communication data packet from the target service request, detect a target character string in the communication data packet based on a historical vulnerability character string in a vulnerability rule library, and obtain a target detection result.

[0098] Specifically, when establishing a communication connection relationship with a user terminal, the computer device can receive a target service request sent by the user terminal based on the communication connection relationship. Among them, the target service request can carry a communication data packet; the communication data packet here is obtained by the user terminal after encapsulating the service data information entered by the user. It can be understood that the computer device can extract the communication data packet from the target service request, and can unpack the communication data packet to obtain the service data information. At this time, the computer device can use the character string in the service data information as the target character string in the communication data packet. Furthermore, the computer device can obtain a vulnerability rule library associated with the target service request, perform string matching on the target character string with the historical vulnerability character string in the vulnerability rule library, and use the result after the string matching as the target detection result.

[0099] It is understandable that the computer device can establish a communication connection relationship with the user terminal. The connection method for establishing the communication connection relationship can be a direct or indirect connection through a wired communication method, or a direct or indirect connection through a wireless communication method, or other methods, which are not limited here. The user terminal can run an application client (for example, xx browser), and the user terminal can be as described above. Figure 1 Any user terminal in the user terminal cluster shown, for example, user terminal 100a.

[0100] It should be understood that when the user corresponding to the user terminal visits a certain website in the application client, the website can be entered in the application client, or a trigger operation (e.g., a click operation) can be directly performed on the website to be accessed (e.g., a history record website or a favorite website, etc.) in the display interface of the application client. At this time, the user terminal can respond to the trigger operation and determine the service data information based on the website to be accessed by the user. Further, the user terminal can encapsulate the service data information to obtain a communication data packet, and then generate a service request for sending to the computer device based on the communication data packet.

[0101] Optionally, when a user corresponding to the user terminal accesses a certain service data (e.g., text data, voice data, or image data, etc.) in the application client, the user terminal can enter the service data to be accessed in the application client. At this time, the user terminal can respond to the trigger operation and determine the service data information based on the service data to be accessed by the user. Furthermore, the user terminal can encapsulate the service data information to obtain a communication data packet, and then generate a service request for sending to the computer device based on the communication data packet.

[0102] It is understandable that when the user terminal establishes a communication connection relationship with the computer device, the computer device can receive a service request sent by the user terminal based on the communication connection relationship. Among them, the embodiment of the present application can refer to the service request received by the computer device in real time as a target service request. Further, the computer device can extract a communication data packet from the target service request and unseal the communication data packet to obtain service data information. At this time, the computer device can use the character string in the service data information as the target character string in the communication data packet.

[0103] Furthermore, the computer device may obtain a vulnerability rule base associated with the target service request. The vulnerability rule base here often uses string matching or regular expression matching of the communication data packet carried by the target service request to identify suspicious or attack-featured behaviors. In other words, the vulnerability rule base can be used to detect whether there is an attack of a known vulnerability in the communication data packet.

[0104] The vulnerability rule base may include rule features corresponding to various known vulnerability types (e.g., historical vulnerability strings). Figure 2 The total number of historical vulnerability strings in the vulnerability rule base 2e shown may be h, where h is a positive integer. The h historical vulnerability strings may specifically include vulnerability string 1, vulnerability string 2, ..., vulnerability string h.

[0105] Furthermore, the computer device may perform string matching on the target string with the historical vulnerability string in the vulnerability rule base, and use the result of the string matching as the target detection result. It is understandable that if the target detection result indicates that there is a historical vulnerability string matching the target string in the vulnerability rule base, the computer device may determine that there is an attack of a known vulnerability in the communication data packet, and then the target service request may be determined as an illegal service request to intercept the target service request with a known vulnerability. If the target detection result indicates that there is no historical vulnerability string matching the target string in the vulnerability rule base, the computer device may determine that there is no attack of a known vulnerability in the communication data packet, and then may determine whether there is an attack of an unknown vulnerability in the communication data packet.

[0106] It is understandable that the unknown vulnerability here refers to a vulnerability that is not included in the vulnerability rule base. For example, a zero-day vulnerability, in layman's terms, is difficult for others to know the existence of a zero-day vulnerability except for the vulnerability discoverer. Therefore, when the vulnerability discoverer (for example, an illegal user) exploits the zero-day vulnerability, the attack launched is often very sudden and destructive. Therefore, in order to reduce the security risk of data transmission, the embodiment of the present application can use a pre-trained target network model to detect whether there is an attack of an unknown vulnerability in the communication data packet.

[0107] Step S102: If the target detection result indicates that there is no historical vulnerability string matching the target string in the vulnerability rule library, the target string is filtered, and an access token sequence corresponding to the communication data packet is obtained based on the filtered target string.

[0108] Specifically, if the target detection result indicates that there is no historical vulnerability string matching the target string in the vulnerability rule base, the computer device can filter the target string, and then obtain a vocabulary corresponding to the communication data packet based on the filtered target string. Further, the computer device can determine the filtered string in the target string based on the vocabulary, and can obtain an access token sequence corresponding to the communication data packet based on the filtered string and the target string.

[0109] It should be understood that if the target detection result indicates that there is no historical vulnerability string matching the target string in the vulnerability rule library, the computer device can tokenize the target string to obtain an access token sequence corresponding to the communication data packet. The tokenization process here can include filtering the to-be-filtered word segmentation determined from the target string, and replacing the to-be-replaced characters in the target string with placeholders.

[0110] It is understandable that the computer device can obtain the marking symbol in the target string, and then can perform word segmentation processing on the target string based on the marking symbol to obtain n word segments associated with the target string; where n is a positive integer. The marking symbol here can be punctuation marks, such as a period (.), a question mark (?), an exclamation mark (!), a comma (,), a colon (,), a semicolon (;), a colon (:), a quotation mark ("" or ''), a separator ( / ) and a spacer (i.e., a space symbol), etc.

[0111] It should be understood that the computer device in the embodiment of the present application can obtain a frequency filtering condition, and then can filter out useless and meaningless strings in the target string based on the frequency filtering condition. Among them, the frequency filtering condition in the embodiment of the present application can be used to instruct the computer device to filter out segmentations with too high frequency (i.e., high-frequency words) and too low frequency (i.e., low-frequency words) in the target string. It can be understood that the high-frequency words here refer to the segmentations corresponding to the segmentation frequencies belonging to the first sorting interval (e.g., the first 3%) in the sorting results of multiple segmentation frequencies, and the low-frequency words here refer to the segmentations corresponding to the segmentation frequencies belonging to the second sorting interval (e.g., the last 3%) in the sorting results of multiple segmentation frequencies. It can be understood that the first sorting interval and the second sorting interval here can be dynamically adjusted according to actual needs, and are not limited here.

[0112] Furthermore, among the n word segments, the computer device can count the word segmentation frequency of the i-th word segmentation in the target character string, and when the word segmentation frequency of the i-th word segmentation meets the frequency filtering condition, the i-th word segmentation is determined as the word segmentation to be filtered; wherein i is a positive integer less than or equal to n.

[0113] For example, the number of segmented words associated with the target string obtained by the computer device is 100, and the computer device can count the segmented frequencies of these 100 segmented words respectively. The computer device can sort the segmented frequencies of these 100 segmented words (for example, in ascending order) to obtain a sorting result. Further, the computer device can select the segmented words corresponding to the first 3% (i.e., the first sorting interval) of the segmented words from the sorting result, and the segmented words corresponding to the last 3% (i.e., the second sorting interval) of the segmented words. In other words, the computer device can use the segmented words corresponding to the first 3 segmented words frequencies in the sorting result, and the segmented words corresponding to the last 3 segmented words frequencies as the segmented words to be filtered that meet the frequency filtering condition.

[0114] Furthermore, the computer device can filter the to-be-filtered word among the n word segments, and then can use all the filtered word segments as the target string after filtering. At this time, the computer device can add the target string after filtering to the character list, and use the added character list as the vocabulary corresponding to the communication data packet.

[0115] It is understandable that the computer device can use the filtered target string in the vocabulary as the key string. At the same time, the computer device can use the string other than the key string in the target string as the filtered string in the target string. Further, in the target string, the computer device can use the filtered string and the marking symbol as the characters to be replaced, and then determine the character position of the characters to be replaced. In the target string, the computer device can replace the characters to be replaced at the character position with placeholders, and then determine the access token sequence corresponding to the communication data packet based on the replaced target string. For example, the computer device can convert the replaced target string into a token sequence through lexical analysis, and then use the converted token sequence as the access token sequence corresponding to the communication data packet.

[0116] Step S103, encoding the access token sequence to obtain a target semantic vector of the access token sequence, and decoding the target semantic vector to obtain a decoded token sequence corresponding to the communication data packet.

[0117] Specifically, the computer device can obtain a target network model associated with a communication data packet. The target network model here may include a target encoding layer and a target decoding layer. It should be understood that the computer device can use the access token sequence as the target input sequence of the target network model, and input the target input sequence into the target encoding layer, and then the target input sequence can be encoded by the encoder in the target encoding layer to obtain a target semantic vector corresponding to the target input sequence. Further, the computer device can input the target semantic vector into the target decoding layer, and the decoder in the target decoding layer can decode the target semantic vector to obtain a target output sequence corresponding to the target semantic vector, and then the target output sequence can be used as a decoding token sequence corresponding to the communication data packet.

[0118] It should be understood that the computer device can use the access token sequence as the target input sequence of the target network model, and input the target input sequence into the target coding layer. The target input sequence here can include m strings; m is a positive integer. Further, the computer device can obtain string A from the m strings. x , through the encoder in the target encoding layer to the string A x Encode to get string A x The corresponding semantic vector C x ; Wherein, x can be a positive integer less than or equal to m. Until the encoding of the target input sequence is completed, the computer device can be based on the string A x The corresponding semantic vector C x, and m semantic vectors are obtained, which can then be used as the target semantic vectors corresponding to the target input sequence. It can be understood that the encoder can use the properties of RNN compression representation. Through word embedding technology, each string in the target input sequence is represented as a vector.

[0119] For example, the word embedding technology here can be One-hot encoding. It can be understood that the vector dimension of One-hot encoding can be the same as the total number of strings in the target input sequence, that is, m dimensions (taking 3 dimensions as an example). Among them, in the One-hot encoded vector, the dimension value of the position corresponding to the string is 1, and the remaining dimension values ​​are 0. For example, if the target input sequence is "how are you", then the semantic vector of the string "how" can be "100", the semantic vector of the string "are" can be "010", and the semantic vector of the string "you" can be "001".

[0120] Furthermore, the computer device may input the target semantic vector into the target decoding layer, and the decoder in the target decoding layer may decode the target semantic vector to obtain a target output sequence corresponding to the target semantic vector, and then the target output sequence may be used as a decoding token sequence corresponding to the communication data packet. It is understood that, in the process of decoding the target semantic vector through the decoder in the target decoding layer, the computer device may decode the target semantic vector according to the target semantic vector and the historical information that has been generated (for example, string B1, string B2, ..., string B y-1 ), to generate string B y . Each string B y are generated in sequence, then when decoding is completed, the computer device can obtain the target output sequence corresponding to the target semantic vector. The target output sequence here can include k strings, where k can be a positive integer, and the k strings can specifically include string B1, string B2, ..., and string B k .

[0121] For ease of understanding, please further refer to Table 1, which is a string diagram provided in an embodiment of the present application.

[0122] Table 1

[0123]

[0124] Among them, the string schematic table may include the target string in the communication data packet, the access token sequence corresponding to the communication data packet, and the decoding token sequence corresponding to the communication data packet. The string schematic table can also be presented in other forms, which are not limited here. As shown in Table 1 above, string 10 may refer to: the string obtained by the computer device after unsealing the communication data packet carried by the target business request (i.e., the target string). The string 20 shown in Table 1 may refer to: the token sequence (i.e., the access token sequence) generated by the computer device after tokenizing the string 10. The string 30 shown in Table 1 refers to: the output sequence (i.e., the decoding token sequence) obtained after the computer device inputs the string 20 into the target network model.

[0125] For further understanding, please refer to Figure 4 , Figure 4 Schematic diagram of a target network model provided in an embodiment of the present application. Figure 4 As shown, the trained target network model obtained by the computer device in the embodiment of the present application can be a network model 400. Among them, the network model 400 may include an encoding layer 41 and a decoding layer 42. It can be understood that the encoder in the encoding layer 41 can be used to encode the input sequence input into the network model 400, and the decoder in the decoding layer 42 can be used to decode the semantic vector obtained after the encoding process.

[0126] It should be understood that when the computer device obtains the access token sequence corresponding to the communication data packet, it can obtain Figure 4 The network model 400 shown in FIG. 4 can then use the access token sequence as a target input sequence input to the network model 400. The target input sequence can be Figure 4 The sequence 4A shown here may include m strings, where m is a positive integer. The m strings may specifically include string A1, string A2, ..., string A m .

[0127] It can be understood that when the computer device inputs the sequence 4A into the encoding layer 41, the computer device can obtain the string A1 from the m strings, and then encode the string A1 through the encoder in the encoding layer 41 to obtain the semantic vector C1 corresponding to the string A1. Further, the computer device can sequentially obtain the string A2 from the m strings, and then encode the string A2 through the encoder in the encoding layer 41 to obtain the semantic vector C2 corresponding to the string A2. And so on, until the computer device obtains the string A1 from the m strings. m , and then get the string Am The corresponding semantic vector C m When the computer device can be based on the semantic vector C1, the semantic vector C2, ..., and the semantic vector C m These m semantic vectors obtain the target semantic vector corresponding to sequence 4A.

[0128] Furthermore, the computer device may input the target semantic vector into Figure 4 The encoding layer 42 shown in the figure, the decoder in the decoding layer 42 decodes the target semantic vector to obtain the target output sequence corresponding to the target semantic vector (for example, Figure 4 The target output sequence is used as the decoding token sequence corresponding to the communication data packet. It can be understood that the decoding process can be regarded as the inverse process of the encoding process. During the decoding process, the computer device needs to predict the next output string based on the target semantic vector obtained by the encoding process and the output sequence that has been generated before. For example, the generation of string B2 is based on the target semantic vector and the generated string B1. For another example, the generation of string B4 is based on the target semantic vector and the generated strings B1, B2 and B3. Each string is generated in turn, so when the decoding is completed, the computer device can obtain Figure 4 The sequence 4B shown here may include k character strings, where k may be a positive integer, and the k character strings may specifically include character string B1, character string B2, ..., and character string B k It is understandable that the total number m of character strings in the sequence 4A and the total number k of character strings in the sequence 4B may be the same or different.

[0129] Among them, the embodiment of the present application uses a pre-trained network model 400 to quickly map sequence 4A (i.e., access token sequence) to sequence 4B (i.e., decoding token sequence), so that the similarity of the two sequences can be quickly determined later, thereby determining whether the communication data packet is attacked by an unknown vulnerability, and then when an unknown vulnerability attack is discovered, the security risk during data transmission can be reduced.

[0130] Step S104, determining the similarity between the access token sequence and the decoding token sequence, and when the similarity does not satisfy the similarity condition, determining that the target vulnerability string exists in the communication data packet, and intercepting the target service request.

[0131] Specifically, the computer device can obtain a similarity determination rule, and then can determine the similarity between the access token sequence and the decoding token sequence based on the similarity determination rule. Further, the computer device can obtain a similarity threshold in the similarity condition, and when the similarity is less than the similarity threshold, determine that the similarity does not meet the similarity condition. And the target business request can be queried in the white list. The white list here can include one or more trusted requests. If the trusted request identical to the target business request is not found in the white list, the computer device can determine that the target vulnerability string exists in the communication data packet and intercept the target business request.

[0132] It is understandable that the similarity between the access token sequence and the decoding token sequence can be measured using NIST (National Institute of standards and Technology). Among them, NIST first needs to determine the amount of information of each n-gram, then add them up and divide them by the number of overall n-gram fragments to calculate. After calculating the amount of information, each co-occurring n-gram can be multiplied by its information weight, and then weighted averaged to obtain the final scoring result. The scoring result here can be used to indicate the similarity between the access token sequence and the decoding token sequence.

[0133] Among them, n-gram is an algorithm based on a statistical language model. Its basic idea is to perform a sliding window operation of size n on the content of the text (for example, the access token sequence or the decoding token sequence) according to bytes, forming a sequence of byte fragments of length n. Each byte fragment is called a gram, and the frequency of occurrence of all grams is counted. For example, if the access token sequence is "I love China", then the unigram of the access token sequence can be "I", "love", "China", and "country". The bigram can be "I love", "love China", and "China". The trigram can be "I love China" and "love China". The tetragram can be "I love China"

[0134] Specifically, the calculation formula of the information amount can be shown as formula (1):

[0135]

[0136] Among them, w1, ..., w n-1 and w n They refer to the frequencies of occurrence of the corresponding n-grams, respectively. Here, n may be the total number with the minimum value selected from the total number of strings m in the access token sequence and the total number of strings k in the decoding token sequence.

[0137] Specifically, the calculation formula of the scoring result (i.e., similarity) can be shown as the following formula (2):

[0138]

[0139] Among them, NIST uses the arithmetic average method. refers to w1 to w n The joint probability of the amount of information, refers to the size of the total vocabulary, i.e., w1 to w n The total number of n-grams. sys refers to the sequence length of the access token sequence (i.e., m), and L ref refers to the sequence length of the decoding token sequence (i.e., n). β is an unfixed empirical value. When β is 2 / 3, the length penalty rate is 0.5.

[0140] It is understandable that the computer device can determine the similarity between the access token sequence and the decoding token sequence through the above formula (1) and formula (2). Further, the computer device can obtain a similarity threshold (for example, 95%) in the similarity condition, and then determine whether the similarity between the access token sequence and the decoding token sequence meets the similarity condition based on the similarity threshold. The similarity threshold here can be adjusted according to actual needs and is not limited here. Among them, when the similarity is greater than the similarity threshold, the computer device can determine that the similarity meets the similarity condition. Optionally, when the similarity is less than or equal to the similarity threshold, the computer device can determine that the similarity does not meet the similarity condition.

[0141] For example, the access token sequence may be the string 20 shown in Table 1 above (e.g., “_adapt__0__config_200pt 1ek bash echo php_192_168_146_129_”), and the decoding token sequence may be the string 30 shown in Table 1 above (e.g., “_adapt__0__config_200pt 0ek bash echo php_192_168_146_129_”). The computer device determines that the similarity between the access token sequence and the decoding token sequence is 98% through the above formulas (1) and (2). At this point, the computer device may determine that the similarity is greater than a similarity threshold (e.g., 95%). In other words, the computer device may determine that the access token sequence is very similar to the decoding token sequence. It is understandable that the computer device may determine that the target service request sent by the user terminal is a legitimate service request (i.e., a normal request), and may further allow the user corresponding to the user terminal to access the service data information to be queried based on the target service request.

[0142] For example, the computer device determines that the similarity between the access token sequence and the decoding token sequence is 83% through the above formula (1) and formula (2). The computer device can determine that the similarity is less than the similarity threshold (for example, 95%), that is, the similarity does not meet the similarity condition. At this time, the computer device can further screen the target business request that does not meet the similarity condition based on the whitelist list to determine whether the target business request is a trusted request.

[0143] It is understandable that among the business requests received by the computer device, the ratio of legitimate business requests (i.e. normal requests) to illegal business requests (i.e. malicious requests) is very different. Usually, more than 95% of the overall requests are legitimate business requests. Due to the small number of training samples of the target network model, some false alarms will occur during the gradual operation process, that is, the business requests received by the computer device were originally legitimate business requests, but were mistakenly judged as illegal business requests. In order to reduce the number of alarms and operational efficiency, the computer device can treat these misjudged business requests as trusted requests and add the trusted requests to the whitelist.

[0144] If the computer device finds a trusted request that is the same as the target business request in the whitelist, the computer device can determine the target business request as a legitimate business request. If the computer device does not find a trusted request that is the same as the target business request in the whitelist, the computer device can determine the target business request as an illegal business request. In other words, the computer device can determine that the target vulnerability string (i.e., the rule feature corresponding to the unknown vulnerability) exists in the communication data packet carried by the target business request. At this time, the computer device can intercept the target business request so that the user corresponding to the user terminal that sent the target business request cannot access the business data information to be queried.

[0145] In an embodiment of the present application, a computer device with a security defense function can detect the target string in the communication data packet carried by the target business request based on the historical vulnerability string in the vulnerability rule base (i.e., the rule feature corresponding to the known vulnerability type) when obtaining the target business request (the business request received in real time), so as to obtain the target detection result for the communication data packet, and the target detection result can be used to determine whether there is an attack of a known vulnerability in the communication data packet. For example, when the target detection result indicates that there is no historical vulnerability string matching the target string in the vulnerability rule base, the computer device can determine that there is no attack of a known vulnerability in the communication data packet, and then the target string can be filtered to obtain the access token sequence corresponding to the communication data packet. Further, the computer device can quickly obtain the decoding token sequence corresponding to the access token sequence, and then determine the similarity of the two token sequences, and can identify the presence of the target vulnerability string in the communication data packet (i.e., the rule feature corresponding to the unknown vulnerability type, for example, a zero-day vulnerability). It can be understood that when the similarity does not meet the similarity condition, the computer device can determine that there is a target vulnerability string in the communication data packet and intercept the target business request. In other words, when the computer device finds that there is no attack of a known vulnerability in the communication data packet, it can further determine whether there is a target vulnerability string belonging to a zero-day vulnerability in the communication data packet. If so, it can be determined that there is an unknown vulnerability in the target business request, thereby realizing the perception and capture of the unknown vulnerability attack in the communication data packet to reduce the security risk during data transmission.

[0146] For further information, see Figure 5 , Figure 5 is a flow chart of a data processing method provided in an embodiment of the present application. Figure 5 As shown, the method can be executed by a computer device with a security defense function, and the computer device can be the above Figure 1 The data processing method provided in the embodiment of the present application may include methods in two stages: a model training stage and a model application stage. The method in the model training stage may at least include the following steps S201 to S204, and the method in the model application stage may at least include the following steps S205 to S208:

[0147] Step S201, obtaining a historical token sequence corresponding to a historical data packet in a historical service request, and using the historical token sequence as a sample token sequence for training an initial network model.

[0148] Specifically, the computer device can obtain the historical data packets carried in the historical service requests, and then can detect the historical character strings in the historical data packets based on the historical vulnerability character strings in the vulnerability rule library to obtain sample detection results; if the sample detection result indicates that there is no historical vulnerability character string matching the historical character string in the vulnerability rule library, the computer device can obtain the historical token sequence corresponding to the historical data packet, and use the historical token sequence as a sample token sequence for training the initial network model. The initial network model may include an initial encoding layer and an initial decoding layer.

[0149] It should be understood that, since the ratio of legitimate business requests to illegitimate business requests in HTTP requests is very different, this imbalance is very difficult for supervised learning. Therefore, the computer device in the embodiment of the present application can use unsupervised learning, a machine learning method, to train the Encoder-Decoder model. Unsupervised learning here refers to solving various problems in pattern recognition based on training samples of category positions (not marked).

[0150] Among them, the embodiment of the present application can refer to the service request received in history as a historical service request, and the communication data packet extracted from the historical service request as a historical data packet. The computer device needs to analyze whether the received historical data packet has an attack of a known vulnerability based on the historical vulnerability string in the vulnerability rule base, so as to filter out the historical data packet with a known vulnerability. It is understandable that the computer device can unseal the historical data packet extracted from the historical service request to obtain the historical string in the historical data packet. Further, the computer device can detect the historical string based on the historical vulnerability string in the vulnerability rule base to obtain a sample detection result. If the sample detection result indicates that there is a historical vulnerability string matching the historical string in the vulnerability rule base, the computer device can determine that there is an attack of a known vulnerability in the historical data packet, and then it is necessary to filter the historical data packet with a known vulnerability. Optionally, if the sample detection result indicates that there is no historical vulnerability string matching the historical string in the vulnerability rule base, the computer device can determine that there is no attack of a known vulnerability in the historical data packet, and then the historical token sequence corresponding to the historical data packet can be obtained, and the historical token sequence is used as a sample token sequence for training the initial network model.

[0151] The specific implementation method of the computer device obtaining the historical token sequence corresponding to the historical data packet can be referred to above. Figure 3 The specific implementation method of obtaining the access token sequence corresponding to the communication data packet in the corresponding embodiment will not be further described here.

[0152] Step S202, taking the sample token sequence as the sample input sequence of the initial network model, and inputting the sample input sequence into the initial coding layer, encoding the sample input sequence through the encoder in the initial coding layer, and obtaining the sample semantic vector corresponding to the sample input sequence.

[0153] Step S203: input the sample semantic vector to the initial decoding layer, and the decoder in the initial decoding layer decodes the sample semantic vector to obtain a sample output sequence corresponding to the sample semantic vector.

[0154] The specific implementation of inputting the sample input sequence into the initial network model to obtain the sample output sequence in steps S202-S203 can be referred to above. Figure 3 The specific implementation method of inputting the target input sequence into the target network model to obtain the target output sequence in the corresponding embodiment will not be further described here.

[0155] Step S204, based on the sample input sequence and the sample output sequence, iteratively train the initial network model, and use the iteratively trained initial network model as the target network model.

[0156] Specifically, the computer device can iteratively train the initial network model based on the sample input sequence and the sample output sequence to obtain a model training result. When the model training result indicates that the model loss function of the initial network model after iterative training meets the model convergence condition, the initial network model that meets the model convergence condition is directly used as the target network model. When the model training result indicates that the model loss function of the initial network model after iterative training does not meet the model convergence condition, the computer device can use the initial network model after iterative training as a transition network model, and then can adjust the model parameters of the transition network model based on the model loss function that does not meet the model convergence condition, until the adjusted transition network model meets the model convergence condition, the computer device can use the transition network model that meets the model convergence condition as the target network model.

[0157] For further understanding, please refer to Figure 6 , Figure 6 This is a flow chart of a method for training a model provided in an embodiment of the present application. Figure 6 As shown, the computer device in the embodiment of the present application may be a computer device with a model training function, and the computer device may be the above-mentioned Figure 1 The server 10 is shown.

[0158] It should be understood that the computer device obtains the information for training the initial network model (for example, Figure 6When a sample token sequence of the initial network model 600 shown in the figure is obtained, the sample token sequence can be used as a sample input sequence, and then the sample input sequence can be input into the initial network model 600, and the initial network model 600 predicts and outputs a sample output sequence corresponding to the sample input sequence.

[0159] At this time, the computer device can obtain the model loss function associated with the initial network model 600, and then determine the model training result of the initial network model 600 based on the sample input sequence, the sample output sequence and the model loss function. It can be understood that when the model training result indicates that the model loss function of the initial network model 600 satisfies the model convergence condition, the computer device can directly determine the initial network model 600 that satisfies the model condition as the trained target network model (for example, Figure 6 Target network model 610 shown).

[0160] When the model training result indicates that the model loss function of the initial network model 600 does not meet the model convergence condition, the computer device may adjust the model parameters of the initial network model 600 based on the model loss function that does not meet the model convergence condition. Further, the computer device may determine the initial network model 600 after adjusting the model parameters as a transition network model, and then iteratively train the transition network model until the transition network model after iterative training meets the model convergence condition. The computer device may use the transition network model that meets the model convergence condition as a trained target network model (for example, Figure 6 Target network model 610 shown).

[0161] It is understandable that the computer device can update the trained target network model (i.e., Encoder-Decoder model) regularly (e.g., one day, one week, or one month, etc.). When updating the Encoder-Decoder model, the computer device can obtain the service requests received within this period, and then enrich the sample data (i.e., the sample token sequence). For example, if the computer device updates the Encoder-Decoder model once a day, and the last update time is 24:00 on December 18, the computer device can update the Encoder-Decoder model at 24:00 on December 19. At this time, the newly added sample data used to train the Encoder-Decoder model can be determined by the historical data packets received from 24:00 on December 18 to 24:00 on December 19 that do not have known vulnerabilities. It is understandable that when there is enough sample data, the Encoder-Decoder model will "understand" the language very well, so that the computer device can obtain a target output sequence (i.e., a decoding token sequence corresponding to the communication data packet) that is as similar in meaning as possible after passing the target input sequence (the access token sequence corresponding to the communication data packet obtained in real time) through the Encoder-Decoder model, thereby being able to more accurately discover attacks on unknown vulnerabilities and thereby reduce security risks during data transmission.

[0162] Step S205, obtaining a target service request, extracting a communication data packet from the target service request, and detecting a target character string in the communication data packet based on a historical vulnerability character string in a vulnerability rule library to obtain a target detection result.

[0163] Step S206: If the target detection result indicates that there is no historical vulnerability string matching the target string in the vulnerability rule library, the target string is filtered, and an access token sequence corresponding to the communication data packet is obtained based on the filtered target string.

[0164] Step S207, obtain the target network model, encode the access token sequence to obtain the target semantic vector of the access token sequence, decode the target semantic vector to obtain the decoded token sequence corresponding to the communication data packet.

[0165] The target network model acquired by the computer device may be the target network model trained in the above step S204.

[0166] Step S208, determining the similarity between the access token sequence and the decoding token sequence, and when the similarity does not satisfy the similarity condition, determining that the target vulnerability string exists in the communication data packet, and intercepting the target service request.

[0167] The specific implementation of steps S205 to S208 can be found in the above Figure 3 The description of step S101 to step S104 in the corresponding embodiment will not be repeated here.

[0168] It is understandable that when the computer device determines that the target vulnerability string exists in the communication data packet, the computer device can generate an alarm prompt information based on the target service request, and then return the alarm prompt information to the user terminal that sent the target service request. When the user terminal receives the alarm prompt information, the alarm prompt information can be output to inform the user corresponding to the user terminal that the service data information to be queried cannot be accessed.

[0169] For further understanding, please refer to Figure 7 , Figure 7 Schematic diagram of the overall system architecture provided by the embodiment of the present application. Figure 7 As shown, the overall system architecture diagram in the embodiment of the present application may include two parts: an offline training model and a real-time application model.

[0170] It is understandable that in the offline model training stage, a computer device with a security defense function can obtain historical business requests received by the computer device in the past, and then can filter a large number of historical data packets carried by historical business requests in combination with rule signatures, and then can obtain historical data packets that do not have known vulnerabilities. At this time, the computer device can use the historical data packets that do not have known vulnerabilities as sample data for training the initial network model. Further, the computer device can tokenize the historical character strings in the historical data packets belonging to the sample data to obtain a historical token sequence corresponding to the historical data packet. The tokenization processing here can include filtering the word segmentation to be filtered determined from the historical character string, and replacing the characters to be replaced in the historical character string with placeholders. Among them, the historical token sequence can be used as a sample token sequence for training the initial network model.

[0171] Furthermore, the computer device may use the sample token sequence as a sample input sequence of the initial network model, and the initial network model outputs a sample output sequence corresponding to the sample input sequence. At this time, the computer device may iteratively train the initial network model based on the sample input sequence and the sample output sequence, and then use the iteratively trained initial network model as the target network model.

[0172] It is understandable that in the real-time application model stage, the computer device can obtain the traffic data packet sent by the user terminal (i.e., the communication data packet carried by the target service request) through the bypass monitoring module, and then analyze the monitored communication data packet to determine whether the communication data packet includes an attack of a vulnerability (known vulnerability or unknown vulnerability). It is understandable that the computer device can detect the communication data packet carried by the target service request in combination with the rule signature to determine whether there is a known vulnerability in the vulnerability rule library in the communication data packet. When the target detection result indicates that there is no historical string matching the target string in the communication data packet in the rule vulnerability library, the computer device can determine that there is no attack of a known vulnerability in the communication data packet. At this time, the computer device can further determine whether the communication data packet includes an attack of an unknown vulnerability.

[0173] It should be understood that the computer device can tokenize the target string to obtain an access token sequence corresponding to the communication data packet. The tokenization process here may include filtering the to-be-filtered word segmentation determined from the target string, and replacing the to-be-replaced characters in the target string with placeholders. Further, the computer device can obtain a target network model trained offline, and then input the access token sequence into the target network model, and the target network model outputs a decoding token sequence corresponding to the communication data packet. At this time, the computer device can determine the similarity between the access token sequence and the decoding token sequence by the above formula (1) and formula (2), and then determine that the similarity does not meet the similarity condition when the similarity is less than a similarity threshold (for example, 95%). At the same time, the computer device can obtain a whitelist list including one or more trusted requests, and then filter based on the whitelist list. In other words, the computer device can query the target service request in the whitelist list.

[0174] If a trusted request identical to the target service request is found in the whitelist, the computer device can determine that the target vulnerability string does not exist in the communication data packet, that is, the target service request is a legitimate service request without unknown vulnerabilities. Optionally, if a trusted request identical to the target service request is not found in the whitelist, the computer device can determine that the target vulnerability string exists in the communication data packet, that is, the computer device can sense the attack of unknown vulnerabilities in the communication data packet. At this time, the computer device can determine the target service request as an illegal service request and intercept the target service request. At the same time, the computer device can generate an alarm prompt message for sending to the user terminal based on the target service request to inform the user corresponding to the user terminal that the service data information to be queried cannot be accessed.

[0175] In the embodiment of the present application, the computer device can determine based on the rule signature that there is no attack of known vulnerabilities in the communication data packet carried by the target business request received in real time, and can further determine whether there is an attack of unknown vulnerabilities (for example, zero-day vulnerabilities) in the communication data packet. It is understandable that the computer device can obtain the target network model trained according to the business request received historically, and then can obtain two sequences (i.e., the access token sequence and the decoding token sequence associated with the target business request) that are as similar as possible in meaning based on the target network model more quickly and accurately, so as to better perceive and capture attacks of unknown vulnerabilities in the future, and intercept the target business request corresponding to the communication data packet with unknown vulnerability attacks, thereby reducing security risks. In addition, when the computer device determines that there is an unknown vulnerability in the communication data packet, the computer device can immediately generate an alarm prompt information based on the target business request, thereby improving the efficiency of emergency response and quickly eliminating security risks during data transmission.

[0176] For further information, see Figure 8 , Figure 8 Schematic diagram of a data processing device provided in an embodiment of the present application. Figure 8 As shown, the data processing device 1 may be a computer program (including program code) running in a computer device, for example, the data processing device 1 is an application software; the data processing device 1 may be used to execute the corresponding steps of the method provided in the embodiment of the present application. Figure 8 As shown, the data processing device 1 can be run on a computer device with a security defense function, and the computer device can be the above-mentioned Figure 2 The data processing device 1 may include: a target request acquisition module 11, an access sequence acquisition module 12, a decoding sequence acquisition module 13, a similarity determination module 14, a sample sequence acquisition module 15, a sample encoding module 16, a sample decoding module 17, an iterative training module 18, an alarm information generation module 19 and an alarm information sending module 20.

[0177] The target request acquisition module 11 is used to acquire the target service request, extract the communication data packet from the target service request, detect the target character string in the communication data packet based on the historical vulnerability character string in the vulnerability rule library, and obtain the target detection result.

[0178] The target request acquisition module 11 includes: a target request receiving unit 111 , a target character string determining unit 112 and a character string matching unit 113 .

[0179] The target request receiving unit 111 is used to receive a target service request sent by a user terminal based on the communication connection relationship when establishing a communication connection relationship with the user terminal; the target service request carries a communication data packet;

[0180] The target string determination unit 112 is used to extract a communication data packet from the target service request, decapsulate the communication data packet to obtain service data information, and use the string in the service data information as the target string in the communication data packet;

[0181] The string matching unit 113 is used to obtain a vulnerability rule library associated with the target service request, perform string matching on the target string and the historical vulnerability string in the vulnerability rule library, and use the string matching result as the target detection result.

[0182] The specific implementation of the target request receiving unit 111, the target string determining unit 112 and the string matching unit 113 can be found in the above Figure 3 The description of step S101 in the corresponding embodiment will not be repeated here.

[0183] The access sequence acquisition module 12 is used to filter the target string if the target detection result indicates that there is no historical vulnerability string matching the target string in the vulnerability rule library, and obtain the access token sequence corresponding to the communication data packet based on the filtered target string.

[0184] The access sequence acquisition module 12 includes: a vocabulary acquisition unit 121 and an access sequence acquisition unit 122 .

[0185] The vocabulary acquisition unit 121 is used to filter the target string if the target detection result indicates that there is no historical vulnerability string matching the target string in the vulnerability rule library, and obtain a vocabulary corresponding to the communication data packet based on the filtered target string.

[0186] The vocabulary acquisition unit 121 includes: a word segmentation processing subunit 1211 , a word segmentation frequency statistics subunit 1212 , a filtering subunit 1213 and a vocabulary acquisition subunit 1214 .

[0187] The word segmentation processing subunit 1211 is used to obtain a marking symbol in the target string, perform word segmentation processing on the target string based on the marking symbol, and obtain n word segments associated with the target string if the target detection result indicates that there is no historical vulnerability string matching the target string in the vulnerability rule library; n is a positive integer;

[0188] The word segmentation frequency counting subunit 1212 is used to count the word segmentation frequency of the i-th word segmentation in the target character string among the n word segmentations, and when the word segmentation frequency of the i-th word segmentation meets the frequency filtering condition, determine the i-th word segmentation as the word segmentation to be filtered; i is a positive integer less than or equal to n;

[0189] The filtering subunit 1213 is used to filter the to-be-filtered words among the n words, and use all the filtered words as the target character string after filtering;

[0190] The vocabulary acquisition subunit 1214 is used to add the filtered target character string to the character list, and use the added character list as the vocabulary corresponding to the communication data packet.

[0191] The specific implementation of the word segmentation processing subunit 1211, the word segmentation frequency counting subunit 1212, the filtering subunit 1213 and the vocabulary acquisition subunit 1214 can be found in the above Figure 3 The description of the vocabulary in the corresponding embodiment will not be repeated here.

[0192] The access sequence acquisition unit 122 is used to determine the filtered character strings in the target character string based on the vocabulary, and obtain the access token sequence corresponding to the communication data packet based on the filtered character strings and the target character string.

[0193] The access sequence acquisition unit 122 includes: a filtered character string determination subunit 1221 , a to-be-replaced character determination subunit 1222 and an access sequence acquisition subunit 1223 .

[0194] The filtered character string determination subunit 1221 is used to use the filtered target character string in the vocabulary as the key character string, and use the character string other than the key character string in the target character string as the filtered character string in the target character string;

[0195] The to-be-replaced character determination subunit 1222 is used to determine the character position of the to-be-replaced character in the target character string by using the filtered character string and the marking symbol as the to-be-replaced character;

[0196] The access sequence acquisition subunit 1223 is used to replace the characters to be replaced at the character positions in the target character string with placeholders, and determine the access token sequence corresponding to the communication data packet based on the replaced target character string.

[0197] The specific implementation of the filtered character string determination subunit 1221, the character to be replaced determination subunit 1222 and the access sequence acquisition subunit 1223 can be found in the above Figure 3 The description of the access token sequence in the corresponding embodiment will not be repeated here.

[0198] The specific implementation of the vocabulary acquisition unit 121 and the access sequence acquisition unit 122 can be found in the above Figure 3 The description of step S102 in the corresponding embodiment will not be repeated here.

[0199] The decoding sequence acquisition module 13 is used to encode the access token sequence to obtain the target semantic vector of the access token sequence, and decode the target semantic vector to obtain the decoding token sequence corresponding to the communication data packet.

[0200] The decoding sequence acquisition module 13 includes: a target model acquisition unit 131 , an encoding processing unit 132 and a decoding processing unit 133 .

[0201] The target model acquisition unit 131 is used to acquire a target network model associated with a communication data packet; the target network model includes a target encoding layer and a target decoding layer;

[0202] The encoding processing unit 132 is used to use the access token sequence as the target input sequence of the target network model, and input the target input sequence into the target encoding layer, and encode the target input sequence through the encoder in the target encoding layer to obtain the target semantic vector corresponding to the target input sequence.

[0203] The encoding processing unit 132 includes: an input subunit 1321 , an encoding processing subunit 1322 and a target semantic vector determination subunit 1323 .

[0204] The input subunit 1321 is used to use the access token sequence as the target input sequence of the target network model, and input the target input sequence into the target encoding layer; the target input sequence includes m character strings; m is a positive integer;

[0205] The encoding processing subunit 1322 is used to obtain a string A from m strings. x , through the encoder in the target encoding layer to the string A x Perform encoding processing to obtain string A x The corresponding semantic vector C x ; x is a positive integer less than or equal to m;

[0206] The target semantic vector determination subunit 1323 is used to determine the target semantic vector based on the character string A. x The corresponding semantic vector C x , and obtain m semantic vectors, which are used as the target semantic vectors corresponding to the target input sequence.

[0207] The specific implementation of the input subunit 1321, the encoding processing subunit 1322 and the target semantic vector determination subunit 1323 can be found in the above Figure 3 The description of the target semantic vector in the corresponding embodiment will not be repeated here.

[0208] The decoding processing unit 133 is used to input the target semantic vector into the target decoding layer, and the decoder in the target decoding layer decodes the target semantic vector to obtain a target output sequence corresponding to the target semantic vector, and uses the target output sequence as a decoding token sequence corresponding to the communication data packet.

[0209] The specific implementation of the target model acquisition unit 131, the encoding processing unit 132 and the decoding processing unit 133 can be found in the above Figure 3 The description of step S103 in the corresponding embodiment will not be repeated here.

[0210] The similarity determination module 14 is used to determine the similarity between the access token sequence and the decoding token sequence, and when the similarity does not meet the similarity condition, determine that the target vulnerability string exists in the communication data packet and intercept the target service request.

[0211] The similarity determination module 14 includes: a similarity determination unit 141 , a query unit 142 and an interception unit 143 .

[0212] The similarity determination unit 141 is used to obtain a similarity determination rule and determine the similarity between the access token sequence and the decoding token sequence based on the similarity determination rule;

[0213] The query unit 142 is used to obtain a similarity threshold in the similarity condition, and when the similarity is less than the similarity threshold, determine that the similarity does not meet the similarity condition, and query the target service request in the white list; the white list includes one or more trusted requests;

[0214] The interception unit 143 is configured to determine that a target vulnerability string exists in the communication data packet and intercept the target service request if no trusted request identical to the target service request is found in the white list.

[0215] The specific implementation of the similarity determination unit 141, the query unit 142 and the interception unit 143 can be found in the above Figure 3 The description of step S104 in the corresponding embodiment will not be repeated here.

[0216] The sample sequence acquisition module 15 is used to acquire the historical token sequence corresponding to the historical data packet in the historical service request, and use the historical token sequence as the sample token sequence for training the initial network model; the initial network model includes an initial encoding layer and an initial decoding layer.

[0217] The sample sequence acquisition module 15 includes: a sample detection unit 151 and a sample sequence acquisition unit 152 .

[0218] The sample detection unit 151 is used to obtain a historical data packet carried in a historical service request, and detect a historical string in the historical data packet based on a historical vulnerability string in a vulnerability rule base to obtain a sample detection result;

[0219] The sample sequence acquisition unit 152 is used to acquire a historical token sequence corresponding to a historical data packet if the sample detection result indicates that there is no historical vulnerability string matching the historical string in the vulnerability rule library, and use the historical token sequence as a sample token sequence for training the initial network model.

[0220] The specific implementation of the sample detection unit 151 and the sample sequence acquisition unit 152 can be found in the above Figure 5 The description of step S201 in the corresponding embodiment will not be repeated here.

[0221] The sample encoding module 16 is used to use the sample token sequence as the sample input sequence of the initial network model, and input the sample input sequence to the initial encoding layer, and encode the sample input sequence through the encoder in the initial encoding layer to obtain a sample semantic vector corresponding to the sample input sequence;

[0222] The sample decoding module 17 is used to input the sample semantic vector into the initial decoding layer, and the decoder in the initial decoding layer decodes the sample semantic vector to obtain a sample output sequence corresponding to the sample semantic vector;

[0223] The iterative training module 18 is used to iteratively train the initial network model based on the sample input sequence and the sample output sequence, and use the iteratively trained initial network model as the target network model.

[0224] The iterative training module 18 includes: a training result determination unit 181 , a transition model determination unit 182 and a model parameter adjustment unit 183 .

[0225] The training result determination unit 181 is used to iteratively train the initial network model based on the sample input sequence and the sample output sequence to obtain a model training result;

[0226] The transition model determination unit 182 is used to use the initial network model after iterative training as the transition network model when the model training result indicates that the model loss function of the initial network model after iterative training does not meet the model convergence condition;

[0227] The model parameter adjustment unit 183 is used to adjust the model parameters of the transition network model based on the model loss function that does not meet the model convergence condition, until the adjusted transition network model meets the model convergence condition, and use the transition network model that meets the model convergence condition as the target network model.

[0228] The specific implementation of the training result determination unit 181, the transition model determination unit 182 and the model parameter adjustment unit 183 can be found in the above Figure 5 The description of step S204 in the corresponding embodiment will not be repeated here.

[0229] The alarm information generating module 19 is used to generate alarm prompt information based on the target service request when determining that the target vulnerability string exists in the communication data packet;

[0230] The alarm information sending module 20 is used to send the alarm prompt information to the user terminal so that the user terminal outputs the alarm prompt information.

[0231] The specific implementation of the target request acquisition module 11, the access sequence acquisition module 12, the decoding sequence acquisition module 13, the similarity determination module 14, the sample sequence acquisition module 15, the sample encoding module 16, the sample decoding module 17, the iterative training module 18, the alarm information generation module 19 and the alarm information sending module 20 can be referred to above. Figure 3 In the corresponding embodiment, steps S101 to S104 and the above Figure 5 The description of steps S201 to S208 in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of the same method will not be repeated here either.

[0232] For further information, see Fig. 9 , Fig. 9 Schematic diagram of a computer device provided in an embodiment of the present application. Fig. 9 As shown, the computer device 1000 may be the above Figure 2Corresponding to the server 20b in the embodiment, the computer device 1000 may include: at least one processor 1001, such as a CPU, at least one network interface 1004, a user interface 1003, a memory 1005, and at least one communication bus 1002. The communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display) and a keyboard (Keyboard), and the network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1005 may optionally also be at least one storage device located away from the aforementioned processor 1001. Fig. 9 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a device control application.

[0233] exist Fig. 9 In the computer device 1000 shown, the network interface 1004 is mainly used to communicate with a user terminal (such as Figure 2 The user terminal 20a shown in the figure performs network communication; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve:

[0234] Obtain the target business request, extract the communication data packet from the target business request, detect the target string in the communication data packet based on the historical vulnerability string in the vulnerability rule library, and obtain the target detection result;

[0235] If the target detection result indicates that there is no historical vulnerability string matching the target string in the vulnerability rule library, the target string is filtered, and an access token sequence corresponding to the communication data packet is obtained based on the filtered target string;

[0236] Encoding the access token sequence to obtain a target semantic vector of the access token sequence, and decoding the target semantic vector to obtain a decoded token sequence corresponding to the communication data packet;

[0237] The similarity between the access token sequence and the decoding token sequence is determined. When the similarity does not satisfy the similarity condition, it is determined that the target vulnerability string exists in the communication data packet, and the target service request is intercepted.

[0238] It should be understood that the computer device 1000 described in the embodiment of the present application can execute the above Figure 3 and Figure 5The description of the data processing method in the corresponding embodiment can also be performed as described above. Figure 8 The description of the data processing device 1 in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of the same method will not be repeated here either.

[0239] The present application also provides a computer-readable storage medium storing a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, Figure 3 and Figure 5 For details on the data processing methods provided in each step, see Figure 3 as well as Figure 5 The implementation methods provided by each step will not be repeated here.

[0240] The computer-readable storage medium may be the data transmission device provided in any of the aforementioned embodiments or the internal storage unit of the computer device, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (smartmedia card, SMC), a secure digital (secure digital, SD) card, a flash card (flash card), etc. equipped on the computer device. Further, the computer-readable storage medium may also include both the internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.

[0241] On one hand, the present application provides a computer program product or a computer program, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device can execute the above Figure 3 or Figure 5 The description of the data processing method in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated here.

[0242] The terms "first", "second", etc. in the description, claims, and drawings of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any variation thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product, or equipment that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules that are not listed, or may optionally include other step units inherent to these processes, methods, devices, products, or equipment.

[0243] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0244] The method and related apparatus provided by the embodiment of the present application are described with reference to the method flow chart and / or structural diagram provided by the embodiment of the present application. Specifically, each process and / or box in the method flow chart and / or structural diagram, as well as the combination of the processes and / or boxes in the flow chart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the process. Figure 1 A process or multiple processes and / or structures Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or structures Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A flow or multiple flows and / or structures illustrate the steps of the functions specified in one block or multiple blocks.

[0245] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. A data processing method, characterized in that: include: Obtain a target service request, extract a communication data packet from the target service request, detect a target character string in the communication data packet based on a historical vulnerability character string in a vulnerability rule library, and obtain a target detection result; If the target detection result indicates that there is no historical vulnerability string matching the target string in the vulnerability rule library, filtering the target string, and obtaining an access token sequence corresponding to the communication data packet based on the filtered target string; Encoding the access token sequence to obtain a target semantic vector of the access token sequence, and decoding the target semantic vector to obtain a decoding token sequence corresponding to the communication data packet; The similarity between the access token sequence and the decoding token sequence is determined, and when the similarity does not satisfy a similarity condition, it is determined that a target vulnerability string exists in the communication data packet, and the target service request is intercepted.

2. The method according to claim 1, characterized in that: The step of obtaining a target service request, extracting a communication data packet from the target service request, and detecting a target character string in the communication data packet based on a historical vulnerability character string in a vulnerability rule library to obtain a target detection result includes: When establishing a communication connection relationship with a user terminal, receiving the target service request sent by the user terminal based on the communication connection relationship; the target service request carries the communication data packet; Extract the communication data packet from the target service request, decapsulate the communication data packet to obtain service data information, and use the character string in the service data information as the target character string in the communication data packet; The vulnerability rule library associated with the target service request is obtained, the target character string is matched with the historical vulnerability character string in the vulnerability rule library, and the result after the character string matching is used as the target detection result.

3. The method according to claim 1, characterized in that: If the target detection result indicates that there is no historical vulnerability string matching the target string in the vulnerability rule base, filtering the target string, and obtaining an access token sequence corresponding to the communication data packet based on the filtered target string, including: If the target detection result indicates that there is no historical vulnerability string matching the target string in the vulnerability rule base, filtering the target string, and obtaining a vocabulary corresponding to the communication data packet based on the filtered target string; Based on the vocabulary, a filtered string in the target string is determined, and based on the filtered string and the target string, the access token sequence corresponding to the communication data packet is obtained.

4. The method according to claim 3, characterized in that If the target detection result indicates that there is no historical vulnerability string matching the target string in the vulnerability rule base, filtering the target string, and obtaining a vocabulary corresponding to the communication data packet based on the filtered target string, including: If the target detection result indicates that there is no historical vulnerability string matching the target string in the vulnerability rule library, obtaining a marking symbol in the target string, performing word segmentation processing on the target string based on the marking symbol, and obtaining n word segments associated with the target string; wherein n is a positive integer; Among the n participles, the participle frequency of the i-th participle in the target character string is counted, and when the participle frequency of the i-th participle meets the frequency filtering condition, the i-th participle is determined as the participle to be filtered; i is a positive integer less than or equal to n; Filter the to-be-filtered segmented words among the n segmented words, and use all the filtered segmented words as the target character string after the filtering process; The filtered target character string is added to a character list, and the added character list is used as the vocabulary corresponding to the communication data packet.

5. The method according to claim 4, characterized in that The step of determining a filtered string in the target string based on the vocabulary, and obtaining the access token sequence corresponding to the communication data packet based on the filtered string and the target string, comprises: The filtered target character string in the vocabulary is used as a key character string, and in the target character string, the character string other than the key character string is used as the filtered character string in the target character string; In the target character string, the filtered character string and the marking symbol are used as characters to be replaced, and the character positions of the characters to be replaced are determined; In the target character string, the character to be replaced at the character position is replaced with a placeholder, and based on the replaced target character string, the access token sequence corresponding to the communication data packet is determined.

6. The method according to claim 1, characterized in that The encoding process of the access token sequence to obtain a target semantic vector of the access token sequence, and the decoding process of the target semantic vector to obtain a decoded token sequence corresponding to the communication data packet includes: Acquire a target network model associated with the communication data packet; the target network model includes a target encoding layer and a target decoding layer; Using the access token sequence as the target input sequence of the target network model, and inputting the target input sequence into the target encoding layer, encoding the target input sequence through an encoder in the target encoding layer, and obtaining the target semantic vector corresponding to the target input sequence; The target semantic vector is input into the target decoding layer, and the decoder in the target decoding layer decodes the target semantic vector to obtain a target output sequence corresponding to the target semantic vector, and the target output sequence is used as the decoding token sequence corresponding to the communication data packet.

7. The method according to claim 6, characterized in that The step of using the access token sequence as the target input sequence of the target network model, inputting the target input sequence into the target encoding layer, encoding the target input sequence through an encoder in the target encoding layer, and obtaining the target semantic vector corresponding to the target input sequence includes: The access token sequence is used as the target input sequence of the target network model, and the target input sequence is input into the target encoding layer; the target input sequence includes m strings; m is a positive integer; Get string A from the m strings x , the character string A is encoded by the encoder in the target encoding layer x Perform encoding processing to obtain the string A x The corresponding semantic vector C x ; The x is a positive integer less than or equal to the m; Based on the string A x The corresponding semantic vector C x , obtain m semantic vectors, and use the m semantic vectors as the target semantic vectors corresponding to the target input sequence.

8. The method according to claim 6, characterized in that The method further comprises: Acquire a historical token sequence corresponding to a historical data packet in a historical service request, and use the historical token sequence as a sample token sequence for training an initial network model; the initial network model includes an initial encoding layer and an initial decoding layer; Using the sample token sequence as a sample input sequence of the initial network model, and inputting the sample input sequence into the initial coding layer, encoding the sample input sequence through an encoder in the initial coding layer, and obtaining a sample semantic vector corresponding to the sample input sequence; Inputting the sample semantic vector into the initial decoding layer, and performing decoding processing on the sample semantic vector by a decoder in the initial decoding layer to obtain a sample output sequence corresponding to the sample semantic vector; Based on the sample input sequence and the sample output sequence, the initial network model is iteratively trained, and the initial network model after iterative training is used as the target network model.

9. The method according to claim 8, characterized in that The step of obtaining a historical token sequence corresponding to a historical service request and using the historical token sequence as a sample token sequence for training an initial network model includes: Acquire the historical data packet carried in the historical service request, and detect the historical character string in the historical data packet based on the historical vulnerability character string in the vulnerability rule base to obtain a sample detection result; If the sample detection result indicates that there is no historical vulnerability string matching the historical string in the vulnerability rule library, the historical token sequence corresponding to the historical data packet is obtained, and the historical token sequence is used as the sample token sequence for training the initial network model.

10. The method according to claim 8, characterized in that The iterative training of the initial network model based on the sample input sequence and the sample output sequence, and taking the iteratively trained initial network model as the target network model, comprises: Based on the sample input sequence and the sample output sequence, iteratively train the initial network model to obtain a model training result; When the model training result indicates that the model loss function of the initial network model after iterative training does not meet the model convergence condition, using the initial network model after iterative training as a transition network model; Based on the model loss function that does not meet the model convergence condition, the model parameters of the transition network model are adjusted until the adjusted transition network model meets the model convergence condition, and the transition network model that meets the model convergence condition is used as the target network model.

11. The method according to claim 1, characterized in that: The determining the similarity between the access token sequence and the decoding token sequence, and when the similarity does not satisfy a similarity condition, determining that a target vulnerability string exists in the communication data packet, and intercepting the target service request, includes: Acquire a similarity determination rule, and determine the similarity between the access token sequence and the decoding token sequence based on the similarity determination rule; Obtaining a similarity threshold in the similarity condition, and when the similarity is less than the similarity threshold, determining that the similarity does not satisfy the similarity condition, and querying the target service request in a whitelist; the whitelist includes one or more trusted requests; If no trusted request identical to the target service request is found in the whitelist, it is determined that the target vulnerability string exists in the communication data packet, and the target service request is intercepted.

12. The method according to claim 1, characterized in that The method further comprises: When it is determined that the target vulnerability string exists in the communication data packet, generating an alarm prompt information based on the target service request; The alarm prompt information is sent to a user terminal so that the user terminal outputs the alarm prompt information.

13. A data processing device, characterized in that: include: A target request acquisition module is used to acquire a target service request, extract a communication data packet from the target service request, detect a target string in the communication data packet based on a historical vulnerability string in a vulnerability rule library, and obtain a target detection result; an access sequence acquisition module, configured to filter the target string if the target detection result indicates that there is no historical vulnerability string matching the target string in the vulnerability rule library, and obtain an access token sequence corresponding to the communication data packet based on the filtered target string; A decoding sequence acquisition module, used to encode the access token sequence to obtain a target semantic vector of the access token sequence, and decode the target semantic vector to obtain a decoding token sequence corresponding to the communication data packet; The similarity determination module is used to determine the similarity between the access token sequence and the decoding token sequence, and when the similarity does not meet the similarity condition, determine that a target vulnerability string exists in the communication data packet and intercept the target service request.

14. A computer device, characterized in that: include: Processor and memory; The processor is connected to a memory, wherein the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method according to any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded and executed by a processor, so that a computer device having the processor executes the method according to any one of claims 1 to 12.