Website classification method and device and computer storage medium
By generating a website link graph and determining embedding vectors for classification based on jump relationships, the problem of detection failure caused by the inability to read page content is solved when detecting bad websites, achieving efficient website classification and avoiding missed detections.
Patent Information
- Application Number
- CN202310173907.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-23
- Publication Date
- 2024-08-30
AI Technical Summary
When the existing technology detects bad websites, some websites block detection methods, so that crawlers cannot read the correct website pages, resulting in detection failure.
By generating a website link graph, the embedding vector of the target website is determined based on the jump relationship between websites, and then classified. The entire process does not require reading the page content of the website.
It solves the problem of detection failure caused by the inability to read the correct website page, and avoids missed detections caused by failure to read content, such as missed detections due to model generalization capabilities or language problems.
Smart Images

Figure CN118568377A
Abstract
Description
Technical Field
[0001] The present application relates to the field of the Internet, and in particular to a website classification method, device and computer storage medium. Background Art
[0002] With the development and popularization of World Wide Web technology, a large number of new websites appear every day. Some of these websites are bad websites full of bad information and need to be dealt with in a targeted manner. The prerequisite for targeted treatment is to detect and identify these websites.
[0003] The existing technology generally models the detection of the above-mentioned bad websites as a classification problem, by collecting the HTML page information of the website, encoding it, and then using methods such as Support Vector Machine (SVM), Bayesian and Multilayer Perceptron (MLP) to classify it to determine whether it is a bad website.
[0004] However, some bad websites have now developed technical means to block detection, such as restricting access, delaying jumps, and other methods, which prevent crawlers from reading the correct website pages, thus causing detection failure. Summary of the invention
[0005] The embodiments of the present application provide a website classification method, device and computer storage medium, which can solve the problem of detection failure caused by the inability to read the correct website page.
[0006] In a first aspect, an embodiment of the present application provides a website classification method, comprising:
[0007] Generate a website link graph based on multiple sample websites, the website link graph includes jump relationships between multiple node websites, the node websites include the sample websites and websites obtained from the sample websites after at least one jump;
[0008] Determine an embedding vector of a target website according to the jump relationship between each node website in the website link graph, wherein the target website is other websites in the website link graph except the sample website;
[0009] The classification of the target website is determined according to the embedding vector of the target website.
[0010] In a possible implementation, generating a website link graph based on a plurality of sample websites specifically includes:
[0011] Taking the plurality of sample websites as starting points, respectively, jump and traverse;
[0012] Record the jump path and the website jumped to during each jump traversal process;
[0013] A website link graph is generated according to the jump path and the website jumped to in each jump traversal process.
[0014] In a possible implementation, taking the plurality of sample websites as starting points respectively to perform jump traversal specifically includes:
[0015] According to the visit volume and classification of the sample websites, all sample websites whose visit volume is greater than a predetermined visit volume threshold and whose website classification is bad are selected as starting websites;
[0016] Each of the starting point websites is taken as a starting point to perform jump traversal.
[0017] In a possible implementation, determining the embedding vector of the target website according to the website link graph specifically includes:
[0018] Taking the node website as the starting node, performing random walk according to the jump relationship between the node websites in the website link graph to obtain a random walk sequence;
[0019] According to the random walk sequence, an embedding vector of the node website is determined, and the embedding vector of the node website includes the embedding vector of the target website.
[0020] In a possible implementation, determining the embedding vector of the target website according to the random walk sequence specifically includes:
[0021] Input the random walk sequence into the word2vec model for training to obtain a mapping relationship table;
[0022] According to the mapping relationship table, an embedding vector of the target website is determined.
[0023] In a possible implementation, determining the classification of the target website according to the embedding vector of the target website specifically includes:
[0024] The embedding vector of the target website is input into a first website classification model, and the first website classification model outputs the classification of the target website.
[0025] In a possible implementation, the embedding vector of the node website also includes the embedding vector of the sample website, and the website classification of the sample website is known; the training method of the first website classification model includes:
[0026] Obtain an embedding vector sample set, wherein the embedding vector sample set includes a plurality of embedding vector samples, the embedding vector samples are embedding vectors corresponding to the sample websites, and each of the embedding vector samples includes a corresponding website classification label;
[0027] Inputting the embedding vector samples in the embedding vector sample set into the first website classification model to obtain a website classification result output by the first website classification model;
[0028] If after the embedding vector samples in the embedding vector sample set that do not exceed a first predetermined proportion are input into the first website classification model, the corresponding website classification labels of the website classification results obtained are consistent, adjusting the coefficients of the first website classification model;
[0029] If, after more than a first predetermined proportion of the embedding vector samples in the embedding vector sample set are input into the first website classification model, the corresponding website classification labels of the obtained website classification results are consistent, the training is completed.
[0030] In a possible implementation, determining the classification of the target website according to the embedding vector of the target website specifically includes:
[0031] Determining embedding vectors of adjacent nodes of the target website according to the website link graph;
[0032] splicing the embedding vectors of the neighboring nodes of the target website and the embedding vector of the target website together to form a splicing vector;
[0033] The concatenated vector is input into a second website classification model, and the second website classification model outputs the classification of the target website.
[0034] In a possible implementation, the embedding vector of the node website also includes the embedding vector of the sample website, the website classification of the sample website is known, and the training method of the second website classification model includes:
[0035] Determining embedding vectors of adjacent nodes of the sample website according to the website link graph;
[0036] splicing the embedding vectors of the adjacent nodes of the sample website and the embedding vector of the sample website together to form a splicing vector;
[0037] The splicing vectors of the sample websites are grouped together to form a splicing vector sample set, wherein the splicing vector of each sample website is a splicing vector sample, and each splicing vector sample includes a corresponding website classification label;
[0038] Inputting the splicing vector samples in the splicing vector sample set into the second website classification model to obtain the website classification result output by the second website classification model;
[0039] If after the splicing vector samples in the splicing vector sample set not exceeding a second predetermined proportion are input into the second website classification model, the corresponding website classification labels of the website classification results obtained are consistent, adjusting the coefficients of the second website classification model;
[0040] If, after the splicing vector samples exceeding the second predetermined ratio in the splicing vector sample set are input into the second website classification model, the corresponding website classification labels of the obtained website classification results are consistent, the training is completed.
[0041] In a possible implementation, the step of concatenating the embedding vectors of the neighboring nodes of the target website and the embedding vector of the target website to form a concatenated vector specifically includes:
[0042] Add the embedding vectors of the adjacent nodes of the target website bit by bit and take the average to obtain an adjacency vector;
[0043] The adjacency vector and the embedding vector of the target website are concatenated together to form a concatenated vector.
[0044] In a second aspect, an embodiment of the present application provides a website classification device, the website classification device comprising:
[0045] A generating module, used to generate a website link graph according to a plurality of sample websites, wherein the website link graph includes jump relationships between a plurality of node websites, wherein the node websites include the sample websites and websites obtained by at least one jump from the sample websites;
[0046] A determination module, used to determine an embedding vector of a target website according to the jump relationship between the node websites in the website link graph, wherein the target website is other websites other than the sample website in the website link graph;
[0047] The classification module is used to determine the classification of the target website according to the embedding vector of the target website.
[0048] In a possible implementation, the generating module specifically includes:
[0049] A jump traversal submodule, used to perform jump traversal with the plurality of sample websites as starting points respectively;
[0050] A jump record submodule, used to record the jump path and the website jumped to in each jump traversal process;
[0051] The jump generation submodule is used to generate a website link graph according to the jump path and the website jumped to in each jump traversal process.
[0052] In a possible implementation, the jump traversal submodule specifically includes:
[0053] A starting point determination unit, configured to select, according to the visit volume and classification of the sample websites, all sample websites whose visit volume is greater than a predetermined visit volume threshold and whose website classification is bad as starting point websites;
[0054] The jump traversal unit is used to perform jump traversal with the starting point website as the starting point.
[0055] In a possible implementation, the determining module specifically includes:
[0056] A random walk submodule is used to take the node website as the starting node, perform random walk according to the jump relationship between the node websites in the website link graph, and obtain a random walk sequence;
[0057] The vector determination submodule is used to determine the embedding vector of the node website according to the random walk sequence, and the embedding vector of the node website includes the embedding vector of the target website.
[0058] In a possible implementation manner, the vector determination submodule specifically includes:
[0059] A mapping relationship unit, used for inputting the random walk sequence into a word2vec model for training to obtain a mapping relationship table;
[0060] A vector determination unit is used to determine the embedding vector of the target website according to the mapping relationship table.
[0061] In a possible implementation, the classification module specifically includes:
[0062] The first model submodule is used to input the embedding vector of the target website into a first website classification model, and the first website classification model outputs the classification of the target website.
[0063] In a possible implementation, the embedding vector of the node website also includes the embedding vector of the sample website, and the website classification of the sample website is known; the website classification device further includes:
[0064] A first sample module obtains an embedding vector sample set, wherein the embedding vector sample set includes a plurality of embedding vector samples, the embedding vector samples are embedding vectors corresponding to the sample websites, and each of the embedding vector samples includes a corresponding website classification label;
[0065] A first input module, used for inputting the embedding vector samples in the embedding vector sample set into the first website classification model to obtain the website classification result output by the first website classification model;
[0066] A first adjustment module is configured to adjust the coefficient of the first website classification model if the website classification results obtained after the embedding vector samples in the embedding vector sample set not exceeding a first predetermined proportion are input into the first website classification model have the same corresponding website classification labels;
[0067] The first ending module is used to end the training if the website classification results obtained after more than a first predetermined proportion of the embedded vector samples in the embedded vector sample set are input into the first website classification model have the same corresponding website classification labels.
[0068] In a possible implementation, the classification module specifically includes:
[0069] An adjacent vector submodule, used to determine the embedding vectors of the adjacent nodes of the target website according to the website link graph;
[0070] A splicing vector submodule, used to splice the embedding vectors of the neighboring nodes of the target website and the embedding vector of the target website together to form a splicing vector;
[0071] The second model submodule is used to input the splicing vector into a second website classification model, and the second website classification model outputs the classification of the target website.
[0072] In a possible implementation, the embedding vector of the node website also includes the embedding vector of the sample website, the website classification of the sample website is known, and the website classification device further includes:
[0073] A vector search module, used to determine the embedding vectors of the adjacent nodes of the sample website according to the website link graph;
[0074] A vector concatenation module, used to concatenate the embedding vectors of the adjacent nodes of the sample website and the embedding vector of the sample website to form a concatenated vector;
[0075] A second sample module is used to collect the splicing vectors of the sample websites together to form a splicing vector sample set, wherein the splicing vector of each sample website is a splicing vector sample, and each of the splicing vector samples includes a corresponding website classification label;
[0076] A second input module, used for inputting the splicing vector samples in the splicing vector sample set into the second website classification model to obtain the website classification result output by the second website classification model;
[0077] A second adjustment module is used to adjust the coefficient of the second website classification model if the corresponding website classification labels of the website classification results obtained after the splicing vector samples in the splicing vector sample set not exceeding a second predetermined proportion are input into the second website classification model are consistent;
[0078] The second ending module is used to end the training if the corresponding website classification labels of the website classification results obtained after the splicing vector samples exceeding the second predetermined ratio in the splicing vector sample set are input into the second website classification model are consistent.
[0079] In a possible implementation, the splicing vector module specifically includes:
[0080] An adjacency vector unit, used for adding and averaging the embedding vectors of the adjacent nodes of the target website bit by bit to obtain an adjacency vector;
[0081] The splicing vector unit is used to splice the adjacency vector and the embedding vector of the target website together to form a splicing vector.
[0082] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded and executed by the processor:
[0083] Generate a website link graph based on multiple sample websites, the website link graph includes jump relationships between multiple node websites, the node websites include the sample websites and websites obtained from the sample websites after at least one jump;
[0084] Determine an embedding vector of a target website according to the jump relationship between each node website in the website link graph, wherein the target website is other websites in the website link graph except the sample website;
[0085] The classification of the target website is determined according to the embedding vector of the target website.
[0086] In a possible implementation, when the processor generates a website link graph according to a plurality of sample websites, the processor specifically performs:
[0087] Taking the plurality of sample websites as starting points, respectively, jump and traverse;
[0088] Record the jump path and the website jumped to during each jump traversal process;
[0089] A website link graph is generated according to the jump path and the website jumped to in each jump traversal process.
[0090] In a possible implementation, the processor takes the plurality of sample websites as starting points and performs jump traversal by specifically executing:
[0091] According to the visit volume and classification of the sample websites, all sample websites whose visit volume is greater than a predetermined visit volume threshold and whose website classification is bad are selected as starting websites;
[0092] Each of the starting point websites is taken as a starting point to perform jump traversal.
[0093] In a possible implementation, when the processor determines the embedding vector of the target website according to the website link graph, specifically performs:
[0094] Taking the node website as the starting node, performing random walk according to the jump relationship between the node websites in the website link graph to obtain a random walk sequence;
[0095] According to the random walk sequence, an embedding vector of the node website is determined, and the embedding vector of the node website includes the embedding vector of the target website.
[0096] In a possible implementation, when the processor determines the embedding vector of the target website according to the random walk sequence, specifically performs:
[0097] Input the random walk sequence into the word2vec model for training to obtain a mapping relationship table;
[0098] According to the mapping relationship table, an embedding vector of the target website is determined.
[0099] In a possible implementation, when the processor determines the classification of the target website according to the embedding vector of the target website, specifically performs:
[0100] The embedding vector of the target website is input into a first website classification model, and the first website classification model outputs the classification of the target website.
[0101] In a possible implementation, the embedding vector of the node website further includes the embedding vector of the sample website, and the website classification of the sample website is known; and the processor is further configured to execute:
[0102] Obtain an embedding vector sample set, wherein the embedding vector sample set includes a plurality of embedding vector samples, the embedding vector samples are embedding vectors corresponding to the sample websites, and each of the embedding vector samples includes a corresponding website classification label;
[0103] Inputting the embedding vector samples in the embedding vector sample set into the first website classification model to obtain a website classification result output by the first website classification model;
[0104] If after the embedding vector samples in the embedding vector sample set that do not exceed a first predetermined proportion are input into the first website classification model, the corresponding website classification labels of the website classification results obtained are consistent, adjusting the coefficients of the first website classification model;
[0105] If, after more than a first predetermined proportion of the embedding vector samples in the embedding vector sample set are input into the first website classification model, the corresponding website classification labels of the obtained website classification results are consistent, the training is completed.
[0106] In a possible implementation, when the processor determines the classification of the target website according to the embedding vector of the target website, specifically performs:
[0107] Determining embedding vectors of adjacent nodes of the target website according to the website link graph;
[0108] splicing the embedding vectors of the neighboring nodes of the target website and the embedding vector of the target website together to form a splicing vector;
[0109] The concatenated vector is input into a second website classification model, and the second website classification model outputs the classification of the target website.
[0110] In a possible implementation, the embedding vector of the node website further includes the embedding vector of the sample website, the website classification of the sample website is known, and the processor is further configured to execute:
[0111] Determining embedding vectors of adjacent nodes of the sample website according to the website link graph;
[0112] splicing the embedding vectors of the adjacent nodes of the sample website and the embedding vector of the sample website together to form a splicing vector;
[0113] The splicing vectors of the sample websites are grouped together to form a splicing vector sample set, wherein the splicing vector of each sample website is a splicing vector sample, and each splicing vector sample includes a corresponding website classification label;
[0114] Inputting the splicing vector samples in the splicing vector sample set into the second website classification model to obtain the website classification result output by the second website classification model;
[0115] If after the splicing vector samples in the splicing vector sample set not exceeding a second predetermined proportion are input into the second website classification model, the corresponding website classification labels of the website classification results obtained are consistent, adjusting the coefficients of the second website classification model;
[0116] If, after the splicing vector samples exceeding the second predetermined ratio in the splicing vector sample set are input into the second website classification model, the corresponding website classification labels of the obtained website classification results are consistent, the training is completed.
[0117] In a possible implementation, when the output processor concatenates the embedding vectors of the neighboring nodes of the target website and the embedding vector of the target website to form a concatenated vector, specifically:
[0118] Add the embedding vectors of the adjacent nodes of the target website bit by bit and take the average to obtain an adjacency vector;
[0119] The adjacency vector and the embedding vector of the target website are concatenated together to form a concatenated vector.
[0120] In a possible implementation manner, before the processor obtains at least one model parameter to be updated, it is further configured to execute:
[0121] Searching for a storage node corresponding to each of the at least one model parameter to be updated;
[0122] The obtaining of at least one model parameter to be updated comprises:
[0123] The at least one model parameter to be updated is obtained from each storage node corresponding to the at least one model parameter to be updated.
[0124] In a possible implementation, before searching for a storage node of at least one model parameter to be updated, the processor is further configured to execute: determining a hash value of the at least one model parameter to be updated;
[0125] When the processor searches for at least one storage node of a model parameter to be updated, the processor specifically executes:
[0126] According to the hash value of the at least one model parameter to be updated, a storage node corresponding to each of the at least one model parameter to be updated is determined.
[0127] In a possible implementation, the model parameters to be updated are obtained by training a node storing the model parameters to be updated according to gradient values uploaded by other nodes.
[0128] In a possible implementation manner, after updating the at least one model parameter to be updated, the processor is further configured to execute:
[0129] The gradient information of the at least one model parameter to be updated after training is uploaded to the storage node corresponding to each of the at least one model parameter to be updated, so that the storage node corresponding to each of the at least one model parameter to be updated uses a machine learning optimization algorithm to train the at least one model parameter to be updated.
[0130] In a fourth aspect, an embodiment of the present application provides a computer storage medium, which stores multiple instructions, and the instructions are suitable for being loaded by a processor and executing the method steps provided by the first aspect of the embodiment of the present application or any one of the implementations of the first aspect.
[0131] In a fifth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer or a processor, enables the above-mentioned computer or processor to execute the encoding method provided by the first aspect of the embodiment of the present application or any possible implementation of the first aspect.
[0132] In an embodiment of the present application, a link graph is first generated based on a sample website, and the jump relationship between each node website is determined based on the link graph. The classification of the target website is determined based on the jump relationship between each node website. In the entire classification process, the classification only needs to be determined based on the jump relationship between the website and the website, and there is no need to read the page content of the website, which solves the problem of detection failure caused by the inability to read the correct website page. At the same time, since the embodiment of the present application does not need to read the web page content, it can also solve various missed detections caused by the inability to read the page content. For example, missed detections caused by the generalization ability of the sample library model, missed detections caused by language problems, and missed detections caused by the crawler's inability to crawl to the website.
[0133] It can be understood that the website classification device provided in the second aspect, the electronic device provided in the third aspect, the computer storage medium provided in the fourth aspect, and the computer program product provided in the fifth aspect are all used to execute the website classification method provided in the first aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects of the website classification method provided in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0134] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0135] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied is shown.
[0136] Figure 2 A flow chart of a website classification method provided in an embodiment of the present application is shown.
[0137] Figure 3 A structural schematic diagram of a website link map provided in an embodiment of the present application is shown.
[0138] Figure 4 Shown according to Figure 2 A specific implementation flow chart of step S100 in the website classification method shown in the corresponding embodiment.
[0139] Figure 5 Shown according to Figure 2 A specific implementation flow chart of step S200 in the website classification method shown in the corresponding embodiment.
[0140] Figure 6 Shown according to Figure 2 A specific implementation flow chart of step S300 in the website classification method shown in the corresponding embodiment.
[0141] Figure 7 A schematic diagram of the structure of a website classification device provided in an embodiment of the present application.
[0142] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0143] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0144] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0145] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0146] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0147] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied is shown.
[0148] like Figure 1 As shown, the system architecture may include terminal devices (such as Figure 1 The embodiment of the present invention is a schematic diagram of a mobile phone 101, a tablet computer 102, a portable computer 103, a desktop computer, etc., a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the terminal device and the server 105. The network 104 may include various connection types, such as a wired communication link, a wireless communication link, etc.
[0149] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers. For example, the server 105 may be a server cluster composed of multiple servers.
[0150] The user can use the terminal device to interact with the server 105 through the network 104 to receive or send messages, etc. The server 105 can be a server that provides various services. For example, the user uses the terminal device 103 (or the terminal device 101 or 102) to upload multiple sample websites to the server 105, and the server 105 can generate a website link graph based on the multiple sample websites, wherein the website link graph contains jump relationships between multiple node websites, and the node websites include the sample websites and websites obtained by at least one jump from the sample websites; according to the jump relationships between the node websites in the website link graph, the embedding vector of the target website is determined, and the target website is other websites other than the sample website in the website link graph; according to the embedding vector of the target website, the classification of the target website is determined.
[0151] It should be noted that the website classification method provided in the embodiment of the present application is generally executed by the server 105, and accordingly, the website classification device is generally set in the server 105. However, in other embodiments of the present application, the terminal device may also have similar functions as the server, so as to execute the website classification scheme provided in the embodiment of the present application.
[0152] The implementation details of the technical solution of the embodiment of the present application are described in detail below:
[0153] Figure 2 A flowchart of a website classification method according to an embodiment of the present application is shown. The website classification method can be executed by a server, which can be Figure 1 Refer to the server shown in Figure 2 As shown, the website classification method at least includes:
[0154] Step S100, generating a website link graph based on a plurality of sample websites, wherein the website link graph includes jump relationships between a plurality of node websites, wherein the node websites include the sample websites and websites obtained from the sample websites through at least one jump.
[0155] Step S200, determining an embedding vector of a target website according to the jump relationship between the node websites in the website link graph, wherein the target website is other websites in the website link graph except the sample website.
[0156] Step S300: determining the category of the target website according to the embedding vector of the target website.
[0157] In an embodiment of the present application, a website link graph is first generated with multiple sample websites as starting points, in which websites are nodes and the jump relationships between websites are edges. The jump relationships between the websites of each node are vectorized according to the website link graph, i.e., the embedding vector. Finally, the classification of the target website is determined according to the embedding vector of the target website. During the entire classification process, it is only necessary to determine the classification according to the jump relationship between the website and the website, and it is not necessary to read the page content of the website, thereby solving the problem of detection failure caused by the inability to read the correct website page. At the same time, since the embodiment of the present application does not need to read the web page content, it can also solve various missed detections caused by the inability to read the page content. For example, missed detections caused by the generalization ability of the sample library model, missed detections caused by language problems, and missed detections caused by the crawler's inability to crawl the website.
[0158] In step S100, a website link graph is generated with a sample website and a website obtained from the sample website through at least one jump as nodes, and with the jump relationship between each node website as an edge.
[0159] Please note that Figure 3 The jump relationship between node websites is directional. For example, in this embodiment, not only can website A jump to website D, but website D can also jump to website A; there is also a situation where website B can only jump to website E, but website E cannot jump to website B. Therefore, the upstream and downstream relationship between each node website can be indicated by the direction.
[0160] The sample websites may include bad websites with bad content, or may include normal websites with only normal content. The classification of the sample websites is known.
[0161] Specifically, in some embodiments, the specific implementation of step S100 can be found in Figure 4 . Figure 4 is based on Figure 2 The detailed description of step S100 in the website classification method shown in the corresponding embodiment, in the website classification method, step S100 may include the following steps:
[0162] Step S110, taking each of the sample websites as a starting point, and performing jump traversal.
[0163] Step S120, recording the jump path and the website jumped to in each jump traversal process.
[0164] Step S130, generating a website link graph according to each jump path and the website jumped to in the jump traversal process.
[0165] In the embodiment of the present application, the process of generating the website link graph is to first take each sample website as the starting point and perform a jump traversal. During the jump process, the jump path and the website jumped to during the jump traversal process are recorded. Then, all sample websites and the websites jumped to by the sample websites during the jump traversal process are taken as node websites, and the jump relationship between each node website is determined according to the recorded jump path, and the jump relationship between each node website is established by jumping according to the jump relationship between each node, so as to generate the final website link graph.
[0166] In step S110, during the generation of the website link graph, the sample websites can be traversed together at the same time to save the time of the traversal, or they can be traversed one by one or in batches to ensure the smoothness of the traversal process. The website link graph can be generated after the sample website traversal is completed according to the recorded websites and jump paths, or the websites and jump relationships can be generated in the graph template along with the traversal.
[0167] Specifically, in some embodiments, the specific implementation of step S110 can refer to the following embodiments. Figure 4The detailed description of step S110 in the website classification method shown in the corresponding embodiment, in the website classification method, step S110 may include the following steps:
[0168] According to the visit volume and classification of the sample websites, all sample websites whose visit volume is greater than a predetermined visit volume threshold and whose website classification is bad are selected as starting websites;
[0169] Each of the starting point websites is taken as a starting point to perform jump traversal.
[0170] In this embodiment, the sample websites are first screened, and only the bad websites with high visit volume among the sample websites are selected as the starting websites for jump traversal, so as to ensure that enough bad websites can be jumped and traversed during the whole jump traversal process.
[0171] In step S200, there are multiple ways to determine the embedding vector, and the details can be found in the following embodiments.
[0172] Specifically, in some embodiments, the specific implementation of step S200 can be found in Figure 5 . Figure 5 is based on Figure 2 The detailed description of step S200 in the website classification method shown in the corresponding embodiment, in the website classification method, step S200 may include the following steps:
[0173] Step S210, taking each of the node websites as a starting node, performing random walk according to the jump relationship between the node websites in the website link graph, and obtaining a random walk sequence.
[0174] Step S220: determining the embedding vector of the node website according to each of the random walk sequences, wherein the embedding vector of the node website includes the embedding vector of the target website.
[0175] In this embodiment, for the website link graph, each node website is first taken as the starting node, and a random walk is performed according to the jump relationship between the node websites in the website link graph to obtain a random walk sequence. After obtaining the random walk sequence, each random walk sequence is analyzed to obtain the embedding vectors of all node websites, that is, the embedding vectors of all target websites and the embedding vectors of all sample websites.
[0176] In step S210, the random walk sequence corresponding to the node website is the path of its random walk. Each node website serving as a starting node generates a random walk sequence corresponding to the node website after random walk.
[0177] In step S220, the random walk sequence is generally analyzed by various models to obtain the embedding vector of each node website. The specific training method can be found in the following embodiment.
[0178] Specifically, in some embodiments, the specific implementation of step S220 can refer to this embodiment. Figure 5 The detailed description of step S220 in the website classification method shown in the corresponding embodiment, in the website classification method, step S220 may include the following steps:
[0179] Input the random walk sequence into the word2vec model for training to obtain a mapping relationship table;
[0180] According to the mapping relationship table, an embedding vector of the target website is determined.
[0181] In an embodiment of the present application, the random walk sequence is analyzed by the word2vec model to obtain the embedding vector of each node website.
[0182] Specifically, there are many types of word2vec models, and different types of word2vec models have different training methods. The following will take the CBOW and Skip gram models as examples to illustrate.
[0183] The specific method of training the CBOW model is to make any node website in each random walk sequence vacant, and use the node website at the vacant position as a label to obtain a training sample. Then the above training sample is input into the CBOW model, and the CBOW model outputs the predicted node website at the vacant position. During the training process of the CBOW model, the mapping relationship table of the CBOW model is continuously adjusted. After the CBOW model is trained, the embedding vector of each node website is determined according to the mapping relationship table of the CBOW model.
[0184] The specific method of training the Skip gram model is to take any node website in each random walk sequence as a sample, and use the random walk sequence as a label to obtain a training sample. Then the above training sample is input into the Skip gram model, and the Skip gram model outputs the predicted corresponding random walk sequence. During the training process of the Skip gram model, the mapping relationship table of the Skip gram model is continuously adjusted. After the Skip gram model is trained, the embedding vector of each node website is determined according to the mapping relationship table of the Skip gram model.
[0185] In step S300, the embedding vector of the target website is analyzed, and the classification of the target website is generally processed by a machine learning model. That is, the embedding vector of the target website is input into the machine learning model, and the machine learning model outputs the classification of the target website. There are many forms of machine learning models, which will be explained one by one with examples below.
[0186] Specifically, in some embodiments, the specific implementation of step S300 can refer to the following embodiments. Figure 2 The detailed description of step S300 in the website classification method shown in the corresponding embodiment, in the website classification method, step S300 may include the following steps:
[0187] The embedding vector of the target website is input into a first website classification model, and the first website classification model outputs the classification of the target website.
[0188] In this embodiment, the machine learning model used is a first website classification model that does not require preprocessing of the embedded vector. The embedded vector of the target website only needs to be directly input into the first classification model, and the first classification model can obtain the classification of the target website.
[0189] During the training of the first website classification model, the embedding vectors of the sample websites in the embedding vectors of the node websites obtained in the aforementioned step S200 are used as training samples. The website classification of the sample websites is known, that is, each training sample is labeled with a website classification.
[0190] Specifically, the training method of the first website classification model includes:
[0191] Obtain an embedding vector sample set, wherein the embedding vector sample set includes a plurality of embedding vector samples, the embedding vector samples are embedding vectors corresponding to the sample websites, and each of the embedding vector samples includes a corresponding website classification label;
[0192] Inputting the embedding vector samples in the embedding vector sample set into the first website classification model to obtain a website classification result output by the first website classification model;
[0193] If after the embedding vector samples in the embedding vector sample set that do not exceed a first predetermined proportion are input into the first website classification model, the corresponding website classification labels of the website classification results obtained are consistent, adjusting the coefficients of the first website classification model;
[0194] If, after more than a first predetermined proportion of the embedding vector samples in the embedding vector sample set are input into the first website classification model, the corresponding website classification labels of the obtained website classification results are consistent, the training is completed.
[0195] Specifically, in some other embodiments, the specific implementation of step S300 can be found in Figure 6 . Figure 6 is based on Figure 2 The detailed description of step S300 in the website classification method shown in the corresponding embodiment, in the website classification method, step S300 may include the following steps:
[0196] Step S310: Determine the embedding vectors of the neighboring nodes of the target website according to the website link graph.
[0197] Step S320: concatenate the embedding vectors of the neighboring nodes of the target website and the embedding vector of the target website to form a concatenated vector.
[0198] Step S330: input the concatenated vector into a second website classification model, and the second website classification model outputs the classification of the target website.
[0199] In this embodiment, the machine learning model uses a second website classification model that requires preprocessing of the embedded vector before input. When inputting the second website classification model, it is necessary to first find the adjacent nodes of the target website in the website link graph, obtain the embedded vectors of the adjacent nodes, and splice the embedded adjacent nodes of the target node and the embedded vectors of the adjacent nodes together to obtain a spliced vector. Finally, the spliced vector obtained after preprocessing is input into the second website classification model, and the second website classification model outputs the classification of the target website.
[0200] In step S310, the target website adjacent nodes may include websites directly adjacent to the target website in the website link graph, i.e., websites to which the target website can directly jump and websites that can directly jump to the target website; they may also include websites indirectly adjacent to the target website in the website link graph, i.e., websites to which the target website can eventually jump after multiple jumps and websites that can eventually jump to the target website after multiple jumps. In this step, for the selection of the target website adjacent nodes, only websites directly adjacent to the target website in the website link graph may be selected, or several node websites closest to the target website may be selected according to the distance from the target website, and the number of node websites selected may be determined according to the size of the embedding vector of the target website.
[0201] In step S320, multiple vectors are concatenated into one vector so as to be input into the second web page classification model. There are many specific ways to concatenate vectors, and the specific examples can be referred to in the following embodiments.
[0202] Specifically, in some embodiments, the specific implementation of step S320 can refer to the following embodiments. Figure 6The detailed description of step S320 in the website classification method shown in the corresponding embodiment, in the website classification method, step S320 may include the following steps:
[0203] The embedding vectors of the adjacent nodes of the target website are added bit by bit and averaged to obtain an adjacency vector.
[0204] The adjacency vector and the embedding vector of the target website are concatenated together to form a concatenated vector.
[0205] In an embodiment of the present application, the vector splicing method is to first process the embedded vectors of the adjacent nodes of the target website into a vector, namely the adjacency vector, and then splice the adjacency vector and the embedded vector of the target website to obtain a spliced vector.
[0206] It should be noted that, in this embodiment, the embedding vectors of the adjacent nodes of the target website are processed by adding and averaging by dimension. In other embodiments, the embedding vectors of each adjacent node may be weighted according to the distance from the target node, and then all the embedding vectors may be weighted and averaged.
[0207] In step S330, after obtaining the preprocessed concatenation vector, the concatenation vector only needs to be directly input into the second classification model, and the second classification model can obtain the classification of the target website.
[0208] During the training of the second website classification model, the sample websites among the node websites obtained in the aforementioned step S200 are used as training samples. The website classification of the sample websites is known, that is, each training sample is labeled with a website classification.
[0209] Specifically, the training method of the second website classification model includes:
[0210] Determining embedding vectors of adjacent nodes of the sample website according to the website link graph;
[0211] splicing the embedding vectors of the adjacent nodes of the sample website and the embedding vector of the sample website together to form a splicing vector;
[0212] The splicing vectors of the sample websites are grouped together to form a splicing vector sample set, wherein the splicing vector of each sample website is a splicing vector sample, and each splicing vector sample includes a corresponding website classification label;
[0213] Inputting the splicing vector samples in the splicing vector sample set into the second website classification model to obtain the website classification result output by the second website classification model;
[0214] If after the splicing vector samples in the splicing vector sample set not exceeding a second predetermined proportion are input into the second website classification model, the corresponding website classification labels of the website classification results obtained are consistent, adjusting the coefficients of the second website classification model;
[0215] If, after the splicing vector samples exceeding the second predetermined ratio in the splicing vector sample set are input into the second website classification model, the corresponding website classification labels of the obtained website classification results are consistent, the training is completed.
[0216] Figure 7 The following is a schematic diagram showing the structure of a website classification device provided in an embodiment of the present application. Figure 7 As shown, the website classification device 700 may at least include: a generation module 710, a determination module 720, and a classification module 730. Among them:
[0217] A generating module 710 is used to generate a website link graph based on a plurality of sample websites, wherein the website link graph includes jump relationships between a plurality of node websites, wherein the node websites include the sample websites and websites obtained by at least one jump from the sample websites;
[0218] A determination module 720 is used to determine an embedding vector of a target website according to the jump relationship between the node websites in the website link graph, wherein the target website is other websites in the website link graph except the sample website;
[0219] The classification module 730 is used to determine the classification of the target website according to the embedding vector of the target website.
[0220] In a possible implementation, the generating module specifically includes:
[0221] A jump traversal submodule, used to perform jump traversal with the plurality of sample websites as starting points respectively;
[0222] A jump record submodule, used to record the jump path and the website jumped to in each jump traversal process;
[0223] The jump generation submodule is used to generate a website link graph according to the jump path and the website jumped to in each jump traversal process.
[0224] In a possible implementation, the jump traversal submodule specifically includes:
[0225] A starting point determination unit, configured to select, according to the visit volume and classification of the sample websites, all sample websites whose visit volume is greater than a predetermined visit volume threshold and whose website classification is bad as starting point websites;
[0226] The jump traversal unit is used to perform jump traversal with the starting point website as the starting point.
[0227] In a possible implementation, the determining module specifically includes:
[0228] A random walk submodule is used to take the node website as the starting node, perform random walk according to the jump relationship between the node websites in the website link graph, and obtain a random walk sequence;
[0229] The vector determination submodule is used to determine the embedding vector of the node website according to the random walk sequence, and the embedding vector of the node website includes the embedding vector of the target website.
[0230] In a possible implementation manner, the vector determination submodule specifically includes:
[0231] A mapping relationship unit, used for inputting the random walk sequence into a word2vec model for training to obtain a mapping relationship table;
[0232] A vector determination unit is used to determine the embedding vector of the target website according to the mapping relationship table.
[0233] In a possible implementation, the classification module specifically includes:
[0234] The first model submodule is used to input the embedding vector of the target website into a first website classification model, and the first website classification model outputs the classification of the target website.
[0235] In a possible implementation, the embedding vector of the node website also includes the embedding vector of the sample website, and the website classification of the sample website is known; the website classification device further includes:
[0236] A first sample module obtains an embedding vector sample set, wherein the embedding vector sample set includes a plurality of embedding vector samples, the embedding vector samples are embedding vectors corresponding to the sample websites, and each of the embedding vector samples includes a corresponding website classification label;
[0237] A first input module, used for inputting the embedding vector samples in the embedding vector sample set into the first website classification model to obtain the website classification result output by the first website classification model;
[0238] A first adjustment module is configured to adjust the coefficient of the first website classification model if the website classification results obtained after the embedding vector samples in the embedding vector sample set not exceeding a first predetermined proportion are input into the first website classification model have the same corresponding website classification labels;
[0239] The first ending module is used to end the training if the website classification results obtained after more than a first predetermined proportion of the embedded vector samples in the embedded vector sample set are input into the first website classification model have the same corresponding website classification labels.
[0240] In a possible implementation, the classification module specifically includes:
[0241] An adjacent vector submodule, used to determine the embedding vectors of the adjacent nodes of the target website according to the website link graph;
[0242] A splicing vector submodule, used to splice the embedding vectors of the neighboring nodes of the target website and the embedding vector of the target website together to form a splicing vector;
[0243] The second model submodule is used to input the splicing vector into a second website classification model, and the second website classification model outputs the classification of the target website.
[0244] In a possible implementation, the embedding vector of the node website also includes the embedding vector of the sample website, the website classification of the sample website is known, and the website classification device further includes:
[0245] A vector search module, used to determine the embedding vectors of the adjacent nodes of the sample website according to the website link graph;
[0246] A vector concatenation module, used to concatenate the embedding vectors of the adjacent nodes of the sample website and the embedding vector of the sample website to form a concatenated vector;
[0247] A second sample module is used to collect the splicing vectors of the sample websites together to form a splicing vector sample set, wherein the splicing vector of each sample website is a splicing vector sample, and each of the splicing vector samples includes a corresponding website classification label;
[0248] A second input module, used for inputting the splicing vector samples in the splicing vector sample set into the second website classification model to obtain the website classification result output by the second website classification model;
[0249] A second adjustment module is used to adjust the coefficient of the second website classification model if the corresponding website classification labels of the website classification results obtained after the splicing vector samples in the splicing vector sample set not exceeding a second predetermined proportion are input into the second website classification model are consistent;
[0250] The second ending module is used to end the training if the corresponding website classification labels of the website classification results obtained after the splicing vector samples exceeding the second predetermined ratio in the splicing vector sample set are input into the second website classification model are consistent.
[0251] In a possible implementation, the splicing vector module specifically includes:
[0252] An adjacency vector unit, used for adding and averaging the embedding vectors of the adjacent nodes of the target website bit by bit to obtain an adjacency vector;
[0253] The splicing vector unit is used to splice the adjacency vector and the embedding vector of the target website together to form a splicing vector.
[0254] In an embodiment of the present application, a link graph is first generated based on a sample website, and the jump relationship between each node website is determined based on the link graph. The classification of the target website is determined based on the jump relationship between each node website. In the entire classification process, the classification only needs to be determined based on the jump relationship between the website and the website, and there is no need to read the page content of the website, which solves the problem of detection failure caused by the inability to read the correct website page. At the same time, since the embodiment of the present application does not need to read the web page content, it can also solve various missed detections caused by the inability to read the page content. For example, missed detections caused by the generalization ability of the sample library model, missed detections caused by language problems, and missed detections caused by the crawler's inability to crawl to the website.
[0255] It should be noted that when the website classification device provided in the above embodiment executes the website classification method, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the wireless screen projection connection device and the wireless screen projection connection method embodiment provided in the above embodiment belong to the same concept. The implementation process is detailed in the method embodiment, which will not be repeated here.
[0256] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0257] See also Figure 8 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 8 As shown, the electronic device 800 may include: at least one processor 801 , at least one network interface 804 , a user interface 803 , a memory 805 , and at least one communication bus 802 .
[0258] The communication bus 802 is used to realize the connection and communication between these components.
[0259] The user interface 803 may include a display screen (Display) and a camera (Camera), and the optional user interface 803 may also include a standard wired interface and a wireless interface.
[0260] The network interface 804 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0261] Among them, the processor 801 may include one or more processing cores. The processor 801 uses various interfaces and lines to connect various parts of the entire electronic device 800, and executes various functions and processes data of the electronic device 80 by running or executing instructions, programs, code sets or instruction sets stored in the memory 805, and calling data stored in the memory 805. Optionally, the processor 801 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 801 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 801, and it can be implemented separately through a chip.
[0262] Among them, the memory 805 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 805 includes a non-transitory computer-readable storage medium. The memory 805 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 805 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory 805 may optionally be at least one storage device located away from the aforementioned processor 801. As Figure 8 As shown, the memory 805 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a website classification application program.
[0263] exist Figure 8 In the electronic device 800 shown, the user interface 803 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 801 can be used to call the website classification application stored in the memory 805 and specifically perform the following operations:
[0264] Generate a website link graph based on multiple sample websites, the website link graph includes jump relationships between multiple node websites, the node websites include the sample websites and websites obtained from the sample websites after at least one jump;
[0265] Determine an embedding vector of a target website according to the jump relationship between each node website in the website link graph, wherein the target website is other websites in the website link graph except the sample website;
[0266] The classification of the target website is determined according to the embedding vector of the target website.
[0267] In a possible implementation, when the processor generates a website link graph according to a plurality of sample websites, the processor specifically performs:
[0268] Taking the plurality of sample websites as starting points, respectively, jump and traverse;
[0269] Record the jump path and the website jumped to during each jump traversal process;
[0270] A website link graph is generated according to the jump path and the website jumped to in each jump traversal process.
[0271] In a possible implementation, the processor takes the plurality of sample websites as starting points and performs jump traversal by specifically executing:
[0272] According to the visit volume and classification of the sample websites, all sample websites whose visit volume is greater than a predetermined visit volume threshold and whose website classification is bad are selected as starting websites;
[0273] Each of the starting point websites is taken as a starting point to perform jump traversal.
[0274] In a possible implementation, when the processor determines the embedding vector of the target website according to the website link graph, specifically performs:
[0275] Taking the node website as the starting node, performing random walk according to the jump relationship between the node websites in the website link graph to obtain a random walk sequence;
[0276] According to the random walk sequence, an embedding vector of the node website is determined, and the embedding vector of the node website includes the embedding vector of the target website.
[0277] In a possible implementation, when the processor determines the embedding vector of the target website according to the random walk sequence, specifically performs:
[0278] Input the random walk sequence into the word2vec model for training to obtain a mapping relationship table;
[0279] According to the mapping relationship table, an embedding vector of the target website is determined.
[0280] In a possible implementation, when the processor determines the classification of the target website according to the embedding vector of the target website, specifically performs:
[0281] The embedding vector of the target website is input into a first website classification model, and the first website classification model outputs the classification of the target website.
[0282] In a possible implementation, the embedding vector of the node website further includes the embedding vector of the sample website, and the website classification of the sample website is known; and the processor is further configured to execute:
[0283] Obtain an embedding vector sample set, wherein the embedding vector sample set includes a plurality of embedding vector samples, the embedding vector samples are embedding vectors corresponding to the sample websites, and each of the embedding vector samples includes a corresponding website classification label;
[0284] Inputting the embedding vector samples in the embedding vector sample set into the first website classification model to obtain a website classification result output by the first website classification model;
[0285] If after the embedding vector samples in the embedding vector sample set that do not exceed a first predetermined proportion are input into the first website classification model, the corresponding website classification labels of the website classification results obtained are consistent, adjusting the coefficients of the first website classification model;
[0286] If, after more than a first predetermined proportion of the embedding vector samples in the embedding vector sample set are input into the first website classification model, the corresponding website classification labels of the obtained website classification results are consistent, the training is completed.
[0287] In a possible implementation, when the processor determines the classification of the target website according to the embedding vector of the target website, specifically performs:
[0288] Determining embedding vectors of adjacent nodes of the target website according to the website link graph;
[0289] splicing the embedding vectors of the neighboring nodes of the target website and the embedding vector of the target website together to form a splicing vector;
[0290] The concatenated vector is input into a second website classification model, and the second website classification model outputs the classification of the target website.
[0291] In a possible implementation, the embedding vector of the node website further includes the embedding vector of the sample website, the website classification of the sample website is known, and the processor is further configured to execute:
[0292] Determining embedding vectors of adjacent nodes of the sample website according to the website link graph;
[0293] splicing the embedding vectors of the adjacent nodes of the sample website and the embedding vector of the sample website together to form a splicing vector;
[0294] The splicing vectors of the sample websites are grouped together to form a splicing vector sample set, wherein the splicing vector of each sample website is a splicing vector sample, and each splicing vector sample includes a corresponding website classification label;
[0295] Inputting the splicing vector samples in the splicing vector sample set into the second website classification model to obtain the website classification result output by the second website classification model;
[0296] If after the splicing vector samples in the splicing vector sample set not exceeding a second predetermined proportion are input into the second website classification model, the corresponding website classification labels of the website classification results obtained are consistent, adjusting the coefficients of the second website classification model;
[0297] If, after the splicing vector samples exceeding the second predetermined ratio in the splicing vector sample set are input into the second website classification model, the corresponding website classification labels of the obtained website classification results are consistent, the training is completed.
[0298] In a possible implementation, when the output processor concatenates the embedding vectors of the neighboring nodes of the target website and the embedding vector of the target website to form a concatenated vector, specifically:
[0299] Add the embedding vectors of the adjacent nodes of the target website bit by bit and take the average to obtain an adjacency vector;
[0300] The adjacency vector and the embedding vector of the target website are concatenated together to form a concatenated vector.
[0301] In a possible implementation manner, before the processor obtains at least one model parameter to be updated, it is further configured to execute:
[0302] Searching for a storage node corresponding to each of the at least one model parameter to be updated;
[0303] The obtaining of at least one model parameter to be updated comprises:
[0304] The at least one model parameter to be updated is obtained from each storage node corresponding to the at least one model parameter to be updated.
[0305] In a possible implementation, before searching for a storage node of at least one model parameter to be updated, the processor is further configured to execute: determining a hash value of the at least one model parameter to be updated;
[0306] When the processor searches for at least one storage node of a model parameter to be updated, the processor specifically executes:
[0307] According to the hash value of the at least one model parameter to be updated, a storage node corresponding to each of the at least one model parameter to be updated is determined.
[0308] In a possible implementation, the model parameters to be updated are obtained by training a node storing the model parameters to be updated according to gradient values uploaded by other nodes.
[0309] In a possible implementation manner, after updating the at least one model parameter to be updated, the processor is further configured to execute:
[0310] The gradient information of the at least one model parameter to be updated after training is uploaded to the storage node corresponding to each of the at least one model parameter to be updated, so that the storage node corresponding to each of the at least one model parameter to be updated uses a machine learning optimization algorithm to train the at least one model parameter to be updated.
[0311] In an embodiment of the present application, a link graph is first generated based on a sample website, and the jump relationship between each node website is determined based on the link graph. The classification of the target website is determined based on the jump relationship between each node website. In the entire classification process, the classification only needs to be determined based on the jump relationship between the website and the website, and there is no need to read the page content of the website, which solves the problem of detection failure caused by the inability to read the correct website page. At the same time, since the embodiment of the present application does not need to read the web page content, it can also solve various missed detections caused by the inability to read the page content. For example, missed detections caused by the generalization ability of the sample library model, missed detections caused by language problems, and missed detections caused by the crawler's inability to crawl to the website.
[0312] The embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a computer or a processor, the computer or the processor executes the above-mentioned Figure 2 , Figure 4-Figure 6One or more steps in the illustrated embodiment. If the above-mentioned website classification device and each component module of the electronic device are implemented in the form of software functional units and sold or used as independent products, they can be stored in the computer-readable storage medium.
[0313] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted by the computer-readable storage medium. The computer instructions can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0314] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The aforementioned storage medium includes: various media that can store program codes, such as system memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk. In the absence of conflict, the technical features in this embodiment and the implementation scheme can be combined arbitrarily.
[0315] The embodiments described above are merely preferred embodiments of the present application and are not intended to limit the scope of the present application. Without departing from the design spirit of the present application, various modifications and improvements made to the technical solutions of the present application by ordinary technicians in this field should fall within the protection scope determined by the claims of the present application.
Claims
1. A website classification method, characterized in that: The website classification method includes: Generate a website link graph based on multiple sample websites, the website link graph includes jump relationships between multiple node websites, the node websites include the sample websites and websites obtained from the sample websites after at least one jump; Determine an embedding vector of a target website according to the jump relationship between each node website in the website link graph, wherein the target website is other websites in the website link graph except the sample website; The classification of the target website is determined according to the embedding vector of the target website.
2. The method according to claim 1, characterized in that Generating a website link graph based on a plurality of sample websites specifically includes: Taking the plurality of sample websites as starting points, respectively, jump and traverse; Record the jump path and the website jumped to during each jump traversal process; A website link graph is generated according to the jump path and the website jumped to in each jump traversal process.
3. The method according to claim 2, characterized in that The jump traversal is performed by taking the plurality of sample websites as starting points, specifically including: According to the visit volume and classification of the sample websites, all sample websites whose visit volume is greater than a predetermined visit volume threshold and whose website classification is bad are selected as starting websites; Each of the starting point websites is taken as a starting point to perform jump traversal.
4. The method according to claim 1, characterized in that Determining the embedding vector of the target website according to the website link graph specifically includes: Taking the node website as the starting node, performing random walk according to the jump relationship between the node websites in the website link graph to obtain a random walk sequence; According to the random walk sequence, an embedding vector of the node website is determined, and the embedding vector of the node website includes the embedding vector of the target website.
5. The method according to claim 4, characterized in that Determining the embedding vector of the target website according to the random walk sequence specifically includes: Input the random walk sequence into the word2vec model for training to obtain a mapping relationship table; According to the mapping relationship table, an embedding vector of the target website is determined.
6. The method according to claim 4, characterized in that Determining the classification of the target website according to the embedding vector of the target website specifically includes: The embedding vector of the target website is input into a first website classification model, and the first website classification model outputs the classification of the target website.
7. The method according to claim 4, characterized in that Determining the classification of the target website according to the embedding vector of the target website specifically includes: Determining embedding vectors of adjacent nodes of the target website according to the website link graph; splicing the embedding vectors of the neighboring nodes of the target website and the embedding vector of the target website together to form a splicing vector; The concatenated vector is input into a second website classification model, and the second website classification model outputs the classification of the target website.
8. A website classification device, characterized in that: The website classification device comprises: A generating module, used to generate a website link graph according to a plurality of sample websites, wherein the website link graph includes jump relationships between a plurality of node websites, wherein the node websites include the sample websites and websites obtained by at least one jump from the sample websites; A determination module, used to determine an embedding vector of a target website according to the jump relationship between the node websites in the website link graph, wherein the target website is other websites other than the sample website in the website link graph; The classification module is used to determine the classification of the target website according to the embedding vector of the target website.
9. An electronic device, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method steps as claimed in any one of claims 1 to 7.
10. A computer storage medium, characterized in that: The computer storage medium stores a plurality of instructions, which are suitable for being loaded by a processor and executing the method steps according to any one of claims 1 to 7.
Citation Information
Patent Citations
Malicious domain name detection method and device and storage medium
CN112019569A
Directed Graph Embedding
US20100121792A1
