Website identification method, device, computer equipment, and storage medium
By extracting target features and matching screening models on sample websites, the website type can be automatically identified, which solves the problems of low efficiency and high cost in existing technologies and realizes efficient and low-cost website type identification.
Patent Information
- Application Number
- CN202210509511.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-11
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-05-11
AI Technical Summary
The existing method of identifying website types requires manual review of page source code, resulting in low efficiency in extracting target features, slow updates and high labor costs.
By extracting target features from sample websites and adding type labels, the preset rules and weight screening model are used to match reference features to automatically identify the type of the website to be identified.
It improves the extraction efficiency and update speed of target features, reduces labor costs, and achieves fast and accurate website type identification.
Smart Images

Figure CN114840796B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a website identification method, device, computer equipment, and storage medium. Background Art
[0002] With the widespread use of the internet, timely identification of website types is crucial for improving the personal and property safety of network users. Existing methods for identifying website types require manual effort to continuously review page source code to identify target features that represent the website. This requires manual intervention to extract these features, update them accordingly, and then apply them to website type identification. This results in low efficiency, slow updates, and high labor costs.
[0003] Currently, no effective solutions have been proposed for the above technical problems. Summary of the Invention
[0004] Based on the deficiencies of the prior art, the present invention provides a website identification method, apparatus, computer equipment, and storage medium to at least solve the problems of low efficiency, slow update, and high labor cost in extracting target features in the prior art.
[0005] In a first aspect, the present application proposes a website identification method, the method comprising:
[0006] Extract target features from sample websites according to preset rules, and add corresponding sample website type labels to the target features;
[0007] Matching the target feature with the reference feature, and obtaining a screened target feature based on the extracted number of target features;
[0008] The website to be identified is matched based on the filtered target features and reference features to determine the type of the website to be identified.
[0009] In one embodiment, extracting target features from sample websites according to preset rules and adding corresponding sample website type labels to the target features include:
[0010] Classifying the code of the sample website based on at least two code label items;
[0011] Determining a preset preliminary extraction quantity of target features included in each code label item based on the preset preliminary extraction quantity and the first weight of each code label item;
[0012] Extract target features from the codes corresponding to the different code tag items contained in the sample website based on preset rules and a preset preliminary extraction number of target features contained in each code tag item;
[0013] Add the corresponding website type label to the target feature.
[0014] In one embodiment, matching the target feature with the reference feature and obtaining the filtered target feature based on the extracted number of target features includes:
[0015] Determining the number of extracted target features contained in each code label item based on the number of extracted target features and the second weight of each code label item;
[0016] The target feature, the reference feature, and the number of target features extracted from each code label item are input into a screening model to output the screened target feature; wherein the screening model calculates the similarity between the target feature and the reference feature and performs similarity sorting, and screens out the target features with higher similarity sorting contained in each code label item based on the number of target features extracted from each code label item.
[0017] In one embodiment, matching the to-be-identified website based on the filtered target features and the reference features to determine the type of the to-be-identified website includes:
[0018] Based on the code of the website to be identified, determine whether there is a feature in the filtered target feature and the reference feature that matches the code of the website to be identified. If so, determine the type of the website to be identified based on the website type label corresponding to the target feature.
[0019] In one embodiment, after matching the target features with reference features and obtaining filtered target features based on the extracted number of target features, the method further includes:
[0020] Testing the screened target features to obtain target features that meet set accuracy;
[0021] The website to be identified is matched based on the target feature that meets the set accuracy and the reference feature to determine the type of the website to be identified.
[0022] In one embodiment, the testing of the screened target features to obtain target features that meet a set accuracy includes:
[0023] Within a preset number of tests, the screened target features are used to match at least two test websites to obtain test results; and it is determined whether the accuracy of the test results meets the set precision. If so, the screened target features are the target features that meet the set precision.
[0024] In one embodiment, after matching the target feature that meets the set accuracy with the reference feature and determining the type of the website to be identified, the method further includes:
[0025] Based on the matching result of the target feature that meets the set precision and the website to be identified, determine whether the accuracy of the matching result meets the set precision; if not, issue a warning for the target feature that meets the set precision, and accumulate the number of abnormal events as an abnormal event; when the accumulated value of the number of abnormal events of the target feature that meets the set precision is greater than or equal to the preset number of abnormal events, confirm that the target feature that meets the set precision is abnormal, and delete the target feature that meets the set precision.
[0026] In a second aspect, the present application provides a website identification device, the device comprising:
[0027] Extraction module: extracts target features from sample websites according to preset rules, and adds corresponding sample website type labels to the target features;
[0028] Screening module: matching the target feature with the reference feature, and obtaining the screened target feature based on the number of extracted target features;
[0029] Identification module: matches the website to be identified based on the screened target features and reference features to determine the type of the website to be identified.
[0030] In a third aspect, the present application provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the website identification method as described in the first aspect above is implemented.
[0031] In a fourth aspect, an embodiment of the present application provides a storage medium on which a computer program is stored, and when the program is executed by a processor, the website identification method as described in the first aspect above is implemented.
[0032] Compared to the background art, the website identification method, device, computer equipment, and storage medium provided in this application extract target features from sample websites according to preset rules, add corresponding sample website type labels to the target features, match the target features with reference features, and obtain filtered target features based on the number of target features extracted; match the website to be identified based on the filtered target features and reference features to determine the type of the website to be identified. This application can extract target features from sample websites according to preset rules and use the target features to determine the type of the website to be identified. The target feature extraction is efficient, the update is timely, and the labor cost is low.
[0033] The details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0035] Figure 1 It is a terminal hardware structure frame of a website identification method in one embodiment of the present application;
[0036] Figure 2 This is a flowchart of a website identification method in one embodiment of the present application;
[0037] Figure 3 This is a flow chart of extracting target features in one embodiment of the present application;
[0038] Figure 4 This is a flow chart for screening target features in one embodiment of the present application;
[0039] Figure 5 This is a flowchart of a website identification method in one embodiment of the present application;
[0040] Figure 6 This is a flow chart of testing the screened target features in one embodiment of the present application;
[0041] Figure 7 This is a flowchart for determining whether the accuracy of a matching result meets a set accuracy in one embodiment of the present application;
[0042] Figure 8 This is a flowchart of a website identification method in a preferred embodiment of the present application;
[0043] Figure 9 This is a schematic diagram of the structure of a website identification device according to an embodiment of the present application;
[0044] Figure 10 This is a schematic diagram of the structure of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application. In addition, it can also be understood that although the efforts made in this development process may be complex and lengthy, for ordinary technicians in the field related to the contents disclosed in the present application, some changes such as design, manufacturing or production based on the technical contents disclosed in the present application are only conventional technical means and should not be understood as the contents disclosed in the present application being insufficient.
[0046] References to "embodiments" in this application mean that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it refer to independent or alternative embodiments that are mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described in this application may be combined with other embodiments unless there is a conflict.
[0047] Unless otherwise defined, the technical or scientific terms used in this application should have the ordinary meaning understood by a person of ordinary skill in the technical field to which this application belongs. The words "one", "a", "the" and the like used in this application do not indicate a limit on quantity and may indicate the singular or plural. The terms "include", "comprise", "have" and any variations thereof used in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units that are inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like used in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The word "multiple" used in this application means greater than or equal to two. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. The terms "first", "second", "third" and the like involved in this application are merely used to distinguish similar objects and do not represent a specific ordering of the objects.
[0048] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. Taking running on a terminal as an example, Figure 1 FIG. 1 is a hardware structure diagram of a terminal of a website identification method according to an embodiment of the present invention. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data. Optionally, the terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0049] Memory 104 can be used to store computer programs, such as software programs and modules of application software, such as the computer program corresponding to the website identification method in the embodiments of the present invention. Processor 102 executes the computer programs stored in memory 104 to perform various functional applications and data processing, thereby implementing the aforementioned methods. Memory 104 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 104 may further include memory remotely located relative to processor 102, and such remote memory may be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0050] The transmission device 106 is used to receive or send data via a network. A specific example of the aforementioned network may include a wireless network provided by the terminal's communications provider. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0051] This embodiment provides a website identification method. Figure 2 is a flow chart of a website identification method according to an embodiment of the present application. Figure 2 As shown, the process includes the following steps:
[0052] Step S21 : extract target features from the sample websites according to preset rules, and add corresponding sample website type labels to the target features.
[0053] Among them, after determining the sample website, you can access the sample website through the client according to the domain name address of the sample website and obtain all the web page codes corresponding to the sample website; you can also obtain the web page code of the sample website through packet capture software. This application does not limit the specific method of obtaining the web page code of the sample website.
[0054] Sample website type labels are marked by technicians based on the specific content of the sample website. They are used to distinguish labels of different website types, such as: fake orders, gambling, phishing, etc.
[0055] After obtaining all the web page codes corresponding to the sample website, target features of the sample website are extracted according to preset rules, and corresponding sample website type labels are added to the extracted target features.
[0056] Step S22 , matching the target features with the reference features, and obtaining filtered target features based on the number of extracted target features.
[0057] Among them, the reference feature is a preset feature. By matching the target feature with the reference feature, the target feature that is more similar to the reference feature can be screened out.
[0058] The number of target features to be extracted is the number of target features that the technician wishes to extract from the sample website. This number can be pre-set by the technician or calculated based on the amount of code and / or code repetition rate of the sample website to obtain an appropriate number of extracted features. This application does not impose any restrictions on the number of target features to be extracted.
[0059] Step S23 : matching the website to be identified based on the screened target features and the reference features to determine the type of the website to be identified.
[0060] The websites to be identified are a certain number of websites whose types need to be determined. This can be accomplished by pre-obtaining the domain names of a certain number of websites to be identified, thereby obtaining the webpage code of the websites to be identified. Since both the filtered target features and the reference features carry corresponding website type tags, the filtered target features and reference features are matched against the webpage code of the websites to be identified, and the type of the website to be identified is determined based on the matching results.
[0061] Through the above steps, target features are extracted from sample websites according to preset rules, and corresponding sample website type labels are added to the target features; the target features are matched with the reference features, and based on the extracted number of target features, the screened target features are obtained; based on the screened target features and the reference features, the website to be identified is matched to determine the type of the website to be identified, so that the target features of the sample websites can be extracted according to the preset rules, and the target features can be used to determine the type of the website to be identified. This method has high efficiency in extracting target features, timely updates, and low labor costs.
[0062] In one embodiment, target features are extracted from sample websites according to preset rules, and corresponding sample website type labels are added to the target features, such as Figure 3 As shown, the specific steps include:
[0063] Step S211 : classifying the code of the sample website based on at least two code tag items.
[0064] The code tag item refers to the type of code corresponding to the sample website. For example, in an HTML (Hypertext Markup Language) document, the code tag items may be: title, body, head, icon. Based on the code tag items, after obtaining the sample website code, the sample website code is categorized.
[0065] Step S212 : determining the preset preliminary extraction quantity of the target features included in each code label item based on the preset preliminary extraction quantity and the first weight of each code label item.
[0066] Since this step is a preliminary extraction, the number of pre-set extractions will be greater than the number of target features to facilitate subsequent screening of target features. This number can be manually entered by a technician or calculated based on relevant technical parameters such as the amount of code in the website to be identified, code repetition rate, and / or extraction accuracy.
[0067] Preferably, the preset preliminary extraction quantity is twice the extraction quantity of the target features.
[0068] Since the amount of information contained in the codes corresponding to different code label items in the sample website is different, a different first weight is assigned to each code label item. Based on the preset preliminary extraction quantity and the first weight of each code label item, the preset preliminary extraction quantity of the target features contained in each code label item can be determined respectively.
[0069] Step S213 : Based on preset rules and a preset preliminary extraction number of target features contained in each code tag item, target features are extracted from the codes corresponding to the different code tag items contained in the sample website.
[0070] Preset rules refer to presetting different extraction rules based on different code tags. For example, for HTML (Hypertext Markup Language) documents with the code tag "body," target feature extraction is performed based on features such as special variable names, prompts, and request paths.
[0071] Based on preset rules and a preset preliminary extraction quantity of target features contained in each code label item, target features that meet the preset preliminary extraction quantity are extracted from the codes contained in each code label item.
[0072] Step S214: adding corresponding sample website type labels to the target features.
[0073] The extracted target features are added with corresponding sample website type labels, which can be used for subsequent identification of the website to be identified.
[0074] Through the above steps, the code of the sample website is classified according to the code tag items; based on the preset preliminary extraction quantity and the first weight of each code tag item, the preset preliminary extraction quantity of the target features contained in each code tag item is determined; based on the preset rules and the preset preliminary extraction quantity of the target features contained in each code tag item, the target features corresponding to the different code tag items contained in the sample website are extracted and the corresponding website type labels are added to the target features. The above steps can achieve rapid extraction of the target features of the sample website according to the preset rules, with high extraction efficiency; different preset preliminary extraction quantities are assigned to different code tag items, so that the extracted target features can fully reflect the characteristics of the sample website.
[0075] In one embodiment, the target feature is matched with the reference feature, and based on the extracted number of target features, a filtered target feature is obtained, such as Figure 4 The method specifically includes the following steps:
[0076] Step S221 : determining the number of extracted target features contained in each code label item based on the number of extracted target features and the second weight of each code label item.
[0077] Since the amount of information corresponding to the codes of different code label items in the sample website is different, a different second weight is assigned to each code label item. Based on the number of extracted target features and the second weight of each code label item, the number of extracted target features contained in each code label item can be determined respectively.
[0078] The second weight of each code tag item may be the same as or different from the first weight.
[0079] In step S222, the target features, reference features, and the number of target features extracted from each code label item are input into a screening model to output the screened target features; wherein the screening model calculates the similarity between the target features and the reference features and sorts them by similarity, and screens out the target features with the highest similarity ranking contained in each code label item based on the number of target features extracted from each code label item.
[0080] The reference features are pre-set features used as a reference. Reference features can be manually extracted and generated by technicians based on sample websites or websites with the same type of tags as the sample websites, or they can be other existing features used to determine website types. This application does not limit the specific method for generating reference features.
[0081] The screening model is a pre-trained algorithm model used to screen the target features initially extracted in step S21 based on the target features, reference features, and the number of target features extracted from each code tag item. The screening model calculates the similarity between the target features and the reference features contained in each code tag item, aggregates and sorts the similarity results, and selects the target features that rank highly in the aggregated results based on the number of extracted code tag items.
[0082] It should be noted that the screening here is not a simple determination of whether the codes or strings of the reference feature and the target feature are equal, but rather a similarity classification through an algorithm. At the same time, the screening model is trained and adjusted to avoid overfitting and avoid screening out target features that are identical to the reference features.
[0083] Through the above steps, based on the number of extracted target features and the second weight of each code tag item, the number of extracted target features contained in each code tag item is determined; the target features, reference features, and the number of extracted target features contained in each code tag item are input into the screening model to output the filtered target features; wherein, the screening model calculates the similarity between the target features and the reference features and sorts them by similarity, and based on the number of extracted target features contained in each code tag item, the target features contained in each code tag item with the highest similarity sorting are screened. The above steps implement the screening of the initially extracted target features, so that the screened target features can accurately reflect the characteristics of the sample website, which can improve the accuracy of identifying the website type.
[0084] In one embodiment, the website to be identified is matched based on the filtered target features and the reference features to determine the type of the website to be identified, specifically including:
[0085] Based on the code of the website to be identified, determine whether there is a feature in the filtered target features and reference features that matches the code of the website to be identified. If so, determine the type of the website to be identified based on the website type label corresponding to the target feature.
[0086] In actual production, a large number of websites are scanned and crawled. The purpose of identifying website types is to filter out specific types of websites from the massive amount of URL data. The code of the website to be identified is obtained and matched with the filtered target features and reference features. If the filtered target features and reference features match the code of the website to be identified, the website type label corresponding to the target feature is added to the website to be identified.
[0087] In one embodiment, after matching the target features with the reference features and obtaining the filtered target features based on the number of extracted target features, as shown in FIG. Figure 5 As shown, it also includes:
[0088] Step S24: testing the filtered target features to obtain target features that meet the set accuracy.
[0089] The set accuracy refers to the accuracy of the matching results obtained by matching the target features to the website to be identified. The set accuracy can be pre-set by technical personnel or calculated based on actual production application requirements, the type of website to be identified, the amount of code, and / or the code repetition rate and other relevant technical parameters. This application does not limit this.
[0090] After obtaining the filtered target features, the target features must be tested to verify the actual usage effect and obtain target features that meet the set accuracy.
[0091] Step S25 : matching the website to be identified based on the target feature that meets the set accuracy and the reference feature to determine the type of the website to be identified.
[0092] Based on the code of the website to be identified, determine whether there is a feature in the target feature that meets the set accuracy and the reference feature that matches the code of the website to be identified. If so, determine the type of the website to be identified based on the website type label corresponding to the target feature that meets the set accuracy.
[0093] The above steps verify the actual use effect of the target features by testing the filtered target features, thereby obtaining target features that meet the set accuracy, further improving the reliability of the target features, and more accurately identifying the target website.
[0094] In one embodiment, the screened target features are tested to obtain target features that meet the set accuracy, such as Figure 6 Shown, including:
[0095] Within a preset number of tests, the screened target features are used to match at least two test websites to obtain test results; it is determined whether the accuracy of the test results meets the set accuracy. If so, the screened target features are target features that meet the set accuracy.
[0096] Among them, at least two test websites are websites of known website types.
[0097] Among them, the screened target features are used to match at least two test websites to obtain the test results of the target features on the test websites (that is, the target features determine whether the test website is the website type corresponding to the target features). The technicians determine whether the test results for a single test website are correct, thereby obtaining the accuracy of the comprehensive test results.
[0098] In order to ensure the accuracy of each target feature, the target feature will be repeatedly matched against multiple test websites within the preset number of tests until the accuracy of the test results meets the set accuracy.
[0099] In a preferred embodiment, after reaching a preset number of tests, if the accuracy of the test results of the screened target feature on the test website still does not reach the set accuracy, the target feature is discarded.
[0100] In a preferred embodiment, after reaching a preset number of tests, if the accuracy of the test results of the screened target feature on the test website still does not reach the set accuracy, it is determined whether the difference between the accuracy of the test result and the set accuracy is greater than a preset accuracy difference threshold (for example: the set accuracy is 95%, the accuracy of the matching result is 60%, the preset accuracy difference threshold is 10%, the difference is 95%-60%=15%, and the difference is greater than the preset accuracy difference threshold). If so, the target feature is discarded.
[0101] In a preferred embodiment, after reaching a preset number of tests, if the accuracy of the test results of the screened target feature on the test website still does not reach the set accuracy, then it is determined whether the difference between the accuracy of the matching result and the set accuracy is greater than a preset accuracy difference threshold (for example: the set accuracy is 95%, the accuracy of the matching result is 90%, the preset accuracy difference threshold is 10%, the difference is 95%-90%=5%, and the difference is less than the preset accuracy difference threshold). If not, the target feature is accepted as the target feature that meets the set accuracy.
[0102] In a preferred embodiment, after reaching a preset number of tests, if the accuracy of the matching results of the screened target feature to the test website still does not reach the set accuracy, it is determined whether the difference between the accuracy of the matching result and the set accuracy is greater than a preset accuracy difference threshold (for example: the set accuracy is 95%, the accuracy of the matching result is 90%, the preset accuracy difference threshold is 10%, the difference is 95%-90%=5%, and the difference is less than the preset accuracy difference threshold). If not, the above matching results and related technical parameters are fed back to the technical staff to determine whether to accept the target feature.
[0103] The above steps test the filtered target features to obtain target features that meet the set accuracy, thereby improving the accuracy of subsequent target feature matching against the target website. Different processing strategies can be developed for target features that do not meet the set accuracy after testing, and these can be flexibly selected based on actual needs, giving technicians a high degree of autonomy.
[0104] In one embodiment, the target feature that meets the set accuracy and the reference feature are matched to the website to be identified, and after the type of the website to be identified is determined, Figure 7 As shown, it also includes:
[0105] Based on the matching results of the target feature that meets the set precision and the website to be identified, determine whether the accuracy of the matching result meets the set precision. If not, issue a warning for the target feature that meets the set precision, and accumulate the number of abnormal events as an abnormal event. When the accumulated value of the number of abnormal events of the target feature that meets the set precision is greater than or equal to the preset number of abnormal events, confirm that the target feature that meets the set precision is abnormal, and delete the target feature that meets the set precision.
[0106] Because the websites to be identified are constantly updated, the accuracy of the target features may decrease or even become invalid, affecting the determination of the website type. Therefore, the website to be identified is matched based on target features that meet the set accuracy and reference features. After determining the type of the website to be identified, the accuracy of the target feature matching the website type is analyzed and statistically analyzed to determine whether the matching result meets the set accuracy. For target features whose matching results do not meet the set accuracy, an alarm is issued and accumulated as an abnormal event. When the actual number of abnormalities is greater than or equal to the preset number of abnormalities, the target feature is confirmed to be abnormal and deleted.
[0107] In a preferred embodiment, the matching results are sampled to calculate the accuracy of the matching results. For example, when the sampling ratio is 10%, that is, for the matching results of 100 websites, 10 matching results are sampled for accuracy calculation. The sampling ratio can be adjusted according to actual application requirements.
[0108] In a preferred embodiment, the above steps can be performed according to a detection frequency. The detection frequency can be a time dimension. For example, when the detection frequency is once a day, the accuracy of the matching results is calculated once a day to determine whether they meet the set accuracy. The detection frequency can also be other different time dimensions, including at least one of seconds, minutes, hours, days, weeks, months, and years.
[0109] Through the above steps, the target features are monitored and analyzed in actual production, and abnormal target features are deleted in a timely manner to avoid the adverse effects of expired or invalid target features on website type judgment, thereby improving the effectiveness and accuracy of the target features.
[0110] The following describes and illustrates the embodiments of the present application through preferred embodiments. Figure 8 This is a flow chart of a website identification method according to a preferred embodiment of the present application. Figure 8 As shown, the website identification method includes:
[0111] Step S801: determine a sample website and obtain all web page codes corresponding to the sample website.
[0112] Step S802: Classify the codes of the sample website based on the code label items.
[0113] In this embodiment, the code tag items are: title, body, head, icon.
[0114] Step S803 : determining the preset preliminary extraction quantity of the target features included in each code label item based on the preset preliminary extraction quantity and the first weight of each code label item.
[0115] In this embodiment, the preset initial extraction quantity is twice the extraction quantity of the target features. The technicians determined that the extraction quantity of the target features is 8, and thus the preset initial extraction quantity is determined to be 16. The first weight of each code tag item is: the title tag item weight is 31.25%; the body tag item weight is 31.25%; the head tag item weight is 18.75%; the icon tag item weight is 18.75%;
[0116] This determines the preset preliminary extraction number of target features contained in each code tag item: 5 items are extracted from the title tag item; 5 items are extracted from the body tag item; 3 items are extracted from the head tag item; and 3 items are extracted from the icon tag item, for a total of 16 items.
[0117] Step S804 : Based on preset rules and a preset preliminary extraction number of target features contained in each code tag item, target features are extracted from the codes corresponding to the different code tag items contained in the sample website.
[0118] Step S805: Add corresponding sample website type labels to the target features.
[0119] Step S806 : determining the number of extracted target features contained in each code label item based on the number of extracted target features and the second weight of each code label item.
[0120] In this embodiment, the second weights of the code tag items are: the weight of the title tag item is 37.5%; the weight of the body tag item is 37.5%; the weight of the head tag item is 12.5%; and the weight of the icon tag item is 12.5%.
[0121] This determines the number of target features to be extracted from each code tag item: 3 from the title tag item; 3 from the body tag item; 1 from the head tag item; and 1 from the icon tag item, for a total of 8.
[0122] Step S807: Input the target features, reference features, and the number of target features extracted from each code label item into the screening model to output the screened target features; wherein the screening model calculates the similarity between the target features and the reference features and sorts them by similarity, and screens out the target features with higher similarity sorting contained in each code label item based on the number of target features extracted from each code label item.
[0123] In this embodiment, the target features after screening are: 3 title tag items; 3 body tag items; 1 head tag item; and 1 icon tag item, for a total of 8 items.
[0124] Step S808: Testing the filtered target features to obtain target features that meet the set accuracy.
[0125] Within a preset number of tests, the screened target features are used to match at least two test websites to obtain test results; it is determined whether the accuracy of the test results meets the set accuracy. If so, the screened target features are target features that meet the set accuracy.
[0126] In this embodiment, the preset number of tests is 20 times, the set accuracy is 95%, and the preset accuracy difference threshold is 10%.
[0127] If, after reaching the preset number of tests, the accuracy of the test results of the filtered target feature on the test website still does not reach the set accuracy, a determination is made as to whether the difference between the test result accuracy and the set accuracy is greater than a preset accuracy difference threshold. If so, the target feature is discarded. If not, the matching results and relevant technical parameters are fed back to the technical staff to determine whether to accept the target feature.
[0128] Step S809 : Matching the website to be identified based on the target feature that meets the set accuracy and the reference feature to determine the type of the website to be identified.
[0129] Based on the code of the website to be identified, determine whether there is a feature in the target feature that meets the set accuracy and the reference feature that matches the code of the website to be identified. If so, determine the type of the website to be identified based on the website type label corresponding to the target feature that meets the set accuracy.
[0130] Step S810, based on the matching results of the target feature that meets the set precision and the website to be identified, determine whether the accuracy of the matching result meets the set precision. If not, issue a warning for the target feature that meets the set precision, and accumulate the number of abnormal events as an abnormal event; when the accumulated value of the number of abnormal events of the target feature that meets the set precision is greater than or equal to 3 times, confirm that the target feature that meets the set precision is abnormal, and delete the target feature that meets the set precision.
[0131] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0132] This embodiment also provides a website identification device for implementing the above-mentioned embodiments and preferred implementations. Details already described will not be repeated. The terms "module," "unit," "subunit," etc. used below may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0133] Figure 9 This is a structural block diagram of the website identification device of this embodiment. Figure 9 As shown, the website identification device 90 includes: an extraction module 92, a screening module 94, and an identification module 96; wherein:
[0134] Extraction module 92, used to extract target features from sample websites according to preset rules and add corresponding sample website type labels to the target features;
[0135] A screening module 94 is configured to match the target feature with the reference feature and obtain a screened target feature based on the number of target features extracted;
[0136] The identification module 96 is configured to match the website to be identified based on the filtered target features and reference features to determine the type of the website to be identified.
[0137] In one embodiment, the extraction module 92 is used to classify the codes of the sample website based on at least two code label items; determine the preset preliminary extraction quantity of target features contained in each code label item based on the preset preliminary extraction quantity and the first weight of each code label item; extract target features of the codes corresponding to different code label items contained in the sample website based on preset rules and the preset preliminary extraction quantity of target features contained in each code label item; and add corresponding website type labels to the target features.
[0138] In one embodiment, the screening module 94 is used to determine the number of extracted target features contained in each code label item based on the number of extracted target features and the second weight of each code label item; the target feature, the reference feature, and the number of extracted target features contained in each code label item are input into the screening model to output the screened target feature; wherein the screening model calculates the similarity between the target feature and the reference feature and sorts the similarity, and screens out the target features with a higher similarity ranking contained in each code label item according to the number of extracted target features contained in each code label item.
[0139] In one embodiment, the identification module 96 is used to determine whether there are features in the filtered target features and reference features that match the code of the website to be identified based on the code of the website to be identified. If so, the type of the website to be identified is determined based on the website type label corresponding to the target feature.
[0140] In one embodiment, the screening module 94 is used to test the screened target features to obtain target features that meet the set accuracy; the identification module 96 is used to match the website to be identified based on the target features that meet the set accuracy and the reference features to determine the type of the website to be identified.
[0141] In one embodiment, the screening module 94 is used to match at least two test websites using the screened target features within a preset number of tests to obtain test results; determine whether the accuracy of the test results meets the set accuracy, and if so, the screened target features are target features that meet the set accuracy.
[0142] In one embodiment, it further includes:
[0143] The abnormal feature judgment module is used to determine whether the accuracy of the matching result meets the set accuracy based on the matching result of the target feature that meets the set accuracy and the website to be identified. If not, a warning is issued for the target feature that meets the set accuracy, and the number of times is accumulated as an abnormal event; when the accumulated value of the number of abnormal events of the target feature that meets the set accuracy is greater than or equal to the preset number of abnormal times, it is confirmed that the target feature that meets the set accuracy is abnormal, and the target feature that meets the set accuracy is deleted.
[0144] In this embodiment, an extraction module extracts target features from sample websites according to preset rules, adding corresponding sample website type labels to the target features. A screening module matches the target features with reference features and, based on the number of target features extracted, obtains filtered target features. An identification module matches the target website to be identified based on the filtered target features and reference features to determine the type of the target website. This device can extract target features from sample websites according to preset rules and use the target features to determine the type of the target website to be identified. This device achieves high efficiency in extracting target features, timely updates, and low labor costs.
[0145] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0146] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 10 As shown. The computer device includes a processor, a memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store motion detection data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements the steps of any of the above-mentioned website identification method embodiments.
[0147] Those skilled in the art will understand that Figure 10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0148] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps of any of the above website identification method embodiments when executing the computer program.
[0149] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned website identification method embodiments are implemented.
[0150] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0151] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0152] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A website identification method, characterized in that: The method comprises: Extract target features from sample websites according to preset rules, and add corresponding sample website type labels to the target features; Matching the target feature with a reference feature, and determining the number of target features extracted from each code label item based on the number of target features extracted and a second weight of each code label item; inputting the target feature, the reference feature, and the number of target features extracted from each code label item into a screening model to output a screened target feature; wherein the screening model calculates the similarity between the target feature and the reference feature and sorts the similarity, and screens out target features with a higher similarity ranking from each code label item based on the number of target features extracted from each code label item; Based on the code of the website to be identified, determine whether there is a feature in the filtered target feature and the reference feature that matches the code of the website to be identified. If so, determine the type of the website to be identified based on the website type label corresponding to the target feature.
2. A website identification method according to claim 1, characterized in that: The step of extracting target features from the sample websites according to preset rules and adding corresponding sample website type labels to the target features includes: Classifying the code of the sample website based on at least two code label items; Determining a preset preliminary extraction quantity of target features included in each code label item based on the preset preliminary extraction quantity and the first weight of each code label item; Extract target features from the codes corresponding to the different code tag items contained in the sample website based on preset rules and a preset preliminary extraction number of target features contained in each code tag item; Add the corresponding website type label to the target feature.
3. A website identification method according to claim 1, characterized in that: After matching the target features with the reference features and obtaining the filtered target features based on the extracted number of target features, the method further includes: Testing the screened target features to obtain target features that meet set accuracy; The website to be identified is matched based on the target feature that meets the set accuracy and the reference feature to determine the type of the website to be identified.
4. A website identification method according to claim 3, characterized in that: The testing of the screened target features to obtain target features that meet the set accuracy includes: Within a preset number of tests, the screened target features are used to match at least two test websites to obtain test results; and it is determined whether the accuracy of the test results meets the set precision. If so, the screened target features are the target features that meet the set precision.
5. A website identification method according to claim 3, characterized in that: After matching the website to be identified based on the target feature that meets the set accuracy and the reference feature and determining the type of the website to be identified, the method further includes: Based on the matching result of the target feature that meets the set precision and the website to be identified, determine whether the accuracy of the matching result meets the set precision; if not, issue a warning for the target feature that meets the set precision, and accumulate the number of abnormal events as an abnormal event; when the accumulated value of the number of abnormal events of the target feature that meets the set precision is greater than or equal to the preset number of abnormal events, confirm that the target feature that meets the set precision is abnormal, and delete the target feature that meets the set precision.
6. A website identification device, characterized in that: The device comprises: Extraction module: extracts target features from sample websites according to preset rules, and adds corresponding sample website type labels to the target features; A screening module is provided: matching the target feature with the reference feature, and determining the number of target features extracted from each code label item based on the number of target features extracted and the second weight of each code label item; inputting the target feature, the reference feature, and the number of target features extracted from each code label item into a screening model to output a screened target feature; wherein the screening model calculates the similarity between the target feature and the reference feature and sorts the similarity, and screens out target features with a higher similarity ranking from each code label item based on the number of target features extracted from each code label item; Identification module: Based on the code of the website to be identified, determine whether there is a feature in the filtered target feature and reference feature that matches the code of the website to be identified. If so, determine the type of the website to be identified based on the website type label corresponding to the target feature.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Feature comparison method and system, computer system and computer readable medium
CN109583368A
Webpage analysis method and device, equipment and storage medium
CN111949916A