Domain name interface calling method and related equipment based on artificial intelligence
Through the domain name interface call method based on artificial intelligence, the classification model is used to judge the security level of domain names and interfaces, and the problems of coarse granularity of domain name whitelists and low maintenance efficiency in the existing technology are solved, and more efficient and secure interface call control is achieved.
Patent Information
- Application Number
- CN202210986670.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-17
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2042-08-17
AI Technical Summary
When the existing technology controls the website call interface, the granularity of the domain name whitelist is too coarse and it is easy to cause excessive authorization, and the website whitelist requires a lot of manpower to maintain, resulting in inefficient management and control.
The domain name interface calling method based on artificial intelligence is adopted. By collecting historical domain names and interfaces, calculating character weights, encoding them into vectors, building training data sets, training domain names and interface classification models, judging the security level of the domain names and interfaces to be identified, and making domain name interface calling decisions.
The control efficiency of domain name interface calls has been improved, and decision-making has been guided through quantitative forms, reducing the need for manpower maintenance and enhancing security.
Smart Images

Figure CN115328675B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to an artificial intelligence-based domain name interface calling method, device, electronic device and storage medium. Background Art
[0002] With the rapid development of big data technology, more and more companies tend to use website call program interfaces to achieve automated data extraction in the process of business operation to improve business operation efficiency. If the website call interface is not controlled, sensitive information on some websites may be at risk of leakage.
[0003] Currently, there are usually two ways to control the behavior of websites calling interfaces. One is to configure a domain name whitelist. However, this method has too coarse granularity and easily causes the problem of over-authorization. The other method is to configure a URL whitelist. However, this method requires a lot of manpower to maintain the URL whitelist, resulting in low control efficiency. Summary of the invention
[0004] In view of the above content, it is necessary to provide an artificial intelligence-based domain name interface calling method and related equipment to solve the technical problem of how to improve the management and control efficiency of domain name interface calling. The related equipment includes an artificial intelligence-based domain name interface calling device, electronic equipment and storage medium.
[0005] The embodiment of the present application provides a domain name interface calling method based on artificial intelligence, the method comprising:
[0006] Collecting historical domain names and historical interfaces to obtain multiple domain name characters and multiple interface characters, and respectively calculating weights of the domain name characters and weights of the interface characters;
[0007] Encode the domain name characters to obtain a domain name vector, encode the interface characters to obtain an interface vector, modify the domain name vector according to the weights of the domain name characters to obtain a domain name code, and modify the interface vector according to the weights of the interface characters to obtain an interface code;
[0008] Constructing a first training data set according to the domain name code, and constructing a second training data set according to the interface code;
[0009] Training a domain classification model based on the first training data set, and training an interface classification model based on the second training data set;
[0010] Determining the security level of the domain name to be identified based on the domain name classification model, and determining the security level of the interface to be identified based on the interface classification model;
[0011] The security level of the domain name to be identified and the security level of the interface to be identified are compared to make a domain name interface call decision.
[0012] The above-mentioned domain name interface calling method based on artificial intelligence obtains a large number of domain name codes and interface codes by encoding historical domain names and historical interfaces, and trains the domain name classification model and interface classification model according to the domain name codes and interface codes respectively, and then judges the security level of the domain name to be identified according to the domain name classification model, and judges the level of the interface to be identified according to the interface classification model, and makes a domain name interface calling decision by comparing the security level of the domain name to be identified with the security level of the interface to be identified, and guides the making of domain name interface calling decisions in a quantitative form, thereby improving the efficiency of decision making.
[0013] In some embodiments, the collecting of historical domain names and historical interfaces to obtain a plurality of domain name characters and interface characters, and calculating the weights of the domain name characters and the weights of the interface characters include:
[0014] Collect multiple historical domain names and multiple historical interfaces from a preset database, and perform word segmentation processing on the historical domain names and historical interfaces to obtain multiple domain name characters and multiple interface characters;
[0015] The word frequency of each domain name character among all domain name characters is calculated as the weight of the domain name character, and the word frequency of each interface character among all interface characters is calculated as the weight of the interface character.
[0016] In this way, by segmenting the names of multiple historical domain names and historical interfaces, multiple domain name characters and interface characters are obtained, and the word frequency of each domain name character and each interface character is calculated as the weight corresponding to the character. The importance of each domain name character and each interface character can be represented in a quantitative manner, thereby improving the accuracy of subsequent domain name encoding and interface encoding.
[0017] In some embodiments, encoding the domain name characters to obtain a domain name vector, encoding the interface characters to obtain an interface vector, modifying the domain name vector according to the weights of the domain name characters to obtain a domain name code, and modifying the interface vector according to the weights of the interface characters to obtain an interface code, comprises:
[0018] Constructing a domain name co-occurrence matrix based on the domain name characters, and constructing an interface co-occurrence matrix based on the interface characters;
[0019] Extracting a domain name vector corresponding to each domain name character from the domain name co-occurrence matrix, and extracting an interface vector corresponding to each interface character from the interface co-occurrence matrix;
[0020] The product of the weight of the domain name character and the domain name vector is calculated as the domain name code corresponding to the domain name character, and the product of the weight of the interface character and the interface vector is calculated as the interface code corresponding to the interface character.
[0021] In this way, the domain name vector corresponding to the domain name characters is obtained by constructing the domain name co-occurrence matrix, and the interface vector corresponding to the interface characters is obtained by constructing the interface co-occurrence matrix. The domain name code is further calculated based on the weights of the domain name vector and the domain name characters, and the interface code is calculated based on the weights of the interface vector and the interface characters, thereby providing data support for the subsequent training of the domain name classification model and the interface classification model.
[0022] In some embodiments, constructing a first training data set according to the domain name encoding, and constructing a second training data set according to the interface encoding, includes:
[0023] The number of domain name characters contained in the historical domain name is used as the length of the historical domain name, and the maximum value of all historical domain name lengths is used as the domain name base value;
[0024] The number of interface characters contained in the historical interface is used as the length of the historical interface, and the maximum value of all historical interface lengths is used as the interface reference value;
[0025] Adding a plurality of first zero vectors after the domain name code corresponding to the historical domain name to obtain domain name sample data corresponding to the historical domain name, wherein the total number of domain name codes and first zero vectors included in the domain name sample data is the same as the domain name reference value;
[0026] Adding a plurality of second zero vectors after the interface code corresponding to the historical interface to obtain interface sample data corresponding to the historical interface, wherein the total number of interface codes and second zero vectors included in the interface sample data is the same as the interface reference value;
[0027] Labeling the domain name sample data to obtain first label data, and labeling the interface sample data to obtain second label data;
[0028] The domain name sample data and the first label data are used in a one-to-one correspondence as a first training data set, and the interface sample data and the second label data are used in a one-to-one correspondence as a second training data set.
[0029] In this way, domain name sample data is obtained by completing the domain name codes corresponding to historical domain names, and interface sample data is obtained by completing the interface codes corresponding to historical interfaces. Quantitative data of the same dimension are used to represent historical domain names and historical interfaces, providing data support for subsequent training of domain name classification models and interface classification models.
[0030] In some embodiments, the training of the domain classification model based on the first training data set and the training of the interface classification model based on the second training data set include:
[0031] Constructing an initial domain name classification model, wherein the initial domain name classification model includes a first encoder and a first classifier;
[0032] Constructing an initial interface classification model, wherein the initial interface classification model includes a second encoder and a second classifier;
[0033] Training an initial domain name classification model according to the first training data set and a preset first loss function until a value of the first loss function is less than a preset first termination threshold, stopping the training and obtaining a domain name classification model;
[0034] The initial interface classification model is trained according to the second training data set and a preset second loss function until the value of the second loss function is less than a preset second termination threshold, and the training is stopped to obtain the interface classification model.
[0035] In this way, by training the domain name classification model and the interface classification model with a large amount of data, the robustness of the domain name classification model and the interface classification model can be improved, thereby improving the accuracy of subsequent domain name classification and interface classification.
[0036] In some embodiments, the determining the security level of the domain name to be identified based on the domain name classification model, and determining the security level of the interface to be identified based on the interface classification model, includes:
[0037] Perform word segmentation on the domain name to be identified to obtain the domain name characters to be identified, query the domain name code corresponding to the domain name characters to be identified, and construct the domain name sample data corresponding to the domain name to be identified according to the domain name code to be identified;
[0038] Perform word segmentation on the interface to be identified to obtain the interface character to be identified, query the interface code corresponding to the interface character to be identified, and construct the interface sample data to be identified corresponding to the interface to be identified according to the interface code to be identified;
[0039] Input the sample data of the domain name to be identified into the domain classification model to obtain a predicted security level probability list corresponding to the domain name to be identified, and input the sample data of the interface to be identified into the interface classification model to obtain a predicted security level probability list corresponding to the interface to be identified;
[0040] The category corresponding to the maximum value in the predicted security level probability list of the domain name to be identified is selected as the security level of the domain name to be identified, and the category corresponding to the maximum value in the predicted security level probability list of the interface to be identified is selected as the security level of the interface to be identified.
[0041] In this way, the security level of the domain name to be identified is obtained through the domain name classification model, and the security level of the interface to be identified is obtained through the interface classification model. Without the need for manual judgment on the security level of the domain name and the interface, data support can be provided for the subsequent formulation of domain name interface release decisions, thereby improving the efficiency of the domain name release strategy.
[0042] In some embodiments, the domain name to be identified corresponds to a plurality of web addresses to be identified, and comparing the security level of the domain name to be identified with the security level of the interface to be identified to make a domain name interface call decision includes:
[0043] If the security level of the domain name to be identified is not greater than the security level of the interface to be identified, calling the interface to be identified using the domain name to be identified to complete the domain name interface call;
[0044] If the security level of the domain name to be identified is greater than the security level of the interface to be identified, constructing multiple key-value pairs to be identified according to multiple URLs to be identified corresponding to the domain name to be identified and the interface to be identified;
[0045] If the key-value pair to be identified can be found in the preset scheduling whitelist, the interface to be identified is called using the URL to be identified to complete the domain name interface call, otherwise an illegal call alarm is issued to the developer.
[0046] In this way, by comparing the security level of the domain name to be identified with the security level of the interface to be identified to make a domain name calling interface decision, the security of the domain name calling interface can be intelligently judged in a quantitative form, thereby improving the efficiency of formulating domain name calling interface strategies.
[0047] The embodiment of the present application also provides a domain name interface calling device based on artificial intelligence, the device comprising:
[0048] A collection unit, used for collecting historical domain names and historical interfaces to obtain a plurality of domain name characters and a plurality of interface characters, and respectively calculating the weights of the domain name characters and the weights of the interface characters;
[0049] An encoding unit, used for encoding the domain name characters to obtain a domain name vector, encoding the interface characters to obtain an interface vector, modifying the domain name vector according to the weights of the domain name characters to obtain a domain name code, and modifying the interface vector according to the weights of the interface characters to obtain an interface code;
[0050] A construction unit, configured to construct a first training data set according to the domain name code, and to construct a second training data set according to the interface code;
[0051] A training unit, configured to train a domain classification model according to the first training data set, and to train an interface classification model according to the second training data set;
[0052] a classification unit, configured to determine the security level of the domain name to be identified based on the domain name classification model, and to determine the security level of the interface to be identified based on the interface classification model;
[0053] The comparison unit is used to compare the security level of the domain name to be identified and the security level of the interface to be identified to make a domain name interface call decision.
[0054] The present application also provides an electronic device, the electronic device comprising:
[0055] a memory storing computer readable instructions; and
[0056] The processor executes the computer-readable instructions stored in the memory to implement the artificial intelligence-based domain name interface calling method.
[0057] An embodiment of the present application also provides a computer-readable storage medium, in which computer-readable instructions are stored. The computer-readable instructions are executed by a processor in an electronic device to implement the artificial intelligence-based domain name interface calling method.
[0058] The above-mentioned domain name interface calling method based on artificial intelligence obtains a large number of domain name codes and interface codes by encoding historical domain names and historical interfaces, and trains the domain name classification model and interface classification model according to the domain name codes and interface codes respectively, and then judges the security level of the domain name to be identified according to the domain name classification model, and judges the level of the interface to be identified according to the interface classification model, and makes a domain name interface calling decision by comparing the security level of the domain name to be identified with the security level of the interface to be identified, and guides the making of domain name interface calling decisions in a quantitative form, thereby improving the efficiency of decision making. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 It is a flowchart of a preferred embodiment of a domain name interface calling method based on artificial intelligence involved in this application.
[0060] Figure 2 It is a functional module diagram of a preferred embodiment of the domain name interface calling device based on artificial intelligence involved in this application.
[0061] Figure 3 It is a structural diagram of an electronic device of a preferred embodiment of the domain name interface calling method based on artificial intelligence involved in the present application.
[0062] Figure 4a It is a structural diagram of the domain name security level list involved in the embodiment of the present application.
[0063] Figure 4bIt is a structural diagram of the interface security level list involved in the embodiment of the present application.
[0064] Figure 5 It is a structural diagram of the domain name co-occurrence matrix involved in the embodiment of the present application.
[0065] Figure 6 It is a structural diagram of the initial domain name classification model involved in the embodiment of the present application. DETAILED DESCRIPTION
[0066] In order to more clearly understand the purpose, features and advantages of the present application, the present application is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that, in the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other. In the following description, many specific details are set forth to facilitate a full understanding of the present application, and the embodiments described are only a part of the embodiments of the present application, rather than all of the embodiments.
[0067] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0068] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by those skilled in the art to which the present application belongs. The terms used herein in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0069] The embodiment of the present application provides a domain name interface calling method based on artificial intelligence, which can be applied to one or more electronic devices. The electronic device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a programmable gate array (Field-Programmable Gate Array, FPGA), a digital processor (Digital Signal Processor, DSP), an embedded device, etc.
[0070] The electronic device may be any electronic product that can perform human-computer interaction with a user, such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an interactive network television (IPTV), a smart wearable device, etc.
[0071] The electronic device may also include a network device and / or a user device, wherein the network device includes, but is not limited to, a single network server, a server group consisting of multiple network servers, or a cloud consisting of a large number of hosts or network servers based on cloud computing.
[0072] The network where the electronic device is located includes but is not limited to the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (VPN), etc.
[0073] like Figure 1 , which is a flow chart of a preferred embodiment of the domain name interface calling method based on artificial intelligence of the present application. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted.
[0074] S10, collecting historical domain names and historical interfaces to obtain a plurality of domain name characters and a plurality of interface characters, and respectively calculating the weights of the domain name characters and the weights of the interface characters.
[0075] In an optional embodiment, the collecting of historical domain names and historical interfaces to obtain a plurality of domain name characters and interface characters, and calculating the weights of the domain name characters and the weights of the interface characters include:
[0076] Collect multiple historical domain names and multiple historical interfaces from a preset database, and perform word segmentation processing on the historical domain names and historical interfaces to obtain multiple domain name characters and multiple interface characters;
[0077] The word frequency of each domain name character among all domain name characters is calculated as the weight of the domain name character, and the word frequency of each interface character among all interface characters is calculated as the weight of the interface character.
[0078] In this optional embodiment, multiple historical domain names and multiple historical interfaces can be extracted from a preset database. The function of the historical domain name is to call the historical interface to extract or monitor data from multiple URLs corresponding to the historical domain name. Exemplarily, the format of the historical domain name can be www.baidu.com, www.google.com, and the name of the historical interface can be Node.nodeValue, Node.textContent.
[0079] In this optional embodiment, the historical domain name and the name of the historical interface can be segmented according to a preset segmentation tool to obtain multiple domain name characters and multiple interface characters. The preset segmentation tool can be an existing segmentation tool such as the jieba segmentation tool, the NLTK segmentation tool (Natural Language Toolkit), the LTP segmentation tool (Language Technology Platform), etc., and this application does not limit this.
[0080] For example, when the format of a historical domain name is www.baidu.com, the multiple domain name characters corresponding to the historical domain name are www, baidu, and com; when the format of a historical interface is "Node.nodeValue", the multiple interface characters corresponding to the historical interface are Node, node, and Value.
[0081] In this optional embodiment, the frequency of each domain name character among all domain name characters can be calculated as the weight corresponding to the domain name character, and the frequency of each interface character among all interface characters can be calculated as the weight corresponding to the interface character.
[0082] In this way, by segmenting the names of multiple historical domain names and historical interfaces, multiple domain name characters and interface characters are obtained, and the word frequency of each domain name character and each interface character is calculated as the weight corresponding to the character. The importance of each domain name character and each interface character can be represented in a quantitative manner, thereby improving the accuracy of subsequent domain name encoding and interface encoding.
[0083] S11, encode the domain name characters to obtain a domain name vector, encode the interface characters to obtain an interface vector, modify the domain name vector according to the weights of the domain name characters to obtain a domain name code, and modify the interface vector according to the weights of the interface characters to obtain an interface code.
[0084] In an optional embodiment, encoding the domain name characters to obtain a domain name vector, encoding the interface characters to obtain an interface vector, modifying the domain name vector according to the weights of the domain name characters to obtain a domain name code, and modifying the interface vector according to the weights of the interface characters to obtain an interface code, comprises:
[0085] Constructing a domain name co-occurrence matrix based on the domain name characters, and constructing an interface co-occurrence matrix based on the interface characters;
[0086] Extracting a domain name vector corresponding to each domain name character from the domain name co-occurrence matrix, and extracting an interface vector corresponding to each interface character from the interface co-occurrence matrix;
[0087] The product of the weight of the domain name character and the domain name vector is calculated as the domain name code corresponding to the domain name character, and the product of the weight of the interface character and the interface vector is calculated as the interface code corresponding to the interface character.
[0088] In this optional embodiment, a domain name co-occurrence matrix can be constructed based on the domain name characters, and an interface co-occurrence matrix can be constructed based on the interface characters. The name of each row of the domain name co-occurrence matrix corresponds to a domain name character, the name of each column corresponds to a domain name character, and the name of the row where the elements with the same row coordinates and column coordinates in the domain name co-occurrence matrix are located is the same as the name of the column where they are located; the name of each row of the interface co-occurrence matrix corresponds to an interface character, the name of each column corresponds to an interface character, and the name of the row where the elements with the same row coordinates and column coordinates in the interface co-occurrence matrix are located is the same as the name of the column where they are located.
[0089] In this optional embodiment, taking the domain name co-occurrence matrix as an example, the value of each element in the domain name co-occurrence matrix may be initialized to 0, and each historical domain name is traversed to assign a value to each element in the domain name co-occurrence matrix. The specific method of the assignment is:
[0090] Selecting an element from the domain name co-occurrence matrix as a target element, taking the row name corresponding to the target element as a central character, and taking the column name corresponding to the target element as a neighboring character;
[0091] Traverse each historical domain name in turn. If the central character exists in the historical domain name and the preceding character of the central character is the neighboring character, the element value of the target element is increased by 1. If the following character of the central character is the neighboring character, the element value of the target element is also increased by 1.
[0092] Each element in the domain name co-occurrence matrix is used as a target element in turn to obtain a value of each element.
[0093] like Figure 5Shown is a schematic structural diagram of the domain name co-occurrence matrix.
[0094] In this optional embodiment, the value of each element in the interface co-occurrence matrix can be initialized to 0, and each historical interface can be traversed to assign a value to each element in the interface co-occurrence matrix. The assignment method is the same as the assignment method of the domain name co-occurrence matrix, which will not be repeated here.
[0095] In this optional embodiment, the elements of each row in the domain name co-occurrence matrix can be arranged from left to right to form a domain name vector of the domain name characters corresponding to the name of the row, and the dimension of the domain name vector is equal to the number of all domain name characters; and the elements of each row in the interface co-occurrence matrix can be arranged from left to right to form an interface vector of the interface characters corresponding to the name of the row, and the dimension of the interface vector is equal to the number of all interface characters.
[0096] In this optional embodiment, the product of the weight of the domain name characters and the domain name vector may be calculated as the domain name code; and the product of the weight of the interface characters and the interface vector may be calculated as the interface code.
[0097] In this optional embodiment, the domain name characters can be used as keys and the domain name codes can be used as values to construct domain name key-value pairs, and the domain name key-value pairs are uniformly stored to obtain a domain name code hash table; and the interface characters can be used as keys and the interface codes can be used as values to construct interface key-value pairs, and the interface key-value pairs are uniformly stored to obtain an interface code hash table.
[0098] In this way, the domain name vector corresponding to the domain name characters is obtained by constructing the domain name co-occurrence matrix, and the interface vector corresponding to the interface characters is obtained by constructing the interface co-occurrence matrix. The domain name code is further calculated based on the weights of the domain name vector and the domain name characters, and the interface code is calculated based on the weights of the interface vector and the interface characters, thereby providing data support for the subsequent training of the domain name classification model and the interface classification model.
[0099] S12, constructing a first training data set according to the domain name code, and constructing a second training data set according to the interface code.
[0100] In an optional embodiment, constructing a first training data set according to the domain name code and constructing a second training data set according to the interface code includes:
[0101] The number of domain name characters contained in the historical domain name is used as the length of the historical domain name, and the maximum value of all historical domain name lengths is used as the domain name base value;
[0102] The number of interface characters contained in the historical interface is used as the length of the historical interface, and the maximum value of all historical interface lengths is used as the interface reference value;
[0103] Adding a plurality of first zero vectors after the domain name codes corresponding to all the domain name characters in the historical domain name to obtain domain name sample data corresponding to the historical domain name, wherein the total number of domain name codes and first zero vectors included in the domain name sample data is the same as the domain name reference value;
[0104] Adding a plurality of second zero vectors after the interface codes corresponding to all interface characters in the historical interface to obtain interface sample data corresponding to the historical interface, wherein the total number of interface codes and second zero vectors included in the interface sample data is the same as the interface reference value;
[0105] Labeling the domain name sample data to obtain first label data, and labeling the interface sample data to obtain second label data;
[0106] The domain name sample data and the first label data are used in a one-to-one correspondence as a first training data set, and the interface sample data and the second label data are used in a one-to-one correspondence as a second training data set.
[0107] In this optional embodiment, the number of domain name characters included in the historical domain name can be used as the length of each historical domain name, and the number of interface characters included in the historical interface can be used as the length of each historical interface.
[0108] In this optional embodiment, the maximum value of the lengths of all historical domain names can be recorded as the domain name reference value, and the domain name reference value can be recorded as maxlen 域名 ; and the maximum value of all historical interface lengths can be recorded as the interface reference value, and the interface reference value can be recorded as maxlen 接口 .
[0109] In this optional embodiment, if the length of a historical domain name is less than the domain name reference value maxlen 域名 , then add multiple first zero vectors after all domain name codes corresponding to the historical domain name to obtain domain name sample data corresponding to the historical domain name, the dimension of the first zero vector is the same as the dimension of the domain name code corresponding to the domain name character, and the value of each dimension in the first zero vector is 0, and the number of the multiple first zero vectors is the same as the maxlen 域名 The difference between the length of the historical domain name and the length of the historical domain name is equal; if the length of a historical interface is less than the interface reference value maxlen 接口 , then add multiple second zero vectors after all interface codes corresponding to the historical interface to obtain the interface sample data corresponding to the historical interface, the dimension of the second zero vector is the same as the dimension of the interface code corresponding to the interface character, and the value of each dimension in the second zero vector is 0, and the number of the multiple second zero vectors is the same as the maxlen 接口 The difference between the length of the previous interface and the length of the historical interface is equal.
[0110] In this optional embodiment, the security level corresponding to each historical domain name can be queried from a preset domain name security level list, and the security level corresponding to the historical domain name is used as the category of the domain name sample data corresponding to the historical domain name. A security level probability list of the historical domain name is constructed according to the category corresponding to the historical domain name. Each element in the security level probability list of the historical domain name is used to represent the probability that the historical domain name belongs to a certain category. The security level corresponding to the historical domain name includes low risk, medium risk and high risk. For example, Figure 4a The diagram shown is a structural diagram of the domain name security level list. The security level probability list corresponding to the historical domain name can be used as the first label data corresponding to the historical domain name.
[0111] Exemplarily, when the security level corresponding to a historical domain name is low risk, the security level probability list of the historical domain name is [1,0,0]. The security level probability list is used to represent that the probability that the historical domain name belongs to the low risk category is 100%, and the probability of belonging to the medium risk category and the probability of belonging to the high risk category are 0.
[0112] In this optional embodiment, the security level corresponding to each historical interface can be queried from a preset interface security level list, and the security level corresponding to the historical interface is used as the category of the interface sample data corresponding to the historical interface. A security level probability list of the historical interface is constructed based on the category corresponding to the historical interface. Each element in the security level probability list of the historical interface is used to characterize the probability that the historical domain name belongs to a certain category. The security levels corresponding to the historical interfaces include low risk, medium risk and high risk. For example, Figure 4b Shown is a schematic diagram of the structure of the interface security level list.
[0113] Exemplarily, when the security level corresponding to a historical interface is high risk, the security level probability list of the historical interface is [0,0,1]. The security level probability list is used to represent that the probability of the historical interface belonging to the high risk category is 100%, and the probability of belonging to the low risk category and the probability of belonging to the medium risk category are 0.
[0114] In this optional embodiment, the domain name sample data and the first label data may be in one-to-one correspondence as a first training data set, and the interface sample data and the second label data may be in one-to-one correspondence as a second training data set.
[0115] In this way, domain name sample data is obtained by completing the domain name codes corresponding to all domain name characters in historical domain names, and interface sample data is obtained by completing the interface codes corresponding to all interface characters in historical interfaces. Quantitative data of the same dimension are used to represent historical domain names and historical interfaces, providing data support for subsequent training of domain name classification models and interface classification models.
[0116] S13: training a domain name classification model based on the first training data set, and training an interface classification model based on the second training data set.
[0117] In an optional embodiment, training a domain classification model based on the first training data set and training an interface classification model based on the second training data set includes:
[0118] Constructing an initial domain name classification model, wherein the initial domain name classification model includes a first encoder and a first classifier;
[0119] Constructing an initial interface classification model, wherein the initial interface classification model includes a second encoder and a second classifier;
[0120] Training an initial domain name classification model according to the first training data set and a preset first loss function until a value of the first loss function is less than a preset first termination threshold, stopping the training and obtaining a domain name classification model;
[0121] The initial interface classification model is trained according to the second training data set and a preset second loss function until the value of the second loss function is less than a preset second termination threshold, and the training is stopped to obtain the interface classification model.
[0122] In this optional embodiment, if Figure 6 The figure shows a schematic diagram of the structure of the initial domain name classification model described in the present scheme. In the initial domain name classification model, the first encoder is composed of a plurality of first neurons connected in series, the number of the plurality of first neurons is the same as the total number of domain name codes and first zero vectors in the domain name sample data, the input of each first neuron in the first encoder corresponds to a domain name code or a first zero vector in the domain name sample data, and the output of the first encoder is a first feature vector corresponding to the domain name sample data; the input of the first classifier is the first feature vector, and the output of the first classifier is a predicted security level probability list corresponding to the domain name sample data, and each element in the predicted security level probability list is used to represent the probability value of the domain name sample data belonging to each category.
[0123] In this optional embodiment, in order to ensure that the predicted security level probability list corresponding to the domain name sample data and the security level probability list corresponding to the first label data are as similar as possible, the predicted security level probability list corresponding to the domain name sample data in the first training data set and the security level probability list corresponding to the first label data can be input into a preset first loss function in sequence to calculate the first loss value of the initial domain name classification model, and the parameters in the initial domain name classification model are iteratively updated according to the gradient descent algorithm until the first loss value of the initial domain name classification model is less than a preset first termination threshold, then the training is stopped and the domain name classification model is obtained, the preset first loss function can be a cross entropy loss function, and the preset first termination threshold can be 0.001.
[0124] In this optional embodiment, the initial interface classification model includes a second encoder and a second classifier, the second encoder is composed of a plurality of second neurons connected in series, the number of the plurality of second neurons is the same as the number of interface codes in the interface sample data, the input of each second neuron in the second encoder corresponds to an interface code or a second zero vector in the interface sample data, the output of the second encoder is a second feature vector corresponding to the interface sample data; the input of the second classifier is the second feature vector, and the output of the second classifier is a predicted security level probability list corresponding to the interface sample data.
[0125] In this optional embodiment, the initial interface classification model may be trained based on the second training data set to obtain an interface classification model. The training process of the interface classification model is the same as the training process of the domain name classification model, which will not be repeated here.
[0126] In this way, by training the domain name classification model and the interface classification model with a large amount of data, the robustness of the domain name classification model and the interface classification model can be improved, thereby improving the accuracy of subsequent domain name classification and interface classification.
[0127] S14, determining the security level of the domain name to be identified based on the domain name classification model, and determining the security level of the interface to be identified based on the interface classification model.
[0128] In an optional embodiment, the determining the security level of the domain name to be identified based on the domain name classification model, and determining the security level of the interface to be identified based on the interface classification model, includes:
[0129] Perform word segmentation on the domain name to be identified to obtain the domain name characters to be identified, query the domain name code corresponding to the domain name characters to be identified, and construct the domain name sample data corresponding to the domain name to be identified according to the domain name code to be identified;
[0130] Perform word segmentation on the interface to be identified to obtain the interface character to be identified, query the interface code corresponding to the interface character to be identified, and construct the interface sample data to be identified corresponding to the interface to be identified according to the interface code to be identified;
[0131] Input the sample data of the domain name to be identified into the domain classification model to obtain a predicted security level probability list corresponding to the domain name to be identified, and input the sample data of the interface to be identified into the interface classification model to obtain a predicted security level probability list corresponding to the interface to be identified;
[0132] The category corresponding to the maximum value in the predicted security level probability list of the domain name to be identified is selected as the security level of the domain name to be identified, and the category corresponding to the maximum value in the predicted security level probability list of the interface to be identified is selected as the security level of the interface to be identified.
[0133] In this optional embodiment, the domain name to be identified includes multiple web addresses to be identified, and the function of the domain name to be identified is to call the interface to be identified to monitor or extract data from the multiple web addresses to be identified.
[0134] In this optional embodiment, the domain name to be identified can be segmented according to the preset segmentation tool to obtain multiple domain name characters to be identified, and the interface to be identified can be segmented according to the preset segmentation tool to obtain multiple interface characters to be identified.
[0135] In this optional embodiment, the domain name code corresponding to each to-be-identified domain name character can be queried from the domain name code hash table as the to-be-identified domain name code, and all to-be-identified domain name codes corresponding to the to-be-identified domain name are combined into to-be-identified domain name sample data. If the length of the to-be-identified domain name is less than the domain name reference value maxlen 域名 , then add multiple first zero vectors after the domain name code to obtain sample domain name data, the dimension of the first zero vector is the same as the dimension of the domain name code, and the value of each dimension in the first zero vector is 0, and the number of the multiple first zero vectors is the same as the maxlen 域名 The difference between the length of the domain name to be identified and the length of the domain name to be identified is equal.
[0136] In this optional embodiment, the interface code corresponding to each interface character to be identified can be queried as the interface code to be identified, and the interface codes to be identified corresponding to the interface to be identified are combined into the interface sample data to be identified. If the length of the interface to be identified is less than the interface reference value maxlen 接口, then add multiple second zero vectors after the interface code to be identified corresponding to the interface to be identified to obtain the interface sample data to be identified, the dimension of the second zero vector is the same as the dimension of the interface code, and the value of each dimension in the second zero vector is 0, and the number of the multiple second zero vectors is the same as the maxlen 接口 The difference between the length of the interface to be identified and the length of the interface to be identified is equal.
[0137] In this optional embodiment, each domain name code to be identified in the domain name sample data to be identified can be input into the first encoder of the domain name classification model in turn to obtain the output result of the domain name classification model, and the output result of the domain name classification model is a predicted security level probability list corresponding to the domain name to be identified.
[0138] Exemplarily, when the predicted security level probability list corresponding to the domain name sample data to be identified is [0.9, 0.1, 0], the probability that the domain name to be identified corresponding to the domain name sample data to be identified belongs to the low-risk category is 0.9, the probability that it belongs to the medium-risk category is 0.1, and the probability that it belongs to the high-risk category is 0.
[0139] In this optional embodiment, each interface code to be identified in the sample data of interfaces to be identified may be sequentially input into the second encoder of the interface classification model to obtain a predicted security level probability list corresponding to the interfaces to be identified.
[0140] Exemplarily, when the predicted security level probability list corresponding to the sample data of the interface to be identified is [0.2, 0.3, 0.5], the probability that the interface to be identified corresponding to the sample data of the interface to be identified belongs to the low-risk category is 0.2, the probability that it belongs to the medium-risk category is 0.3, and the probability that it belongs to the high-risk category is 0.5.
[0141] In this optional embodiment, the category corresponding to the maximum value in the predicted security level probability list of the domain name to be identified can be selected as the security level of the domain name to be identified, and the category corresponding to the maximum value in the predicted security level probability list of the interface to be identified can be selected as the security level of the interface to be identified.
[0142] Exemplarily, when the predicted security level probability list corresponding to the domain name to be identified is [0.9, 0.1, 0], its maximum value is 0.9, then the category corresponding to the domain name to be identified is low risk; when the predicted security level probability list corresponding to the interface to be identified is [0.2, 0.3, 0.5], its maximum value is 0.5, then the category corresponding to the interface to be identified is high risk.
[0143] In this way, the security level of the domain name to be identified is obtained through the domain name classification model, and the security level of the interface to be identified is obtained through the interface classification model. Without the need for manual judgment on the security level of the domain name and the interface, data support can be provided for the subsequent formulation of domain name interface release decisions, thereby improving the efficiency of the domain name release strategy.
[0144] S15, comparing the security level of the domain name to be identified and the security level of the interface to be identified to make a domain name interface call decision.
[0145] In an optional embodiment, the domain name to be identified corresponds to a plurality of web addresses to be identified, and the step of comparing the security level of the domain name to be identified with the security level of the interface to be identified to make a domain name interface call decision includes:
[0146] If the security level of the domain name to be identified is not greater than the security level of the interface to be identified, calling the interface to be identified using the domain name to be identified to complete the domain name interface call;
[0147] If the security level of the domain name to be identified is greater than the security level of the interface to be identified, constructing multiple key-value pairs to be identified according to multiple URLs to be identified corresponding to the domain name to be identified and the interface to be identified;
[0148] If the key-value pair to be identified can be found in the preset scheduling whitelist, the interface to be identified is called using the URL to be identified to complete the domain name interface call, otherwise an illegal call alarm is issued to the developer.
[0149] In this optional embodiment, the security levels are in descending order: high risk, medium risk, and low risk.
[0150] In this optional embodiment, the security level of the domain name to be identified can be compared with the security level of the interface to be identified. If the security level of the domain name to be identified is not greater than the security level of the interface to be identified, it indicates that the content contained in the domain name to be identified is not sensitive information, and the domain name to be identified can be allowed to call the interface to be identified to extract or monitor various information stored in the domain name to be identified.
[0151] In this optional embodiment, if the security level of the domain name to be identified is greater than the security level of the interface to be identified, it indicates that the data stored in the domain name to be identified is relatively sensitive, and it is necessary to further determine whether the domain name to be identified can call the interface to be identified. Each URL to be identified corresponding to the domain name to be identified can be used as a key, and the interface to be identified can be used as a value to construct multiple key-value pairs to be identified, and the number of the key-value pairs to be identified is the same as the number of URLs to be identified corresponding to the domain name to be identified.
[0152] In this optional embodiment, each key-value pair to be identified can be queried from a preset scheduling whitelist. If the key-value pair to be identified can be found, it indicates that the interface to be identified can be called by the URL to be identified in the key-value pair to be identified. Then, the URL to be identified can be allowed to call the interface to be identified to extract or monitor the data in the URL to be identified. The preset scheduling whitelist is used to store all combinations of allowed URL call interfaces.
[0153] In this optional embodiment, if the to-be-identified key-value pair cannot be found in the preset scheduling whitelist, the to-be-identified website in the to-be-identified key-value pair is prohibited from calling the to-be-identified interface, and an illegal call alert is sent to the developer.
[0154] In this way, by comparing the security level of the domain name to be identified with the security level of the interface to be identified to make a domain name calling interface decision, the security of the domain name calling interface can be intelligently judged in a quantitative form, thereby improving the efficiency of formulating domain name calling interface strategies.
[0155] The above-mentioned domain name interface calling method based on artificial intelligence obtains a large number of domain name codes and interface codes by encoding historical domain names and historical interfaces, and trains the domain name classification model and interface classification model according to the domain name codes and interface codes respectively, and then judges the security level of the domain name to be identified according to the domain name classification model, and judges the level of the interface to be identified according to the interface classification model, and makes a domain name interface calling decision by comparing the security level of the domain name to be identified with the security level of the interface to be identified, and guides the making of domain name interface calling decisions in a quantitative form, thereby improving the efficiency of decision making.
[0156] like Figure 2 As shown, it is a functional module diagram of a preferred embodiment of the domain name interface calling device based on artificial intelligence provided in an embodiment of the present application. The domain name interface calling device based on artificial intelligence 11 includes a collection unit 110, an encoding unit 111, a construction unit 112, a training unit 113, a classification unit 114, and a comparison unit 115. The module / unit referred to in this application refers to a series of computer program segments that can be executed by the processor 13 and can complete fixed functions, which are stored in the memory 12. In this embodiment, the functions of each module / unit will be described in detail in subsequent embodiments.
[0157] In an optional embodiment, the collection unit 110 is used to collect historical domain names and historical interfaces to obtain multiple domain name characters and multiple interface characters, and calculate the weights of the domain name characters and the weights of the interface characters respectively.
[0158] In an optional embodiment, the collecting of historical domain names and historical interfaces to obtain a plurality of domain name characters and interface characters, and calculating the weights of the domain name characters and the weights of the interface characters include:
[0159] Collect multiple historical domain names and multiple historical interfaces from a preset database, and perform word segmentation processing on the historical domain names and historical interfaces to obtain multiple domain name characters and multiple interface characters;
[0160] The word frequency of each domain name character among all domain name characters is calculated as the weight of the domain name character, and the word frequency of each interface character among all interface characters is calculated as the weight of the interface character.
[0161] In this optional embodiment, multiple historical domain names and multiple historical interfaces can be extracted from a preset database. The function of the historical domain name is to call the historical interface to extract or monitor data from multiple URLs corresponding to the historical domain name. Exemplarily, the format of the historical domain name can be www.baidu.com, www.google.com, and the name of the historical interface can be Node.nodeValue, Node.textContent.
[0162] In this optional embodiment, the historical domain name and the name of the historical interface can be segmented according to a preset segmentation tool to obtain multiple domain name characters and multiple interface characters. The preset segmentation tool can be an existing segmentation tool such as the jieba segmentation tool, the NLTK segmentation tool (Natural Language Toolkit), the LTP segmentation tool (Language Technology Platform), etc., and this application does not limit this.
[0163] For example, when the format of a historical domain name is www.baidu.com, the multiple domain name characters corresponding to the historical domain name are www, baidu, and com; when the format of a historical interface is "Node.nodeValue", the multiple interface characters corresponding to the historical interface are Node, node, and Value.
[0164] In this optional embodiment, the frequency of each domain name character among all domain name characters can be calculated as the weight corresponding to the domain name character, and the frequency of each interface character among all interface characters can be calculated as the weight corresponding to the interface character.
[0165] In an optional embodiment, the encoding unit 111 is used to encode the domain name characters to obtain a domain name vector, and to encode the interface characters to obtain an interface vector, to modify the domain name vector according to the weights of the domain name characters to obtain a domain name code, and to modify the interface vector according to the weights of the interface characters to obtain an interface code.
[0166] In an optional embodiment, encoding the domain name characters to obtain a domain name vector, encoding the interface characters to obtain an interface vector, modifying the domain name vector according to the weights of the domain name characters to obtain a domain name code, and modifying the interface vector according to the weights of the interface characters to obtain an interface code, comprises:
[0167] Constructing a domain name co-occurrence matrix based on the domain name characters, and constructing an interface co-occurrence matrix based on the interface characters;
[0168] Extracting a domain name vector corresponding to each domain name character from the domain name co-occurrence matrix, and extracting an interface vector corresponding to each interface character from the interface co-occurrence matrix;
[0169] The product of the weight of the domain name character and the domain name vector is calculated as the domain name code corresponding to the domain name character, and the product of the weight of the interface character and the interface vector is calculated as the interface code corresponding to the interface character.
[0170] In this optional embodiment, a domain name co-occurrence matrix can be constructed based on the domain name characters, and an interface co-occurrence matrix can be constructed based on the interface characters. The name of each row of the domain name co-occurrence matrix corresponds to a domain name character, the name of each column corresponds to a domain name character, and the name of the row where the elements with the same row coordinates and column coordinates in the domain name co-occurrence matrix are located is the same as the name of the column where they are located; the name of each row of the interface co-occurrence matrix corresponds to an interface character, the name of each column corresponds to an interface character, and the name of the row where the elements with the same row coordinates and column coordinates in the interface co-occurrence matrix are located is the same as the name of the column where they are located.
[0171] In this optional embodiment, taking the domain name co-occurrence matrix as an example, the value of each element in the domain name co-occurrence matrix may be initialized to 0, and each historical domain name is traversed to assign a value to each element in the domain name co-occurrence matrix. The specific method of the assignment is:
[0172] Selecting an element from the domain name co-occurrence matrix as a target element, taking the row name corresponding to the target element as a central character, and taking the column name corresponding to the target element as a neighboring character;
[0173] Traverse each historical domain name in turn. If the central character exists in the historical domain name and the preceding character of the central character is the neighboring character, the element value of the target element is increased by 1. If the following character of the central character is the neighboring character, the element value of the target element is also increased by 1.
[0174] Each element in the domain name co-occurrence matrix is used as a target element in turn to obtain a value of each element.
[0175] like Figure 5Shown is a schematic structural diagram of the domain name co-occurrence matrix.
[0176] In this optional embodiment, the value of each element in the interface co-occurrence matrix can be initialized to 0, and each historical interface can be traversed to assign a value to each element in the interface co-occurrence matrix. The assignment method is the same as the assignment method of the domain name co-occurrence matrix, which will not be repeated here.
[0177] In this optional embodiment, the elements of each row in the domain name co-occurrence matrix can be arranged from left to right to form a domain name vector of the domain name characters corresponding to the name of the row, and the dimension of the domain name vector is equal to the number of all domain name characters; and the elements of each row in the interface co-occurrence matrix can be arranged from left to right to form an interface vector of the interface characters corresponding to the name of the row, and the dimension of the interface vector is equal to the number of all interface characters.
[0178] In this optional embodiment, the product of the weight of the domain name characters and the domain name vector may be calculated as the domain name code; and the product of the weight of the interface characters and the interface vector may be calculated as the interface code.
[0179] In this optional embodiment, the domain name characters can be used as keys and the domain name codes can be used as values to construct domain name key-value pairs, and the domain name key-value pairs are uniformly stored to obtain a domain name code hash table; and the interface characters can be used as keys and the interface codes can be used as values to construct interface key-value pairs, and the interface key-value pairs are uniformly stored to obtain an interface code hash table.
[0180] In an optional embodiment, the construction unit 112 is configured to construct a first training data set according to the domain name code, and to construct a second training data set according to the interface code.
[0181] In an optional embodiment, constructing a first training data set according to the domain name code and constructing a second training data set according to the interface code includes:
[0182] The number of domain name characters contained in the historical domain name is used as the length of the historical domain name, and the maximum value of all historical domain name lengths is used as the domain name base value;
[0183] The number of interface characters contained in the historical interface is used as the length of the historical interface, and the maximum value of all historical interface lengths is used as the interface reference value;
[0184] Adding a plurality of first zero vectors after the domain name codes corresponding to all the domain name characters in the historical domain name to obtain domain name sample data corresponding to the historical domain name, wherein the total number of domain name codes and first zero vectors included in the domain name sample data is the same as the domain name reference value;
[0185] Adding a plurality of second zero vectors after the interface codes corresponding to all interface characters in the historical interface to obtain interface sample data corresponding to the historical interface, wherein the total number of interface codes and second zero vectors included in the interface sample data is the same as the interface reference value;
[0186] Labeling the domain name sample data to obtain first label data, and labeling the interface sample data to obtain second label data;
[0187] The domain name sample data and the first label data are used in a one-to-one correspondence as a first training data set, and the interface sample data and the second label data are used in a one-to-one correspondence as a second training data set.
[0188] In this optional embodiment, the number of domain name characters included in the historical domain name can be used as the length of each historical domain name, and the number of interface characters included in the historical interface can be used as the length of each historical interface.
[0189] In this optional embodiment, the maximum value of the lengths of all historical domain names can be recorded as the domain name reference value, and the domain name reference value can be recorded as maxlen 域名 ; and the maximum value of all historical interface lengths can be recorded as the interface reference value, and the interface reference value can be recorded as maxlen 接口 .
[0190] In this optional embodiment, if the length of a historical domain name is less than the domain name reference value maxlen 域名 , then add multiple first zero vectors after all domain name codes corresponding to the historical domain name to obtain domain name sample data corresponding to the historical domain name, the dimension of the first zero vector is the same as the dimension of the domain name code corresponding to the domain name character, and the value of each dimension in the first zero vector is 0, and the number of the multiple first zero vectors is the same as the maxlen 域名 The difference between the length of the historical domain name and the length of the historical domain name is equal; if the length of a historical interface is less than the interface reference value maxlen 接口 , then add multiple second zero vectors after all interface codes corresponding to the historical interface to obtain the interface sample data corresponding to the historical interface, the dimension of the second zero vector is the same as the dimension of the interface code corresponding to the interface character, and the value of each dimension in the second zero vector is 0, and the number of the multiple second zero vectors is the same as the maxlen 接口 The difference between the length of the previous interface and the length of the historical interface is equal.
[0191] In this optional embodiment, the security level corresponding to each historical domain name can be queried from a preset domain name security level list, and the security level corresponding to the historical domain name is used as the category of the domain name sample data corresponding to the historical domain name. A security level probability list of the historical domain name is constructed according to the category corresponding to the historical domain name. Each element in the security level probability list of the historical domain name is used to represent the probability that the historical domain name belongs to a certain category. The security level corresponding to the historical domain name includes low risk, medium risk and high risk. For example, Figure 4a The diagram shown is a structural diagram of the domain name security level list. The security level probability list corresponding to the historical domain name can be used as the first label data corresponding to the historical domain name.
[0192] Exemplarily, when the security level corresponding to a historical domain name is low risk, the security level probability list of the historical domain name is [1,0,0]. The security level probability list is used to represent that the probability that the historical domain name belongs to the low risk category is 100%, and the probability of belonging to the medium risk category and the probability of belonging to the high risk category are 0.
[0193] In this optional embodiment, the security level corresponding to each historical interface can be queried from a preset interface security level list, and the security level corresponding to the historical interface is used as the category of the interface sample data corresponding to the historical interface. A security level probability list of the historical interface is constructed based on the category corresponding to the historical interface. Each element in the security level probability list of the historical interface is used to characterize the probability that the historical domain name belongs to a certain category. The security levels corresponding to the historical interfaces include low risk, medium risk and high risk. For example, Figure 4b Shown is a schematic diagram of the structure of the interface security level list.
[0194] Exemplarily, when the security level corresponding to a historical interface is high risk, the security level probability list of the historical interface is [0,0,1]. The security level probability list is used to represent that the probability of the historical interface belonging to the high risk category is 100%, and the probability of belonging to the low risk category and the probability of belonging to the medium risk category are 0.
[0195] In this optional embodiment, the domain name sample data and the first label data may be in one-to-one correspondence as a first training data set, and the interface sample data and the second label data may be in one-to-one correspondence as a second training data set.
[0196] In an optional embodiment, the training unit 113 is configured to train a domain name classification model based on the first training data set, and train an interface classification model based on the second training data set.
[0197] In an optional embodiment, training a domain classification model based on the first training data set and training an interface classification model based on the second training data set includes:
[0198] Constructing an initial domain name classification model, wherein the initial domain name classification model includes a first encoder and a first classifier;
[0199] Constructing an initial interface classification model, wherein the initial interface classification model includes a second encoder and a second classifier;
[0200] Training an initial domain name classification model according to the first training data set and a preset first loss function until a value of the first loss function is less than a preset first termination threshold, stopping the training and obtaining a domain name classification model;
[0201] The initial interface classification model is trained according to the second training data set and a preset second loss function until the value of the second loss function is less than a preset second termination threshold, and the training is stopped to obtain the interface classification model.
[0202] In this optional embodiment, if Figure 6 The figure shows a schematic diagram of the structure of the initial domain name classification model described in the present scheme. In the initial domain name classification model, the first encoder is composed of a plurality of first neurons connected in series, the number of the plurality of first neurons is the same as the total number of domain name codes and first zero vectors in the domain name sample data, the input of each first neuron in the first encoder corresponds to a domain name code or a first zero vector in the domain name sample data, and the output of the first encoder is a first feature vector corresponding to the domain name sample data; the input of the first classifier is the first feature vector, and the output of the first classifier is a predicted security level probability list corresponding to the domain name sample data, and each element in the predicted security level probability list is used to represent the probability value of the domain name sample data belonging to each category.
[0203] In this optional embodiment, in order to ensure that the predicted security level probability list corresponding to the domain name sample data and the security level probability list corresponding to the first label data are as similar as possible, the predicted security level probability list corresponding to the domain name sample data in the first training data set and the security level probability list corresponding to the first label data can be input into a preset first loss function in sequence to calculate the first loss value of the initial domain name classification model, and the parameters in the initial domain name classification model are iteratively updated according to the gradient descent algorithm until the first loss value of the initial domain name classification model is less than a preset first termination threshold, then the training is stopped and the domain name classification model is obtained, the preset first loss function can be a cross entropy loss function, and the preset first termination threshold can be 0.001.
[0204] In this optional embodiment, the initial interface classification model includes a second encoder and a second classifier, the second encoder is composed of a plurality of second neurons connected in series, the number of the plurality of second neurons is the same as the number of interface codes in the interface sample data, the input of each second neuron in the second encoder corresponds to an interface code or a second zero vector in the interface sample data, the output of the second encoder is a second feature vector corresponding to the interface sample data; the input of the second classifier is the second feature vector, and the output of the second classifier is a predicted security level probability list corresponding to the interface sample data.
[0205] In this optional embodiment, the initial interface classification model may be trained based on the second training data set to obtain an interface classification model. The training process of the interface classification model is the same as the training process of the domain name classification model, which will not be repeated here.
[0206] In an optional embodiment, the classification unit 114 is configured to determine the security level of the domain name to be identified based on the domain name classification model, and determine the security level of the interface to be identified based on the interface classification model.
[0207] In an optional embodiment, the determining the security level of the domain name to be identified based on the domain name classification model, and determining the security level of the interface to be identified based on the interface classification model, includes:
[0208] Perform word segmentation on the domain name to be identified to obtain the domain name characters to be identified, query the domain name code corresponding to the domain name characters to be identified, and construct the domain name sample data corresponding to the domain name to be identified according to the domain name code to be identified;
[0209] Perform word segmentation on the interface to be identified to obtain the interface character to be identified, query the interface code corresponding to the interface character to be identified, and construct the interface sample data to be identified corresponding to the interface to be identified according to the interface code to be identified;
[0210] Input the sample data of the domain name to be identified into the domain classification model to obtain a predicted security level probability list corresponding to the domain name to be identified, and input the sample data of the interface to be identified into the interface classification model to obtain a predicted security level probability list corresponding to the interface to be identified;
[0211] The category corresponding to the maximum value in the predicted security level probability list of the domain name to be identified is selected as the security level of the domain name to be identified, and the category corresponding to the maximum value in the predicted security level probability list of the interface to be identified is selected as the security level of the interface to be identified.
[0212] In this optional embodiment, the domain name to be identified includes multiple web addresses to be identified, and the function of the domain name to be identified is to call the interface to be identified to monitor or extract data from the multiple web addresses to be identified.
[0213] In this optional embodiment, the domain name to be identified can be segmented according to the preset segmentation tool to obtain multiple domain name characters to be identified, and the interface to be identified can be segmented according to the preset segmentation tool to obtain multiple interface characters to be identified.
[0214] In this optional embodiment, the domain name code corresponding to each to-be-identified domain name character can be queried from the domain name code hash table as the to-be-identified domain name code, and all to-be-identified domain name codes corresponding to the to-be-identified domain name are combined into to-be-identified domain name sample data. If the length of the to-be-identified domain name is less than the domain name reference value maxlen 域名 , then add multiple first zero vectors after the domain name code to obtain sample domain name data, the dimension of the first zero vector is the same as the dimension of the domain name code, and the value of each dimension in the first zero vector is 0, and the number of the multiple first zero vectors is the same as the maxlen 域名 The difference between the length of the domain name to be identified and the length of the domain name to be identified is equal.
[0215] In this optional embodiment, the interface code corresponding to each interface character to be identified can be queried as the interface code to be identified, and the interface codes to be identified corresponding to the interface to be identified are combined into the interface sample data to be identified. If the length of the interface to be identified is less than the interface reference value maxlen 接口 , then add multiple second zero vectors after the interface code to be identified corresponding to the interface to be identified to obtain the interface sample data to be identified, the dimension of the second zero vector is the same as the dimension of the interface code, and the value of each dimension in the second zero vector is 0, and the number of the multiple second zero vectors is the same as the maxlen 接口 The difference between the length of the interface to be identified and the length of the interface to be identified is equal.
[0216] In this optional embodiment, each domain name code to be identified in the domain name sample data to be identified can be input into the first encoder of the domain name classification model in turn to obtain the output result of the domain name classification model, and the output result of the domain name classification model is a predicted security level probability list corresponding to the domain name to be identified.
[0217] Exemplarily, when the predicted security level probability list corresponding to the domain name sample data to be identified is [0.9, 0.1, 0], the probability that the domain name to be identified corresponding to the domain name sample data to be identified belongs to the low-risk category is 0.9, the probability that it belongs to the medium-risk category is 0.1, and the probability that it belongs to the high-risk category is 0.
[0218] In this optional embodiment, each interface code to be identified in the sample data of interfaces to be identified may be sequentially input into the second encoder of the interface classification model to obtain a predicted security level probability list corresponding to the interfaces to be identified.
[0219] Exemplarily, when the predicted security level probability list corresponding to the sample data of the interface to be identified is [0.2, 0.3, 0.5], the probability that the interface to be identified corresponding to the sample data of the interface to be identified belongs to the low-risk category is 0.2, the probability that it belongs to the medium-risk category is 0.3, and the probability that it belongs to the high-risk category is 0.5.
[0220] In this optional embodiment, the category corresponding to the maximum value in the predicted security level probability list of the domain name to be identified can be selected as the security level of the domain name to be identified, and the category corresponding to the maximum value in the predicted security level probability list of the interface to be identified can be selected as the security level of the interface to be identified.
[0221] Exemplarily, when the predicted security level probability list corresponding to the domain name to be identified is [0.9, 0.1, 0], its maximum value is 0.9, then the category corresponding to the domain name to be identified is low risk; when the predicted security level probability list corresponding to the interface to be identified is [0.2, 0.3, 0.5], its maximum value is 0.5, then the category corresponding to the interface to be identified is high risk.
[0222] In an optional embodiment, the comparison unit 115 is used to compare the security level of the domain name to be identified and the security level of the interface to be identified to make a domain name interface call decision.
[0223] In an optional embodiment, the domain name to be identified corresponds to a plurality of web addresses to be identified, and the step of comparing the security level of the domain name to be identified with the security level of the interface to be identified to make a domain name interface call decision includes:
[0224] If the security level of the domain name to be identified is not greater than the security level of the interface to be identified, calling the interface to be identified using the domain name to be identified to complete the domain name interface call;
[0225] If the security level of the domain name to be identified is greater than the security level of the interface to be identified, constructing multiple key-value pairs to be identified according to multiple URLs to be identified corresponding to the domain name to be identified and the interface to be identified;
[0226] If the key-value pair to be identified can be found in the preset scheduling whitelist, the interface to be identified is called using the URL to be identified to complete the domain name interface call, otherwise an illegal call alarm is issued to the developer.
[0227] In this optional embodiment, the security levels are in descending order: high risk, medium risk, and low risk.
[0228] In this optional embodiment, the security level of the domain name to be identified can be compared with the security level of the interface to be identified. If the security level of the domain name to be identified is not greater than the security level of the interface to be identified, it indicates that the content contained in the domain name to be identified is not sensitive information, and the domain name to be identified can be allowed to call the interface to be identified to extract or monitor various information stored in the domain name to be identified.
[0229] In this optional embodiment, if the security level of the domain name to be identified is greater than the security level of the interface to be identified, it indicates that the data stored in the domain name to be identified is relatively sensitive, and it is necessary to further determine whether the domain name to be identified can call the interface to be identified. Each URL to be identified corresponding to the domain name to be identified can be used as a key, and the interface to be identified can be used as a value to construct multiple key-value pairs to be identified, and the number of the key-value pairs to be identified is the same as the number of URLs to be identified corresponding to the domain name to be identified.
[0230] In this optional embodiment, each key-value pair to be identified can be queried from a preset scheduling whitelist. If the key-value pair to be identified can be found, it indicates that the interface to be identified can be called by the URL to be identified in the key-value pair to be identified. Then, the URL to be identified can be allowed to call the interface to be identified to extract or monitor the data in the URL to be identified. The preset scheduling whitelist is used to store all combinations of allowed URL call interfaces.
[0231] In this optional embodiment, if the to-be-identified key-value pair cannot be found in the preset scheduling whitelist, the to-be-identified website in the to-be-identified key-value pair is prohibited from calling the to-be-identified interface, and an illegal call alert is sent to the developer.
[0232] The above-mentioned domain name interface calling method based on artificial intelligence obtains a large number of domain name codes and interface codes by encoding historical domain names and historical interfaces, and trains the domain name classification model and interface classification model according to the domain name codes and interface codes respectively, and then judges the security level of the domain name to be identified according to the domain name classification model, and judges the level of the interface to be identified according to the interface classification model, and makes a domain name interface calling decision by comparing the security level of the domain name to be identified with the security level of the interface to be identified, and guides the making of domain name interface calling decisions in a quantitative form, thereby improving the efficiency of decision making.
[0233] like Figure 3, which is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 1 includes a memory 12 and a processor 13. The memory 12 is used to store computer-readable instructions, and the processor 13 executes the computer-readable instructions stored in the memory to implement the domain name interface calling method based on artificial intelligence in any of the above embodiments.
[0234] In an optional embodiment, the electronic device 1 further includes a bus, a computer program stored in the memory 12 and executable on the processor 13, such as an artificial intelligence-based domain name interface calling program.
[0235] Figure 3 Only the electronic device 1 having components 12-13 is shown, and those skilled in the art will understand that Figure 3 The structure shown does not constitute a limitation on the electronic device 1 , and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0236] Combination Figure 1 The memory 12 in the electronic device 1 stores a plurality of computer-readable instructions to implement a domain name interface calling method based on artificial intelligence, and the processor 13 can execute the plurality of instructions to implement:
[0237] Collecting historical domain names and historical interfaces to obtain multiple domain name characters and multiple interface characters, and respectively calculating weights of the domain name characters and weights of the interface characters;
[0238] Encode the domain name characters to obtain a domain name vector, encode the interface characters to obtain an interface vector, modify the domain name vector according to the weights of the domain name characters to obtain a domain name code, and modify the interface vector according to the weights of the interface characters to obtain an interface code;
[0239] Constructing a first training data set according to the domain name code, and constructing a second training data set according to the interface code;
[0240] Training a domain classification model based on the first training data set, and training an interface classification model based on the second training data set;
[0241] Determining the security level of the domain name to be identified based on the domain name classification model, and determining the security level of the interface to be identified based on the interface classification model;
[0242] The security level of the domain name to be identified and the security level of the interface to be identified are compared to make a domain name interface call decision.
[0243] Specifically, the specific implementation method of the processor 13 for the above instructions can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.
[0244] Those skilled in the art will appreciate that the schematic diagram is merely an example of the electronic device 1 and does not constitute a limitation on the electronic device 1. The electronic device 1 may have either a bus structure or a star structure. The electronic device 1 may also include more or less other hardware or software than shown in the diagram, or a different arrangement of components. For example, the electronic device 1 may also include input and output devices, network access devices, etc.
[0245] It should be noted that the electronic device 1 is only an example, and other existing or future electronic products that are suitable for the present application should also be included in the protection scope of the present application and included here by reference.
[0246] Among them, the memory 12 includes at least one type of readable storage medium, and the readable storage medium can be non-volatile or volatile. The readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 12 can be an internal storage unit of the electronic device 1, such as a mobile hard disk of the electronic device 1. In other embodiments, the memory 12 can also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 12 can also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 12 can not only be used to store application software and various types of data installed in the electronic device 1, such as the code of the domain name interface call program based on artificial intelligence, but also can be used to temporarily store data that has been output or is to be output.
[0247] In some embodiments, the processor 13 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 13 is the control core (Control Unit) of the electronic device 1, and uses various interfaces and lines to connect the various components of the entire electronic device 1, and executes or executes programs or modules stored in the memory 12 (for example, executing a domain name interface call program based on artificial intelligence, etc.), and calls data stored in the memory 12 to execute various functions of the electronic device 1 and process data.
[0248] The processor 13 executes the operating system of the electronic device 1 and various installed applications. The processor 13 executes the applications to implement the steps in the above-mentioned embodiments of the domain name interface calling method based on artificial intelligence, for example Figure 1 Steps shown.
[0249] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory 12 and executed by the processor 13 to complete the present application. The one or more modules / units may be a series of computer-readable instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the electronic device 1. For example, the computer program may be divided into a collection unit 110, an encoding unit 111, a construction unit 112, a training unit 113, a classification unit 114, and a comparison unit 115.
[0250] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a computer device, or a network device, etc.) or a processor to execute the part of the domain name interface calling method based on artificial intelligence described in each embodiment of the present application.
[0251] If the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also instruct the relevant hardware devices to complete through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented.
[0252] The computer program includes computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory and other memory, etc.
[0253] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.
[0254] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0255] The bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. Figure 3 Only one arrow is used in the figure, but it does not mean that there is only one bus or one type of bus. The bus is configured to realize the connection and communication between the memory 12 and at least one processor 13, etc.
[0256] Although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 13 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, and power status indicators. The electronic device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.
[0257] Furthermore, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device 1 and other electronic devices.
[0258] Optionally, the electronic device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual user interface.
[0259] An embodiment of the present application also provides a computer-readable storage medium (not shown), in which computer-readable storage medium is stored computer-readable instructions, and the computer-readable instructions are executed by a processor in an electronic device to implement the artificial intelligence-based domain name interface calling method described in any of the above embodiments.
[0260] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0261] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0262] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0263] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0264] In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the specification can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any specific order.
[0265] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.
Claims
1. A domain name interface calling method based on artificial intelligence, characterized in that: The method comprises: Collecting historical domain names and historical interfaces to obtain multiple domain name characters and multiple interface characters, and respectively calculating weights of the domain name characters and weights of the interface characters; Encode the domain name characters to obtain a domain name vector, encode the interface characters to obtain an interface vector, modify the domain name vector according to the weights of the domain name characters to obtain a domain name code, and modify the interface vector according to the weights of the interface characters to obtain an interface code; Constructing a first training data set according to the domain name code, and constructing a second training data set according to the interface code; Training a domain classification model based on the first training data set, and training an interface classification model based on the second training data set; Determining the security level of the domain name to be identified based on the domain name classification model, and determining the security level of the interface to be identified based on the interface classification model; The security level of the domain name to be identified and the security level of the interface to be identified are compared to make a domain name interface call decision.
2. The domain name interface calling method based on artificial intelligence according to claim 1, characterized in that: The collecting of historical domain names and historical interfaces to obtain a plurality of domain name characters and interface characters, and calculating the weights of the domain name characters and the weights of the interface characters, includes: Collect multiple historical domain names and multiple historical interfaces from a preset database, and perform word segmentation processing on the historical domain names and historical interfaces to obtain multiple domain name characters and multiple interface characters; The word frequency of each domain name character among all domain name characters is calculated as the weight of the domain name character, and the word frequency of each interface character among all interface characters is calculated as the weight of the interface character.
3. The domain name interface calling method based on artificial intelligence according to claim 1, characterized in that: The encoding of the domain name characters to obtain a domain name vector, the encoding of the interface characters to obtain an interface vector, the domain name vector to obtain a domain name code according to the weight of the domain name characters, and the interface vector to obtain an interface code according to the weight of the interface characters, include: Constructing a domain name co-occurrence matrix based on the domain name characters, and constructing an interface co-occurrence matrix based on the interface characters; Extracting a domain name vector corresponding to each domain name character from the domain name co-occurrence matrix, and extracting an interface vector corresponding to each interface character from the interface co-occurrence matrix; The product of the weight of the domain name character and the domain name vector is calculated as the domain name code corresponding to the domain name character, and the product of the weight of the interface character and the interface vector is calculated as the interface code corresponding to the interface character.
4. The domain name interface calling method based on artificial intelligence according to claim 1, characterized in that: The step of constructing a first training data set according to the domain name code and constructing a second training data set according to the interface code includes: The number of domain name characters contained in the historical domain name is used as the length of the historical domain name, and the maximum value of all historical domain name lengths is used as the domain name base value; The number of interface characters contained in the historical interface is used as the length of the historical interface, and the maximum value of all historical interface lengths is used as the interface reference value; Adding a plurality of first zero vectors after the domain name codes corresponding to all the domain name characters in the historical domain name to obtain domain name sample data corresponding to the historical domain name, wherein the total number of domain name codes and first zero vectors included in the domain name sample data is the same as the domain name reference value; Adding a plurality of second zero vectors after the interface codes corresponding to all interface characters in the historical interface to obtain interface sample data corresponding to the historical interface, wherein the total number of interface codes and second zero vectors included in the interface sample data is the same as the interface reference value; Labeling the domain name sample data to obtain first label data, and labeling the interface sample data to obtain second label data; The domain name sample data and the first label data are used in a one-to-one correspondence as a first training data set, and the interface sample data and the second label data are used in a one-to-one correspondence as a second training data set.
5. The domain name interface calling method based on artificial intelligence according to claim 1, characterized in that: The step of training a domain classification model based on the first training data set and training an interface classification model based on the second training data set includes: Constructing an initial domain name classification model, wherein the initial domain name classification model includes a first encoder and a first classifier; Constructing an initial interface classification model, wherein the initial interface classification model includes a second encoder and a second classifier; Training an initial domain name classification model according to the first training data set and a preset first loss function until a value of the first loss function is less than a preset first termination threshold, stopping the training and obtaining a domain name classification model; The initial interface classification model is trained according to the second training data set and a preset second loss function until the value of the second loss function is less than a preset second termination threshold, and the training is stopped to obtain the interface classification model.
6. The domain name interface calling method based on artificial intelligence as claimed in claim 5, characterized in that: The determining the security level of the domain name to be identified based on the domain name classification model, and determining the security level of the interface to be identified based on the interface classification model, includes: Perform word segmentation on the domain name to be identified to obtain the domain name characters to be identified, query the domain name code corresponding to the domain name characters to be identified, and construct the domain name sample data corresponding to the domain name to be identified according to the domain name code to be identified; Perform word segmentation on the interface to be identified to obtain the interface character to be identified, query the interface code corresponding to the interface character to be identified, and construct the interface sample data to be identified corresponding to the interface to be identified according to the interface code to be identified; Input the sample data of the domain name to be identified into the domain classification model to obtain a predicted security level probability list corresponding to the domain name to be identified, and input the sample data of the interface to be identified into the interface classification model to obtain a predicted security level probability list corresponding to the interface to be identified; The category corresponding to the maximum value in the predicted security level probability list of the domain name to be identified is selected as the security level of the domain name to be identified, and the category corresponding to the maximum value in the predicted security level probability list of the interface to be identified is selected as the security level of the interface to be identified.
7. The domain name interface calling method based on artificial intelligence according to claim 1, characterized in that: The domain name to be identified corresponds to a plurality of web addresses to be identified, and the step of comparing the security level of the domain name to be identified with the security level of the interface to be identified to make a domain name interface call decision includes: If the security level of the domain name to be identified is not greater than the security level of the interface to be identified, calling the interface to be identified using the domain name to be identified to complete the domain name interface call; If the security level of the domain name to be identified is greater than the security level of the interface to be identified, constructing multiple key-value pairs to be identified according to multiple URLs to be identified corresponding to the domain name to be identified and the interface to be identified; If the key-value pair to be identified can be found in the preset scheduling whitelist, the interface to be identified is called using the URL to be identified to complete the domain name interface call, otherwise an illegal call alarm is issued to the developer.
8. A domain name interface calling device based on artificial intelligence, characterized in that: The device comprises: A collection unit, used for collecting historical domain names and historical interfaces to obtain a plurality of domain name characters and a plurality of interface characters, and respectively calculating the weights of the domain name characters and the weights of the interface characters; An encoding unit, used for encoding the domain name characters to obtain a domain name vector, encoding the interface characters to obtain an interface vector, modifying the domain name vector according to the weights of the domain name characters to obtain a domain name code, and modifying the interface vector according to the weights of the interface characters to obtain an interface code; A construction unit, configured to construct a first training data set according to the domain name code, and to construct a second training data set according to the interface code; A training unit, configured to train a domain classification model based on the first training data set, and to train an interface classification model based on the second training data set; a classification unit, configured to determine the security level of the domain name to be identified based on the domain name classification model, and to determine the security level of the interface to be identified based on the interface classification model; The comparison unit is used to compare the security level of the domain name to be identified and the security level of the interface to be identified to make a domain name interface call decision.
9. An electronic device, characterized in that: The electronic device comprises: a memory storing computer readable instructions; and A processor executes computer-readable instructions stored in the memory to implement the domain name interface calling method based on artificial intelligence as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions are executed by a processor in an electronic device to implement the artificial intelligence-based domain name interface calling method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Credit threshold training method, IP address detection method and related devices
CN112003846A
Method and device for configuring domain name white list, terminal and storage medium
CN112637218A