Model training method and protocol address encoding information generation method and device

By encoding the protocol address and processing the home distance label, the problem of low efficiency in protocol address encoding is solved, and a more accurate encoding model is generated.

CN119766777BActive Publication Date: 2025-12-16BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411835300.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-12-16
Estimated Expiration
2044-12-12

AI Technical Summary

Technical Problem

In the context of protocol address encoding tasks, the large volume of protocol address data to be encoded and the lack of a general training target lead to low encoding efficiency.

Method used

The protocol address set is encoded using an initial protocol address encoding model to generate protocol address encoding information. The dataset is then divided according to the address location and distance labels to generate a training dataset. Finally, the model is trained to generate the protocol address encoding model.

Benefits of technology

It achieves high efficiency and accuracy in protocol address encoding, and generates a more accurate encoding model by considering the geographical characteristics of the protocol address's location.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119766777B_ABST
    Figure CN119766777B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure disclose a model training method and a protocol address coding information generation method and device. A specific implementation of the method comprises: using an initial protocol address coding model to code and process each protocol address to generate protocol address coding information, thereby obtaining a set of protocol address coding information; dividing each protocol address coding information to generate a set of protocol address coding information groups; for each protocol address coding information group, generating a corresponding home location distance label according to a set of address home locations; generating a training data set according to the set of protocol address coding information groups and the set of home location distance labels; and performing model training on the initial protocol address coding model according to the training data set to generate a protocol address coding model. The implementation is related to artificial intelligence, and the protocol address coding model can accurately and efficiently generate protocol address coding information corresponding to a target protocol address.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular, to a model training method and a protocol address encoding information generation method and device. BACKGROUND

[0002] At present, with the continuous development of artificial intelligence, embedding technology is also increasingly applied in various scenarios. For the embedding encoding processing of protocol addresses, the commonly used way is to encode the protocol addresses by using one-hot encoding to obtain protocol address encoding information.

[0003] However, the inventors have found that when the above-mentioned way is used for encoding processing, the following technical problems often exist:

[0004] In the protocol address encoding task scenario, the data volume of the protocol addresses to be encoded is large, and there is no general training target, resulting in low encoding efficiency.

[0005] The above information disclosed in the background section is only intended to enhance the understanding of the background of the present inventive concept, and therefore, it can include information that does not form the prior art known to those of ordinary skill in the art in the country. SUMMARY

[0006] The summary section is provided to introduce the concepts briefly in a simplified form, which will be described in detail in the specific embodiments section. The summary section is not intended to identify key or essential features of the claimed technical solution, nor is it intended to be used to limit the scope of the claimed technical solution.

[0007] Some embodiments of the present disclosure propose a model training method, a protocol address encoding information generation method and device to solve the technical problems mentioned in the background section.

[0008] In a first aspect, some embodiments of the present disclosure provide a model training method, comprising: encoding each protocol address in an obtained protocol address set using an initial protocol address encoding model to generate protocol address encoding information, thereby obtaining a protocol address encoding information set, wherein each protocol address has a corresponding address belonging place; dividing each protocol address encoding information in the protocol address encoding information set to generate a protocol address encoding information group set, wherein each protocol address encoding information group includes a target number of protocol address encoding information; for each protocol address encoding information group in the protocol address encoding information group set, generating a belonging place distance label corresponding to the protocol address encoding information group according to a corresponding address belonging place group; generating a training data set according to the protocol address encoding information group set and a corresponding belonging place distance label set; and training the initial protocol address encoding model according to the training data set to generate a protocol address encoding model.

[0009] Optionally, the generating of the belonging place distance label corresponding to the protocol address encoding information group according to the corresponding address belonging place group comprises: determining a first belonging place distance between a first address belonging place and a second address belonging place, wherein the protocol address encoding information group includes a first protocol address encoding information, a second protocol address encoding information, and a third protocol address encoding information, the first address belonging place corresponds to the first protocol address encoding information, and the second address belonging place corresponds to the second protocol address encoding information; determining a second belonging place distance between the first address belonging place and a third address belonging place, wherein the third address belonging place corresponds to the third protocol address encoding information; and generating the belonging place distance label according to the first belonging place distance and the second belonging place distance.

[0010] Optionally, the generating of the belonging place distance label according to the first belonging place distance and the second belonging place distance comprises: determining distance comparison information between the first belonging place distance and the second belonging place distance as the belonging place distance label.

[0011] Optionally, the initial protocol address encoding model comprises an initial word embedding layer, a vector fusion layer, and a plurality of initial fully connected layers connected in series; and the encoding processing of each protocol address in the obtained protocol address set by using the initial protocol address encoding model to generate protocol address encoding information comprises: performing address segmentation processing on the protocol address to generate a segmented information set; inputting each segmented information in the segmented information set to the initial word embedding layer to generate a segmented information embedding vector, thereby obtaining a segmented information embedding vector set; inputting each segmented information embedding vector in the segmented information embedding vector set to the vector fusion layer to generate a fusion vector; and inputting the fusion vector to the plurality of initial fully connected layers connected in series to generate the protocol address encoding information.

[0012] Optionally, before the encoding processing of each protocol address in the obtained protocol address set by using the initial protocol address encoding model to generate protocol address encoding information to obtain a protocol address encoding information set, the method further comprises: obtaining a protocol address data set; and performing the following generation steps on each protocol address data in the protocol address data set: performing data preprocessing on the protocol address data to generate processed address data, wherein the processed address data comprises a protocol address segment and a corresponding address attribution; generating at least one protocol address in the protocol address segment, and determining that the attribution of the at least one protocol address is the address attribution.

[0013] In a second aspect, some embodiments of the present disclosure provide a model training apparatus, comprising: an encoding unit configured to perform encoding processing on each protocol address in an obtained protocol address set by using an initial protocol address encoding model to generate protocol address encoding information, thereby obtaining a protocol address encoding information set, wherein each protocol address has a corresponding address attribution; a division unit configured to divide each protocol address encoding information in the protocol address encoding information set to generate a protocol address encoding information group set, wherein each protocol address encoding information group comprises a target number of protocol address encoding information; a first generation unit configured to generate, for each protocol address encoding information group in the protocol address encoding information group set, an attribution distance label corresponding to the protocol address encoding information group according to a corresponding address attribution group; a second generation unit configured to generate a training data set according to the protocol address encoding information group set and a corresponding attribution distance label set; and a training unit configured to perform model training on the initial protocol address encoding model according to the training data set to generate a protocol address encoding model.

[0014] Optionally, the first generating unit can be configured to: determine a first home location distance between the first address home location and a second address home location, wherein the protocol address coding information set comprises: a first protocol address coding information, a second protocol address coding information and a third protocol address coding information, the first address home location corresponds to the first protocol address coding information, and the second address home location corresponds to the second protocol address coding information; determine a second home location distance between the first address home location and a third address home location, wherein the third address home location corresponds to the third protocol address coding information; and generate the home location distance label according to the first home location distance and the second home location distance.

[0015] Optionally, the first generating unit can be configured to: determine distance comparison information between the first home location distance and the second home location distance as the home location distance label.

[0016] Optionally, the initial protocol address coding model comprises: an initial word embedding layer, a vector fusion layer and a plurality of initial fully connected layers connected in series; and the coding unit can be configured to: perform address segmentation processing on the protocol address to generate a segmentation information set; input each segmentation information in the segmentation information set to the initial word embedding layer to generate a segmentation information embedding vector, thereby obtaining a segmentation information embedding vector set; input each segmentation information embedding vector in the segmentation information embedding vector set to the vector fusion layer to generate a fusion vector; and input the fusion vector to the plurality of initial fully connected layers connected in series to generate the protocol address coding information.

[0017] Optionally, the device further comprises: obtaining a protocol address data set; and performing the following generation steps on each protocol address data in the protocol address data set: performing data preprocessing on the protocol address data to generate processed address data, wherein the processed address data comprises: a protocol address segment and a corresponding address home location; generating at least one protocol address within the protocol address segment, and determining that the home location corresponding to the at least one protocol address is the address home location.

[0018] In a third aspect, some embodiments of the present disclosure provide a protocol address coding information generation method, comprising: obtaining a target protocol address set; inputting each target protocol address in the target protocol address set to a pre-trained protocol address coding model to generate target protocol address coding information, thereby obtaining a target protocol address coding information set, wherein the protocol address coding model is generated based on a model training method.

[0019] In a fourth aspect, some embodiments of the present disclosure provide a protocol address encoding information generation apparatus, comprising: an obtaining unit configured to obtain a target protocol address; and an input unit configured to input the target protocol address into a pre-trained protocol address encoding model to generate protocol address encoding information corresponding to the target protocol address, wherein the protocol address encoding model is generated based on a model training method.

[0020] In a fifth aspect, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; and a storage device having one or more programs stored thereon, when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner of the first aspect and the third aspect.

[0021] In a sixth aspect, some embodiments of the present disclosure provide a computer readable medium having a computer program stored thereon, wherein the program is executed by a processor to implement the method described in any implementation manner of the first aspect and the third aspect.

[0022] In a seventh aspect, some embodiments of the present disclosure provide a computer program product comprising a computer program, wherein the computer program is executed by a processor to implement the method described in any implementation manner of the first aspect and the third aspect.

[0023] The above various embodiments of the present disclosure have the following beneficial effects: through the model training method of some embodiments of the present disclosure, the protocol address coding model can accurately and efficiently generate protocol address coding information corresponding to the target protocol address. Specifically, the reason why the related protocol address coding is not efficient and accurate is that in the protocol address coding task scenario, the data volume of the protocol address to be coded is large, and there is no general training target, resulting in low coding efficiency. Based on this, the model training method of some embodiments of the present disclosure uses an initial protocol address coding model to code each protocol address in the obtained protocol address set to generate protocol address coding information and obtain a protocol address coding information set. Each protocol address has a corresponding address of origin. Here, the protocol addresses in the protocol address set are coded to facilitate subsequent model training on the coding results corresponding to the protocol addresses, ensuring the accuracy of model training. Here, by determining the address of origin corresponding to the protocol address, the subsequent model can fully consider the geographical features of the address of origin corresponding to the protocol address in the training process to obtain a more accurate model based on the geographical features of the address of origin for coding processing. Then, each protocol address coding information in the protocol address coding information set is divided to generate a protocol address coding information group set. Each protocol address coding information group includes a target number of protocol address coding information. Here, each protocol address coding information is divided to facilitate subsequent model training based on the distance between the addresses of origin. Secondly, for each protocol address coding information group in the protocol address coding information group set, the address of origin distance label corresponding to the protocol address coding information group can be accurately generated based on the corresponding address of origin group to generate a training data set subsequently. Furthermore, the training data set is generated based on the protocol address coding information group set and the corresponding address of origin distance label set for subsequent model training. Finally, the initial protocol address coding model is trained based on the training data set to generate a protocol address coding model to obtain a more accurate protocol address coding model. In summary, by generating the address of origin distance label corresponding to each protocol address coding information group as a label for model training, the model learns more geographical features of the address of origin to generate a more accurate protocol address coding model. BRIEF DESCRIPTION OF DRAWINGS

[0024] The above and other features, advantages, and aspects of the embodiments of the present disclosure will become more apparent upon consideration of the following detailed description, taken in conjunction with the accompanying drawings. Throughout the drawings, like or similar reference numerals designate identical or similar elements throughout the several views. It should be understood that the drawings are schematic and elements and features are not necessarily to scale.

[0025] Figure 1is a schematic diagram of one application scenario of a model training method according to some embodiments of the present disclosure;

[0026] Figure 2 is a flowchart of some embodiments of a model training method according to the present disclosure;

[0027] Figure 3 is a flowchart of another embodiments of a model training method according to the present disclosure;

[0028] Figure 4 is a flowchart of some embodiments of a protocol address encoding information generation method according to the present disclosure;

[0029] Figure 5 is a structural schematic diagram of some embodiments of a model training apparatus according to the present disclosure;

[0030] Figure 6 is a structural schematic diagram of some embodiments of a protocol address encoding information generation apparatus according to the present disclosure;

[0031] Figure 7 is a structural schematic diagram of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION

[0032] Embodiments of the present disclosure will be described below in greater detail with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms, and should not be interpreted as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided so as to more completely and comprehensively understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes, and are not intended to limit the scope of protection of the present disclosure.

[0033] It should be further noted that, for the convenience of description, only the parts related to the present application are shown in the drawings. The embodiments in the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0034] It should be noted that the terms "first", "second", etc. mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not intended to limit the order or interdependence of the functions performed by these devices, modules or units.

[0035] It should be noted that the adjectives "one", "multiple" mentioned in the present disclosure are illustrative and not limiting, and those skilled in the art should understand that, unless otherwise explicitly stated in the context, it should be understood as "one or more".

[0036] Names of messages or information exchanged between multiple devices in the embodiments of the present disclosure are only for illustrative purposes, and are not used to limit the scope of the messages or information.

[0037] The collection, storage, and use of user personal information (such as a protocol address) involved in the present disclosure are subject to the obligations of the relevant organization or individual, including conducting a personal information security impact assessment, fulfilling the notification obligations to the personal information subject, and obtaining the prior authorization consent of the personal information subject before performing the corresponding operations.

[0038] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0039] Figure 1 is a schematic diagram of one application scenario of a model training method according to some embodiments of the present disclosure.

[0040] In Figure 1In the application scenario of the electronic device 101, first, the electronic device 101 can utilize the initial protocol address encoding model 102 to perform encoding processing on each protocol address in the obtained protocol address set 103 to generate protocol address encoding information, and obtain a protocol address encoding information set 104. Each protocol address has a corresponding address belonging place. Then, the electronic device 101 can divide each protocol address encoding information in the protocol address encoding information set 104 to generate a protocol address encoding information group set. Each protocol address encoding information group includes a target number of protocol address encoding information. In the application scenario, the protocol address encoding information group set includes a first protocol address encoding information group 105, a second protocol address encoding information group 106, and a third protocol address encoding information group 107. The target number can be 3. Next, the electronic device 101 can generate a corresponding belonging place distance label for each protocol address encoding information group in the protocol address encoding information group set according to the corresponding address belonging place group. In the application scenario, the corresponding belonging place distance label for the first protocol address encoding information group 105 is a first belonging place distance label 108. The corresponding belonging place distance label for the second protocol address encoding information group 106 is a second belonging place distance label 109. The corresponding belonging place distance label for the third protocol address encoding information group 107 is a third belonging place distance label 110. Further, the electronic device 101 can generate a training data set 111 according to the protocol address encoding information group set and the corresponding belonging place distance label set. In the application scenario, the training data set 111 includes a first training data 1111, a second training data 1112, and a third training data 1113. The first training data 1111 is generated based on the first protocol address encoding information group 105 and the first belonging place distance label 108. The second training data 1112 is generated based on the second protocol address encoding information group 106 and the second belonging place distance label 109. The third training data 1113 is generated based on the third protocol address encoding information group 107 and the third belonging place distance label 110. Finally, the electronic device 101 can perform model training on the initial protocol address encoding model 102 according to the training data set 111 to generate a protocol address encoding model 112.

[0041] It should be noted that the electronic device 101 described above can be hardware or software. When the electronic device is hardware, it can be implemented as a distributed cluster composed of multiple servers or terminal devices, or as a single server or a single terminal device. When the electronic device is software, it can be installed in the hardware devices listed above. It can be implemented as, for example, multiple software or software modules for providing distributed services, or as a single software or software module. No specific limitation is made here.

[0042] It should be understood that Figure 1 The number of electronic devices shown is merely illustrative. Any number of electronic devices can be used depending on the implementation requirements.

[0043] Continue to refer to Figure 2 The diagram illustrates a flow 200 of some embodiments of a model training method according to the present disclosure. This model training method includes the following steps:

[0044] Step 201: Using the initial protocol address encoding model, encode each protocol address in the obtained protocol address set to generate protocol address encoding information and obtain a protocol address encoding information set.

[0045] In some embodiments, the execution entity of the above model training method (e.g. Figure 1 The electronic device 101 shown can utilize an initial protocol address encoding model to encode each protocol address in the acquired protocol address set to generate protocol address encoding information, thus obtaining a protocol address encoding information set. The initial protocol address encoding model can be a protocol address encoding model that has not yet finished training. The protocol address encoding model can be a neural network model that performs address encoding (i.e., address word embedding) on ​​protocol addresses. In practice, the protocol address can be an Internet Protocol Address (IP address). For example, the initial protocol address encoding model can be composed of a Word Embedding model and convolutional layers. The protocol address encoding information can be in vector form. Each protocol address has a corresponding address location. The address location can be the address location corresponding to the protocol address. For example, the protocol address is "198.0.0.0". The address location corresponding to the protocol address is "Guizhou".

[0046] As an example, the aforementioned execution entity can input each protocol address in the protocol address set into the initial protocol address encoding model to generate protocol address encoding information and obtain a protocol address encoding information set.

[0047] In some optional implementations of certain embodiments, before encoding each protocol address in the obtained protocol address set using the initial protocol address encoding model to generate protocol address encoding information and obtain the protocol address encoding information set, the above method further includes the following steps:

[0048] In a first step, a protocol address data set is obtained. The protocol address data is data related to a protocol address. In practice, the protocol address data can include a start protocol address, an end protocol address, home information, and operator information. For example, the start protocol address can be a start IP address corresponding to a protocol address segment. The end protocol address can be an end IP address corresponding to the protocol address segment. The protocol address segment can be a protocol address interval related to a certain home. The home information can be home information corresponding to the protocol address segment. The operator information can be operator information available for use corresponding to the protocol address segment. For example, the protocol address data can be "1.25.136.0, 1.25.151.255, Hohhot, Inner Mongolia, China Unicom". The protocol address segment can be a protocol address interval between the start protocol address "1.25.136.0" and the end protocol address "1.25.151.255".

[0049] In a second step, for each protocol address data in the protocol address data set, the following generation steps are performed:

[0050] In a first sub-step, data preprocessing is performed on the protocol address data to generate processed address data. The processed address data includes a protocol address segment and corresponding address home.

[0051] As an example, the execution subject can remove the operator information in the protocol address data to generate the processed address data.

[0052] In a second sub-step, at least one protocol address in the protocol address segment is generated, and it is determined that the address home corresponding to the at least one protocol address is the address home. For example, for a protocol address segment that can be a protocol address interval between a start protocol address "1.25.136.0" and an end protocol address "1.25.151.255", the at least one protocol address can include "1.25.135.0", "1.25.137.0", "1.25.138.0", and "1.25.142.0".

[0053] In step 202, each protocol address coding information in the protocol address coding information set is divided to generate a protocol address coding information group set.

[0054] In some embodiments, the execution subject can divide each protocol address coding information in the protocol address coding information set to generate a protocol address coding information group set. Each protocol address coding information group includes a target number of protocol address coding information. For example, the target number can be 4. The target number can be pre-set.

[0055] As an example, the execution subject can randomly combine the protocol address coding information sets according to the target number to generate protocol address coding information group sets.

[0056] At step 203, for each protocol address coding information group in the protocol address coding information group sets, the execution subject generates a home distance label corresponding to the protocol address coding information group according to the corresponding address home group.

[0057] In some embodiments, the execution subject can generate a home distance label corresponding to the protocol address coding information group according to the corresponding address home group for each protocol address coding information group in the protocol address coding information group sets. The corresponding address home group is the address home group corresponding to the protocol address coding information group. The home distance label can be a label related to the home distance. For example, the home distance label can be the distance between the home corresponding to the protocol address and the target location. For example, the home distance label can be the distance between the home corresponding to the protocol address and the geographic center point corresponding to the protocol address coding information group. The geographic center point corresponding to the protocol address coding information group can be the graphic center corresponding to the home graph composed of each address home in the address home group.

[0058] As an example, first, the execution subject can determine the home graph formed by the address home group. Then, determine the image center corresponding to the home graph. Finally, determine the distance between the location corresponding to the image center and each address home as the home distance label.

[0059] In some optional implementations of some embodiments, the execution subject can generate a home distance label corresponding to the protocol address coding information group according to the corresponding address home group, which can include the following steps:

[0060] First, the execution subject can determine the first home distance between the first address home and the second address home. The protocol address coding information group includes the first protocol address coding information, the second protocol address coding information, and the third protocol address coding information. The first address home corresponds to the first protocol address coding information. The second address home corresponds to the second protocol address coding information.

[0061] For example, the first address home is "Beijing". The second address home is "Tianjin". The first protocol address coding information is the protocol address coding information corresponding to "Beijing". The second protocol address coding information is the protocol address coding information corresponding to "Tianjin". The first home distance can be the distance between "Beijing" and "Tianjin".

[0062] Secondly, the execution subject can determine a second distance between the first address location and a third address location. The third address location corresponds to the third protocol address coding information. For example, the third address location is Nanjing. The third protocol address coding information is the protocol address coding information corresponding to Nanjing. The second distance can be the distance between Beijing and Nanjing.

[0063] Thirdly, the execution subject can generate a location distance label according to the first distance and the second distance.

[0064] For example, the execution subject can first generate a first distance key-value pair between the first distance, the first address location, and the second address location. Then, generate a second distance key-value pair between the second distance, the first address location, and the third address location. Finally, determine the first distance key-value pair and the second distance key-value pair as the location distance label.

[0065] Alternatively, the execution subject can determine the distance comparison information between the first distance and the second distance as the location distance label. The distance comparison information can represent the size relationship between the first distance and the second distance. For example, the location distance label can be "the location distance label is greater than the second distance". The location distance label can also be "the location distance label is less than the second distance".

[0066] Step 204: Generate a training data set according to the set of protocol address coding information and the corresponding set of location distance labels.

[0067] In some embodiments, the execution subject can generate a training data set according to the set of protocol address coding information and the corresponding set of location distance labels.

[0068] For example, the execution subject can combine each protocol address coding information set with a location distance label to generate training data, thereby obtaining a training data set.

[0069] Step 205: Model training is performed on the initial protocol address coding model according to the training data set to generate a protocol address coding model.

[0070] In some embodiments, the execution subject can perform model training on the initial protocol address coding model according to the training data set to generate a protocol address coding model.

[0071] As an example, the above execution subject can perform model training on the initial protocol address encoding model by means of back propagation according to the above training data set and by using a MarginRankingLoss loss function, to generate a protocol address encoding model.

[0072] The above various embodiments of the present disclosure have the following beneficial effects: By means of the model training method of some embodiments of the present disclosure, the protocol address encoding model can accurately and efficiently generate protocol address encoding information corresponding to a target protocol address. Specifically, the reason why the related protocol address encoding is not efficient and accurate is that, in the protocol address encoding task scenario, the data volume of the protocol addresses to be encoded is large, and there is no general training target, resulting in low encoding efficiency. Based on this, the model training method of some embodiments of the present disclosure uses an initial protocol address encoding model to encode each protocol address in the obtained protocol address set to generate protocol address encoding information, thereby obtaining a protocol address encoding information set. Each protocol address has a corresponding address of origin. Here, the protocol addresses in the protocol address set are encoded to facilitate subsequent model training on the encoding results corresponding to the protocol addresses, thereby ensuring the accuracy of the model training. Here, by determining the address of origin corresponding to the protocol address, the subsequent model can fully consider the geographical features of the address of origin corresponding to the protocol address in the training process, to obtain a more accurate model based on the geographical features of the address of origin for encoding processing. Then, each protocol address encoding information in the above protocol address encoding information set is divided to generate a protocol address encoding information group set. Each protocol address encoding information group includes a target number of protocol address encoding information. Here, each protocol address encoding information is divided to facilitate subsequent model training based on the distance between the addresses of origin of the protocol addresses. Secondly, for each protocol address encoding information group in the above protocol address encoding information group set, the address of origin distance label corresponding to the above protocol address encoding information group can be accurately generated according to the corresponding address of origin group, to generate a training data set subsequently. Furthermore, according to the above protocol address encoding information group set and the corresponding address of origin distance label set, a training data set is generated for subsequent model training. Finally, according to the above training data set, the above initial protocol address encoding model is trained to generate a protocol address encoding model, to obtain a more accurate protocol address encoding model for protocol encoding. In summary, by generating the address of origin distance label corresponding to each protocol address encoding information group as a label for model training, the model learns more geographical features of the address of origin, and generates a more accurate protocol address encoding model.

[0073] Further reference is made to Figure 3, shows the flow 300 of some other embodiments of the model training method according to the present disclosure. The model training method comprises the following steps:

[0074] Step 301, the address segmentation processing is performed on the above-mentioned protocol address to generate a segmented information set.

[0075] In some embodiments, the execution subject (for example Figure 1 The electronic device 101 shown can perform address segmentation processing on the above-mentioned protocol address to generate a segmented information set. Among them, the protocol address can be divided into 4 segments. Each segment of information is a segmented information. That is, the segmented information set can include 4 segmented information. Each segment contains 8 binary digits, a total of 32 bits. The four segments are usually represented in dotted decimal notation, for example 192.168.1.78. The value range of each segment is from 0 to 255. For example, the protocol address is “192.168.1.78”, and the corresponding segmented information set can include “192”, “168”, “1” and “78”. Among them, the initial protocol address encoding model includes an initial word embedding layer, a vector fusion layer and a plurality of initial fully connected layers (Fully Connected Layer) connected in series. Among them, the initial word embedding layer can be a word embedding layer that has not yet been trained to completion. In practice, the word embedding layer can be a Word Embedding layer. The initial fully connected layer can be a fully connected layer that has not yet been trained to completion. The vector fusion layer can be a network layer that fuses vectors. In practice, vector fusion can be vector splicing.

[0076] As an example, the above-mentioned execution subject can split the 4 segments of address information corresponding to the protocol address to obtain a segmented information set.

[0077] Step 302, input each segmented information in the above-mentioned segmented information set to the above-mentioned initial word embedding layer to generate a segmented information embedding vector to obtain a segmented information embedding vector set.

[0078] In some embodiments, the above-mentioned execution subject can input each segmented information in the above-mentioned segmented information set to the above-mentioned initial word embedding layer to generate a segmented information embedding vector to obtain a segmented information embedding vector set. The segmented information embedding vector can be in the form of a vector.

[0079] Step 303, input each segmented information embedding vector in the above-mentioned segmented information embedding vector set to the above-mentioned vector fusion layer to generate a fusion vector.

[0080] In some embodiments, the above-mentioned execution subject can input each segmented information embedding vector in the above-mentioned segmented information embedding vector set to the above-mentioned vector fusion layer to generate a fusion vector.

[0081] As an example, the execution subject can input each segment information embedding vector in the segment information embedding vector set into the vector fusion layer, to splice according to the information position corresponding to each segment information, to generate a fusion vector. For example, the protocol address is "first segment information. second segment information. third segment information. fourth segment information". The segment information embedding vector set includes: the first segment information embedding vector corresponding to the first segment information, the second segment information embedding vector corresponding to the second segment information, the third segment information embedding vector corresponding to the third segment information, and the fourth segment information embedding vector corresponding to the fourth segment information. The fusion vector can be [first segment information embedding vector, second segment information embedding vector, third segment information embedding vector, third segment information embedding vector].

[0082] Step 304, input the fusion vector into the plurality of initial fully connected layers in series to generate the protocol address encoding information.

[0083] In some embodiments, the execution subject can input the fusion vector into the plurality of initial fully connected layers in series to generate the protocol address encoding information.

[0084] Step 305, divide each protocol address encoding information in the protocol address encoding information set to generate a protocol address encoding information group set.

[0085] Step 306, for each protocol address encoding information group in the protocol address encoding information group set, generate a home distance label corresponding to the protocol address encoding information group according to the corresponding address home group.

[0086] Step 307, generate a training data set according to the protocol address encoding information group set and the corresponding home distance label set.

[0087] Step 308, according to the training data set, model training is performed on the initial protocol address encoding model to generate a protocol address encoding model.

[0088] In some embodiments, the specific implementation of steps 305-308 and the technical effects brought by them can refer to Figure 2 The steps 202-205 in the corresponding embodiments, will not be repeated here.

[0089] As can be seen from Figure 3 Compared with the description of some embodiments corresponding to Figure 2 , Figure 3Corresponding to the flow 300 of the model training method in some embodiments, the initial protocol address encoding model includes an initial word embedding layer, a vector fusion layer, and a plurality of initial fully connected layers in series, so that the subsequent trained protocol address encoding model can accurately and batch generate corresponding protocol address encoding information.

[0090] With reference to Figure 4 , a flow 400 of some embodiments of a protocol address encoding information generation method according to the present disclosure is shown. The protocol address encoding information generation method includes the following steps:

[0091] Step 401, obtaining a target protocol address set.

[0092] In some embodiments, the execution subject (for example, an electronic device) of the above-mentioned protocol address encoding information generation method can obtain the target protocol address set through wired or wireless means.

[0093] Step 402, inputting each target protocol address in the above-mentioned target protocol address set into a pre-trained protocol address encoding model to generate target protocol address encoding information, and obtaining a target protocol address encoding information set.

[0094] In some embodiments, the execution subject can input each target protocol address in the above-mentioned target protocol address set into a pre-trained protocol address encoding model to generate target protocol address encoding information, and obtain a target protocol address encoding information set. The protocol address encoding model is generated based on the model training method.

[0095] Here, through the encoding process, the protocol address can be converted into a vector, and then the abnormal behavior in network traffic or the potential attack pattern can be analyzed. After mapping the protocol address to a vector, the network usage in different regions or countries can be analyzed in combination with geographic location data. In user behavior analysis, protocol address encoding information can help identify the geographic location, access habits, and other information of users.

[0096] The above-mentioned various embodiments of the present disclosure have the following beneficial effects: through the protocol address encoding information generation method of some embodiments of the present disclosure, batch encoding processing for the target protocol address set can be efficiently and accurately realized.

[0097] Further reference Figure 5 , as an implementation of the methods shown in the above-mentioned figures, the present disclosure provides some embodiments of a model training device, which device embodiments correspond to those method embodiments shown in Figure 2 , and the model training device can be specifically applied in various electronic devices.

[0098] As Figure 5As shown, a model training apparatus 500 includes an encoding unit 501, a division unit 502, a first generation unit 503, a second generation unit 504, and a training unit 505. The encoding unit 501 is configured to encode each protocol address in a set of acquired protocol addresses by using an initial protocol address encoding model to generate protocol address encoding information, thereby obtaining a set of protocol address encoding information, wherein each protocol address has a corresponding address belonging place; the division unit 502 is configured to divide each protocol address encoding information in the set of protocol address encoding information to generate a set of protocol address encoding information groups, wherein each protocol address encoding information group includes a target number of protocol address encoding information; the first generation unit 503 is configured to generate, for each protocol address encoding information group in the set of protocol address encoding information groups, a belonging place distance label corresponding to the protocol address encoding information group according to a corresponding group of address belonging places; the second generation unit 504 is configured to generate a training data set according to the set of protocol address encoding information groups and a set of corresponding belonging place distance labels; and the training unit 505 is configured to perform model training on the initial protocol address encoding model according to the training data set to generate a protocol address encoding model.

[0099] In some optional implementations of some embodiments, the first generation unit 503 can be further configured to determine a first belonging place distance between a first address belonging place and a second address belonging place, wherein the protocol address encoding information group includes a first protocol address encoding information, a second protocol address encoding information, and a third protocol address encoding information, the first address belonging place corresponds to the first protocol address encoding information, and the second address belonging place corresponds to the second protocol address encoding information; determine a second belonging place distance between the first address belonging place and a third address belonging place, wherein the third address belonging place corresponds to the third protocol address encoding information; and generate the belonging place distance label according to the first belonging place distance and the second belonging place distance.

[0100] In some optional implementations of some embodiments, the first generation unit 503 can be further configured to determine distance comparison information between the first belonging place distance and the second belonging place distance as the belonging place distance label.

[0101] In some optional implementations of some embodiments, the initial protocol address encoding model includes an initial word embedding layer, a vector fusion layer, and a plurality of initial fully connected layers in series. The encoding unit 501 can be further configured to: perform address segmentation processing on the protocol address to generate a set of segmented information; input each piece of segmented information in the set of segmented information to the initial word embedding layer to generate a segmented information embedding vector, thereby obtaining a set of segmented information embedding vectors; input each segmented information embedding vector in the set of segmented information embedding vectors to the vector fusion layer to generate a fusion vector; and input the fusion vector to the plurality of initial fully connected layers in series to generate the protocol address encoding information.

[0102] In some optional implementations of some embodiments, the device 500 further includes an address obtaining unit and an information input unit (not shown in the figure). The address obtaining unit can be configured to obtain a set of target protocol addresses. The information input unit can be configured to input each target protocol address in the set of target protocol addresses to a pre-trained protocol address encoding model to generate target protocol address encoding information, thereby obtaining a set of target protocol address encoding information, wherein the protocol address encoding model is generated based on a model training method.

[0103] It can be understood that the units described in the model training device 500 correspond to the respective steps in the method described with reference to Figure 2 The operations, features, and beneficial effects described above for the method also apply to the model training device 500 and the units contained therein, and will not be repeated here.

[0104] Further reference Figure 6 , as an implementation of the method shown in the above figures, the present disclosure provides some embodiments of a protocol address encoding information generation device, which correspond to the method embodiments shown in Figure 4 , and the protocol address encoding information generation device can be applied in various electronic devices.

[0105] As shown in Figure 6 , a model training device 600 includes an obtaining unit 601 and an input unit 602. The obtaining unit 601 is configured to obtain a target protocol address. The input unit 602 is configured to input the target protocol address to a pre-trained protocol address encoding model to generate protocol address encoding information corresponding to the target protocol address, wherein the protocol address encoding model is generated based on a model training method.

[0106] It can be understood that the units described in the protocol address encoding information generation device 600 correspond to the respective steps in the method described with reference to Figure 4The various steps in the described methods correspond. Thus, the operations, features and advantages described above for the method apply equally to the protocol address coding information generating apparatus 600 and the units contained therein, which will not be described again here.

[0107] Reference is made below to Figure 7 which shows a structural schematic diagram of an electronic device (e.g. Figure 1 101) 700 suitable for use in implementing some embodiments of the present disclosure. Figure 7 The electronic device shown is merely an example and should not bring any limitation to the function and scope of use of embodiments of the present disclosure.

[0108] As shown in Figure 7 , the electronic device 700 can include a processing device (e.g. a central processor, a graphics processor, etc.) 701 which can perform various appropriate actions and processes according to programs stored in a read-only memory 702 or loaded into a random access memory 703 from a storage device 708. Various programs and data required for the operation of the electronic device 700 are also stored in the random access memory 703. The processing device 701, the read-only memory 702 and the random access memory 703 are connected to each other through a bus 704. An input / output interface 705 is also connected to the bus 704.

[0109] Generally, the following devices can be connected to the input / output interface 705: input devices 706 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 708 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 709. The communication devices 709 can allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. Although Figure 7 The electronic device 700 is shown with various devices, but it should be understood that all the devices shown are not required to be implemented or possessed. More or fewer devices can be alternatively implemented or possessed. Figure 7 Each block shown in

[0110] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to some embodiments of the present disclosure. For example, some embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer readable medium, the computer program comprising program code for performing the methods illustrated by the flowcharts. In some such embodiments, the computer program can be downloaded and installed from a network via the communication device 709, or installed from the storage device 708, or installed from the read only memory 702. When the computer program is executed by the processing device 701, the above-mentioned functions defined in the methods of some embodiments of the present disclosure are performed.

[0111] It should be noted that the computer readable medium described above with reference to some embodiments of the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium may, for example, be— but is not limited to— an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any suitable combination of the above. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present disclosure, the computer readable storage medium can be any tangible medium that contains or stores a program used by or in connection with an instruction execution system, apparatus or device. In some embodiments of the present disclosure, the computer readable signal medium can include a data signal carried in a baseband or as part of a carrier wave, in which the computer readable program code is carried. Such a propagated data signal can take any of a variety of forms, including but not limited to electro-magnetic, optical, or any suitable combination thereof. The computer readable signal medium can also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate or transport a program for use by or in connection with an instruction execution system, apparatus or device. Program code contained in the computer readable medium can be transmitted by any suitable medium, including but not limited to wire, cable, RF, etc., or any suitable combination of the above.

[0112] In some embodiments, the client, server, or both can communicate using any known or future developed network protocols, such as the HyperText Transfer Protocol (HTTP), and can be interconnected with any form or medium of digital data communication (for example, a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet, and peer-to-peer networks (for example, ad hoc peer-to-peer networks), as well as any current or future developed network.

[0113] The computer readable medium described above can be included in the electronic device described above; or can exist separately from the electronic device and be not assembled into the electronic device. The computer readable medium described above carries one or more programs, when the one or more programs are executed by the electronic device, cause the electronic device to: encode each protocol address in a set of acquired protocol addresses by using an initial protocol address encoding model to generate protocol address encoding information, to obtain a set of protocol address encoding information, wherein each protocol address has a corresponding address belonging place; divide each protocol address encoding information in the set of protocol address encoding information to generate a set of protocol address encoding information groups, wherein each protocol address encoding information group includes a target number of protocol address encoding information; for each protocol address encoding information group in the set of protocol address encoding information groups, generate a belonging place distance label corresponding to the protocol address encoding information group according to a corresponding address belonging place group; generate a training data set according to the set of protocol address encoding information groups and a set of corresponding belonging place distance labels; and perform model training on the initial protocol address encoding model according to the training data set to generate a protocol address encoding model.

[0114] Computer program code for carrying out operations of some embodiments of the present disclosure can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network ("LAN") or a wide area network ("WAN"), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0115] The flow and block diagrams in the drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flow and block diagrams can represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may be executed in the reverse order, depending on the functionality involved. It will also be noted that each block of the block diagrams and / or flowchart illustrations, and combinations thereof, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or combinations of hardware and software.

[0116] The units described in some embodiments of the present disclosure can be implemented by means of software, or by means of hardware. The described units can also be provided in a processor, for example, a processor can be described as comprising an encoding unit, a dividing unit, a first generating unit, a second generating unit and a training unit. In some cases, the names of these units do not constitute a limitation on the units themselves, for example, the second generating unit can also be described as "a unit for generating a training data set according to the above protocol address coding information set and the corresponding home location distance label set".

[0117] The functions described above in the detailed description can be performed in part or in whole by one or more hardware logic components. For example, and without limitation, illustrative types of hardware logic components that can be used include Field-programmable Gate Arrays (FPGAs), Program-specific Integrated Circuits (ASICs), Program-specific Standard Products (ASSPs), System-on-a-chip systems (SOCs), Complex Programmable Logic Devices (CPLDs), etc.

[0118] Some embodiments of the present disclosure also provide a computer program product comprising a computer program which, when executed by a processor, implements any of the above-described model training methods or protocol address coding information generation methods.

[0119] The above description is merely illustrative of the embodiments of the present disclosure and the principles of the technology employed. It will be appreciated that the scope of the applications involved in the embodiments of the present disclosure is not limited to the specific combinations of technical features described above, and should also encompass other technical solutions formed by any combination of the above technical features or equivalent features thereof without departing from the inventive concept. For example, the above technical features can be replaced with technical features disclosed in the embodiments of the present disclosure (but not limited to) having similar functions to form technical solutions.

Claims

1. A model training method, comprising: Using the initial protocol address encoding model, each protocol address in the obtained protocol address set is encoded to generate protocol address encoding information, resulting in a protocol address encoding information set, where each protocol address has a corresponding address location; The protocol address encoding information in the protocol address encoding information set is divided to generate a protocol address encoding information group set, wherein the number of protocol address encoding information included in each protocol address encoding information group is the target number. For each protocol address encoding information group in the protocol address encoding information group set, a location distance label corresponding to the protocol address encoding information group is generated according to the corresponding address location group. A training dataset is generated based on the protocol address encoding information set and the corresponding home distance label set; Based on the training dataset, the initial protocol address encoding model is trained to generate a protocol address encoding model.

2. The method according to claim 1, wherein, The step of generating a location distance label corresponding to the protocol address encoding information group based on the corresponding address location group includes: Determine the first location distance between the first address location and the second address location, wherein the protocol address encoding information group includes: first protocol address encoding information, second protocol address encoding information and third protocol address encoding information, the first address location corresponds to the first protocol address encoding information, and the second address location corresponds to the second protocol address encoding information; Determine the second location distance between the first address location and the third address location, wherein the third address location corresponds to the third protocol address encoding information; Generate a location distance label based on the first location distance and the second location distance.

3. The method according to claim 2, wherein, The step of generating a location distance label based on the first location distance and the second location distance includes: The distance comparison information between the first home location distance and the second home location distance is determined as the home location distance label.

4. The method according to claim 1, wherein, The initial protocol address encoding model includes: an initial word embedding layer, a vector fusion layer, and multiple concatenated initial fully connected layers; and The step of using the initial protocol address encoding model to encode each protocol address in the obtained protocol address set to generate protocol address encoding information includes: The protocol address is segmented to generate a segment information set; Each segment information in the segment information set is input into the initial word embedding layer to generate a segment information embedding vector, thus obtaining a segment information embedding vector set; Each segment information embedding vector in the segment information embedding vector set is input to the vector fusion layer to generate a fused vector; The fusion vector is input to the plurality of cascaded initial fully connected layers to generate the protocol address encoding information.

5. The method according to claim 1, wherein, Before using the initial protocol address encoding model to encode each protocol address in the obtained protocol address set to generate protocol address encoding information and obtain the protocol address encoding information set, the method further includes: Obtain the protocol address dataset; For each protocol address data in the protocol address dataset, perform the following generation steps: The protocol address data is preprocessed to generate processed address data, wherein the processed address data includes: protocol address ranges and corresponding address locations; Generate at least one protocol address within the protocol address range, and determine the home location corresponding to at least one protocol address as the address home location.

6. A method for generating protocol address encoding information, comprising: Obtain the target protocol address set; Each target protocol address in the target protocol address set is input into a pre-trained protocol address encoding model to generate target protocol address encoding information, thereby obtaining a target protocol address encoding information set, wherein the protocol address encoding model is generated based on the method described in any one of claims 1-5.

7. A model training device, comprising: The encoding unit is configured to use the initial protocol address encoding model to encode each protocol address in the acquired protocol address set to generate protocol address encoding information, thereby obtaining a protocol address encoding information set, wherein each protocol address has a corresponding address location; The partitioning unit is configured to partition each protocol address encoding information in the protocol address encoding information set to generate a protocol address encoding information group set, wherein the number of protocol address encoding information included in each protocol address encoding information group is a target number. The first generation unit is configured to generate a home distance label corresponding to each protocol address encoding information group in the protocol address encoding information group set, based on the corresponding address home group. The second generation unit is configured to generate a training dataset based on the protocol address encoding information set and the corresponding home distance label set; The training unit is configured to train the initial protocol address encoding model based on the training dataset to generate a protocol address encoding model.

8. A protocol address encoding information generation device, comprising: The acquisition unit is configured to acquire the target protocol address; The input unit is configured to input the target protocol address into a pre-trained protocol address encoding model to generate protocol address encoding information corresponding to the target protocol address, wherein the protocol address encoding model is generated based on the method described in any one of claims 1-5.

9. An electronic device, comprising: One or more processors; Storage device, on which one or more programs are stored, When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-6.

10. A computer-readable medium having a computer program stored thereon, wherein, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-6.

11. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Address model training method and device, equipment and storage medium

    CN117195993A

  • Data processing method and apparatus, and device and computer medium

    WO2023241410A1