Website detection method, related device, equipment and storage medium
By extracting and correcting characters in the target URL text that do not meet the preset conditions, generating standard characters and replacing the original characters, the problem of low URL detection accuracy in the prior art is solved, and the accuracy of URL detection is improved.
Patent Information
- Application Number
- CN202411424560.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-02-25
AI Technical Summary
The prior art has low detection accuracy when detecting complex URL data, resulting in weakening of the accuracy of URL detection.
By extracting target characters that do not meet the preset conditions in the target URL text, the target characters are processed using a correction method that matches the specific type, standard characters that meet the preset conditions are generated, and the original target characters are replaced to obtain the standard URL text.
It improves the accuracy of URL detection and reduces the difficulty of subsequent URL detection, so that the target URL text that does not meet the URL naming rules can be converted into standard URL text that complies with the rules.
Smart Images

Figure CN119514495A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of text detection, and in particular to a URL detection method and related devices, equipment and storage media. Background Art
[0002] With the development of Internet technology, URL detection has received more and more attention. In real-world scenarios, URLs are difficult to detect by hiding short texts containing harmful URLs, re-encoding them, etc., which leads to the smooth spread of harmful URLs and increases the difficulty of network security supervision.
[0003] In the prior art, the security monitoring of URL text is usually achieved by relying on traditional natural language models. However, due to the concealment of harmful URLs contained in URL text, the detection accuracy of complex URL data in actual application scenarios is poor, thereby weakening the accuracy of URL detection. In view of this, how to improve the accuracy of URL detection has become an urgent problem to be solved. Summary of the invention
[0004] The main technical problem solved by the present application is to provide a URL detection method and related devices, equipment and storage media, which can improve the accuracy of URL detection.
[0005] In order to solve the above technical problems, the first aspect of the present application provides a URL detection method, including: extracting each target character in the target URL text that does not meet the preset conditions; wherein the preset conditions include at least the following two types: a preset font form and a preset URL character; based on the target character belonging to a specific type that does not meet the preset conditions, processing the target character using a correction method that matches the specific type to obtain a standard character that meets the preset conditions after the target character is corrected; wherein the correction method that matches the preset font form includes generating a homograph of the target character as a standard character based on at least a target character image of the target character, and the correction method that matches the preset URL character includes converting and generating a homophone of the target character as a standard character, and both the homograph and the homophone belong to the preset URL characters; replacing the target character with the standard character based on the target character to obtain the standard URL text of the target URL text.
[0006] In order to solve the above technical problems, the second aspect of the present application provides a URL detection device, including: an extraction module, a processing module and a replacement module, the extraction module is used to respectively extract each target character that does not meet the preset conditions in the target URL text; wherein the preset conditions include at least the following two types: a preset font form and a preset URL character; the processing module is used to process the target character based on the target character belonging to a specific category that does not meet the preset conditions, using a correction method matching the specific category to obtain a standard character that meets the preset conditions after the target character is corrected; wherein the correction method matching the preset font form includes at least based on the target character image of the target character, generating a homograph of the target character as a standard character, and the correction method matching the preset URL character includes converting and generating a homophone of the target character as a standard character, and both the homograph and the homophone belong to the preset URL characters; the replacement module is used to replace the target character based on the standard character of the target character to obtain the standard URL text of the target URL text.
[0007] In order to solve the above technical problems, the third aspect of the present application provides an electronic device, including a memory and a processor coupled to each other, the memory stores program instructions, and the processor is used to execute the program instructions to implement the URL detection method in the above first aspect.
[0008] In order to solve the above technical problem, the fourth aspect of the present application provides a computer-readable storage medium, which stores program instructions that can be executed by a processor, and the program instructions are used to implement the URL detection method described in the first aspect above.
[0009] In the above scheme, at least the preset font form and the preset URL characters are set as preset conditions, and each target character in the target URL text that does not meet the preset conditions is extracted respectively. Based on the specific category that the target character belongs to that does not meet the preset conditions, the target character is processed by a correction method that matches the specific category. The correction method that matches the preset font form includes generating a homograph of the target character as a standard character based on at least the target character image of the target character. The correction method that matches the preset URL character includes converting and generating a homophone of the target character as a standard character, and both the homograph and the homophone belong to the preset URL character. The target character is replaced by the standard character of the target character to obtain the standard URL text of the target URL text. For the target character in the target URL text that hides the URL content by changing the font form, the standard character that belongs to the preset URL character after correction can be generated based on at least the target character image of the target character. For the target character in the target URL text that hides the URL content by replacing the homophone character, the standard character that belongs to the preset URL character after correction can be generated based on the pronunciation of the target character. Therefore, the target URL text that does not meet the URL naming rules can be converted into the standard URL text that meets the URL naming rules, and the standard URL text is conducive to reducing the difficulty of subsequent URL detection. Therefore, the accuracy of URL detection can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 It is a flowchart of an embodiment of the website detection method of the present application; Figure 2 It is a schematic diagram of the framework of an embodiment of a URL detection device of the present application; Figure 3 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application; Figure 4 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0011] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.
[0012] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0013] The terms "system" and "network" are often used interchangeably in this article. The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the fragment " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. In addition, "many" in this article means two or more than two.
[0014] See also Figure 1 , Figure 1 This is a flow chart of an embodiment of the URL detection method of the present application. Specifically, it may include the following steps: Step S10: extracting target characters in the target website text that do not meet the preset conditions respectively.
[0015] In the disclosed embodiments, a URL is the address of a resource on the Internet, which specifies the specific location of the resource on the Internet. Through the URL, users can quickly find and access the information or services they want to obtain. A URL usually consists of multiple parts, including a protocol, a subdomain, a domain name, a port number, a path, and a query string.
[0016] In one implementation scenario, the preset conditions include at least a preset font format and preset URL characters. Specifically, the preset font format is the plain text format to which the target URL text currently belongs. For example, the characters in the plain text format conform to the preset font format, while the text characters in the formula format do not conform to the preset font format. The preset URL characters can be constructed based on the URL (uniform resource locator). The URL is composed of a string of characters, which can be letters, numbers, and special symbols. All characters that can constitute the URL, such as letters, numbers, and special symbols, are used as preset URL characters.
[0017] In one implementation scenario, the target URL text is determined by a number of candidate URL texts. When at least one character in the candidate URL text does not meet the preset condition, it indicates that the candidate URL text does not meet the URL naming rules, and the URL content is hidden in the text. The text with at least one character that does not meet the preset condition is used as the target URL text. For example, the first candidate URL text is "123456.cc", and the second candidate URL text is "123456.cc", that is, the first candidate URL text meets the preset condition, and the second candidate URL text does not meet the preset condition.
[0018] In a specific implementation scenario, the target characters that do not meet the preset conditions include any of the following situations: target characters that only do not meet the preset font form, target characters that only do not belong to the preset URL, and target characters that do not meet the preset font form and do not belong to the preset URL.
[0019] In a specific implementation scenario, when each preset URL character is saved in a preset font format, a matching result between the candidate URL text and each preset URL character is obtained. When the matching result indicates that there is at least one character in the candidate URL text that does not conform to the preset font format and / or preset URL character, the candidate URL text is used as the target URL text.
[0020] In a specific implementation scenario, based on the candidate URL text, each original character in the candidate URL text is obtained. For example, the candidate URL text is " point ", the original characters extracted are " "" "" "" "" "" "" "" ""point"" "" ", the matching results between each original character in the candidate URL text and each preset URL character, for example, the original character " " matches the preset URL character "m" but does not conform to the preset font form, that is, the original characters in the candidate URL text do not meet the preset conditions.
[0021] In a specific implementation scenario, the candidate URL text is extracted based on the text to be detected. For example, the text to be detected is: "My dear, call the envoy and write to the emperor: point ” Based on the text to be detected, the candidate URL text is extracted as " point ”.
[0022] In a specific implementation scenario, as a possible implementation method, a URL text extraction model can be pre-trained, and the URL text extraction model can include but is not limited to the network model of the Encoder-Decoder architecture, etc., the text to be detected is input into the URL text extraction model, and the output result of the URL text extraction model is used as the candidate URL text. In order to ensure the recognition accuracy of the URL text extraction model as much as possible, the sample detection text can be collected, and the sample real Wang Zhiwei text can be annotated in the sample detection text. On this basis, the sample detection text can be processed based on the URL text extraction model to obtain the sample predicted URL text of the sample detection text, so that the network parameters of the URL text extraction model can be adjusted based on the difference between the sample real URL text and the sample predicted URL text, until the URL text extraction model training converges, and the URL text extraction model that converges in training can be used to process the text to be detected to obtain the candidate URL text. It should be noted that the specific processing process of the URL text extraction model can refer to the technical details such as the network model of the Encoder-Decoder architecture, etc., which will not be repeated here, and the number of candidate texts extracted from any text to be detected is not limited in this application. With the above method, the trained URL text extraction model can understand the rich syntactic and grammatical information of sentences, and can model the polysemy of words, thereby improving the effect of natural language processing tasks and further improving the extraction accuracy of candidate URL texts.
[0023] In a specific implementation scenario, the URL text extraction model is obtained by fine-tuning the pre-trained language model. As a possible implementation method, a sequence labeling method based on a pre-trained language model combined with a conditional random field is used to realize the construction of the URL text extraction model. Conditional Random Field (CRF) is a discriminative probability model, which is a type of random field and is often used to label or analyze sequence data, such as natural language text. Conditional random field is a discriminative probability model that uses a probabilistic graphical model to express long-distance dependencies and overlapping features in sequence data. It can better solve problems such as labeling bias and can be used for sequence labeling and analysis, such as part-of-speech tagging, named entity recognition and other tasks. Specifically, the linear chain conditional random field is used in the sequence labeling model. For a specified sequence , and its corresponding label is , if the following conditions are met:
[0024] Let P(N,K) be the weight matrix output by the decoding layer, and then we can get the evaluation score , that is, as follows:
[0025] Where A in formula (1) is the transfer matrix, k is the number of labels, and n is the sequence length. The maximum probability of the sequence label y can be calculated using the SoftMax function, as shown in the following formula:
[0026] Among them, in formula (2) is the maximum probability of sequence label y.
[0027] Step S20: based on the target character belonging to a specific category that does not meet the preset conditions, the target character is processed using a correction method that matches the specific category to obtain a standard character that meets the preset conditions after the target character is corrected.
[0028] In one implementation scenario, when the target character does not conform to the preset font form, a correction method matching the preset font form is adopted, including generating a homograph of the target character as a standard character based at least on the target character image of the target character. The above scheme, for the target character in the target URL text that hides the URL content by changing the font form, can generate a standard character that belongs to the preset URL character after correction based at least on the target character image of the target character, which is conducive to reducing the difficulty of subsequent URL detection. Therefore, the accuracy of URL detection can be improved.
[0029] In a specific implementation scenario, based on the target character, a target character image of the target character is generated, and based on the preset font form, a standard character image of each preset URL character is generated. Based on the similarity between the target character image and the standard character image, the preset URL character corresponding to the standard character image is selected as the homographic character. For example, the target character is " ", the homograph obtained is "m", for another example, the target character is ①, and the homograph obtained is "0" and "1". Specifically, the OCR (Optical Character Recognition) technology can be used to obtain the similarity between the target character image and the standard character image. The specific processing process of OCR can refer to the technical details of the optical character recognition technology, which will not be repeated here.
[0030] In a specific implementation scenario, the first image feature of the target character image is extracted, and the second image feature of the standard character image is extracted, and the feature similarity between the first image feature and each second image feature is obtained, and at least the preset URL character corresponding to the standard character image with the largest feature similarity is selected as the isomorphic character. The above scheme can generate a standard character belonging to the preset URL character after correction for the target character in the target URL text by changing the font form, which is at least based on the target character image of the target character, which is conducive to reducing the difficulty of subsequent URL detection. Therefore, the accuracy of URL detection can be improved.
[0031] In an implementation scenario, when the target character does not belong to the preset website characters, a correction method matching the preset website characters is adopted, including converting and generating a homophone character of the target character as the standard character, and both the homograph character and the homophone character belong to the preset website characters. For example, when the target character is "dot", the pronunciation of "dot" is obtained as "dian", and by retrieving each preset website character based on "dian", the corresponding homograph character is obtained as ".", so as to obtain the standard character corresponding to the target character. In the above solution, for the target character in the target website text that hides the website content by replacing it with a homophone character, the standard character that belongs to the preset website characters after correction can be generated based on the pronunciation of the target character, which is beneficial to reducing the subsequent website detection difficulty. Therefore, the accuracy of website detection can be improved.
[0032] In an implementation scenario, when the same target character does not conform to the preset font form and the preset website characters, the correction method matching the preset conditions includes at least generating a homograph character of the target character based on the target character image of the target character, and converting and generating a homophone character of the target character, obtaining the character similarity between the target character and the homograph character, and obtaining the phoneme similarity between the target character and the homophone character. Based on the character similarity and the phoneme similarity, select the homograph character or the homophone character as the standard character of the target character. For example, when the target character is "eight", which neither conforms to the preset font form nor belongs to the preset website characters, the generated homograph character is "0" with a character similarity of 2% to the target character, and the generated homophone character is "8" with a phoneme similarity of 100% to the target character. Therefore, "8" is used as the standard character for the target character. In the above solution, based on the standard character that belongs to the preset website characters after correction, it is beneficial to reduce the subsequent website detection difficulty. Therefore, the accuracy of website detection can be improved.
[0033] In a specific implementation scenario, when the character similarity is not less than the phoneme similarity, select the homograph character as the standard character of the target character.
[0034] In another specific implementation scenario, when the character similarity is less than the phoneme similarity, select the homophone character as the standard character of the target character.
[0035] Step S30: Replace the target character with the standard character of the target character to obtain the standard website text of the target website text.
[0036] In one implementation scenario, for the target characters in the target URL text that hide the URL content by changing the font form, a standard character belonging to the preset URL character after correction can be generated based on at least the target character image of the target character. For the target characters in the target URL text that hide the URL content by replacing homophone characters, a standard character belonging to the preset URL character after correction can be generated based on the pronunciation of the target character. The target character is replaced based on the standard character of the target character. Therefore, the target URL text that does not conform to the URL naming rules can be converted into a standard URL text that conforms to the URL naming rules, and the standard URL text is conducive to reducing the difficulty of subsequent URL detection. Therefore, the accuracy of URL detection can be improved.
[0037] In a specific implementation scenario, when the number of standard characters generated based on a target character is one, a standard URL text about the target URL text can be obtained; when the number of standard characters generated based on a target character is n, n standard URL texts about the target URL text can be obtained; when the target URL text contains m target characters, if the number of standard characters generated by each target character is one, a standard URL text about the target URL text can be obtained, and so on. For the sake of brevity, it will not be repeated here.
[0038] In one implementation scenario, the text to be processed can be processed based on the large language model to obtain a standard URL text expressed in a preset language, and the text to be processed is the target URL text, or the URL text to be processed is the standard URL text after the target characters in the target URL text are replaced with standard characters. The large language model can understand human natural language input, and obtain keyword information about the input text and the logical relationship between various elements based on the input text, and generate semantically relevant outputs. With the help of the semantic understanding ability of the large language model, the understanding and adjustment of cross-language texts can be achieved. For the specific principles, please refer to the more technical details of the large language model, which will not be repeated here.
[0039] In a specific implementation scenario, based on the URL text to be processed, a prompt text is constructed, the prompt text is used to instruct the large language model to adjust the URL text to be processed to a standard URL text expressed in a preset language, the prompt text is sent to the large language model, and the URL text output by the large language model is obtained as the standard URL text expressed in a preset language.
[0040] In a specific implementation scenario, the prompt text may include multiple tasks for instructing the large language model to generate standard URL text. For example, the URL text to be processed is "https: / / ucuc." (Korean)", and the prompt text is constructed as "Please identify the URL that may be hidden in 'https: / / ucuc. (Korean)'. The answer is to give the URL content directly in the original text. No explanation is required, and there is no need to generate text that does not exist in the text, and correct the identified URL content. Please output in JSON format such as "Original URL: '[URL 1, URL 2, ...]', Corrected URL: '[URL 1, URL 2, ...]'". If there is no URL, please directly output 'NAN'". The output text of the large language model is "Original URL: 'https: / / ucuc. (Korean)', Corrected URL: 'https: / / ucuc.com'", that is, the generated standard URL text is "https: / / ucuc.com".
[0041] In one implementation scenario, the target characters are replaced with standard characters based on the target characters to obtain the standard URL text of the target URL text. The standard URL text can be detected to determine whether the standard URL text is a harmful URL or a valid URL, etc. It should be noted that the detection method for the standard URL text is not limited in this application, such as the URL detection model, etc.
[0042] In the above scheme, at least the preset font form and the preset URL characters are set as preset conditions, and each target character in the target URL text that does not meet the preset conditions is extracted respectively. Based on the specific category that the target character belongs to that does not meet the preset conditions, the target character is processed by a correction method that matches the specific category. The correction method that matches the preset font form includes generating a homograph of the target character as a standard character based on at least the target character image of the target character. The correction method that matches the preset URL character includes converting and generating a homophone of the target character as a standard character, and both the homograph and the homophone belong to the preset URL character. The target character is replaced by the standard character of the target character to obtain the standard URL text of the target URL text. For the target character in the target URL text that hides the URL content by changing the font form, the standard character that belongs to the preset URL character after correction can be generated based on at least the target character image of the target character. For the target character in the target URL text that hides the URL content by replacing the homophone character, the standard character that belongs to the preset URL character after correction can be generated based on the pronunciation of the target character. Therefore, the target URL text that does not meet the URL naming rules can be converted into the standard URL text that meets the URL naming rules, and the standard URL text is conducive to reducing the difficulty of subsequent URL detection. Therefore, the accuracy of URL detection can be improved.
[0043] See also Figure 2 , Figure 22 is a schematic diagram of a framework of an embodiment of a website detection device 20 of the present application. Figure 2 As shown, the URL detection device 20 includes: an extraction module 21, a processing module 22 and a replacement module 23, the extraction module 21 is used to extract each target character in the target URL text that does not meet the preset conditions; wherein the preset conditions include at least the following two types: a preset font form and a preset URL character; the processing module 22 is used to process the target character based on the target character belonging to a specific category that does not meet the preset conditions, using a correction method that matches the specific category to obtain a standard character that meets the preset conditions after the target character is corrected; wherein the correction method that matches the preset font form includes at least based on the target character image of the target character, generating a homograph of the target character as a standard character, and the correction method that matches the preset URL character includes converting and generating a homophone of the target character as a standard character, and both the homograph and the homophone belong to the preset URL characters; the replacement module 23 is used to replace the target character based on the standard character of the target character to obtain the standard URL text of the target URL text.
[0044] In the above scheme, the website detection device 20 sets at least the preset font form and the preset website character as preset conditions, extracts each target character in the target website text that does not meet the preset conditions, and processes the target character by a correction method that matches the specific type based on the target character belonging to the specific category that does not meet the preset conditions. The correction method that matches the preset font form includes generating a homograph of the target character as a standard character based on at least the target character image of the target character, and the correction method that matches the preset website character includes converting and generating a homophone of the target character as a standard character, and both the homograph and the homophone belong to the preset website character, and replacing the target character based on the standard character of the target character to obtain the standard website text of the target website text. For the target character in the target website text that hides the website content by changing the font form, the standard character that belongs to the preset website character after correction can be generated based on at least the target character image of the target character, and for the target character in the target website text that hides the website content by replacing the homophone character, the standard character that belongs to the preset website character after correction can be generated based on the pronunciation of the target character. Therefore, the target website text that does not meet the website naming rules can be converted into the standard website text that meets the website naming rules, and the standard website text is conducive to reducing the difficulty of subsequent website detection. Therefore, the accuracy of URL detection can be improved.
[0045] In some disclosed embodiments, the processing module 22 also includes an image generation module (not shown) for generating a target character image of the target character based on the target character, and generating a standard character image of each preset URL character based on a preset font form; the processing module 22 also includes a homograph character selection module (not shown) for selecting a preset URL character corresponding to the standard character image as a homograph character based on the similarity between the target character image and the standard character image.
[0046] In some disclosed embodiments, the homomorphic character selection module (not shown) further includes an image feature extraction module (not shown) for extracting a first image feature of a target character image and extracting a second image feature of a standard character image; the homomorphic character selection module (not shown) further includes a feature similarity acquisition module (not shown) for acquiring feature similarities between the first image feature and each second image feature; the homomorphic character selection module (not shown) further includes a character selection submodule (not shown) for selecting at least a preset URL character corresponding to the standard character image with the greatest feature similarity as a homomorphic character.
[0047] In some disclosed embodiments, when the same target character does not conform to the preset font form and the preset URL character, the processing module 22 also includes a generation conversion module (not shown) for generating a homograph of the target character based at least on a target character image of the target character, and converting and generating a homophone of the target character; the processing module 22 also includes a similarity acquisition module (not shown) for acquiring the character similarity between the target character and the homograph, and acquiring the phoneme similarity between the target character and the homophone; the processing module 22 also includes a standard character acquisition module (not shown) for selecting a homograph or a homophone as the standard character of the target character based on the character similarity and the phoneme similarity.
[0048] In some disclosed embodiments, the standard character acquisition module (not shown) also includes a similarity comparison module (not shown) for selecting a homograph as the standard character of the target character in response to the character similarity being not less than the phoneme similarity; and selecting a homophone as the standard character of the target character in response to the character similarity being less than the phoneme similarity.
[0049] In some disclosed embodiments, before extracting each target character that does not meet the preset conditions in the target URL text, the URL detection device 20 also includes a candidate extraction module (not shown) for extracting candidate URL text from the text to be detected; the URL detection device 20 also includes a matching module (not shown) for obtaining the matching results between the candidate URL text and each preset URL character; the URL detection device 20 also includes a target determination module (not shown) for using the candidate URL text as the target URL text in response to the matching result indicating that there is at least one character in the candidate URL text that does not meet the preset conditions.
[0050] In some disclosed embodiments, the URL detection device 20 also includes a large model processing module (not shown), which is used to construct a prompt text based on the URL text to be processed; wherein the prompt text is used to instruct the large language model to adjust the URL text to be processed to a standard URL text expressed in a preset language; send the prompt text to the large language model, and obtain the URL text output by the large language model as the standard URL text expressed in a preset language; wherein the URL text to be processed is the target URL text, or the URL text to be processed is the standard URL text after the target characters in the target URL text are replaced with standard characters.
[0051] See also Figure 3 , Figure 3 1 is a schematic diagram of a framework of an embodiment of an electronic device 30 of the present application. The electronic device 30 includes a memory 31 and a processor 32. The memory 31 stores program instructions, and the processor 32 is used to execute the program instructions to implement the steps in any of the above-mentioned URL detection method embodiments. For details, please refer to the aforementioned disclosed embodiments, which will not be repeated here. The electronic device 30 may specifically include but is not limited to: a server, a smart phone, a laptop computer, a tablet computer, a self-service machine, etc., which are not limited here.
[0052] Specifically, the processor 32 is used to control itself and the memory 31 to implement the steps in any of the above-mentioned URL detection method embodiments. The processor 32 can also be called a CPU (Central Processing Unit). The processor 32 may be an integrated circuit chip with signal processing capabilities. The processor 32 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 32 can be implemented by an integrated circuit chip.
[0053] In the above scheme, the electronic device 30 sets at least the preset font form and the preset URL characters as preset conditions, extracts each target character in the target URL text that does not meet the preset conditions, and processes the target character based on the specific category that the target character belongs to. The correction method matching the preset font form includes generating the homograph of the target character as the standard character based on at least the target character image of the target character, and the correction method matching the preset URL character includes converting and generating the homophone of the target character as the standard character, and both the homograph and the homophone belong to the preset URL character, and replacing the target character based on the standard character of the target character to obtain the standard URL text of the target URL text. For the target character in the target URL text that hides the URL content by changing the font form, the standard character belonging to the preset URL character after correction can be generated based on at least the target character image of the target character, and for the target character in the target URL text that hides the URL content by replacing the homophone character, the standard character belonging to the preset URL character after correction can be generated based on the pronunciation of the target character. Therefore, the target URL text that does not meet the URL naming rules can be converted into the standard URL text that meets the URL naming rules, and the standard URL text is conducive to reducing the difficulty of subsequent URL detection. Therefore, the accuracy of URL detection can be improved.
[0054] See also Figure 4 , Figure 4 4 is a schematic diagram of a framework of an embodiment of a computer-readable storage medium 40 of the present application. The computer-readable storage medium 40 stores program instructions 41 that can be executed by a processor, and the program instructions 41 are used to implement the steps in any of the above-mentioned URL detection method embodiments.
[0055] In the above scheme, the computer-readable storage medium 40 sets at least the preset font form and the preset URL characters as preset conditions, extracts each target character in the target URL text that does not meet the preset conditions, and processes the target character using a correction method that matches the specific type based on the target character belonging to the specific category that does not meet the preset conditions. The correction method that matches the preset font form includes generating a homograph of the target character as a standard character based on at least the target character image of the target character, and the correction method that matches the preset URL character includes converting and generating a homophone of the target character as a standard character, and both the homograph and the homophone belong to the preset URL character, and replacing the target character based on the standard character of the target character to obtain the standard URL text of the target URL text. For the target character in the target URL text that hides the URL content by changing the font form, the standard character that belongs to the preset URL character after correction can be generated based on at least the target character image of the target character, and for the target character in the target URL text that hides the URL content by replacing the homophone character, the standard character that belongs to the preset URL character after correction can be generated based on the pronunciation of the target character. Therefore, the target URL text that does not meet the URL naming rules can be converted into the standard URL text that meets the URL naming rules, and the standard URL text is conducive to reducing the difficulty of subsequent URL detection. Therefore, the accuracy of URL detection can be improved.
[0056] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0057] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.
[0058] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0059] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0060] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0061] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0062] If the technical solution of this application involves personal information, the product using the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using the technical solution of this application has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that he or she agrees to the collection of his or her personal information; or on the device that processes personal information, the personal information processing rules are notified by obvious signs / information, and the individual's authorization is obtained through pop-up information or by asking the individual to upload his or her personal information; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.
Claims
1. A method for detecting a website, characterized in that: include: Extracting the target characters in the target URL text that do not meet the preset conditions respectively; wherein the preset conditions include at least the following two: a preset font form and a preset URL character; Based on the fact that the target character belongs to a specific category that does not meet the preset conditions, the target character is processed by a correction method that matches the specific category to obtain a standard character that meets the preset conditions after the target character is corrected; wherein the correction method that matches the preset font form includes generating a homograph of the target character as the standard character based on at least a target character image of the target character, and the correction method that matches the preset URL character includes converting and generating a homophone of the target character as the standard character, and both the homograph and the homophone belong to the preset URL character; The target characters are replaced by standard characters based on the target characters to obtain the standard URL text of the target URL text.
2. The method according to claim 1, characterized in that The step of generating a homographic character of the target character based at least on the target character image of the target character comprises: Based on the target character, generating a target character image of the target character, and based on the preset font form, generating a standard character image of each of the preset URL characters; Based on the similarity between the target character image and the standard character image, a preset URL character corresponding to the standard character image is selected as the homographic character.
3. The method according to claim 2, characterized in that The selecting, based on the similarity between the target character image and the standard character image, a preset URL character corresponding to the standard character image as the homographic character comprises: Extracting a first image feature of the target character image, and extracting a second image feature of the standard character image; Obtaining feature similarities between the first image feature and each of the second image features; At least the preset URL character corresponding to the standard character image with the greatest feature similarity is selected as the homographic character.
4. The method according to claim 1, characterized in that: In the case that the same target character does not conform to the preset font form and the preset URL character, based on the target character belonging to a specific category that does not conform to the preset condition, the target character is processed in a correction manner that matches the specific category to obtain a standard character that conforms to the preset condition after the target character is corrected, including: generating a homograph of the target character based at least on a target character image of the target character, and converting and generating a homophone of the target character; Obtaining character similarity between the target character and the homograph character, and obtaining phoneme similarity between the target character and the homophone character; Based on the character similarity and the phoneme similarity, the homograph character or the homophone character is selected as a standard character of the target character.
5. The method according to claim 4, characterized in that The selecting the homograph character or the homophone character as the standard character of the target character based on the character similarity and the phoneme similarity comprises at least one of the following: In response to the character similarity being not less than the phoneme similarity, selecting the homograph as a standard character for the target character; In response to the character similarity being less than the phoneme similarity, the homophone character is selected as a standard character for the target character.
6. The method according to claim 1, characterized in that Before extracting the target characters that do not meet the preset conditions from the target website text, the method further includes: Extract candidate URL text from the text to be detected; Obtaining a matching result between the candidate URL text and each of the preset URL characters; In response to the matching result indicating that at least one character in the candidate URL text does not meet the preset condition, the candidate URL text is used as the target URL text.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Based on the URL text to be processed, construct a prompt text; wherein the prompt text is used to instruct the large language model to adjust the URL text to be processed to a standard URL text expressed in a preset language; Sending the prompt text to the large language model, and obtaining the URL text output by the large language model as the standard URL text expressed in the preset language; The to-be-processed URL text is the target URL text, or the to-be-processed URL text is the standard URL text after the target characters in the target URL text are replaced with the standard characters.
8. A website detection device, characterized in that: include: The extraction module is used to extract the target characters in the target URL text that do not meet the preset conditions; wherein the preset conditions include at least the following two: a preset font form and a preset URL character; A processing module, configured to process the target character using a correction method that matches the specific type based on the target character belonging to a specific type that does not meet the preset condition, so as to obtain a standard character that meets the preset condition after the target character is corrected; wherein the correction method that matches the preset font form includes generating a homograph of the target character as the standard character based on at least a target character image of the target character, and the correction method that matches the preset URL character includes converting and generating a homophone of the target character as the standard character, and both the homograph and the homophone belong to the preset URL character; The replacement module is used to replace the target characters based on the standard characters of the target characters to obtain the standard URL text of the target URL text.
9. An electronic device, characterized in that: It comprises a memory and a processor coupled to each other, wherein the memory stores program instructions, and the processor is used to execute the program instructions to implement the URL detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the URL detection method described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Name correction method, device, electronic equipment and storage medium
CN113947073A
Statement processing method and device
CN114154488A
Message restoration method and device, electronic equipment and storage medium
CN117932596A
Text error correction method and device, equipment, storage medium and program product
CN118428352A
Methods of uniform resource locator (url) translation
EP2680160A1