Network resource classification method and device and electronic equipment
By receiving classification requests, determining the target text and recalling the tag set, using similar indexes to classify network resources, generating update tags, the poor adaptability problem caused by the diversification and evolution of network resource types is solved, and efficient classification is achieved.
Patent Information
- Application Number
- CN202510471885.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2025-08-15
AI Technical Summary
In the prior art, there are many types of network resources and are constantly evolving, resulting in poor adaptability of traditional classification methods and it is difficult to fully cover all resource types.
By receiving classification requests, the target text is determined, the tag collection containing alternative tags and update tags is retrieved, the target text and tags are classified using the similarity index of the target text to the tags, and new update tags are generated to adapt to the diversity and changes of network resources.
It realizes the comprehensiveness and timeliness of network resource classification, improves classification efficiency, reduces classification costs, and solves the problem of poor adaptability of traditional static label systems when facing the continuous evolution of network resources.
Smart Images

Figure CN120492966A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a network resource classification method, device and electronic equipment. Background Art
[0002] In related technologies, when classifying network resources, traditional classification methods are highly dependent on existing knowledge bases. However, with the diversification and continuous evolution of network resource types, it is difficult for traditional classification methods to fully cover all resource types, resulting in the technical problem of poor adaptability of network resource classification.
[0003] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0004] The embodiments of the present invention provide a network resource classification method, apparatus, and electronic device to at least solve the technical problem of poor adaptability of network resource classification due to the large variety and continuous evolution of network resources.
[0005] According to one aspect of an embodiment of the present invention, a network resource classification method is provided, comprising: receiving a classification request corresponding to a network resource; determining a target text corresponding to the network resource in response to the classification request; retrieving a label set, wherein the label set includes a plurality of candidate labels and an update label, and the update label is obtained based on semantic parameters corresponding to the sample text when similarity indexes between the sample text and the plurality of candidate labels are all less than a similarity threshold; determining a classification result with the network resource based on similarity indexes corresponding to the target text and the plurality of target labels, wherein the plurality of target labels include the plurality of candidate labels and the update label in the label set.
[0006] Optionally, determining the target text corresponding to the network resource includes: determining an initial text corresponding to the network resource, and determining semantic parameters and a predetermined vocabulary corresponding to the initial text; determining multiple text fragments corresponding to the initial text based on the semantic parameters and the predetermined vocabulary corresponding to the initial text; and determining the target text corresponding to the network resource based on the multiple text fragments.
[0007] Optionally, determining the target text corresponding to the network resource based on the multiple text fragments includes: determining the matching index of each text fragment corresponding to other text fragments in the multiple text fragments, and obtaining multiple matching indexes corresponding to the multiple text fragments; determining the retention index corresponding to the multiple text fragments based on the multiple matching indexes corresponding to the multiple text fragments; and determining the target text corresponding to the network resource based on the retention indexes corresponding to the multiple text fragments.
[0008] Optionally, before calling the label set, it also includes: determining a first model, wherein the first model is obtained by training an initial model based on masked text, and the masked text is determined based on training text, masked words, and a mask ratio index; using the first model, performing semantic analysis on the sample text to obtain semantic parameters corresponding to the sample text.
[0009] Optionally, before determining the first model, the method includes: determining multiple training words corresponding to the training text, and determining the semantic importance index and word frequency corresponding to the multiple training words respectively; determining the mask words corresponding to the training text based on the semantic importance indexes corresponding to the multiple training words respectively; determining the mask ratio index corresponding to the training text based on the word frequencies corresponding to the multiple training words respectively, and the mask words; and determining the mask text corresponding to the training text based on the training text, the mask words, and the mask ratio index.
[0010] Optionally, determining the target text corresponding to the network resource includes: determining multiple initial texts corresponding to the network resource, and text types corresponding to the multiple initial texts respectively; determining multiple association indexes corresponding to the multiple initial texts based on the multiple initial texts, wherein the multiple association indexes represent the association strength between the corresponding initial texts and other initial texts respectively; determining weight values corresponding to the multiple initial texts respectively based on the text types corresponding to the multiple initial texts and the multiple association indexes; determining the target text corresponding to the network resource based on the multiple initial texts and the weight values corresponding to the multiple initial texts respectively.
[0011] Optionally, before calling the label set, it also includes: determining a second model, wherein the second model is obtained by training the initial model based on a training set, the training set is obtained based on a positive text set and a negative text set, the positive text set is the training text, and the texts corresponding to the training semantic parameters are a set of the same text, and the negative text set is the training text, and the texts corresponding to the training semantic parameters are not a set of the same text; using the second model, performing semantic analysis on the sample text to obtain semantic parameters corresponding to the sample text.
[0012] According to one aspect of an embodiment of the present invention, a network resource classification device is provided, comprising: a receiving module for receiving a classification request corresponding to a network resource; a responding module for determining a target text corresponding to the network resource in response to the classification request; a retrieving module for retrieving a label set, wherein the label set includes a plurality of candidate labels and an update label, and the update label is determined based on semantic parameters corresponding to the sample text when the similarity indexes of the sample text and the plurality of candidate labels are all less than a similarity threshold; a determining module for determining a classification result with the network resource based on the similarity indexes of the target text corresponding to the plurality of target labels, wherein the plurality of target labels include the plurality of candidate labels and the update label in the label set.
[0013] According to one aspect of an embodiment of the present invention, an electronic device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement any of the above-mentioned network resource classification methods.
[0014] According to one aspect of an embodiment of the present invention, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute any of the above-mentioned network resource classification methods.
[0015] In an embodiment of the present invention, a classification request corresponding to a network resource is received; in response to the classification request, a target text corresponding to the network resource is determined; a label set is retrieved, wherein the label set includes multiple candidate labels and an update label, and the update label is obtained based on the semantic parameters corresponding to the sample text when the similarity indexes between the sample text and the multiple candidate labels are all less than a similarity threshold; and a classification result for the network resource is determined based on the multiple similarity indices, wherein the multiple similarity indices are the similarity indices between the target text and the multiple target labels, and the multiple target labels include multiple candidate labels and an update label. By retrieving the label set and determining the classification result for the network resource based on the similarity indices between the target text and the multiple target labels, not only can the most suitable category in the existing label set be automatically matched, but also new update labels can be automatically generated when the similarity of all labels is less than a threshold, so as to instantly adapt to the diversity and changes of network resource types and ensure the comprehensiveness and timeliness of the classification system, thereby effectively solving the problem of poor adaptability of the traditional static label system in the face of constantly evolving network resources, improving the classification efficiency of network resources, reducing the classification cost, and thus solving the technical problem of poor adaptability of network resource classification due to the large number of network resource types and their continuous evolution. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0017] Figure 1 is a flow chart of a network resource classification method according to an embodiment of the present invention;
[0018] Figure 2 This is a flowchart of network resource classification implementation in an optional embodiment of the present invention;
[0019] Figure 3 It is a structural block diagram of a network resource classification device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0020] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0021] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0022] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following interpretations:
[0023] Jaccard similarity: Jaccard similarity is a similarity metric calculation method used to evaluate the similarity between documents, sentences, or word sets. It is calculated by dividing the size of the intersection of two sets by the size of the union.
[0024] Fast Gradient Method (FGM): The Fast Gradient Method (FGM) is an algorithm for generating adversarial examples, commonly known as the fast gradient method. Based on a given input sample, this method makes a small update to the model's weights, so that the updated sample produces the maximum classification error at the model's output layer.
[0025] L2 regularization: L2 regularization, also known as weight decay or Ridge regularization, is a technique commonly used in machine learning and deep learning model training to prevent overfitting.
[0026] Support Vector Machine (SVM): Support Vector Machine (SVM) is a supervised learning method mainly used for classification and regression analysis.
[0027] Lightweight neural network: A neural network model with simple design, fewer parameters, and lower computational cost.
[0028] Example 1
[0029] According to an embodiment of the present invention, an embodiment of a network resource classification method is provided. It should be noted that the steps shown in the flowchart of 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.
[0030] Figure 1 is a flow chart of a network resource classification method according to an embodiment of the present invention. Figure 1 As shown, the method includes the following steps:
[0031] S102, receiving a classification request corresponding to a network resource;
[0032] In step S102 provided in the present application, a classification request corresponding to the network resource is received.
[0033] Among them, network resources are involved, which are resources corresponding to various entities and functions that are located, accessed and used in the network. The network resources can be physical (such as computer servers, network switches, routers, storage devices, printers, etc.), or virtual or software-based (such as websites, applications, databases, cloud services, user accounts, etc.).
[0034] This involves a classification request, which is used to request the classification of network resources. For example, the classification request might be: "Identify the resource type of the device with IP address 192.168.1.5." This involves analyzing the relevant text of the network resource (such as unstructured data describing the network resource's attributes, functions, and roles) and then classifying it into categories such as server, client, printer, security device, etc.
[0035] By receiving a classification request corresponding to a network resource, the network resource that needs to be classified can be clearly identified, thereby facilitating subsequent targeted analysis and classification based on the network resource.
[0036] S104, in response to the classification request, determining a target text corresponding to the network resource;
[0037] In step S104 provided in the present application, the classification request is responded to, and the target text corresponding to the network resource is determined.
[0038] This involves target text, which is the text associated with the network resource in the classification request and used to classify the network resource. This target text can be unstructured data describing the network resource's attributes, functions, and roles. This unstructured data is typically generated during the operation, management, or monitoring of the network resource. The target text can come from a variety of sources, including configuration files, system logs, operation and maintenance documents or manuals, and network monitoring reports.
[0039] The target text is formed by collecting and integrating data generated by network resources at different times and scenarios (such as unstructured data describing the attributes, functions and roles of the network resources). By determining the target text corresponding to the network resource, the key information of the network resource can be understood, providing a data basis for subsequent analysis and classification.
[0040] S106: Retrieving a label set, wherein the label set includes multiple candidate labels and an updated label, wherein the updated label is obtained based on semantic parameters corresponding to the sample text when similarity indexes between the sample text and the multiple candidate labels are all less than a similarity threshold;
[0041] In step S106 provided in this application, a tag set is retrieved.
[0042] This involves a tag set, which stores different classification tags. This includes pre-set category tags and new category tags that are adaptively added during the classification process. These tags are used to classify network resources into corresponding categories. Specifically, the tag set includes multiple candidate tags and updated tags that are automatically added during the classification process. For example, a tag set might include "server," "router," "firewall," "switch," and so on. These tags represent the classification of different types of resources on the network.
[0043] Therein, a plurality of candidate tags are involved, and the plurality of candidate tags are pre-set category tags for classifying network resources.
[0044] This involves updating labels, which are newly generated category labels based on the text of new network resources or changes to existing resource attributes during the classification process. For example, if none of the existing candidate labels are sufficiently matched during the classification process, meaning their similarity indices fall below the set similarity threshold, a new label will be generated based on semantic parameters extracted from the resource's text (i.e., the sample text) to more accurately describe the resource.
[0045] Among them, sample text is involved. The sample text is a text used to classify the sample network resource and describes the detailed information of the sample network resource. The sample network resource is a new type of network resource or a resource after the attributes of an existing resource have changed. That is, during the classification process, the similarity index of the sample network resource with multiple alternative labels is lower than the set similarity threshold. Then, in this case, based on the sample text of the sample network resource, a new category label for the sample network resource is further established.
[0046] This involves the similarity index, which quantifies the degree of semantic similarity between two texts. This similarity index can be calculated using methods such as cosine similarity, Jaccard similarity, or similarity scoring methods based on deep learning. A higher similarity index indicates a better semantic match between the two texts.
[0047] This involves a similarity threshold, a pre-set numerical standard used to determine whether a sample text is sufficiently similar to an alternative label to be classified into the corresponding category. If the similarity index between the sample text and all alternative labels is below the similarity threshold, the existing classification system is considered insufficient to accurately describe the resource, and it is necessary to consider generating updated labels.
[0048] This involves semantic parameters, which are parameters used to represent the semantic features of text (such as sample text). These semantic parameters can be feature vectors based on word embeddings or high-level abstract features extracted from the text, such as device type, performance indicators, or descriptions of operating status.
[0049] The process of retrieving a set of labels is to find the most appropriate category to describe the web resource represented by the sample text. If the semantic features of the sample text do not match the similarity threshold of multiple candidate labels, the system generates new, updated labels based on the semantic parameters of the sample text to accommodate the addition or change of the web resource. This mechanism ensures the flexibility and dynamism of the web resource classification system, allowing it to self-improve as the web environment evolves.
[0050] Retrieving a tag set containing multiple candidate tags and update tags provides an analysis basis for matching the most similar candidate tags when classifying network resources in subsequent classification requests, or generating update tags when no suitable match is found.
[0051] S108 , determining a classification result with network resources based on similarity indices corresponding to the target text and a plurality of target tags, wherein the plurality of target tags include a plurality of candidate tags and update tags in the tag set.
[0052] In step S108 provided in the present application, a classification result with network resources is determined based on multiple similarity indices.
[0053] Therein, multiple target tags are involved. The multiple target tags are all tags in the tag set when classifying the network resources in the classification request, including multiple candidate tags and update tags.
[0054] Among them, the classification result is involved, which is the category to which the network resource belongs after comparing and analyzing the similarity index between the target text and multiple target tags. For example, when there is at least one similarity index between the target text and multiple target tags that is greater than or equal to a similarity threshold, the category corresponding to the network resource is determined from the multiple target tags. On the contrary, when the similarity index between the target text and multiple target tags is less than the similarity threshold, then based on the semantic parameters of the target text, an updated tag corresponding to the target text is determined, and based on the updated tag, the network resource is classified, and the updated tag is stored in the tag set.
[0055] The classification result for the target text and the network resource is determined based on the similarity index corresponding to multiple target tags. This allows the classification result corresponding to the target text to be determined directly based on multiple similarity indices when at least one similarity index is greater than or equal to the similarity threshold, quickly locating the resource category and achieving rapid classification. Furthermore, when multiple similarity indices are all less than the similarity threshold, the updated tag corresponding to the target text is first determined based on the semantic parameters corresponding to the target text, and the updated tag is added to the tag set. The classification result is then determined based on the similarity index between the target text and each tag. This ensures that the classification process can dynamically expand as network resources are updated and changed, significantly enhancing the flexible adaptation of the classification to unknown or changing network resources.
[0056] Through the above steps S102-S108, a classification request corresponding to the network resource is received; in response to the classification request, a target text corresponding to the network resource is determined; a label set is retrieved, wherein the label set includes multiple alternative labels and an update label, and the update label is obtained based on the semantic parameters corresponding to the sample text when the similarity indexes of the sample text and the multiple alternative labels are all less than a similarity threshold; based on the multiple similarity indices, a classification result with the network resource is determined, wherein the multiple similarity indices are the similarity indices corresponding to the target text and the multiple target labels respectively, and the multiple target labels include multiple alternative labels and an update label. By retrieving the label set and determining the classification results with network resources based on the similarity indexes corresponding to the target text and multiple target labels, it can not only automatically match the most suitable category in the existing label set, but also automatically generate new updated labels when the similarity of all labels is lower than the threshold, and instantly adapt to the diversity and changes of network resource types, ensuring the comprehensiveness and timeliness of the classification system, thereby effectively solving the problem of poor adaptability of traditional static label systems in the face of constantly evolving network resources, improving the classification efficiency of network resources, reducing classification costs, and thus solving the technical problem of poor adaptability of network resource classification due to the large number of network resource types and their continuous evolution.
[0057] As an optional embodiment, determining the target text corresponding to the network resource includes: determining the initial text corresponding to the network resource, and determining the semantic parameters and predetermined vocabulary corresponding to the initial text; determining multiple text fragments corresponding to the initial text based on the semantic parameters and predetermined vocabulary corresponding to the initial text; and determining the target text corresponding to the network resource based on the multiple text fragments.
[0058] In this embodiment, the specific steps of determining the target text corresponding to the network resource are described.
[0059] The initial text is the original text obtained from the network resources, including the complete text content of configuration, operation records, etc. The initial text can be unstructured text data, such as system logs, configuration files, management interface output, user manuals, or any other form of text description.
[0060] The predetermined word library is a word library that is predetermined based on the needs of network resource management and includes common proprietary words and terms in network resource management. The predetermined word library can be summarized based on historical data.
[0061] It involves multiple text fragments, which are several smaller fragments into which the initial text is divided. When processing large or complex text data, dividing the text into fragments helps to focus on local semantic details, and also facilitates parallel processing or phased analysis. The basis for dividing text fragments can be sentence boundaries, paragraphs, topics, keyword density, etc. Each fragment should contain sufficient contextual information to ensure its semantic coherence and integrity. For example, in a router configuration file, multiple text fragments such as "interface configuration", "routing rules", and "security policy" can be divided, and each fragment reflects a specific aspect or function of the router.
[0062] In the steps involved in this embodiment, first, an initial text corresponding to a network resource is determined, and semantic parameters and a predetermined vocabulary corresponding to the initial text are determined. Then, based on the semantic parameters and the predetermined vocabulary corresponding to the initial text, multiple text segments corresponding to the initial text are determined. Finally, based on the multiple text segments, a target text corresponding to the network resource is determined.
[0063] By combining the semantic parameters corresponding to the initial text with the predetermined vocabulary, it is possible to accurately divide directly related proprietary words and terms. By subdividing the initial text into multiple segments with clear semantic focus, it is helpful to effectively capture key information related to the characteristics of network resources. In the process of division, combining the semantic parameters corresponding to the initial text with the predetermined vocabulary, it is possible to more accurately divide directly related proprietary words and terms, thereby ensuring that the obtained target text can accurately and comprehensively reflect the characteristics of network resources.
[0064] As an optional embodiment, determining the target text corresponding to the network resource based on multiple text fragments includes: determining the matching index of each text fragment corresponding to other text fragments in the multiple text fragments, and obtaining multiple matching indexes corresponding to the multiple text fragments; determining the retention index corresponding to the multiple text fragments based on the multiple matching indexes corresponding to the multiple text fragments; and determining the target text corresponding to the network resource based on the retention indexes corresponding to the multiple text fragments.
[0065] In this embodiment, specific steps of determining a target text corresponding to a network resource based on a plurality of text segments are described.
[0066] This involves a matching index, which measures the degree of match between a given text segment and all other text segments within a set of text segments. This matching index can be expressed as semantic similarity or content similarity. The higher the matching index, the stronger the correlation between the text segment and one or more of the other text segments. This indicates that the text segment is relatively important and can be assigned a higher weight.
[0067] Among them, a retention index is involved, which is determined based on the matching index and is used to determine the retention value or weight of each text segment in the process of constructing the target text.
[0068] In the steps involved in this embodiment, first, a matching index is determined for each of the multiple text segments with respect to the other text segments, thereby obtaining a plurality of matching indices corresponding to the multiple text segments. Then, based on the plurality of matching indices corresponding to the multiple text segments, a retention index is determined corresponding to the multiple text segments. Finally, based on the retention indices corresponding to the multiple text segments, a target text corresponding to the network resource is determined.
[0069] By determining the matching index of each text fragment with other fragments, it helps to accurately identify the key and representative parts of the text. Then, based on the matching index, the retention index of each text fragment can be determined, which can eliminate redundant or irrelevant information and ensure that the target text can accurately and comprehensively reflect the characteristics of network resources, thereby providing an important reference basis for subsequent classification.
[0070] As an optional embodiment, before calling the label set, it also includes: determining a first model, wherein the first model is obtained by training the initial model based on the masked text, and the masked text is determined based on the training text, masked words, and masked ratio index; using the first model, performing semantic analysis on the sample text to obtain semantic parameters corresponding to the sample text.
[0071] In this embodiment, the specific steps before calling the tag set are described.
[0072] Among them, the first model is involved, which is a model for semantic understanding and text feature extraction. The first model is trained using masked text based on the initial model (such as a deep learning model).
[0073] Among them, masked text is involved, and the masked text is the text obtained by masking (covering) the training text according to the mask word and the mask ratio index.
[0074] Among them, an initial model is involved, which is a predetermined model that initially has the ability to understand language and generate text.
[0075] Among them, training text is involved, which is the text collected in the network resource classification scenario (i.e., the network resource management scenario) and used to train the initial model. The training text may include configuration files, system logs, operation records and other types.
[0076] Among them, mask words are involved, which are words in the training text that need to be covered when using the training text to train the initial model.
[0077] This involves the masking ratio index, which controls the proportion of words that will be masked during the initial model training process using training text. Properly setting this masking ratio index helps balance the difficulty and efficiency of model training, promoting the model to learn stronger contextual understanding capabilities.
[0078] In the steps involved in this embodiment, first, a first model is determined, and then the first model is used to perform semantic analysis on a sample text to obtain semantic parameters corresponding to the sample text.
[0079] Masked text can help the initial model learn how to re-predict masked words (masked words) from the context, and reasonably setting the mask ratio index can help balance the difficulty and efficiency of model training, promote the model to learn stronger contextual understanding capabilities, thereby enhancing the initial model's sensitivity and understanding of the context, and then use the first model optimized by masked text to perform semantic analysis on the sample text, which can effectively handle professional vocabulary and complex text structures, thereby helping to improve the accuracy of semantic understanding of the text.
[0080] As an optional embodiment, before determining the first model, it includes: determining multiple training words corresponding to the training text, and determining the semantic importance index and word frequency corresponding to the multiple training words respectively; determining the mask words corresponding to the training text based on the semantic importance indexes corresponding to the multiple training words respectively; determining the mask ratio index corresponding to the training text based on the word frequencies corresponding to the multiple training words respectively, and the mask words; determining the mask text corresponding to the training text based on the training text, the mask words, and the mask ratio index.
[0081] In this embodiment, specific steps before determining the first model are described.
[0082] Among them, multiple training words are involved, which are words extracted from training texts and used for model training. The multiple training words may include proper nouns, operation commands, status descriptions, etc. in network resource descriptions.
[0083] This involves the semantic importance index, which quantifies the semantic contribution of each training word to the training text. By calculating factors such as the word's relevance to the context, its polysemy, and its uniqueness within the field, a numerical value reflecting the word's importance to text understanding can be obtained.
[0084] Among them, word frequency is involved, which is the frequency of occurrence of corresponding training words in the training text, and can be expressed by the ratio of the number of occurrences of the corresponding training words in the training text to the total number of words.
[0085] In the steps involved in this embodiment, first, multiple training words corresponding to the training text are determined, and the semantic importance index and word frequency corresponding to each of the multiple training words are determined. Then, based on the semantic importance index corresponding to each of the multiple training words, a mask word corresponding to the training text is determined. Next, based on the word frequency corresponding to each of the multiple training words and the mask word, a mask ratio index corresponding to the training text is determined. Finally, based on the training text, the mask word, and the mask ratio index, a mask text corresponding to the training text is determined.
[0086] Through the above steps, words with high semantic importance often carry the core information in the text. By masking these words, the model can be trained to infer the meaning of the masked words from the context, thereby enhancing the model's ability to handle complex contexts and extract key features. Determining the masking ratio index corresponding to the training text by analyzing the word frequencies of multiple training words and masking words helps balance the model's mastery of common vocabulary and learning of rare but semantically important technical terms. A reasonable masking ratio index ensures that the model can both consolidate its understanding of high-frequency words and overcome learning barriers to low-frequency key information. This significantly improves the relevance and efficiency of model training while also increasing the accuracy of the trained model's semantic understanding of the text.
[0087] As an optional embodiment, determining a target text corresponding to a network resource includes: determining multiple initial texts corresponding to the network resource, and text types corresponding to the multiple initial texts respectively; determining multiple association indexes corresponding to the multiple initial texts based on the multiple initial texts, wherein the multiple association indexes represent the association strength between the corresponding initial texts and other initial texts respectively; determining weight values corresponding to the multiple initial texts respectively based on the text types corresponding to the multiple initial texts and the multiple association indexes; and determining the target text corresponding to the network resource based on the multiple initial texts and the weight values corresponding to the multiple initial texts respectively.
[0088] In this embodiment, the specific steps of determining the target text corresponding to the network resource are described.
[0089] Multiple initial texts are involved. These initial texts are obtained from different data sources and are related to the network resources in the classification request. The multiple initial texts can correspond to different text types, for example, configuration files, system logs, operation manuals, network communication records, etc.
[0090] The text type is involved, and the text type is the category to which each initial text belongs. For example, the text type may include a configuration file category, a system log category, an operation manual category, and the like.
[0091] Among them, multiple correlation indices are involved, which are used to quantify the strength of the mutual correlation between the initial texts. These multiple correlation indices can be obtained by calculating the number of similar or identical keywords between the texts, semantic similarity scores, topic overlap, etc.
[0092] This involves weighting, calculated based on the text type and relevance index of the initial texts. This weight determines the weight of each initial text in the target text. Texts with higher weights will occupy a more prominent position in the target text, ensuring that the final target text fully and accurately reflects the characteristics of the network resources.
[0093] In the steps involved in this embodiment, first, multiple initial texts corresponding to the network resource and the text types corresponding to the multiple initial texts are determined. Then, based on the multiple initial texts, multiple relevance indices corresponding to the multiple initial texts are determined. Next, based on the text types corresponding to the multiple initial texts and the multiple relevance indices, weight values corresponding to the multiple initial texts are determined. Finally, based on the multiple initial texts and the weight values corresponding to the multiple initial texts, a target text corresponding to the network resource is determined.
[0094] By combining different types of initial text (such as configuration files, system logs, and operation manuals), we can capture the characteristics of network resources from multiple perspectives, providing richer information and more comprehensive descriptions than a single data source. The introduction of a correlation index quantifies the strength of associations between different initial texts, helping to filter and highlight information that plays a key role in describing network resources. The determination of weights further emphasizes the proportion of important information and reduces the impact of irrelevant or redundant information, ensuring that the target text accurately reflects the core attributes of the network resource, thereby improving classification accuracy.
[0095] As an optional embodiment, before calling the label set, it also includes: determining a second model, wherein the second model is obtained by training the initial model based on the training set, the training set is obtained based on the positive text set and the negative text set, the positive text set is the training text, and the texts corresponding to the training semantic parameters are a set of the same text, the negative text set is the training text, and the texts corresponding to the training semantic parameters are not a set of the same text; using the second model, semantic analysis is performed on the sample text to obtain semantic parameters corresponding to the sample text.
[0096] In this embodiment, the specific steps before calling the tag set are described.
[0097] Among them, a second model is involved, which is a model for semantic understanding and text feature extraction. The second model is trained using masked text based on the initial model (such as a deep learning model).
[0098] Among them, a training set is involved, which is a text set composed of a positive text set and a negative text set. It is used to supervise the initial model learning process and help the initial model distinguish between correct and incorrect network resource descriptions, thereby improving its understanding and classification capabilities of network resource semantics.
[0099] The text set is a training text set, and the texts corresponding to the training semantic parameters are a set of the same texts. That is, the text set contains the correct network resource description texts that are directly related to the training semantic parameters.
[0100] Among them, a negative text set is involved, which is a set of training texts that are not the same text as the texts corresponding to the training semantic parameters. In other words, the negative text set contains network resource texts that do not match the training semantic parameters or have incorrect descriptions.
[0101] Among them, a training semantic parameter is involved, and the training semantic parameter is used to reflect the semantic information corresponding to the corresponding training text.
[0102] In the steps involved in this embodiment, first, the second model is determined, and then, the second model is used to perform semantic analysis on the sample text to obtain semantic parameters corresponding to the sample text.
[0103] Through the above steps, the positive text set is used as a positive example in the model training process, which helps the initial model learn and memorize the typical features and description patterns of specific network resources. The negative text set is used as a negative example to help train the initial model to identify and exclude non-network resource descriptions, or information that does not match the characteristics of specific resources, thereby improving the model's ability to identify and exclude interfering information, thereby helping to improve the accuracy of the second model in semantic understanding.
[0104] In addition, the process of training to obtain the second model can be performed after the initial model is trained to obtain the first model, and then further trained, or it can be directly trained based on the initial model.
[0105] Similarly, the first model obtained by the above training can be further trained after the initial model is trained to obtain the second model, or it can be directly trained based on the initial model.
[0106] Based on the above embodiment and optional embodiment, an optional implementation manner is provided, which is described in detail below.
[0107] In related technologies, when classifying network resources, traditional classification methods are highly dependent on existing knowledge bases. However, with the diversification and continuous evolution of network resource types, it is difficult for traditional classification methods to fully cover all resource types, resulting in the technical problem of poor adaptability of network resource classification.
[0108] To address the above-mentioned problems, no effective solutions have been proposed so far.
[0109] In view of this, an optional embodiment of the present invention provides a network resource classification method, which can also be called a semantic recognition and active asset classification method based on a large model, which can effectively solve the technical problem in related technologies that network resource classification has poor adaptability due to the large number and continuous evolution of network resource types.
[0110] Figure 2 This is a flowchart of network resource classification implementation in an optional embodiment of the present invention, such as Figure 2 As shown, the following is described in detail.
[0111] S1, data preprocessing and collection for dynamic semantic enhancement;
[0112] Acquire relevant data of network assets (same as the above network resources, such as routers). Specifically, S1 includes:
[0113] S11, obtain unstructured data:
[0114] Collect unstructured data from various data sources (such as network device configuration files, system logs, operation and maintenance manuals, network topology diagrams, etc.). For example, various unstructured data is collected from the network environment, including but not limited to network device configuration files (such as firewall rule sets), system logs (such as operating status records), operation and maintenance manuals (such as device manuals), and network topology diagrams (existing in textual descriptions). This data exists in the form of text files, log files, etc., and contains information such as the device's Internet Protocol (IP) address, port number, configuration parameters, and operating status.
[0115] For example, data can be extracted from target network devices through network data scraping tools or application programming interfaces (APIs). For example, the Secure Shell (SSH) protocol can be used to access a router to obtain configuration files, or the Syslog protocol can be used to collect logs.
[0116] S12, semantic enhancement processing:
[0117] Determine the initial text corresponding to the network resource, and determine the semantic parameters and predetermined vocabulary corresponding to the initial text; determine multiple text segments corresponding to the initial text based on the semantic parameters and predetermined vocabulary corresponding to the initial text; and determine the target text corresponding to the network resource based on the multiple text segments.
[0118] For example, unlike simple cleaning and word segmentation, a dynamic semantic enhancement preprocessing mechanism is designed. That is, by introducing a context-based adaptive word segmentation algorithm and combining it with a network-specific vocabulary (the same as the predetermined vocabulary mentioned above), the word segmentation boundaries are dynamically adjusted to avoid the semantic fragmentation problem of traditional word segmentation tools when processing professional terms (such as "firewall policy", "high load status", etc.).
[0119] Preprocessing: This approach uses a context-based adaptive word segmentation algorithm, combined with specialized network vocabulary (e.g., "firewall policy" and "bandwidth limit"), to dynamically adjust word segmentation boundaries. For example, when encountering "high load status," traditional word segmentation tools might split it into "high," "load," and "status." However, this approach uses contextual analysis to identify it as a complete term (similar to the multiple text fragments mentioned above), avoiding semantic fragmentation.
[0120] S13, noise filtering processing:
[0121] Determine the matching index of each text segment with other text segments in a plurality of text segments, and obtain a plurality of matching indexes corresponding to the plurality of text segments; determine the retention index corresponding to the plurality of text segments based on the plurality of matching indexes corresponding to the plurality of text segments; and determine the target text corresponding to the network resource based on the retention indexes corresponding to the plurality of text segments.
[0122] For example, in response to the heterogeneity of data sources, a noise filtering method based on semantic similarity was proposed. A pre-trained model (such as a pre-trained language model) was used to calculate the semantic relevance between text fragments (the same as the multiple matching indices mentioned above), eliminate irrelevant information (such as redundant log entries), and retain the core semantics related to assets (the same as the network resources mentioned above). This solves the problem of insufficient understanding of complex semantic data by conventional preprocessing methods.
[0123] For example, regarding the retention index, the "timestamp" field that appears repeatedly in the log is filtered, and only the core semantics related to the asset status (such as "connection failure") are retained. Finally, structured feature data (same as the target text above) is generated, such as "Device name: Router 1 (Router1), IP address: 192.168.1.1, Status: Abnormal", providing a data basis for subsequent analysis.
[0124] S2, construction and optimization of domain-adaptive large models;
[0125] We selected a pre-trained model suitable for Chinese language processing (such as a pre-trained language model), and based on this, proposed a "two-stage domain adaptive optimization" technology, which is significantly different from conventional model fine-tuning:
[0126] Phase 1: Dynamic mask domain pre-training;
[0127] Determine a first model, wherein the first model is obtained by training an initial model based on a masked text, and the masked text is determined based on the training text, masked words, and a masked ratio index; use the first model to perform semantic analysis on the sample text to obtain semantic parameters corresponding to the sample text.
[0128] Before determining the first model, multiple training words corresponding to the training text are determined, and the semantic importance indexes and word frequencies corresponding to the multiple training words are determined; based on the semantic importance indexes corresponding to the multiple training words, the mask words corresponding to the training text are determined; based on the word frequencies corresponding to the multiple training words, and the mask words, the mask ratio index corresponding to the training text is determined; based on the training text, the mask words, and the mask ratio index, the mask text corresponding to the training text is determined.
[0129] For example, in response to the dense terminology and complex semantics of network assets, a dynamic masking strategy was designed. During the pre-training phase, this strategy dynamically adjusts the masking ratio (similar to the masking ratio index described above) and position based on the real-time semantic distribution of the input data (similar to the semantic importance index and word frequency described above). It prioritizes masking key terms (similar to the masked words described above, such as "IP address" and "port number"), enhancing the model's sensitivity to domain characteristics. Compared to traditional static masking methods, this improves the model's understanding of rare terms and dynamic context.
[0130] For example, identify the high-frequency term "port number" in the configuration file, including:
[0131] A dynamic mask adjustment strategy is adopted to increase the mask ratio of key terms such as "port number" to 30%, while common words are kept at 15%, and the mask position is adjusted according to the context (such as the number after "port number").
[0132] The deep learning model was trained for 10 rounds, with each round processing approximately 500 megabytes (MB) of data to enhance the model's sensitivity to domain characteristics.
[0133] Phase 2: Adversarial fine-tuning and regularization.
[0134] Determine a second model, wherein the second model is obtained by training the initial model based on a training set, the training set is obtained based on a positive text set and a negative text set, the positive text set is the training text, and the texts corresponding to the training semantic parameters are a set of the same text, and the negative text set is the training text, and the texts corresponding to the training semantic parameters are not a set of the same text; use the second model to perform semantic analysis on the sample text to obtain semantic parameters corresponding to the sample text.
[0135] During supervised learning fine-tuning, an adversarial training mechanism is introduced. By generating adversarial examples (similar to the negative text set mentioned above, such as logs simulating configuration anomalies), the model is forced to learn more robust semantic features. Combined with domain-specific regularization constraints (such as limiting the weight of irrelevant words), this avoids overfitting to general corpora and improves the ability to extract the specific semantics of network assets. This two-stage optimization addresses the problem of conventional fine-tuning relying solely on labeled data and lacking generalization.
[0136] For example, first generate adversarial samples, that is, simulate abnormal logs (such as "connection timeout" replaced by "access denied") and input them into the model.
[0137] Adversarial training is used to generate perturbations through an algorithm that generates adversarial samples (e.g., Fast Gradient Method, FGM), forcing the model to learn robust features.
[0138] Apply regularization constraints, impose L2 regularization penalty on the weights of common words (such as "的" and "是"), and set the coefficient to 0.01 to avoid overfitting.
[0139] Finally, the optimized model (the same as the second model above) can accurately extract semantic features related to assets, such as the context meaning corresponding to "Router1 abnormal status".
[0140] S3, Deep semantic feature extraction and multimodal adaptive fusion;
[0141] Use the optimized large model to perform deep semantic analysis on the preprocessed data and extract asset feature vectors. Different from traditional methods that are only based on a single data source or simple feature splicing, a "multimodal adaptive fusion" technology is proposed, including a feature extraction stage and a fusion stage.
[0142] In the feature extraction stage, determine multiple initial texts corresponding to network resources, and the text types corresponding to the multiple initial texts respectively; based on the multiple initial texts, determine multiple correlation indices corresponding to the multiple initial texts respectively, where the multiple correlation indices represent the correlation strengths of the corresponding initial texts with the initial texts corresponding to other initial texts respectively; based on the text types corresponding to the multiple initial texts and the multiple correlation indices, determine the weight values corresponding to the multiple initial texts respectively; based on the multiple initial texts and the weight values corresponding to the multiple initial texts respectively, determine the target text corresponding to the network resource.
[0143] Input the preprocessed data into the large model, and dynamically adjust the attention weights through the self-attention mechanism. That is, the model dynamically adjusts the weights of each data source (the same as the multiple initial texts above, such as configuration files and logs) through the self-attention mechanism, and gives priority to information with high semantic contribution (such as abnormal status descriptions) to generate more representative feature vectors.
[0144] For example, assign a higher weight (0.8) to the "abnormal status description" in the log and a lower weight (0.5) to the "static IP" in the configuration file to generate an initial feature vector (such as 768-dimensional).
[0145] In the fusion stage (that is, the multimodal fusion stage), an adaptive fusion algorithm based on semantic consistency is designed. By calculating the semantic consistency scores between different modal features (the same as the multiple correlation indices above, such as the matching degree between static configurations and dynamic logs), dynamically adjust the fusion weights to avoid over-reliance on noisy data by traditional weighted average methods. This process not only improves the comprehensiveness of the feature vectors but also enhances the recognition ability for unknown assets (such as new devices), overcoming the deficiencies of complex and lack of self-adaptability in multi-source data fusion.
[0146] For example, when calculating the semantic consistency score, a semantic match between "IP address: 192.168.1.1" in the configuration file and "connection failure" in the log file yields a score of 0.9, indicating a high correlation. Based on the results, the fusion weights are dynamically adjusted. Specifically, based on the scores, the weight of the configuration file feature is set to 0.4, and the weight of the log feature is set to 0.6 to avoid noise interference.
[0147] Finally, a weighted fusion algorithm is used to generate a comprehensive feature vector, ensuring that the vector contains comprehensive information about the asset. For example, the 768-dimensional vector corresponding to "Router1, abnormal, IP: 192.168.1.1" is used.
[0148] S4, active asset classification and incremental learning optimization.
[0149] Based on the extracted feature vectors, an active asset classification model is constructed to automatically map asset categories (such as servers, routers, etc.). An "online incremental learning" mechanism is also introduced. That is, when a new device or configuration change is detected, the model uses few-sample learning technology combined with semantic similarity assessment to quickly update the classification rules without retraining the entire model. Pseudo-labels are generated using small batches of new data, and high-quality samples are screened through consistency checks (comparison with historical feature vectors) and gradually incorporated into the model. This process contrasts with the traditional static classifier's reliance on large-scale retraining, significantly improving real-time and adaptability.
[0150] For example, active asset classification and incremental learning optimization, including:
[0151] For classification models:
[0152] Use a support vector machine (SVM) or lightweight neural network to input the comprehensive feature vector and train an initial classifier. Categories include "server," "router," "firewall," and so on.
[0153] For online incremental learning:
[0154] (1) Detecting new devices: When a new log “Device X connection anomaly” is found and the feature vector does not match the historical data, incremental learning is triggered.
[0155] (2) Few-shot learning: Combined with semantic similarity (0.85 similarity to the “router” category), a pseudo-label “router” is generated.
[0156] (3) Consistency check: Compare historical feature vectors, filter samples with confidence higher than 0.9, and update model parameters.
[0157] (4) Iterative update: Each batch processes 10 new data items, which takes about 5 seconds and does not require retraining the entire model.
[0158] Finally, the real-time classification results (such as "DeviceX: Router") are updated to the asset library (the same as the above tag set).
[0159] Through the above optional implementation, at least the following beneficial effects can be achieved:
[0160] (1) Compared with related technologies, the present invention retrieves a label set and determines the classification result of the network resource based on the similarity index corresponding to the target text and multiple target labels. It can not only automatically match the most suitable category in the existing label set, but also automatically generate new updated labels when the similarity of all labels is lower than the threshold, and instantly adapt to the diversity and changes of network resource types, ensuring the comprehensiveness and timeliness of the classification system, thereby effectively solving the problem of poor adaptability of the traditional static label system in the face of constantly evolving network resources, improving the classification efficiency of network resources, reducing the classification cost, and further solving the technical problem of poor adaptability of network resource classification due to the large number of network resource types and their continuous evolution.
[0161] (2) Compared with related technologies, the present invention can help the initial model learn how to re-predict masked words from the context through masked text, and reasonably setting the mask ratio index helps to balance the difficulty and efficiency of model training, promote the model to learn stronger context understanding ability, thereby enhancing the initial model's sensitivity and understanding ability to the context, and then use the first model optimized by masked text to perform semantic analysis on the sample text, which can effectively process professional vocabulary and complex text structures, thereby helping to improve the accuracy of semantic understanding of the text.
[0162] (3) Compared with related technologies, the present invention can capture the characteristics of network resources from multiple perspectives by integrating different types of initial texts (such as configuration files, system logs, and operation manuals). Compared with a single data source, the information is richer and the description is more comprehensive. The introduction of the correlation index quantifies the correlation strength between different initial texts, which helps to screen and highlight the information that plays a key role in the description of network resources. The determination of the weight value further emphasizes the proportion of important information, reduces the impact of irrelevant or redundant information, ensures that the target text accurately reflects the core attributes of the network resource, and thus helps to improve the accuracy of classification.
[0163] (4) Compared with related technologies, the present invention breaks through the limitations of traditional methods in understanding the semantics of unstructured data through adaptive word segmentation and semantic noise filtering, and significantly improves the accuracy of asset feature extraction in complex scenarios. Moreover, through two-stage optimization combined with adversarial training, the semantic recognition ability of the model in the field of network assets surpasses conventional fine-tuning methods, and is particularly suitable for identifying unknown devices. Based on the fusion technology of semantic consistency, it overcomes the problems of information redundancy and inconsistency in traditional multi-source data processing, and improves the robustness and comprehensiveness of asset classification. In addition, through few-sample learning and dynamic updating, it solves the problem of insufficient adaptability of traditional methods to network changes, reduces the need for manual intervention, and ensures the real-time nature of the asset library.
[0164] It should be noted that for the aforementioned method embodiments, for simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that the present invention is not limited by the order of the actions described, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0165] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of various embodiments of the present invention.
[0166] Example 2
[0167] According to an embodiment of the present invention, a device for implementing the above-mentioned network resource classification method is also provided. Figure 3 : is a structural block diagram of a network resource classification device according to an embodiment of the present invention. Figure 3 As shown, the device includes: a receiving module 302, a responding module 304, a calling module 306 and a determining module 308. The device will be described in detail below.
[0168] A receiving module 302 is used to receive a classification request corresponding to a network resource; a response module 304 is connected to the above-mentioned receiving module 302, and is used to determine the target text corresponding to the network resource in response to the classification request; a calling module 306 is connected to the above-mentioned response module 304 and is connected to the above-mentioned, and is used to call a label set, wherein the label set includes multiple alternative labels and update labels, and the update label is determined based on the semantic parameters corresponding to the sample text when the similarity index between the sample text and the multiple alternative labels is less than the similarity threshold; a determination module 308 is connected to the above-mentioned calling module 306, and is used to determine the classification result with the network resource based on the similarity index between the target text and the multiple target labels, wherein the multiple target labels include multiple alternative labels and update labels in the label set.
[0169] It should be noted here that the above-mentioned receiving module 302, response module 304, call module 306 and determination module 308 correspond to steps S102 to S108 in implementing the network resource classification method. The instances and application scenarios implemented by multiple modules and corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned embodiment 1.
[0170] Example 3
[0171] According to another aspect of an embodiment of the present invention, an electronic device is provided, including: a processor; and a memory for storing processor-executable instructions, wherein the processor is configured to execute the instructions to implement any of the above-mentioned network resource classification methods.
[0172] Example 4
[0173] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute any of the above-mentioned network resource classification methods.
[0174] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.
[0175] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0176] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, 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, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0177] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0178] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0179] 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 invention, 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 and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc. Various media that can store program codes.
[0180] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A network resource classification method, characterized in that: include: receiving a classification request corresponding to a network resource; In response to the classification request, determining a target text corresponding to the network resource; Retrieving a label set, wherein the label set includes a plurality of candidate labels and an updated label, wherein the updated label is obtained based on semantic parameters corresponding to the sample text when similarity indexes between the sample text and the plurality of candidate labels are all less than a similarity threshold; A classification result with the network resource is determined based on similarity indexes corresponding to the target text and a plurality of target tags, wherein the plurality of target tags include the plurality of candidate tags and the update tag in the tag set.
2. The method according to claim 1, characterized in that The determining of the target text corresponding to the network resource includes: Determining an initial text corresponding to the network resource, and determining semantic parameters and a predetermined vocabulary corresponding to the initial text; Determining a plurality of text segments corresponding to the initial text based on semantic parameters corresponding to the initial text and a predetermined vocabulary; A target text corresponding to the network resource is determined based on the multiple text segments.
3. The method according to claim 2, characterized in that Determining the target text corresponding to the network resource based on the multiple text segments includes: Determining a matching index of each text segment corresponding to other text segments in a plurality of text segments, to obtain a plurality of matching indexes corresponding to the plurality of text segments; Determining retention indices corresponding to the plurality of text segments respectively based on the plurality of matching indices corresponding to the plurality of text segments respectively; A target text corresponding to the network resource is determined according to the retention indices corresponding to the multiple text segments.
4. The method according to claim 1, wherein Before calling the tag set, the method further includes: Determining a first model, wherein the first model is obtained by training an initial model based on a masked text, and the masked text is determined based on a training text, a masked word, and a masking ratio index; The first model is used to perform semantic analysis on the sample text to obtain semantic parameters corresponding to the sample text.
5. The method according to claim 4, characterized in that Before determining the first model, the method includes: Determining a plurality of training words corresponding to the training text, and determining semantic importance indexes and word frequencies respectively corresponding to the plurality of training words; Determining a mask word corresponding to the training text according to the semantic importance indexes corresponding to the plurality of training words; Determining a mask ratio index corresponding to the training text based on the word frequencies corresponding to the plurality of training words and the mask word; The masked text corresponding to the training text is determined according to the training text, the masked words, and the masked ratio index.
6. The method according to claim 1, characterized in that The determining of the target text corresponding to the network resource includes: Determining a plurality of initial texts corresponding to the network resource, and text types corresponding to the plurality of initial texts respectively; Determining, based on the multiple initial texts, a plurality of relevance indexes corresponding to the multiple initial texts, wherein the multiple relevance indexes represent the strength of relevance between the corresponding initial texts and other initial texts; Determining weight values corresponding to the multiple initial texts respectively according to the text types and multiple association indexes corresponding to the multiple initial texts respectively; A target text corresponding to the network resource is determined based on the multiple initial texts and the weight values respectively corresponding to the multiple initial texts.
7. The method according to any one of claims 1 to 6, characterized in that Before calling the tag set, the method further includes: Determine a second model, wherein the second model is obtained by training the initial model based on a training set, the training set is obtained based on a positive text set and a negative text set, the positive text set is a set of training texts, and texts corresponding to the training semantic parameters are the same text, and the negative text set is a set of training texts, and texts corresponding to the training semantic parameters are not the same text; The second model is used to perform semantic analysis on the sample text to obtain semantic parameters corresponding to the sample text.
8. A network resource classification device, characterized in that: include: A receiving module, configured to receive a classification request corresponding to a network resource; a response module, configured to determine a target text corresponding to the network resource in response to the classification request; a retrieval module, configured to retrieve a tag set, wherein the tag set includes a plurality of candidate tags and an updated tag, wherein the updated tag is determined based on semantic parameters corresponding to the sample text when similarity indexes between the sample text and the plurality of candidate tags are all less than a similarity threshold; A determination module is used to determine a classification result with the network resource based on similarity indexes corresponding to the target text and multiple target tags, wherein the multiple target tags include the multiple candidate tags and the update tag in the tag set.
9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the network resource classification method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the network resource classification method according to any one of claims 1 to 7.