Web page information detection method and system based on artificial intelligence
By obtaining the text content and page links of the web page and performing comprehensive inspection and scoring, the problem that the existing technology cannot fully detect web page information is solved, the comprehensiveness and accuracy of the detection is improved, and the security evaluation of page links is enhanced.
Patent Information
- Application Number
- CN202410989191.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-07-23
AI Technical Summary
The prior art cannot conduct comprehensive testing of web page information, especially the comprehensive evaluation based on both text content and page links.
By obtaining the text content and page links of the web page, the link validity and content checks are performed separately, combined with the text content feature analysis, the trained model is used for detection and scoring, and a web page information detection report is generated to ensure the comprehensiveness and accuracy of the detection.
It realizes comprehensive detection of web page information, improves the accuracy and objectivity of detection of links and text content, and enhances the security evaluation ability of page links.
Smart Images

Figure CN118520193B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to a web page information detection method and system based on artificial intelligence. Background Art
[0002] In the related art, CN111506852A discloses an intelligent web data monitoring device, including a square device box, hardware, operating system and software, wherein the hardware includes a CPU processor, RAM memory, ROM memory, Flash memory, network interface module, LCD display and power module, and the software includes a neural network framework, a graphics image processing framework, a database system, equipment management software, image screenshot software, image recognition software, data analysis software and early warning software. The scheme also provides a monitoring method based on an intelligent web data monitoring device, which uses artificial intelligence to simulate human operations to detect and evaluate the content of website web pages, so that the monitored web page display effect is the same as the effect actually seen by users browsing the web pages. If illegal web page content and information are found, the artificial intelligence will automatically cut off the website from the outside world to reduce the consequences of bad public opinion. It can effectively save labor costs and reduce the evaluation error of website web page content.
[0003] CN117786266A discloses an artificial intelligence management method and robot for identifying pornographic websites. It uses links in web pages searched out by information related to pornography or associated with pornography to deeply search for possible pornographic web pages, and then identifies pornographic web pages through artificial intelligence models. The artificial intelligence model is used to block or replace pornographic content in pornographic web pages. Pornographic web pages can be detected in time and modified, making the network environment healthier.
[0004] Based on the above-mentioned related technologies, artificial intelligence can be used to imitate human operations to detect and evaluate the content of website web pages. However, the related technologies do not take into account the security of the web links in the website, that is, it is impossible to conduct a comprehensive detection of web page information based on both text content and page links.
[0005] The information disclosed in the background technology section of this application is only intended to deepen the understanding of the general background technology of this application, and should not be regarded as an admission or any form of implication that the information constitutes the prior art already known to those skilled in the art. Summary of the invention
[0006] The present invention provides a web page information detection method and system based on artificial intelligence, which can solve the technical problem that the related technology cannot comprehensively detect web page information based on text content and page links.
[0007] According to a first aspect of the present invention, there is provided a web page information detection method based on artificial intelligence, comprising:
[0008] Obtaining web page information of the web page to be detected, wherein the web page information includes: text content and page links;
[0009] Determine the link validity check result and the link content check result according to the page link;
[0010] Determining a page link detection score according to the link validity check result and the link content check result;
[0011] Determine text content features according to the text content, wherein the text content features include: keywords, phrases, keyword frequency and phrase frequency;
[0012] The text content features are processed by a trained text content detection model to determine a text content compliance detection score;
[0013] Determining a webpage information detection score according to the text content compliance detection score and the page link detection score;
[0014] A web page information detection report is generated based on the web page information detection score.
[0015] According to a second aspect of the present invention, there is provided a web page information detection system based on artificial intelligence, comprising:
[0016] A web page information module, used to obtain web page information of the web page to be detected, wherein the web page information includes: text content and page links;
[0017] A page link module, used to determine a link validity check result and a link content check result according to the page link;
[0018] A page link detection module, used to determine a page link detection score according to the link validity check result and the link content check result;
[0019] A text content feature module, used to determine text content features according to the text content, wherein the text content features include: keywords, phrases, keyword frequency and phrase frequency;
[0020] A text content detection module, used to process the text content features through a trained text content detection model to determine a text content compliance detection score;
[0021] A web page information detection module, used to determine a web page information detection score according to the text content compliance detection score and the page link detection score;
[0022] The detection report module is used to generate a web page information detection report based on the web page information detection score.
[0023] Technical effect: According to the present invention, it is possible to accurately determine whether a web page link is valid and whether the content is consistent with the expected content, and analyze the text content in the web page to be detected through the trained text content detection model. Furthermore, based on the two aspects of page link detection and text content detection, the web page information can be comprehensively detected, thereby improving the comprehensiveness and accuracy of web page information detection. When determining the page link detection score, the page link detection score can be determined based on the link validity check results, link content check results, website information vectors, and malicious website information vectors. During the calculation process, the page link can be comprehensively detected based on the three aspects of the page link's security status, validity, and content check, thereby improving the comprehensiveness, accuracy, and objectivity of the page link detection score. When determining the first training loss function, the first training loss function can be determined based on the standard text compliance score, known compliance keyword semantic vectors, known compliance phrase semantic vectors, first text content compliance detection score, compliance sample keyword semantic vectors, compliance sample phrase semantic vectors, compliance sample keyword word frequency, and compliance sample phrase word frequency, so that the text content detection model reduces the first training loss function during the training process, and makes the trained text content detection model more suitable for text content detection of compliant text content, and improves the accuracy of the load forecasting model in a more targeted manner. When determining the second training loss function, the second training loss function can be determined based on the standard text compliance score, known non-compliant keyword semantic vectors, known non-compliant phrase semantic vectors, second text content compliance detection score, non-compliant sample keyword semantic vectors, non-compliant sample phrase semantic vectors, non-compliant sample keyword word frequency, and non-compliant sample phrase word frequency, so that the text content detection model reduces the second training loss function during the training process, and makes the trained text content detection model more suitable for text content detection of non-compliant text content, and improves the accuracy of the load forecasting model in a more targeted manner.
[0024] It should be understood that the above general description and the following detailed description are exemplary and explanatory only and do not limit the present invention. Other features and aspects of the present invention will become more apparent from the following detailed description of exemplary embodiments with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other embodiments can be obtained based on these drawings without creative work.
[0026] Figure 1A schematic diagram exemplarily shows a flow chart of a web page information detection method based on artificial intelligence according to an embodiment of the present invention;
[0027] Figure 2 A block diagram of a web page information detection system based on artificial intelligence according to an embodiment of the present invention is exemplarily shown. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0029] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0030] Figure 1 The following is a flow chart of a method for detecting web page information based on artificial intelligence according to an embodiment of the present invention, wherein the method comprises:
[0031] Step S101, obtaining web page information of a web page to be detected, wherein the web page information includes: text content and page links;
[0032] Step S102, determining a link validity check result and a link content check result according to the page link;
[0033] Step S103, determining a page link detection score according to the link validity check result and the link content check result;
[0034] Step S104, determining text content features according to the text content, wherein the text content features include: keywords, phrases, keyword frequency and phrase frequency;
[0035] Step S105, processing the text content features through the trained text content detection model to determine the text content compliance detection score;
[0036] Step S106, determining a web page information detection score according to the text content compliance detection score and the page link detection score;
[0037] Step S107: generating a web page information detection report according to the web page information detection score.
[0038] According to the artificial intelligence-based web page information detection method of an embodiment of the present invention, it is possible to accurately determine whether a web page link is valid and whether the content is consistent with the expected content, and to analyze the text content in the web page to be detected through a trained text content detection model. Furthermore, based on both page link detection and text content detection, a comprehensive detection of web page information can be performed, thereby improving the comprehensiveness and accuracy of web page information detection.
[0039] According to an embodiment of the present invention, in step S101, web page information of a web page to be detected is obtained, wherein the web page information includes text content and page links.
[0040] For example, use crawler technology or API interface to collect the HTML source code, JavaScript files and CSS style sheets of the target web page, clean the captured data, remove noise, redundancy and invalid information, ensure the accuracy and consistency of the data, and extract useful feature information from the cleaned data, such as text content and page links.
[0041] According to an embodiment of the present invention, in step S102, a link validity check result and a link content check result are determined according to the page link.
[0042] According to one embodiment of the present invention, step S102 includes:
[0043] Determine the link validity check result based on the HTTP request and response mechanism of the page link;
[0044] According to the page link, determining the return content of the page link;
[0045] A link content check result is determined according to the returned content and the expected content.
[0046] For example, using the HTTP request and response mechanism, check whether the link returns a valid HTTP status code (for example, HTTP status code 200 indicates success), and determine the link validity check result based on the returned HTTP status code; for links whose returned HTTP status code is a valid status code, further check whether its content is valid. For example, check whether the returned content is the expected HTML page, rather than redirecting to other websites or pages that display error information, and determine the link content check result based on the content returned by the page link and the expected content of the page link.
[0047] According to an embodiment of the present invention, in step S103, a page link detection score is determined according to the link validity check result and the link content check result.
[0048] According to one embodiment of the present invention, step S103 includes:
[0049] Determine the website characteristics of the website pointed to by the page link according to the page link, wherein the website characteristics include: website IP address and website domain name;
[0050] Obtain malicious website IP addresses and malicious website domain names of known malicious websites;
[0051] Determine a website information vector according to the website IP address and the website domain name;
[0052] Determine a malicious website information vector according to the malicious website IP address and the malicious website domain name;
[0053] A page link detection score is determined according to the link validity check result, the link content check result, the website information vector and the malicious website information vector.
[0054] For example, AI technology is used to analyze the characteristics of the website pointed to by the page link (for example, the website domain name and the website IP address), and the website domain name and the website IP address are used to determine whether the website pointed to by the page link is a malicious website; by participating in network security communities and forums and paying attention to reports on malicious websites and IP addresses released by other security researchers or organizations, the malicious website IP addresses and malicious website domain names of known malicious websites are obtained; the website IP addresses and website domain names pointed to by the page link are combined into a website information vector; the malicious website IP addresses and malicious website domain names of known malicious websites are combined into a malicious website information vector; based on the link validity check results, the link content check results, the website information vector and the malicious website information vector, the validity and security of the page links in the page to be detected are evaluated, and the page link detection score is determined.
[0055] According to an embodiment of the present invention, determining a page link detection score according to the link validity check result, the link content check result, the website information vector and the malicious website information vector includes: determining a page link detection score PLD according to formula (1), (1)
[0056] Among them, if is the conditional function, max is the maximum value function, is the preset similarity threshold, is the link validity check result of the kth page link in the web page to be detected, is the link content inspection result of the kth page link in the web page to be detected, is the website IP address of the website pointed to by the kth page link in the web page to be detected, is the website domain name of the website pointed to by the k-th page link in the web page to be detected, is the malicious website IP address of the i-th known malicious website, is the malicious website domain name of the i-th known malicious website, is the website information vector of the website pointed to by the k-th page link in the web page to be detected, is the malicious website information vector of the i-th known malicious website, for The transposed vector of , where , , K is the number of page links in the web page to be detected, m is the number of known malicious websites, k≤K, i≤m, and k, K, i and m are all positive integers.
[0057] According to an embodiment of the present invention, after the website IP address and the website domain name are resolved, information in digital form can be obtained, which can be used as an element of the website information vector. is the cosine similarity between the website information vector of the website pointed to by the k-th page link in the web page to be detected and the malicious website information vector of the ith known malicious website. The smaller the cosine similarity, the less consistent the website IP address and website domain name of the website pointed to by the k-th page link are with the malicious website IP address and malicious website domain name of the ith known malicious website. The maximum value of the cosine similarity between the website information vector of the website pointed to by the k-th page link in the web page to be detected and the malicious website information vectors of m known malicious websites is taken, that is, the minimum difference between the website IP address and website domain name of the website pointed to by the k-th page link and the malicious website IP addresses and malicious website domain names of m known malicious websites is taken. The above-mentioned minimum difference processing can be used to determine the most likely situation of jumping to a malicious website through the k-th page link, and the page link detection score is determined based on this, so that the page link detection score can reflect the security status of the page link. is the link validity check result of the kth page link in the web page to be detected. When the page link returns a valid HTTP status code, the link validity check result is 0. When the page link returns an invalid HTTP status code, the link validity check result is 1. is the link content check result of the kth page link in the web page to be detected. When the returned content of the page link is consistent with the expected content, the link content check result is 0. When the returned content of the page link is inconsistent with the expected content, the link content check result is 1.
[0058] According to one embodiment of the present invention, in formula (1), <0.5, the following two situations can be expressed in the form of conditional functions: When the condition is met, it means that the security status, validity and content check of the kth page link all meet the standards. At this time, the value of the condition function is 1. When the condition is 0, it means that the security status, validity and content check of the k-th page link do not meet the standards. At this time, the value of the condition function is 0. In order to perform an averaging operation based on the number of page links in the page to be detected, the smaller the ratio is, the more links that meet the security status standard, the validity standard and the content inspection standard are.
[0059] In this way, the page link detection score can be determined based on the link validity check results, link content check results, website information vectors and malicious website information vectors. During the calculation process, the page link can be comprehensively tested based on the three aspects of security status, validity and content check of the page link, thereby improving the comprehensiveness, accuracy and objectivity of the page link detection score.
[0060] According to an embodiment of the present invention, in step S104, text content features are determined according to the text content, wherein the text content features include: keywords, phrases, keyword frequency and phrase frequency.
[0061] For example, natural language processing technology is used to extract meaningful features from text content, such as keywords and phrases, and the keyword frequency and phrase frequency of the keywords and phrases in the text content are determined.
[0062] According to one embodiment of the present invention, the training step of the text content detection model includes:
[0063] Obtain known compliant keywords, compliant phrases, non-compliant keywords, and non-compliant phrases;
[0064] Determine, according to the compliant keywords, the compliant phrases, the non-compliant keywords and the non-compliant phrases, a semantic vector of a known compliant keyword, a semantic vector of a known compliant phrase, a semantic vector of a known non-compliant keyword and a semantic vector of a known non-compliant phrase;
[0065] Acquire text samples of web pages from multiple sources, wherein the text samples include: compliant samples and non-compliant samples, and determine standard text compliance scores of the compliant samples and the non-compliant samples;
[0066] Determining the compliance sample keywords, compliance sample phrases, compliance sample keyword frequency and compliance sample phrase frequency of the compliance sample;
[0067] Determine a semantic vector of a compliant sample keyword and a semantic vector of a compliant sample phrase according to the compliant sample keyword and the compliant sample phrase;
[0068] Determining non-compliant sample keywords, non-compliant sample phrases, non-compliant sample keyword frequency, and non-compliant sample phrase frequency of the non-compliant sample;
[0069] Determine a semantic vector of a non-compliant sample keyword and a semantic vector of a non-compliant sample phrase according to the non-compliant sample keyword and the non-compliant sample phrase;
[0070] Processing the compliant sample keyword semantic vector, the compliant sample phrase semantic vector, the compliant sample keyword frequency, and the compliant sample phrase frequency through a text content detection model to determine a first text content compliance detection score;
[0071] Processing the non-compliant sample keyword semantic vector, the non-compliant sample phrase semantic vector, the non-compliant sample keyword frequency, and the non-compliant sample phrase frequency through a text content detection model to determine a second text content compliance detection score;
[0072] Determine a first training loss function according to the standard text compliance score, the known compliance keyword semantic vector, the known compliance phrase semantic vector, the first text content compliance detection score, the compliance sample keyword semantic vector, the compliance sample phrase semantic vector, the compliance sample keyword frequency and the compliance sample phrase frequency;
[0073] Determine a second training loss function according to the standard text compliance score, the known non-compliant keyword semantic vector, the known non-compliant phrase semantic vector, the second text content compliance detection score, the non-compliant sample keyword semantic vector, the non-compliant sample phrase semantic vector, the non-compliant sample keyword frequency and the non-compliant sample phrase frequency;
[0074] The text content detection model is trained according to the first training loss function and the second training loss function to determine a trained text content detection model.
[0075] For example, known compliant keywords, compliant phrases, non-compliant keywords and non-compliant phrases are obtained through public databases; known compliant keywords, compliant phrases, non-compliant keywords and non-compliant phrases are processed through a natural language processing model to obtain semantic vectors of known compliant keywords, semantic vectors of known compliant phrases, semantic vectors of known non-compliant keywords and semantic vectors of known non-compliant phrases; a large amount of text sample data, including compliant text samples and non-compliant text samples, are collected through historical records and expert annotations as samples for training text content detection models, and standard text compliance scores of compliant samples and non-compliant samples are determined through expert annotation scoring. The standard text compliance score indicates the degree of compliance of the text. The larger the standard text compliance score, the more compliant the text is with regulations; compliant sample keywords and compliant sample phrases are extracted from compliant samples using natural language processing technology, and the compliant sample keyword frequency and compliant sample phrase frequency of the compliant sample keywords and compliant sample phrases appearing in the compliant samples are determined; compliant sample keywords, compliant sample phrases and non-compliant sample phrases are categorized into the compliant sample keywords and compliant sample phrases through a natural language processing model. The non-compliant sample keywords and the non-compliant sample phrases are processed to determine the compliant sample keyword semantic vector and the compliant sample phrase semantic vector; the non-compliant sample keywords and the non-compliant sample phrases are extracted from the non-compliant samples by using natural language processing technology, and the non-compliant sample keyword frequency and the non-compliant sample phrase frequency of the non-compliant sample keywords and the non-compliant sample phrase frequency in the non-compliant samples are determined; the non-compliant sample keywords and the non-compliant sample phrases are processed by the natural language processing model to determine the non-compliant sample keyword semantic vector and the non-compliant sample phrase semantic vector; the compliant sample keyword semantic vector, the compliant sample phrase semantic vector, the compliant sample keyword frequency and the compliant sample phrase frequency are input into the untrained text content detection model to determine the first text content compliance detection score for evaluating the text content compliance degree of the compliant sample; the non-compliant sample keyword semantic vector, the non-compliant sample phrase semantic vector, the non-compliant sample keyword frequency and the non-compliant sample phrase frequency are input into the untrained text content detection model to determine the second text content compliance detection score for evaluating the text content compliance degree of the non-compliant sample.
[0076] According to an embodiment of the present invention, a first training loss function is determined based on the standard text compliance score, the known compliance keyword semantic vector, the known compliance phrase semantic vector, the first text content compliance detection score, the compliance sample keyword semantic vector, the compliance sample phrase semantic vector, the compliance sample keyword word frequency and the compliance sample phrase word frequency, including: determining the first training loss function of the text content detection model according to formula (2): ,
[0077] (2)
[0078] Among them, max is the maximum value function, is the word frequency of the compliant sample phrase of the e-th compliant sample phrase of the r-th compliant sample, is the compliant sample keyword frequency of the j-th compliant sample keyword of the r-th compliant sample, is the preset word frequency threshold, is the semantic vector of the jth compliant sample keyword of the rth compliant sample, is the semantic vector of the e-th compliant sample phrase of the r-th compliant sample, is the semantic vector of the a-th known compliant keyword, is the semantic vector of the d-th known compliant phrase, Score the standard text compliance of the rth compliance sample, Score the compliance detection of the first text content of the rth compliance sample, for The transposed vector of for where R is the number of compliant samples, A is the number of known compliant keywords, D is the number of known compliant phrases, n is the number of compliant sample keywords, E is the number of compliant sample phrases, e≤E, d≤D, r≤R, a≤A, j≤n, and e, E, d, D, r, R, a, A, j, and n are all positive integers.
[0079] According to one embodiment of the present invention, is the ratio of the compliant sample phrase word frequency of the e-th compliant sample phrase of the r-th compliant sample to the preset word frequency threshold, indicating the frequency of occurrence of the e-th compliant sample phrase of the r-th compliant sample. Indicates the frequency of occurrence of the keyword of the jth compliant sample in the rth compliant sample, is the cosine similarity between the semantic vector of the compliant sample keyword of the jth compliant sample keyword of the rth compliant sample and the semantic vector of the ath known compliant keyword. The larger the cosine similarity, the closer the semantics of the jth compliant sample keyword in the rth compliant sample is to the semantics of the ath known compliant keyword. is the cosine similarity between the semantic vector of the compliant sample phrase of the e-th compliant sample phrase of the r-th compliant sample and the semantic vector of the d-th known compliant phrase. The larger the cosine similarity, the closer the semantics of the e-th compliant sample phrase in the r-th compliant sample is to the semantics of the d-th known compliant phrase. The maximum value of the cosine similarity between the semantic vector of the compliant sample keyword of the jth compliant sample keyword of the rth compliant sample and the semantic vector of the ath known compliant keyword is taken, that is, the minimum difference between the semantics of the jth compliant sample keyword in the rth compliant sample and the semantics of the Ath known compliant keywords. The above-mentioned minimum difference processing can be used to determine the compliance degree of the jth compliant sample keyword of the rth compliant sample. The maximum value of the cosine similarity between the semantic vector of the compliant sample phrase of the e-th compliant sample phrase of the r-th compliant sample and the semantic vector of the d-th known compliant phrase is taken, that is, the minimum difference between the semantics of the e-th compliant sample phrase in the r-th compliant sample and the semantics of the D known compliant phrases. The above-mentioned process of taking the minimum difference can be used to determine the compliance degree of the e-th compliant sample phrase of the r-th compliant sample.
[0080] The frequency of occurrence of the compliance sample phrases and the compliance degree of the compliance sample phrases are positively correlated with the compliance degree of the compliance samples. For example, when the compliance degree of the phrases in the text sample is higher and the frequency of occurrence of the phrases is higher, the compliance degree of the text sample is higher.
[0081] The frequency of occurrence of the compliant sample keywords and the compliance degree of the compliant sample keywords are positively correlated with the compliance degree of the compliant sample. For example, the higher the compliance degree of the keywords in the text sample and the higher the frequency of occurrence of the keywords, the higher the compliance degree of the text sample.
[0082] It represents the relative difference between the standard text compliance score of the r-th compliant sample evaluated by the expert and the first text content compliance detection score of the r-th compliant sample determined according to the untrained text content detection model.
[0083] According to one embodiment of the present invention, using The average operation is performed based on the number of compliant sample phrases, using The weight of the relative difference is obtained by averaging the number of keywords in the compliance samples, and the weighted average of the relative difference is obtained based on the weight to obtain the first training loss function. During the training process, the loss function is reduced, so that the error between the first text content compliance detection score and the standard text compliance score is reduced, and the accuracy of the text content detection model in judging the compliance degree of the text content is improved, thereby improving the accuracy of the text content detection model.
[0084] In this way, the first training loss function can be determined based on the standard text compliance score, known compliance keyword semantic vectors, known compliance phrase semantic vectors, the first text content compliance detection score, compliance sample keyword semantic vectors, compliance sample phrase semantic vectors, compliance sample keyword frequency and compliance sample phrase frequency, so that the first training loss function can be reduced during the training process of the text content detection model, and the trained text content detection model can be more suitable for text content detection of compliant text content, thereby improving the accuracy of the load forecasting model in a more targeted manner.
[0085] According to an embodiment of the present invention, according to the standard text compliance score, the known non-compliant keyword semantic vector, the known non-compliant phrase semantic vector, the second text content compliance detection score, the non-compliant sample keyword semantic vector, the non-compliant sample phrase semantic vector, the non-compliant sample keyword frequency and the non-compliant sample phrase frequency, determining a second training loss function, including: determining the second training loss function of the text content detection model according to formula (3): , (3)
[0086] Among them, max is the maximum value function, is the frequency of the non-compliant sample phrase of the qth non-compliant sample phrase of the yth non-compliant sample, is the frequency of the non-compliant sample keyword of the g-th non-compliant sample keyword of the y-th non-compliant sample, is the preset word frequency threshold, is the semantic vector of the g-th non-compliant sample keyword of the y-th non-compliant sample, is the semantic vector of the qth non-compliant sample phrase of the yth non-compliant sample, is the semantic vector of the bth known non-compliant keyword, is the semantic vector of the t-th known non-compliant phrase, Score the standard text compliance of the y-th non-compliant sample, Score the compliance detection of the second text content of the yth non-compliant sample, for The transposed vector of for where B is the number of known non-compliant keywords, T is the number of known non-compliant phrases, Y is the number of non-compliant samples, G is the number of non-compliant sample keywords, Q is the number of non-compliant sample phrases, b≤B, t≤T, y≤Y, g≤G, q≤Q, and b, B, t, T, y, Y, g, G, q and Q are all positive integers.
[0087] According to one embodiment of the present invention, Indicates the frequency of occurrence of the qth non-compliant sample phrase of the yth non-compliant sample, Indicates the frequency of occurrence of the g-th non-compliant sample keyword in the y-th non-compliant sample. is the cosine similarity between the semantic vector of the g-th non-compliant sample keyword of the y-th non-compliant sample and the semantic vector of the b-th known non-compliant keyword. The larger the cosine similarity, the closer the semantics of the g-th non-compliant sample keyword of the y-th non-compliant sample is to the semantics of the b-th known non-compliant keyword. is the cosine similarity between the semantic vector of the qth non-compliant sample phrase of the yth non-compliant sample and the semantic vector of the tth known non-compliant phrase. The larger the cosine similarity, the closer the semantics of the qth non-compliant sample phrase of the yth non-compliant sample is to the tth known non-compliant phrase. The maximum value of the cosine similarity between the semantic vector of the g-th non-compliant sample keyword of the y-th non-compliant sample and the semantic vectors of B known non-compliant keywords is taken, that is, the minimum difference between the semantics of the g-th non-compliant sample keyword of the y-th non-compliant sample and the semantics of the b-th known non-compliant keyword. The above-mentioned minimum difference process can be used to determine the non-compliance degree of the g-th non-compliant sample keyword of the y-th non-compliant sample. is the maximum value of the cosine similarity between the semantic vector of the qth non-compliant sample phrase of the yth non-compliant sample and the semantic vector of the tth known non-compliant phrase, that is, the minimum difference in semantics between the qth non-compliant sample phrase of the yth non-compliant sample and the tth known non-compliant phrase. The above process of taking the minimum difference can be used to determine the degree of non-compliance of the qth non-compliant sample phrase of the yth non-compliant sample.
[0088] The frequency of occurrence of the non-compliant sample phrase and the non-compliant degree of the non-compliant sample phrase are negatively correlated with the compliance degree of the yth non-compliant sample. For example, when the compliance degree of a phrase in a text sample is higher and the frequency of occurrence of the phrase is higher, the compliance degree of the text sample is lower. The frequency of occurrence of the non-compliant sample keywords and the non-compliant degree of the non-compliant sample keywords are negatively correlated with the compliance degree of the yth non-compliant sample. For example, when the non-compliant degree of the keywords in the text sample is higher and the frequency of occurrence of the phrase is higher, the compliance degree of the text sample is lower. Represents the relative difference between the standard text compliance score of the y-th non-compliant sample assessed by the expert and the second text content compliance detection score of the y-th non-compliant sample determined based on the untrained text content detection model.
[0089] According to one embodiment of the present invention, using The average operation is performed based on the number of non-compliant sample phrases, using The weight of the relative error is obtained by averaging the number of keywords in the non-compliant samples, and the weighted average of the relative error is obtained to obtain the second training loss function. During the training process, the loss function is reduced, so that the accuracy of the text content detection model in judging the degree of non-compliance of the text content is improved, thereby improving the accuracy of the text content detection model.
[0090] In this way, the second training loss function can be determined based on the standard text compliance score, known non-compliant keyword semantic vectors, known non-compliant phrase semantic vectors, the second text content compliance detection score, non-compliant sample keyword semantic vectors, non-compliant sample phrase semantic vectors, non-compliant sample keyword word frequency and non-compliant sample phrase word frequency, so that the second training loss function can be reduced during the training process of the text content detection model, and the trained text content detection model can be more suitable for text content detection of non-compliant text content, thereby improving the accuracy of the load forecasting model in a more targeted manner.
[0091] According to one embodiment of the present invention, the first training loss function or the second training loss function can be selected based on whether the sample processed by the text content detection model is a compliant sample or a non-compliant sample, and during the training process, the selected loss function is back-propagated, and the parameters of the text content detection model are adjusted to minimize the first training loss function and the second training loss function. After multiple trainings, a trained text content detection model can be obtained. According to one embodiment of the present invention, in step S105, the text content features are processed by the trained text content detection model to determine the text content compliance detection score.
[0092] According to one embodiment of the present invention, step S105 includes:
[0093] Determine a keyword semantic vector according to a natural language processing model and the keyword;
[0094] Determine a phrase semantic vector based on a natural language processing model and the phrase;
[0095] The keyword semantic vector, the phrase semantic vector, the keyword word frequency and the phrase word frequency are processed by a trained text content detection model to obtain a text content compliance detection score.
[0096] For example, keywords and phrases are input into a natural language processing model to determine keyword semantic vectors and phrase semantic vectors. The keyword semantic vectors, phrase semantic vectors, keyword frequency, and phrase frequency are processed through a trained text content detection model to obtain a text content compliance detection score.
[0097] According to an embodiment of the present invention, in step S106, the web page information detection score is determined according to the text content compliance detection score and the page link detection score.
[0098] For example, a weighted sum is taken based on the text content compliance detection score and the page link detection score to determine the web page information detection score.
[0099] According to an embodiment of the present invention, in step S107, a web page information detection report is generated according to the web page information detection score.
[0100] For example, when the web page information detection score is less than a set threshold, browsing of the web page is restricted and staff are notified to modify the web page.
[0101] According to the web page information detection method based on artificial intelligence of the embodiment of the present invention, it is possible to accurately determine whether the web page link is valid and whether the content is consistent with the expected content, and analyze the text content in the web page to be detected through the trained text content detection model. Further, based on the two aspects of page link detection and text content detection, the web page information can be comprehensively detected to improve the comprehensiveness and accuracy of web page information detection. When determining the page link detection score, the page link detection score can be determined based on the link validity check result, the link content check result, the website information vector and the malicious website information vector. During the calculation process, the page link can be comprehensively detected based on the three aspects of the security status, validity and content check of the page link, thereby improving the comprehensiveness, accuracy and objectivity of the page link detection score. When determining the first training loss function, the first training loss function can be determined based on the standard text compliance score, known compliance keyword semantic vectors, known compliance phrase semantic vectors, first text content compliance detection score, compliance sample keyword semantic vectors, compliance sample phrase semantic vectors, compliance sample keyword word frequency, and compliance sample phrase word frequency, so that the text content detection model reduces the first training loss function during the training process, and makes the trained text content detection model more suitable for text content detection of compliant text content, and improves the accuracy of the load forecasting model in a more targeted manner. When determining the second training loss function, the second training loss function can be determined based on the standard text compliance score, known non-compliant keyword semantic vectors, known non-compliant phrase semantic vectors, second text content compliance detection score, non-compliant sample keyword semantic vectors, non-compliant sample phrase semantic vectors, non-compliant sample keyword word frequency, and non-compliant sample phrase word frequency, so that the text content detection model reduces the second training loss function during the training process, and makes the trained text content detection model more suitable for text content detection of non-compliant text content, and improves the accuracy of the load forecasting model in a more targeted manner.
[0102] Figure 2 A block diagram of a web page information detection system based on artificial intelligence according to an embodiment of the present invention is exemplarily shown, and the system includes:
[0103] A web page information module, used to obtain web page information of the web page to be detected, wherein the web page information includes: text content and page links;
[0104] A page link module, used to determine a link validity check result and a link content check result according to the page link;
[0105] A page link detection module, used to determine a page link detection score according to the link validity check result and the link content check result;
[0106] A text content feature module, used to determine text content features according to the text content, wherein the text content features include: keywords, phrases, keyword frequency and phrase frequency;
[0107] A text content detection module, used to process the text content features through a trained text content detection model to determine a text content compliance detection score;
[0108] A web page information detection module, used to determine a web page information detection score according to the text content compliance detection score and the page link detection score;
[0109] The detection report module is used to generate a web page information detection report based on the web page information detection score.
[0110] The present invention may be a method, a transposition, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present invention.
[0111] It should be understood by those skilled in the art that the embodiments of the present invention described above and shown in the accompanying drawings are only examples and do not limit the present invention. The purpose of the present invention has been fully and effectively achieved. The functional and structural principles of the present invention have been demonstrated and explained in the embodiments, and the embodiments of the present invention may be deformed or modified in any way without departing from the principles.
Claims
1. A web page information detection method based on artificial intelligence, characterized in that: include: Obtaining web page information of the web page to be detected, wherein the web page information includes: text content and page links; Determine the link validity check result and the link content check result according to the page link; Determining a page link detection score according to the link validity check result and the link content check result; Determine text content features according to the text content, wherein the text content features include: keywords, phrases, keyword frequency and phrase frequency; The text content features are processed by a trained text content detection model to determine a text content compliance detection score; Determining a webpage information detection score according to the text content compliance detection score and the page link detection score; Generating a web page information detection report according to the web page information detection score; According to the page link, the link validity check result and the link content check result are determined, including: Determine the link validity check result based on the HTTP request and response mechanism of the page link; According to the page link, determining the return content of the page link; Determine the link content check result according to the returned content and the expected content; Determining a page link detection score according to the link validity check result and the link content check result includes: Determine the website characteristics of the website pointed to by the page link according to the page link, wherein the website characteristics include: website IP address and website domain name; Obtain malicious website IP addresses and malicious website domain names of known malicious websites; Determine a website information vector according to the website IP address and the website domain name; Determine a malicious website information vector according to the malicious website IP address and the malicious website domain name; Determining a page link detection score according to the link validity check result, the link content check result, the website information vector, and the malicious website information vector; Determining a page link detection score according to the link validity check result, the link content check result, the website information vector, and the malicious website information vector includes: According to the formula Determine the page link detection score PLD, where if is the conditional function, max is the maximum value function, ε is the preset similarity threshold, IE k is the link validity check result of the kth page link in the web page to be detected, IC k is the link content check result of the kth page link in the web page to be detected, IP k is the website IP address of the website pointed to by the kth page link in the web page to be detected, DN k is the website domain name of the website pointed to by the kth page link in the web page to be detected, MIP i is the malicious website IP address of the i-th known malicious website, MDN i is the malicious website domain name of the i-th known malicious website, is the website information vector of the website pointed to by the k-th page link in the web page to be detected, is the malicious website information vector of the i-th known malicious website, for The transposed vector of , where K is the number of page links in the web page to be detected, m is the number of known malicious websites, k≤K, i≤m, and k, K, i and m are all positive integers.
2. The webpage information detection method based on artificial intelligence according to claim 1 is characterized in that: The text content features are processed by the trained text content detection model to determine the text content compliance detection score, including: Determine a keyword semantic vector according to a natural language processing model and the keyword; Determine a phrase semantic vector based on a natural language processing model and the phrase; The keyword semantic vector, the phrase semantic vector, the keyword word frequency and the phrase word frequency are processed by a trained text content detection model to obtain a text content compliance detection score.
3. The webpage information detection method based on artificial intelligence according to claim 1 is characterized in that: The training steps of the text content detection model include: Obtain known compliant keywords, compliant phrases, non-compliant keywords, and non-compliant phrases; Determine, according to the compliant keywords, the compliant phrases, the non-compliant keywords and the non-compliant phrases, a semantic vector of a known compliant keyword, a semantic vector of a known compliant phrase, a semantic vector of a known non-compliant keyword and a semantic vector of a known non-compliant phrase; Acquire text samples of web pages from multiple sources, wherein the text samples include: compliant samples and non-compliant samples, and determine standard text compliance scores of the compliant samples and the non-compliant samples; Determining the compliance sample keywords, compliance sample phrases, compliance sample keyword frequency and compliance sample phrase frequency of the compliance sample; Determine a semantic vector of a compliant sample keyword and a semantic vector of a compliant sample phrase according to the compliant sample keyword and the compliant sample phrase; Determining non-compliant sample keywords, non-compliant sample phrases, non-compliant sample keyword frequency, and non-compliant sample phrase frequency of the non-compliant sample; Determine a semantic vector of a non-compliant sample keyword and a semantic vector of a non-compliant sample phrase according to the non-compliant sample keyword and the non-compliant sample phrase; Processing the compliant sample keyword semantic vector, the compliant sample phrase semantic vector, the compliant sample keyword frequency, and the compliant sample phrase frequency through a text content detection model to determine a first text content compliance detection score; Processing the non-compliant sample keyword semantic vector, the non-compliant sample phrase semantic vector, the non-compliant sample keyword frequency, and the non-compliant sample phrase frequency through a text content detection model to determine a second text content compliance detection score; Determine a first training loss function according to the standard text compliance score, the known compliance keyword semantic vector, the known compliance phrase semantic vector, the first text content compliance detection score, the compliance sample keyword semantic vector, the compliance sample phrase semantic vector, the compliance sample keyword frequency and the compliance sample phrase frequency; Determine a second training loss function according to the standard text compliance score, the known non-compliant keyword semantic vector, the known non-compliant phrase semantic vector, the second text content compliance detection score, the non-compliant sample keyword semantic vector, the non-compliant sample phrase semantic vector, the non-compliant sample keyword frequency and the non-compliant sample phrase frequency; The text content detection model is trained according to the first training loss function and the second training loss function to determine a trained text content detection model.
4. The webpage information detection method based on artificial intelligence according to claim 3 is characterized in that: Determining a first training loss function according to the standard text compliance score, the known compliance keyword semantic vector, the known compliance phrase semantic vector, the first text content compliance detection score, the compliance sample keyword semantic vector, the compliance sample phrase semantic vector, the compliance sample keyword frequency, and the compliance sample phrase frequency includes: According to the formula Determine the first training loss function Loss of the text content detection model T1 , where max is the maximum value function, PWF e,r is the word frequency of the conforming sample phrase of the e-th conforming sample phrase of the r-th conforming sample, KWF j,r is the compliant sample keyword frequency of the jth compliant sample keyword of the rth compliant sample, WF T is the preset word frequency threshold, SK j,r is the semantic vector of the jth compliant sample keyword of the rth compliant sample, SP e,r is the semantic vector of the e-th compliant sample phrase of the r-th compliant sample, KSK a is the semantic vector of the a-th known compliant keyword, KSP d is the semantic vector of the d-th known compliant phrase, PPC s,r The standard text compliance score for the rth compliance sample, PPC 1,r Score the compliance detection of the first text content of the rth compliance sample, FSK j,r ) T For SK j,r The transposed vector, (SP e,r ) T For SP e,r where R is the number of compliant samples, A is the number of known compliant keywords, D is the number of known compliant phrases, n is the number of compliant sample keywords, E is the number of compliant sample phrases, e≤E, d≤D, r≤R, a≤A, j≤n, and e, E, d, D, r, R, a, A, j, and n are all positive integers.
5. The webpage information detection method based on artificial intelligence according to claim 4 is characterized in that: Determining a second training loss function according to the standard text compliance score, the known non-compliant keyword semantic vector, the known non-compliant phrase semantic vector, the second text content compliance detection score, the non-compliant sample keyword semantic vector, the non-compliant sample phrase semantic vector, the non-compliant sample keyword frequency, and the non-compliant sample phrase frequency includes: According to the formula Determine the second training loss function Loss of the text content detection model T2 , where max is the maximum value function, NPWF y,q is the frequency of the non-compliant sample phrase of the qth non-compliant sample phrase of the yth non-compliant sample, NKWF y,g is the frequency of the keyword of the g-th non-compliant sample in the y-th non-compliant sample, WF T To preset the word frequency threshold, NSK y,g is the semantic vector of the g-th non-compliant sample keyword of the y-th non-compliant sample, NSP y,q is the semantic vector of the qth non-compliant sample phrase of the yth non-compliant sample, NKSK b is the semantic vector of the bth known non-compliant keyword, NKSP t is the semantic vector of the t-th known non-compliant phrase, PPC ns,y Score the standard text compliance of the yth non-compliant sample, PPC 2,y Score the compliance detection of the second text content of the yth non-compliant sample, (NSK y,g ) T For NSK y,g The transposed vector of (NSP y,q ) / For NSP y,q where B is the number of known non-compliant keywords, T is the number of known non-compliant phrases, Y is the number of non-compliant samples, G is the number of non-compliant sample keywords, Q is the number of non-compliant sample phrases, b≤B, t≤T, y≤Y, g≤G, q≤Q, and b, B, t, T, y, Y, g, G, q and Q are all positive integers.
6. An artificial intelligence-based web page information detection system for executing the method according to any one of claims 1 to 5, characterized in that: include: A web page information module, used to obtain web page information of the web page to be detected, wherein the web page information includes: text content and page links; A page link module, used to determine a link validity check result and a link content check result according to the page link; A page link detection module, used to determine a page link detection score according to the link validity check result and the link content check result; A text content feature module, used to determine text content features according to the text content, wherein the text content features include: keywords, phrases, keyword frequency and phrase frequency; A text content detection module, used to process the text content features through a trained text content detection model to determine a text content compliance detection score; A web page information detection module, used to determine a web page information detection score according to the text content compliance detection score and the page link detection score; The detection report module is used to generate a web page information detection report based on the web page information detection score.
