Detection method and device based on generative model

Through the detection method based on the generative model, the characteristics of the access request are extracted for comparison and verification, and exception prompt information is generated, which solves the vulnerability and backdoor detection problems in the service system, improves security, and ensures data protection.

CN118381658BActive Publication Date: 2024-11-22ZHEJIANG E COMMERCE BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410801267.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-11-22
Estimated Expiration
2044-06-20

AI Technical Summary

Technical Problem

The prior art is difficult to effectively detect and prevent vulnerabilities and backdoors in service systems, reducing the security of the service system.

Method used

The detection method based on the generative model is adopted, and the access characteristics of the access request are obtained, and exception prompt information is generated, and trusted checksum alarms are processed to improve the security of the service system.

Benefits of technology

It realizes timely detection and prevention of the service system, improves security, and ensures data protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118381658B_ABST
    Figure CN118381658B_ABST
Patent Text Reader

Abstract

The embodiments of this specification provide a detection method and device based on a generative model, wherein a detection method based on a generative model includes: after obtaining an access request for service access, extracting access features of the access request, inputting prompt words and access features into the generative model for comparison with trusted access features, and if the comparison fails, generating abnormal prompt information for the access request based on the comparison result, performing a trustworthy verification on the access request, and performing alarm processing for service access based on the abnormal prompt information after the verification passes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This document relates to the field of data processing technology, and in particular to a detection method and device based on a generative model. Background Art

[0002] In today's network environment, the service system is an important service carrier and provider platform, which collects a large amount of valuable information, such as user information, enterprise data, and customer financial information. Its importance is self-evident. Therefore, data protection for the service system has become the main protection direction of the service provider. In the current service network environment, there are many types of vulnerabilities and backdoors, which reduce the security of the service system. How to detect vulnerabilities and backdoors in real time and improve the security of the service system is the direction of future efforts of the service provider. Summary of the invention

[0003] One or more embodiments of the present specification provide a detection method based on a generative model, comprising: obtaining an access request for service access. Extracting access features from the access request to obtain access features of the access request. Inputting a prompt word and the access features into a generative model to compare with trusted access features, and if the comparison fails, generating abnormal prompt information for the access request based on the comparison result. Performing a trustworthy check on the access request, and performing alarm processing for the service access based on the abnormal prompt information after the check passes.

[0004] One or more embodiments of the present specification provide a detection device based on a generative model, including: a request acquisition module, configured to obtain an access request for service access. A feature extraction module, configured to extract access features from the access request to obtain access features of the access request. A feature comparison module, configured to compare the prompt word and the access features input into the generative model with the trusted access features, and if the comparison fails, generate abnormal prompt information for the access request based on the comparison result. An alarm module, configured to perform a trustworthy check on the access request, and perform alarm processing for the service access based on the abnormal prompt information after the check passes.

[0005] One or more embodiments of the present specification provide a detection device based on a generative model, comprising: a processor; and a memory configured to store computer executable instructions, wherein the computer executable instructions, when executed, cause the processor to: obtain an access request for service access. Perform access feature extraction on the access request to obtain access features of the access request. Input a prompt word and the access feature into a generative model for comparison with a trusted access feature, and if the comparison fails, generate abnormal prompt information for the access request based on the comparison result. Perform a trustworthy check on the access request, and perform alarm processing for the service access based on the abnormal prompt information after the check passes.

[0006] One or more embodiments of the present specification provide a computer-readable storage medium for storing computer-executable instructions, which implement the following process when executed: obtaining an access request for service access. Extracting access features from the access request to obtain access features of the access request. Inputting prompt words and the access features into a generative model to compare with trusted access features, and if the comparison fails, generating abnormal prompt information for the access request based on the comparison result. Performing a trustworthy check on the access request, and performing alarm processing for the service access based on the abnormal prompt information after the check passes. BRIEF DESCRIPTION OF THE DRAWINGS

[0007] In order to more clearly illustrate one or more embodiments of the present specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present specification. For users of ordinary skills in the art, other drawings can be obtained based on these drawings without creative labor.

[0008] Figure 1 A schematic diagram of an implementation environment of a detection method based on a generative model provided for one or more embodiments of this specification;

[0009] Figure 2 A processing flow chart of a detection method based on a generative model provided for one or more embodiments of this specification;

[0010] Figure 3 A processing flow chart of a detection method based on a generative model applied to an abnormal alarm scenario provided in one or more embodiments of this specification;

[0011] Figure 4 A schematic diagram of an embodiment of a detection device based on a generative model provided for one or more embodiments of this specification;

[0012] Figure 5 A schematic diagram of the structure of a detection device based on a generative model provided for one or more embodiments of this specification. DETAILED DESCRIPTION

[0013] In order to enable users in the technical field to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below in conjunction with the drawings in one or more embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by ordinary technical users in this field without creative work should fall within the scope of protection of this document.

[0014] The detection method based on the generative model provided in one or more embodiments of this embodiment can be applied to the implementation environment of detection based on the generative model, referring to Figure 1 , the implementation environment at least includes: a generative model 101 for performing feature comparison and comparison result generation, a server 102 for performing anomaly detection on access requests, and in addition, the implementation environment may also include a database 103 for storing page access requests and / or data access requests;

[0015] The generative model 101 may include a discriminator 101 - 1 and a generator 101 - 2;

[0016] In this implementation environment, during the process of performing anomaly detection on access requests, the server 102 obtains access requests for service access from the database 103, extracts access features of the access requests to obtain access features of the access requests, inputs the access features into the discriminator 101-1 of the generative model 101 for feature comparison to obtain comparison results, and the generator 101-2 generates abnormal prompt information for the access request based on the comparison results. When the access request is verified to be trustworthy and the verification passes, an alarm processing is performed on the service access according to the abnormal prompt information, so that the service provider can respond to abnormal network access in a timely manner, thereby improving the security of the service provider.

[0017] One or more embodiments of a detection method based on a generative model provided in this specification are as follows:

[0018] Reference Figure 2 The detection method based on the generative model provided in this embodiment specifically includes steps S202 to S208.

[0019] Step S202: obtaining an access request for accessing a service.

[0020] The detection method based on the generative model provided in the present embodiment detects the access requests contained in the network traffic data and / or log files of the service party, and promptly issues an alarm when it is detected that the access request may carry "abnormal behavior" to the service party. Specifically, after obtaining various types of access requests for service access, the access features of the access requests are extracted, and the "abnormalities" in the access requests can be detected by using these access features. The access features are input into the generative model so that the generative model compares the access features with the trusted access features, and if the comparison fails, abnormal prompt information for the access request is generated according to the comparison result. In order to ensure that the alarm is more accurate, after obtaining the abnormal prompt information output by the generative model, the access request is verified for credibility, and after the verification passes, the alarm processing of the service access is performed according to the abnormal prompt information. The abnormalities carried in the access request can be detected in time, thereby improving the security of the service party.

[0021] In this embodiment, the access request refers to a request from the accessing party to access the resources of the service provider. Optionally, the access request may be a resource access request, such as a web resource access request. Specifically, the user may enter login credentials on the login page and send the login credentials to the server via an HTTP request for verification. After the verification is passed, the service page returned by the server may be obtained. In addition, the access request may also be a data access request, such as an access request to access data stored in a database. Optionally, the access request includes at least one of the following: an HTTP request, an identity verification request, and a data query request.

[0022] The access request includes multiple request fields, each of which carries different information about the access request, such as a URL (Uniform Resource Locator) field, which is used to identify the location of the network resource that the accessing party wants to access, and another example, an access port field, which is used to identify the numeric number of a specific service process on the server, and another example, Get / Post / Put / Delete method fields. In addition, after obtaining the access request, the service provider can also obtain the address information of the accessing party, such as the IP address, according to the access request, and obtain the time information of the accessing party sending the access request, and further calculate the request frequency of the access request according to the time information.

[0023] In actual applications, there are cases where the access party uses the URL field of the access request to perform abnormal access to the service party. For example, the URL can become a carrier for SQL (Structured Query Language) injection. The access party may pass malicious code through the URL to induce the server to perform unexpected operations. The following example illustrates the process of using the URL for SQL injection: the abnormal access party may enter "' OR'1'='1" in the username field of the login form of the Web application. This string will exist in the URL and be sent to the server through the HTTP request. Since '1'='1' is always true, the final query condition is always true, which means that if there are user records in the database, this query will return at least one user record, usually the first matching user. In this way, the abnormal access party can bypass identity authentication and successfully log in to the application.

[0024] In addition, there are situations where the access party frequently sends access requests to attempt to make abnormal access to the server. In this case, whether the access request is an abnormal request can be determined by calculating the request frequency of the access request, or the access party frequently changes the IP address to initiate abnormal access to the server. Accordingly, whether the access request is an abnormal request can be determined by the characteristics related to the IP address.

[0025] In practical applications, network traffic data and log files record all behaviors in the network, including normal and abnormal behaviors. By detecting network traffic data and log files, the situation in the network can be fully understood, and alarms can be issued for abnormal situations in the network to avoid data loss on the service provider. Specifically, various types of access requests can be obtained by searching the database. In an optional implementation manner provided in this embodiment, the access request for service access is obtained in the following manner:

[0026] Searching a network database for a page access request for a service page of the access service, or searching a data access request for accessing service data of the access service;

[0027] or,

[0028] Searching the log library for a page access request to a service page of the access service, or searching for a data access request to access service data of the access service;

[0029] Optionally, the page access request is submitted by entering the page address of the service page in a browser.

[0030] Specifically, network traffic data is stored in a network database, and page access requests for service pages of access services and / or data access requests for accessing service data of access services can be searched in the network database. In addition, log files are stored in a log library, and page access requests for service pages of access services and / or data access requests for accessing service data of access services can be searched in the log library.

[0031] It should be noted that the log files and network traffic data may also be stored in the same database, and page access requests for accessing service pages of the access service and / or data access requests for accessing service data of the access service may be searched in the database.

[0032] During the specific execution process, the request field of the access request may contain an invalid request field whose field value is empty. In order to improve the correctness of subsequent feature extraction, the access request needs to be preprocessed to remove the invalid request field from the request field of the access request. In an optional implementation manner provided in this embodiment, the access request is preprocessed in the following manner:

[0033] Performing field value detection on multiple request fields included in the access request;

[0034] If there is an invalid request field whose field value is empty among the multiple request fields, the invalid request field is removed from the access request.

[0035] Specifically, the request field may be a single character, or a request field consisting of multiple characters. When the request field is a single character, character value detection is performed on multiple request characters included in the access request. If an invalid request character with a null character value exists among the multiple request characters, the invalid request character is removed from the request characters of the access request. When the request field is multiple characters, field value detection is performed on multiple request fields included in the access request. If an invalid request field with a null field value exists among the multiple request fields, the invalid request field is removed from the request fields of the access request. Optionally, the request field may be one or more of an IP address field, a Referer header field, and a request body field.

[0036] It should be noted that, in the process of preprocessing the access request, in addition to the above-mentioned method of removing invalid request fields, the noise contained in the access request can also be removed, or the incomplete fields or characters in the access request can be repaired, or the access request can be formatted. The following example is used to illustrate: in the process of preprocessing the access request, the field value detection can be performed on the multiple request fields contained in the access request. If there is an abnormal request field with an abnormal field value among the multiple request fields, the abnormal request field is removed from the request field of the access request, or the abnormal request field is repaired based on the normal field value corresponding to the abnormal request field; in addition, formatting the access request means arranging the request fields of the access request according to a preset format, or parsing the access request and filling the parsing results into the preset request template. In addition, the above-mentioned process of removing invalid request fields, removing noise, repairing fields, and formatting can be combined according to actual needs, and this embodiment is not limited here.

[0037] Step S204: extract access features from the access request to obtain access features of the access request.

[0038] The access characteristics refer to the characteristics that can characterize the access behavior of the access party, that is, the access behavior characteristics. Optionally, the access characteristics include static characteristics, which may include IP address; URL path (Uniform Resource Locator); request method (such as GET, POST, PUT, DELETE, etc.); Referer (source); request header (such as Accept, Accept-Language, Accept-Encoding, etc.); access port and other field characteristics. In addition, the access characteristics may also include dynamic characteristics, which may include at least one of the following: request frequency (that is, the number of requests per unit time); request interval (that is, the time interval between consecutive requests) and other address characteristics;

[0039] In addition, the access feature can be used as a behavior label that includes access behavior. For example, if the URL of the access request contains "' OR'1'='1", the access feature of the access request can be a behavior label that "the access request contains SQL injection". For example, if the IP of the accessing party keeps changing when sending the access request, the access feature of the access request can be a behavior label that "frequently visits".

[0040] In specific implementation, after preprocessing the access request, the access features of the access request can be extracted, so that the generative model can judge whether the access request is abnormal based on the access features. In order to make the output result of the generative model more accurate, the access features of the access request can be extracted from multiple dimensions, so that the generative model can judge whether the access request is abnormal in combination with the feature comparison results of multiple dimensions. In an optional implementation manner provided in this embodiment, the access features of the access request are extracted in the following manner:

[0041] Extracting static features from the access request to obtain static features, and extracting dynamic features from the access request to obtain dynamic features;

[0042] The static feature and the dynamic feature are subjected to feature concatenation processing to obtain the access feature.

[0043] Specifically, after extracting static features from the access request to obtain static features such as the IP address and URL path, and extracting dynamic features from the access request to obtain dynamic features such as the request frequency and request interval, the static features and the dynamic features are concatenated to obtain the access features;

[0044] In addition, feature splicing may be omitted, and static features and dynamic features may be used together as access features. That is, after the above-mentioned sub-steps of extracting static features from the access request to obtain static features and extracting dynamic features from the access request to obtain dynamic features are executed, it also includes: using the static features and the dynamic features as the access features; optionally, the access features include one or more of the static features or the dynamic features.

[0045] Step S206: input the prompt word and the access feature into the generative model for comparison with the trusted access feature, and if the comparison fails, generate abnormal prompt information for the access request according to the comparison result.

[0046] After obtaining the access request for service access and extracting the request features of the access request, in this step, the access features and prompt words are input into the generative model, so that the generative model can compare the access features with the trusted access features according to the prompt words to detect whether there are access features in the access features that are inconsistent with the trusted access features. In the case that there are access features in the access features that are inconsistent with the trusted access features (i.e., abnormal access features), abnormal prompt information for the access request is generated based on the inconsistent access features.

[0047] The generative model may be a generative AI, such as a generative adversarial network (GANs). Optionally, the generative model may include a discriminator and a generator, wherein the discriminator may compare the extracted access feature with the trusted access feature to determine whether the access feature is a trusted access feature, and the generator may generate abnormal prompt information or normal prompt information based on the judgment result of the discriminator. The trusted access feature is a baseline access feature extracted based on a trusted access request sample;

[0048] In this embodiment, the prompt word refers to text that acts on the model to help the model confirm the task type or prompt the model what content to output, such as prompt information, task description text, etc. By inputting the prompt word into the model, the model can determine the task type based on the semantic recognition result after semantically recognizing the prompt word, and output the corresponding result.

[0049] The generative model can complete multiple types of tasks. In order to clarify the task type of the generative model, a prompt word can be input into the generative model so that the generative model can determine the task type and execute the task under the task type. For example, the prompt word can be "Please help me determine whether this access request is abnormal." After receiving the prompt word, the generative model determines that the task type is a prompt information generation type, then compares the access feature with the trusted access feature, and generates prompt information based on the comparison result.

[0050] The abnormal prompt information refers to the result of determining whether the access request is abnormal, such as "the access request is abnormal", or the abnormal prompt information can also be a description statement of what kind of abnormality exists in the access request, such as "the access request contains a SQL injection of "' OR'1'='1"". It should be noted that the abnormal prompt information can include both the above-mentioned determination result and the description statement.

[0051] In the process of feature comparison by the generative model, the trusted access feature can be used as a reference feature for feature comparison. When any access feature of the access request is inconsistent with the trusted access feature or the similarity is less than the similarity threshold, it indicates that the request field or request address corresponding to any access feature is abnormal, and abnormal prompt information for the access request can be generated according to any access feature. In an optional implementation manner provided by this embodiment, the prompt word and the access feature are input into the generative model for comparison with the trusted access feature in the following manner:

[0052] Performing semantic recognition on the prompt word, and calculating the similarity between the access feature and each trusted access feature of the access request according to the semantic recognition result;

[0053] It is detected whether there is a feature similarity less than a similarity threshold value among the feature similarities obtained by calculation, and if so, it is determined that the feature comparison result is comparison failure.

[0054] Specifically, by performing semantic recognition on the prompt words, the task type of the generative model can be determined. When the task type is prompt information generation, the access features are compared with the trusted access features. In the process of comparing the access features with the trusted access features, the feature similarities of each access feature and each trusted access feature can be calculated respectively, and it is detected whether there is a feature similarity less than a similarity threshold among the calculated feature similarities. If so, it indicates that the corresponding access feature is inconsistent with the trusted access feature, that is, the access feature is an abnormal access feature, and the feature comparison result is determined to be a failed comparison; if not, it indicates that all the access features are consistent with the trusted access features, and the feature comparison result is determined to be a passed comparison.

[0055] Further, when the comparison result obtained by inputting the prompt word and the access feature into the generative model and comparing them with the trusted access feature is that the comparison fails, it indicates that there are abnormal access features in the access request, and abnormal prompt information for the access request can be generated according to the abnormal access features included in the comparison result. In an optional implementation manner provided by this embodiment, the abnormal prompt information for the access request is generated according to the comparison result in the following manner:

[0056] Extracting abnormal access features whose feature similarity contained in the comparison result is less than the similarity threshold;

[0057] An abnormal prompt corpus containing the abnormal access feature is generated, and the abnormal prompt information is generated based on the abnormal prompt corpus and the request information of the access request.

[0058] Specifically, abnormal access features whose feature similarity is less than a similarity threshold contained in the comparison results are extracted, abnormal prompt corpus corresponding to the abnormal access features is queried and extracted in the corpus, or abnormal prompt corpus containing abnormal access features is generated through the corpus generation capability of the generative model, and the abnormal prompt information is generated based on the abnormal prompt corpus and the request information of the access request.

[0059] For example, after calculating feature similarity 1 between access feature a and trusted access feature A, and calculating feature similarity 2 between access feature b and trusted access feature B, feature similarity 1 is less than the similarity threshold, then access feature a corresponding to feature similarity 1 can be extracted, and the prompt corpus corresponding to access feature a is queried in the corpus, "Access requests with access feature a may have xxx risks", and based on the prompt corpus and the request information of the access request, abnormal prompt information such as "The access request is an HTTP request and contains access feature a and access feature b, where access feature a may indicate that the access request has xxx risks" is generated.

[0060] Step S208: Perform a credibility check on the access request, and perform an alarm process on the service access according to the abnormal prompt information after the check passes.

[0061] After the above-mentioned abnormal prompt information for the access request is generated according to the comparison result, in this step, the access request is verified for credibility to verify whether the result output by the generative model (i.e., the abnormal prompt information) is accurate, to avoid alarms based on erroneous results, and to improve the security of the alarm process.

[0062] The trustworthy verification refers to the verification of whether the abnormal access features in the abnormal prompt information are really abnormal access features. If the trustworthy verification passes, it means that the abnormal access features in the abnormal prompt information are true, and further indicates that the abnormal prompt information output by the generative model is accurate; if the trustworthy verification fails, it means that the abnormal access features in the abnormal prompt information are false, and further indicates that the abnormal prompt information output by the generative model is wrong.

[0063] During the specific execution process, in the process of performing a trustworthy check on the access request, a trustworthy check may be performed on the abnormal access feature based on a trustworthy check method corresponding to the abnormal access feature contained in the abnormal prompt information. In an optional implementation manner provided in this embodiment, the following method is used to perform a trustworthy check on the access request:

[0064] Parsing the abnormal prompt information to obtain abnormal access features contained in the access request;

[0065] The abnormal access feature is subjected to a credibility check according to the credibility check method corresponding to the abnormal access feature.

[0066] Specifically, by parsing the abnormal prompt information, the abnormal access feature contained in the access request described in the abnormal prompt information is obtained, and the abnormal access feature is trusted and verified according to the trusted verification method corresponding to the abnormal access feature. The trusted verification method refers to a method for verifying whether the abnormal access feature is really an abnormal access feature.

[0067] Continuing with the above example, when the abnormal prompt information output by the generative model is: "The access request is an HTTP request, and contains access feature a and access feature b, where access feature a may indicate that the access request has xxx risk", by parsing the abnormal prompt information, the abnormal access feature is obtained as access feature a. If access feature a is SQL injection ("' OR'1'='1"), then check whether the SQL injection ("' OR'1'='1") matches the known SQL injection. If so, the check passes, indicating that the abnormal access feature in the access request is true; if not, the check fails, and feedback information for the abnormal prompt information can be input into the generative model, so that the generative model generates correct prompt information based on the feedback information.

[0068] In addition, when the result of the trustworthy verification of the access request is that the verification fails, the parameters of the generative model can be adjusted based on the feedback information generated by the trustworthy verification result to improve the generative model. In an optional implementation manner provided by this embodiment, if the result of the trustworthy verification of the access request is that the verification fails, the following operations are performed:

[0069] Generate feedback information for the abnormal prompt information;

[0070] The feedback information is input into the generative model to perform model parameter update processing, so that the generative model generates correct prompt information for the access request according to the updated model parameters.

[0071] Specifically, when the result of the trustworthy verification of the access request is that the verification fails, it indicates that the abnormal prompt information output by the generative model is error prompt information. In this case, feedback information for the abnormal prompt information can be generated, and the feedback information can be input into the generative model for model parameter updating, so that the generative model generates correct prompt information for the access request according to the updated model parameters.

[0072] For example, when the abnormal prompt information output by the generative model is: "The access request is an HTTP request, and contains access feature a and access feature b, where access feature a may indicate that the access request has xxx risk", a credibility check is performed on access feature a. If the check fails, feedback information such as "Access feature a in the access request is detected as a credible access feature" or "Your output is incorrect" is generated. The feedback information is input into the generative model to update the model parameters, so that the generative model corrects the abnormal prompt information according to the updated model parameters and generates correct prompt information for the access request.

[0073] Further, in the case where the abnormal access feature is a field feature, in the process of performing a trustworthy check on the abnormal access feature, the abnormal request field corresponding to the field feature may be compared with the preset request field. In an optional implementation manner provided by this embodiment, the following method is used to perform a trustworthy check on the abnormal access feature according to the trustworthy check method corresponding to the abnormal access feature:

[0074] In the case where the abnormal access feature is a field feature, comparing the abnormal request field corresponding to the field feature with a preset request field;

[0075] If the abnormal request field is consistent with the preset request field, it is determined that the trustworthy check has passed.

[0076] For example, when the abnormal access feature is "the access request contains SQL injection", the SQL injection field in the URL is compared with the known SQL injection field. If they are consistent, it means that the abnormal prompt information output by the generative model is the correct prompt information, and the trustworthy verification passes.

[0077] In another optional implementation manner provided by this embodiment, the abnormal access feature is verified for credibility according to the credibility verification method corresponding to the abnormal access feature in the following manner:

[0078] In the case where the abnormal access feature is a field feature, it is detected whether there is a context association between the abnormal request field and the previous field and the following field of the abnormal request field. If so, it is determined that the trust check has passed.

[0079] Using the above example, when the abnormal access feature is "the access request contains SQL injection", check whether the SQL injection field in the URL has a contextual association with the previous field and the following field. If not, it means that the URL does carry SQL injection, and the trust verification passes.

[0080] In addition, when the abnormal access feature is an address feature, in an optional implementation manner provided by this embodiment, the abnormal access feature is subjected to a trustworthy verification according to a trustworthy verification method corresponding to the abnormal access feature in the following manner:

[0081] In the case where the abnormal access feature is an address feature, calculating the number of changes of the abnormal request address corresponding to the address feature within a preset time period;

[0082] If the number of changes is greater than the change number threshold, it is determined that the trustworthiness check of the access request has passed.

[0083] For example, when the abnormal access feature is "frequent access", the number of times the IP address of the HTTP request changes within a preset time period can be calculated. If the number of changes is greater than the change threshold, it indicates that the access party sending the HTTP request performs abnormal access by changing the address, and it is determined that the trustworthiness check of the access request has passed.

[0084] During the specific execution process, based on the abnormal prompt information output by the generative model, an alarm processing of the service access can be performed. In an optional implementation manner provided in this embodiment, the alarm processing of the service access is performed according to the abnormal prompt information in the following manner:

[0085] Generate warning information based on the abnormal prompt information, and determine an information push channel for pushing the abnormal prompt information;

[0086] The alarm information is pushed to the processing personnel according to the information pushing method corresponding to the information pushing channel, so that the processing personnel intercepts and processes the access request.

[0087] For example, when the abnormal prompt information output by the generative model is: "The access request is an HTTP request, and contains access feature a and access feature b, where access feature a may indicate that the access request has xxx risk", an alarm message such as "The HTTP request has xxx risk, and the xxx risk needs to be repaired in some way" can be generated, and the alarm information can be pushed to the processing personnel through the information push method corresponding to the information push channel such as email, SMS, automatic telephone system or centralized security dashboard, so that the processing personnel can process the access request, such as blocking the IP address of the abnormal access party, strengthening input verification, or patching the SQL injection vulnerability in the program.

[0088] In summary, the detection method based on the generative model provided in this embodiment obtains an access request for service access, extracts access features from the access request, obtains access features of the access request, inputs prompt words and access features into the discriminator of the generative model for comparison with the trusted access features, and if the comparison fails, generates abnormal prompt information for the access request according to the comparison result through the generator of the generative model, performs a trustworthy verification on the access request, and performs service access alarm processing according to the abnormal prompt information after the verification passes, thereby improving the security of resources;

[0089] Furthermore, in the process of extracting access features from access requests, static features are extracted from the access requests to obtain static features, and dynamic features are extracted from the access requests to obtain dynamic features. Static features and dynamic features are spliced ​​to obtain the access features, so as to extract features from multiple dimensions, thereby improving the richness of features and thereby improving the output accuracy of the generative model.

[0090] The following takes the application of a detection method based on a generative model provided in this embodiment in an abnormal alarm scenario as an example, combined with Figure 3 , the detection method based on the generative model provided in this embodiment is further described, see Figure 3 , a detection method based on a generative model applied to abnormal alarm scenarios specifically includes the following steps.

[0091] Step S302: searching a network database for a page access request for a service page of an access service.

[0092] The page access request is submitted by entering the page address of the service page in the browser.

[0093] Optionally, step S302 may also be replaced by searching the log library for a data access request for accessing service data of the access service.

[0094] Step S304: perform field value detection on multiple request fields included in the page access request.

[0095] Step S306: If there is an invalid request field with a null value among the multiple request fields, the invalid request field is removed from the page access request.

[0096] Step S308: extract static features from the access request to obtain static features, and extract dynamic features from the access request to obtain dynamic features.

[0097] Step S310, performing feature concatenation processing on static features and dynamic features to obtain access features.

[0098] Step S312: input the prompt word and the access feature into the generative model, perform semantic recognition on the prompt word, and calculate the similarity between the access feature and each trusted access feature of the access request according to the semantic recognition result.

[0099] Step S314 , detecting whether there is a feature similarity less than a similarity threshold value among the feature similarities obtained by calculation, and if so, determining that the feature comparison result is comparison failure.

[0100] Step S316: extract access features whose feature similarity is less than a similarity threshold in the comparison result.

[0101] Step S318: query the prompt corpus corresponding to the extracted access feature, and generate abnormal prompt information based on the prompt corpus and the request information of the access request.

[0102] Step S320: parse the abnormal prompt information to obtain abnormal access features contained in the access request.

[0103] Step S322: Perform a credibility check on the abnormal access feature according to the credibility check method corresponding to the abnormal access feature.

[0104] Specifically, in the case where the abnormal access feature is a field feature, the abnormal request field corresponding to the field feature is compared with the preset request field. If the abnormal request field is consistent with the preset request field, it is determined that the trust check has passed. Alternatively, in the case where the abnormal access feature is a field feature, it is detected whether there is a contextual association between the abnormal request field and the previous field and the following field of the abnormal request field. If so, it is determined that the trust check has passed.

[0105] In addition, when the abnormal access feature is an address feature, the number of changes of the abnormal request address corresponding to the address feature within a preset time period is calculated; if the number of changes is greater than the change number threshold, it is determined that the trustworthiness check of the access request has passed.

[0106] Step S324, generating warning information based on the abnormal prompt information, and determining an information push channel for pushing the abnormal prompt information.

[0107] Step S326: Push the warning information to the processing personnel according to the information push method corresponding to the information push channel, so that the processing personnel can intercept and process the access request.

[0108] An embodiment of a detection device based on a generative model provided in this specification is as follows:

[0109] In the above-mentioned embodiment, a detection method based on a generative model is provided, and correspondingly, a detection device based on a generative model is also provided, which will be described below with reference to the accompanying drawings.

[0110] Reference Figure 4 , which shows a schematic diagram of a detection device based on a generative model provided in this embodiment.

[0111] Since the device embodiment corresponds to the method embodiment, the description is relatively simple, and the relevant parts can refer to the corresponding description of the method embodiment provided above. The device embodiment described below is only illustrative.

[0112] This embodiment provides a detection device based on a generative model, including:

[0113] A request acquisition module 402 is configured to acquire an access request for accessing a service;

[0114] The feature extraction module 404 is configured to extract access features from the access request to obtain access features of the access request;

[0115] The feature comparison module 406 is configured to input the prompt word and the access feature into the generative model for comparison with the trusted access feature, and generate abnormal prompt information for the access request according to the comparison result if the comparison fails;

[0116] The alarm module 408 is configured to perform a credibility check on the access request, and perform an alarm process on the service access according to the abnormal prompt information after the check passes.

[0117] An embodiment of a detection device based on a generative model provided in this specification is as follows:

[0118] Corresponding to the above-described detection method based on a generative model, based on the same technical concept, one or more embodiments of this specification further provide a detection device based on a generative model, and the detection device based on a generative model is used to execute the above-provided detection method based on a generative model. Figure 5 A schematic diagram of the structure of a detection device based on a generative model provided for one or more embodiments of this specification.

[0119] This embodiment provides a detection device based on a generative model, including:

[0120] like Figure 5 As shown, the detection device based on the generative model may have relatively large differences due to different configurations or performances, and may include one or more processors 501 and a memory 502, and one or more storage applications or data may be stored in the memory 502. Among them, the memory 502 may be a short-term storage or a persistent storage. The application stored in the memory 502 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the detection device based on the generative model. Further, the processor 501 may be configured to communicate with the memory 502, and execute a series of computer executable instructions in the memory 502 on the detection device based on the generative model. The detection device based on the generative model may also include one or more power supplies 503, one or more wired or wireless network interfaces 504, one or more input / output interfaces 505, one or more keyboards 506, etc.

[0121] In a specific embodiment, a detection device based on a generative model includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions for the detection device based on the generative model, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following:

[0122] Obtain access requests for service access;

[0123] Extracting access features from the access request to obtain access features of the access request;

[0124] Inputting the prompt word and the access feature into the generative model to compare with the trusted access feature, and generating abnormal prompt information for the access request according to the comparison result if the comparison fails;

[0125] The access request is verified to be trustworthy, and after the verification is passed, an alarm process for the service access is performed according to the abnormal prompt information.

[0126] An embodiment of a computer-readable storage medium provided in this specification is as follows:

[0127] Corresponding to the above-described detection method based on a generative model, based on the same technical concept, one or more embodiments of this specification also provide a computer-readable storage medium.

[0128] The computer-readable storage medium provided in this embodiment is used to store computer-executable instructions, and the computer-executable instructions implement the following process when executed:

[0129] Obtain access requests for service access;

[0130] Extracting access features from the access request to obtain access features of the access request;

[0131] Inputting the prompt word and the access feature into the generative model to compare with the trusted access feature, and generating abnormal prompt information for the access request according to the comparison result if the comparison fails;

[0132] The access request is verified to be trustworthy, and after the verification is passed, an alarm process for the service access is performed according to the abnormal prompt information.

[0133] It should be noted that an embodiment of a computer-readable storage medium in this specification and an embodiment of a detection method based on a generative model in this specification are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the aforementioned corresponding method, and the repeated parts will not be repeated.

[0134] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referenced to each other. Each embodiment focuses on the differences from other embodiments. For example, the device embodiment, equipment embodiment and computer-readable storage medium embodiment are similar to the method embodiment, so the description is relatively simple. To read the relevant contents in the device embodiment, equipment embodiment and computer-readable storage medium embodiment, please refer to the partial description of the method embodiment.

[0135] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0136] In the 1930s, it was very clear whether the improvement of a technology was hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Design users almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. The design user can "integrate" a digital system on a PLD by programming it himself, without having to ask a chip manufacturer to design and make a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs. The original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Technical users in this field should also be aware that only by slightly programming the method flow in the above-mentioned hardware description languages ​​and programming it into the integrated circuit, the hardware circuit that implements the logic method flow can be easily obtained.

[0137] The controller can be implemented in any suitable manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Users of the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller can be considered as a hardware component, and the devices for implementing various functions included therein can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.

[0138] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by commodities with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0139] For the convenience of description, the above devices are described in terms of functions and are divided into various units. Of course, when implementing the embodiments of this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0140] It should be understood by technical users in the art that one or more embodiments of this specification may be provided as a method, system or computer program commodity. Therefore, one or more embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program commodity implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0141] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart 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 produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0142] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0143] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0144] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0145] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0146] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined in this article, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0147] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0148] One or more embodiments of the present specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0149] The above description is only an embodiment of this document and is not intended to limit this document. For users of this technical field, this document may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this document should be included in the scope of the claims of this document.

Claims

1. A detection method based on a generative model, comprising: Obtain access requests for service access; Extracting static features and dynamic features from the access request, and concatenating the obtained static features and dynamic features to obtain access features of the access request; Inputting the prompt word and the access feature into the generative model to compare with the trusted access feature extracted based on the trusted access request sample, and generating abnormal prompt information for the access request according to the abnormal access feature included in the comparison result when the comparison fails; Parse the abnormal prompt information, and if the abnormal access feature obtained is a field feature, compare the abnormal request field corresponding to the field feature with the preset request field, and if the comparison is consistent, determine that the verification is passed; if the abnormal access feature obtained is an address feature, calculate the number of changes of the abnormal request address corresponding to the address feature within a preset time period, and if the number of changes is greater than the number of changes threshold, determine that the verification is passed, and perform alarm processing on the service access according to the abnormal prompt information after the verification is passed; If the verification fails, the generated feedback information for the abnormal prompt information is input into the generative model for model parameter update processing, so that the generative model generates correct prompt information for the access request according to the updated model parameters.

2. According to the generative model-based detection method of claim 1, after the step of obtaining the access request for service access is executed, and before the step of extracting static features and dynamic features from the access request, and concatenating the obtained static features and dynamic features to obtain the access features of the access request is executed, the method further comprises: Performing field value detection on multiple request fields included in the access request; If there is an invalid request field whose field value is empty among the multiple request fields, the invalid request field is removed from the access request.

3. According to the detection method based on generative model in claim 1, the comparing with the trusted access features extracted based on the trusted access request sample comprises: Performing semantic recognition on the prompt word, and calculating the similarity between the access feature and each trusted access feature of the access request according to the semantic recognition result; It is detected whether there is a feature similarity less than a similarity threshold value among the feature similarities obtained by calculation, and if so, it is determined that the feature comparison result is comparison failure.

4. According to the generative model-based detection method of claim 3, generating abnormal prompt information for the access request according to the abnormal access features included in the comparison result comprises: Extracting the abnormal access features contained in the comparison result whose feature similarity is less than the similarity threshold; An abnormal prompt corpus containing the abnormal access feature is generated, and the abnormal prompt information is generated based on the abnormal prompt corpus and the request information of the access request.

5. According to the detection method based on the generative model in claim 1, after the analysis operation of the abnormal prompt information is performed, it also includes: In the case where the abnormal access feature is a field feature, it is detected whether there is a context association between the abnormal request field and the previous field and the following field of the abnormal request field. If so, it is determined that the verification is passed.

6. According to the generative model-based detection method of claim 1, the alarm processing of the service access according to the abnormal prompt information comprises: Generate warning information based on the abnormal prompt information, and determine an information push channel for pushing the abnormal prompt information; The alarm information is pushed to the processing personnel according to the information pushing method corresponding to the information pushing channel, so that the processing personnel intercepts and processes the access request.

7. According to the generative model-based detection method of claim 1, the obtaining of the access request for service access comprises: Searching a network database for a page access request for a service page of an access service, or searching a data access request for accessing service data of an access service; or, Searching the log library for a page access request to a service page of an access service, or searching for a data access request to access service data of an access service; The page access request is submitted by inputting the page address of the service page in the browser.

8. A detection device based on a generative model, comprising: A request acquisition module configured to acquire an access request for accessing a service; A feature extraction module is configured to extract static features and dynamic features from the access request, and perform feature splicing on the obtained static features and dynamic features to obtain access features of the access request; a feature comparison module configured to input the prompt word and the access feature into a generative model and compare the trusted access feature extracted based on the trusted access request sample, and generate abnormal prompt information for the access request according to the abnormal access feature included in the comparison result if the comparison fails; The alarm module is configured to parse the abnormal prompt information, and if the abnormal access feature obtained is a field feature, compare the abnormal request field corresponding to the field feature with the preset request field, and determine that the verification is passed if the comparison is consistent; if the abnormal access feature obtained is an address feature, calculate the number of changes of the abnormal request address corresponding to the address feature within a preset time period, and determine that the verification is passed if the number of changes is greater than a change number threshold, and perform alarm processing for the service access according to the abnormal prompt information after the verification is passed; If the verification fails, the generated feedback information for the abnormal prompt information is input into the generative model for model parameter update processing, so that the generative model generates correct prompt information for the access request according to the updated model parameters.

9. A detection device based on a generative model, comprising: processor; and a memory configured to store computer executable instructions that, when executed, cause the processor to: Obtain access requests for service access; Extracting static features and dynamic features from the access request, and concatenating the obtained static features and dynamic features to obtain access features of the access request; Inputting the prompt word and the access feature into the generative model to compare with the trusted access feature extracted based on the trusted access request sample, and generating abnormal prompt information for the access request according to the abnormal access feature included in the comparison result when the comparison fails; Parse the abnormal prompt information, and if the abnormal access feature obtained is a field feature, compare the abnormal request field corresponding to the field feature with the preset request field, and if the comparison is consistent, determine that the verification is passed; if the abnormal access feature obtained is an address feature, calculate the number of changes of the abnormal request address corresponding to the address feature within a preset time period, and if the number of changes is greater than the number of changes threshold, determine that the verification is passed, and perform alarm processing on the service access according to the abnormal prompt information after the verification is passed; If the verification fails, the generated feedback information for the abnormal prompt information is input into the generative model for model parameter update processing, so that the generative model generates correct prompt information for the access request according to the updated model parameters.

10. A computer-readable storage medium for storing computer-executable instructions, wherein the computer-executable instructions implement the steps of the method of claim 1 when executed.