Model training method, protocol address coding information generation method and device
The protocol address set is encoded through the model training method, and the home distance label is used to generate the training data set, which solves the problem of large amount of data and lacks training targets in the protocol address encoding task, and achieves more efficient and accurate protocol address encoding.
Patent Information
- Application Number
- CN202411835300.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-12
AI Technical Summary
In the protocol address encoding task scenario, the protocol address to be encoded is large in amount and lacks general training targets, resulting in low encoding efficiency.
The model training method is adopted, and the protocol address set is encoded using the initial protocol address encoding model, protocol address encoding information is generated, and the training data set is generated by dividing and home distance tags, and the model is trained to generate a more accurate protocol address encoding model.
By generating a more accurate protocol address coding model, the efficiency and accuracy of protocol address coding are improved, and the problem of inefficient encoding is solved.
Smart Images

Figure CN119766777A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular to a model training method, a protocol address encoding information generation method and a device. Background Art
[0002] At present, with the continuous development of artificial intelligence, embedding technology is increasingly being used in various scenarios. For the embedded coding processing of protocol addresses, the commonly used method is: encode the protocol address by one-hot encoding to obtain the protocol address coding information.
[0003] However, the inventors have found that when the above method is used for encoding processing, the following technical problems often occur:
[0004] In the protocol address encoding task scenario, the amount of protocol address data to be encoded is generally large, and there is no common training target, resulting in low encoding efficiency.
[0005] The above information disclosed in this Background section is only for enhancement of understanding of the background of the inventive concept and therefore it may contain information that does not form the prior art that is already known in this country to a person of ordinary skill in the art. Summary of the invention
[0006] The content of this disclosure is used to introduce concepts in a brief form, which will be described in detail in the detailed implementation section below. The content of this disclosure is not intended to identify the key features or essential features of the technical solution claimed for protection, nor is it intended to limit the scope of the technical solution claimed for protection.
[0007] Some embodiments of the present disclosure propose a model training method, a protocol address encoding information generation method and a device to solve the technical problems mentioned in the above background technology section.
[0008] In a first aspect, some embodiments of the present disclosure provide a model training method, comprising: using an initial protocol address encoding model to encode each protocol address in an acquired protocol address set to generate protocol address encoding information and obtain a protocol address encoding information set, wherein each protocol address has a corresponding address location; dividing each protocol address encoding information in the above-mentioned 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; for each protocol address encoding information group in the above-mentioned protocol address encoding information group set, according to the corresponding address location group, generating a location distance label corresponding to the above-mentioned protocol address encoding information group; generating a training data set according to the above-mentioned protocol address encoding information group set and the corresponding location distance label set; and performing model training on the above-mentioned initial protocol address encoding model according to the above-mentioned training data set to generate a protocol address encoding model.
[0009] Optionally, the above-mentioned generating the location distance label corresponding to the above-mentioned protocol address coding information group according to the corresponding address location group includes: determining a first location distance between the first address location and the second address location, wherein the above-mentioned protocol address coding information group includes: first protocol address coding information, second protocol address coding information and third protocol address coding information, the above-mentioned first address location corresponds to the above-mentioned first protocol address coding information, and the above-mentioned second address location corresponds to the above-mentioned second protocol address coding information; determining the second location distance between the above-mentioned first address location and the third address location, wherein the above-mentioned third address location corresponds to the above-mentioned third protocol address coding information; generating the location distance label according to the above-mentioned first location distance and the above-mentioned second location distance.
[0010] Optionally, generating a home distance tag according to the first home distance and the second home distance includes: determining distance comparison information between the first home distance and the second home distance as the home distance tag.
[0011] Optionally, the above-mentioned initial protocol address encoding model includes: an initial word embedding layer, a vector fusion layer and multiple initial fully connected layers connected in series; and the above-mentioned initial protocol address encoding model is used to encode each protocol address in the acquired protocol address set to generate protocol address encoding information, including: address segmentation processing of the above-mentioned protocol address to generate a segmentation information set; each segmentation information in the above-mentioned segmentation information set is input into the above-mentioned initial word embedding layer to generate a segmentation information embedding vector to obtain a segmentation information embedding vector set; each segmentation information embedding vector in the above-mentioned segmentation information embedding vector set is input into the above-mentioned vector fusion layer to generate a fusion vector; the above-mentioned fusion vector is input into the above-mentioned multiple initial fully connected layers connected in series to generate the above-mentioned protocol address encoding information.
[0012] Optionally, before using the initial protocol address encoding model to encode each protocol address in the acquired protocol address set to generate protocol address encoding information and obtain the protocol address encoding information set, the method further includes: obtaining a protocol address data set; executing the following generation steps for 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 includes: a protocol address segment and a corresponding address location; generating at least one protocol address within the protocol address segment, and determining that the location corresponding to at least one protocol address is the address location.
[0013] In a second aspect, some embodiments of the present disclosure provide a model training device, comprising: an encoding unit, configured to use an initial protocol address encoding model to encode each protocol address in an acquired protocol address set to generate protocol address encoding information and obtain 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 above-mentioned 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; a first generation unit, configured to generate, for each protocol address encoding information group in the above-mentioned protocol address encoding information group set, an attribution distance label corresponding to the above-mentioned protocol address encoding information group according to the corresponding address attribution group; a second generation unit, configured to generate a training data set according to the above-mentioned protocol address encoding information group set and the corresponding attribution distance label set; a training unit, configured to perform model training on the above-mentioned initial protocol address encoding model according to the above-mentioned training data set to generate a protocol address encoding model.
[0014] Optionally, the first generation unit can be configured to: determine a first location distance between the first address location and the second address location, wherein the above-mentioned protocol address coding information group includes: first protocol address coding information, second protocol address coding information and third protocol address coding information, the above-mentioned first address location corresponds to the above-mentioned first protocol address coding information, and the above-mentioned second address location corresponds to the above-mentioned second protocol address coding information; determine the second location distance between the above-mentioned first address location and the third address location, wherein the above-mentioned third address location corresponds to the above-mentioned third protocol address coding information; generate a location distance label based on the above-mentioned first location distance and the above-mentioned second location distance.
[0015] Optionally, the first generating unit may be configured to: determine distance comparison information between the first home distance and the second home distance as a home distance tag.
[0016] Optionally, the above-mentioned initial protocol address encoding model includes: an initial word embedding layer, a vector fusion layer and multiple series-connected initial fully connected layers; and the encoding unit can be configured to: perform address segmentation processing on the above-mentioned protocol address to generate a segmentation information set; input each segmentation information in the above-mentioned segmentation information set into the above-mentioned initial word embedding layer to generate a segmentation information embedding vector to obtain a segmentation information embedding vector set; input each segmentation information embedding vector in the above-mentioned segmentation information embedding vector set into the above-mentioned vector fusion layer to generate a fusion vector; input the above-mentioned fusion vector into the above-mentioned multiple series-connected initial fully connected layers to generate the above-mentioned protocol address encoding information.
[0017] Optionally, the device also includes: obtaining a protocol address data set; executing the following generation steps for each protocol address data in the above protocol address data set: performing data preprocessing on the above protocol address data to generate processed address data, wherein the above processed address data includes: a protocol address segment and a corresponding address location; generating at least one protocol address within the above protocol address segment, and determining that the location corresponding to at least one protocol address is the above address location.
[0018] In a third aspect, some embodiments of the present disclosure provide a method for generating protocol address coding information, including: obtaining a target protocol address set; inputting each target protocol address in the above target protocol address set into a pre-trained protocol address coding model to generate target protocol address coding information, and obtaining a target protocol address coding information set, wherein the above 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 generating device, comprising: an acquisition unit, configured to acquire a target protocol address; an input unit, configured to input the above-mentioned target protocol address into a pre-trained protocol address encoding model to generate protocol address encoding information corresponding to the above-mentioned target protocol address, wherein the above-mentioned 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; a storage device on which one or more programs are stored, and 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 one of the implementation methods in the first and third aspects.
[0021] In a sixth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any one of the implementation modes of the first aspect and the third aspect is implemented.
[0022] In a seventh aspect, some embodiments of the present disclosure provide a computer program product, including a computer program, which, when executed by a processor, implements the method described in any one of the implementation modes of the first and third aspects above.
[0023] The above-mentioned 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 encoding model can be used to accurately and efficiently generate the protocol address encoding information corresponding to the target protocol address. Specifically, the reason why the relevant protocol address encoding is not efficient and accurate is that in the protocol address encoding task scenario, the data volume of the protocol address to be encoded is generally 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 the initial protocol address encoding model to encode each protocol address in the acquired protocol address set to generate protocol address encoding information and obtain a protocol address encoding information set. Among them, each protocol address has a corresponding address attribution. Here, by encoding the protocol addresses in the protocol address set, it is convenient to perform model training on the encoding results corresponding to the protocol addresses in the subsequent model training to ensure the accuracy of the model training. Here, by determining the address attribution corresponding to the protocol address, the subsequent model can fully consider the geographical characteristics of the attribution corresponding to the protocol address during the training process, so as to obtain a more accurate model for encoding processing based on the geographical characteristics of the attribution. Then, each protocol address coding information in the above-mentioned protocol address coding information set is divided to generate a protocol address coding information group set. Among them, the number of protocol address coding information included in each protocol address coding information group is the target number. Here, by dividing each protocol address coding information, it is convenient to train the model based on the subsequent location distance between the protocol addresses. Secondly, for each protocol address coding information group in the above-mentioned protocol address coding information group set, according to the corresponding address location group, the location distance label corresponding to the above-mentioned protocol address coding information group can be accurately generated to generate a training data set later. Furthermore, according to the above-mentioned protocol address coding information group set and the corresponding location distance label set, a training data set is generated for subsequent model training. Finally, according to the above-mentioned training data set, the above-mentioned initial protocol address coding model is model trained to generate a protocol address coding model to obtain a more accurate protocol address coding model for protocol coding. In summary, by generating the location distance label corresponding to each protocol address coding information group as a label for model training, the model learns more location geographical features and generates a more accurate protocol address coding model. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.
[0025] Figure 1is a schematic diagram of an 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 the model training method according to the present disclosure;
[0027] Figure 3 is a flowchart of other embodiments of the model training method according to the present disclosure;
[0028] Figure 4 is a flow chart of some embodiments of the method for generating protocol address encoding information according to the present disclosure;
[0029] Figure 5 is a schematic diagram of the structure of some embodiments of the model training device according to the present disclosure;
[0030] Figure 6 It is a structural schematic diagram of some embodiments of the protocol address encoding information generating device according to the present disclosure;
[0031] Figure 7 It is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION
[0032] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of 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 also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other.
[0034] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0035] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0036] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0037] With regard to the collection, storage, and use of user personal information (such as protocol addresses) involved in this disclosure, before performing the corresponding operations, the relevant organizations or individuals shall fulfill their obligations, including conducting personal information security impact assessments, fulfilling the obligation to inform the personal information subject, and obtaining the authorization and consent of the personal information subject in advance.
[0038] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.
[0039] Figure 1 It is a schematic diagram of an application scenario of the model training method according to some embodiments of the present disclosure.
[0040] exist Figure 1In the application scenario, first, the electronic device 101 can use the initial protocol address encoding model 102 to encode each protocol address in the acquired protocol address set 103 to generate protocol address encoding information and obtain a protocol address encoding information set 104. Among them, each protocol address has a corresponding address attribution. Then, the electronic device 101 can divide the various protocol address encoding information in the above-mentioned protocol address encoding information set 104 to generate a protocol address encoding information group set. Among them, the number of protocol address encoding information included in each protocol address encoding information group is the target number. In this 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 a value of 3. Then, the electronic device 101 can generate a corresponding attribution distance label for each protocol address encoding information group in the above-mentioned protocol address encoding information group set according to the corresponding address attribution group. In this application scenario, for the first protocol address coding information group 105, the corresponding attribution distance tag is the first attribution distance tag 108. For the second protocol address coding information group 106, the corresponding attribution distance tag is the second attribution distance tag 109. For the third protocol address coding information group 107, the corresponding attribution distance tag is the third attribution distance tag 110. Furthermore, the electronic device 101 can generate a training data set 111 according to the above protocol address coding information group set and the corresponding attribution distance tag set. In this application scenario, the training data set 111 includes: first training data 1111, second training data 1112 and third training data 1113. The first training data 1111 is generated based on the first protocol address coding information group 105 and the first attribution distance tag 108. The second training data 1112 is generated based on the second protocol address coding information group 106 and the second attribution distance tag 109. The third training data 1113 is generated based on the third protocol address coding information group 107 and the third attribution distance tag 110. Finally, the electronic device 101 may 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 can be hardware or software. When the electronic device is hardware, it can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or it can be implemented as a single server or a single terminal device. When the electronic device is embodied as software, it can be installed in the hardware devices listed above. It can be implemented as multiple software or software modules for providing distributed services, for example, or it can be implemented 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 in the embodiment is only for illustration. Any number of electronic devices may be provided according to implementation requirements.
[0043] Continue to refer Figure 2 , shows a process 200 of some embodiments of the model training method according to the present disclosure. The model training method comprises the following steps:
[0044] Step 201: using the initial protocol address encoding model, encode each protocol address in the acquired protocol address set to generate protocol address encoding information, thereby obtaining a protocol address encoding information set.
[0045] In some embodiments, the execution entity of the above model training method (for example Figure 1 The electronic device 101 shown) can use the initial protocol address encoding model to encode each protocol address in the acquired protocol address set to generate protocol address encoding information and obtain a protocol address encoding information set. Among them, the initial protocol address encoding model can be a protocol address encoding model that has not yet been trained. The protocol address encoding model can be a neural network model that performs address encoding (i.e., address word embedding processing) on the protocol address. 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 a convolutional layer. The protocol address encoding information can be information in the form of a vector. Among them, 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 execution entity may input each protocol address in the protocol address set into an 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 some embodiments, before using the initial protocol address encoding model to encode each protocol address in the acquired protocol address set to generate protocol address encoding information and obtain the protocol address encoding information set, the method further includes the following steps:
[0048] The first step is to obtain a protocol address data set. The protocol address data is data related to the protocol address. In practice, the protocol address data may include: a starting protocol address, an ending protocol address, location information, and operator information. For example, the starting protocol address may be the starting IP address corresponding to the protocol address segment. The ending protocol address may be the ending IP address corresponding to the protocol address segment. The protocol address segment may be a protocol address interval associated with a certain location. The location information may be the location information corresponding to the protocol address segment. The operator information may be the operator information available corresponding to the protocol address segment. For example, the protocol address data may be "1.25.136.0, 1.25.151.255, Hohhot, Inner Mongolia, Lian**". The protocol address segment may be the protocol address interval between the starting protocol address "1.25.136.0" and the ending protocol address "1.25.151.255".
[0049] The second step is to perform the following generation steps for each protocol address data in the above protocol address data set:
[0050] Sub-step 1: pre-process the protocol address data to generate processed address data, wherein the processed address data includes: protocol address segments and corresponding address locations.
[0051] As an example, the execution entity may remove the operator information in the protocol address data to generate processed address data.
[0052] Sub-step 2, generating at least one protocol address in the above-mentioned protocol address segment, and determining the location corresponding to at least one protocol address as the location of the above-mentioned address. For example, the protocol address segment may be the protocol address interval between the starting protocol address "1.25.136.0" and the ending protocol address "1.25.151.255", and at least one protocol address may include: "1.25.135.0", "1.25.137.0", "1.25.138.0", "1.25.142.0".
[0053] Step 202: divide each protocol address coding information in the above protocol address coding information set to generate a protocol address coding information group set.
[0054] In some embodiments, the execution subject may divide each protocol address coding information in the protocol address coding information set to generate a protocol address coding information group set. The number of protocol address coding information included in each protocol address coding information group is a target number. For example, the target number may be a value of 4. The target number may be pre-set.
[0055] As an example, the execution subject may randomly combine the protocol address coding information in the protocol address coding information set according to a target number to generate a protocol address coding information group set.
[0056] Step 203: for each protocol address coding information group in the protocol address coding information group set, generate a home location distance label corresponding to the protocol address coding information group according to the corresponding address home location group.
[0057] In some embodiments, the above-mentioned execution entity may generate, for each protocol address coding information group in the above-mentioned protocol address coding information group set, a location distance label corresponding to the above-mentioned protocol address coding information group according to the corresponding address location group. The corresponding address location group is the address location group corresponding to the protocol address coding information group. The location distance label may be a label related to the location distance. For example, the location distance label may be the distance between the location corresponding to the protocol address and the target location. For example, the location distance label may be the distance between the location corresponding to the protocol address and the geographical center point corresponding to the protocol address coding information group. The geographical center point corresponding to the protocol address coding information group may be the location corresponding to the center of gravity of the location graphic composed of the address locations corresponding to the protocol address coding information group.
[0058] As an example, first, the execution subject may determine the location graph formed by the address location group, then determine the image center of gravity corresponding to the location graph, and finally determine the distance between the location corresponding to the image center of gravity and each address location as the location distance label.
[0059] In some optional implementations of some embodiments, generating the home location distance label corresponding to the protocol address coding information group according to the corresponding address home location group may include the following steps:
[0060] In the first step, the execution subject can determine the first location distance between the first address location and the second address location. The protocol address coding information group includes: first protocol address coding information, second protocol address coding information and third protocol address coding information. The first address location corresponds to the first protocol address coding information. The second address location corresponds to the second protocol address coding information.
[0061] For example, the first address location is "Beijing". The second address location 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 location distance may be the distance between "Beijing" and "Tianjin".
[0062] In the second step, the execution entity may determine the second location distance between the first address location and the 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 location distance may be the distance between "Beijing" and "Nanjing".
[0063] In a third step, the execution entity may generate a home location distance label according to the first home location distance and the second home location distance.
[0064] As an example, first, the execution subject may generate a first distance key-value pair between a first address location and a second address location. Then, a second distance key-value pair between a first address location and a third address location is generated. Finally, the first distance key-value pair and the second distance key-value pair are determined as location distance tags.
[0065] Optionally, the execution entity may determine the distance comparison information between the first attribution distance and the second attribution distance as an attribution distance tag. The distance characterization information may characterize the magnitude relationship between the first attribution distance and the second attribution distance. For example, the attribution distance tag may be "the attribution distance tag is greater than the second attribution distance". The attribution distance tag may also be "the attribution distance tag is less than the second attribution distance".
[0066] Step 204: Generate a training data set based on the above protocol address coding information set and the corresponding home distance label set.
[0067] In some embodiments, the execution entity may generate a training data set based on the protocol address coding information set and the corresponding home location distance label set.
[0068] As an example, the above execution entity may combine each protocol address encoding information group with the home location distance label to generate training data and obtain a training data set.
[0069] Step 205: Perform model training on the initial protocol address encoding model according to the training data set to generate a protocol address encoding model.
[0070] In some embodiments, the execution entity may perform model training on the initial protocol address encoding model according to the training data set to generate a protocol address encoding model.
[0071] As an example, the execution entity may perform model training on the initial protocol address encoding model by back propagation based on the training data set and using the MarginRankingLoss loss function to generate a protocol address encoding model.
[0072] The above-mentioned 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 encoding model can be used to accurately and efficiently generate the protocol address encoding information corresponding to the target protocol address. Specifically, the reason why the relevant protocol address encoding is not efficient and accurate is that in the protocol address encoding task scenario, the data volume of the protocol address to be encoded is generally 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 the initial protocol address encoding model to encode each protocol address in the acquired protocol address set to generate protocol address encoding information and obtain a protocol address encoding information set. Among them, each protocol address has a corresponding address attribution. Here, by encoding the protocol addresses in the protocol address set, it is convenient to perform model training on the encoding results corresponding to the protocol addresses in the subsequent model training to ensure the accuracy of the model training. Here, by determining the address attribution corresponding to the protocol address, the subsequent model can fully consider the geographical characteristics of the attribution corresponding to the protocol address during the training process, so as to obtain a more accurate model for encoding processing based on the geographical characteristics of the attribution. Then, each protocol address coding information in the above-mentioned protocol address coding information set is divided to generate a protocol address coding information group set. Among them, the number of protocol address coding information included in each protocol address coding information group is the target number. Here, by dividing each protocol address coding information, it is convenient to train the model based on the subsequent location distance between the protocol addresses. Secondly, for each protocol address coding information group in the above-mentioned protocol address coding information group set, according to the corresponding address location group, the location distance label corresponding to the above-mentioned protocol address coding information group can be accurately generated to generate a training data set later. Furthermore, according to the above-mentioned protocol address coding information group set and the corresponding location distance label set, a training data set is generated for subsequent model training. Finally, according to the above-mentioned training data set, the above-mentioned initial protocol address coding model is model trained to generate a protocol address coding model to obtain a more accurate protocol address coding model for protocol coding. In summary, by generating the location distance label corresponding to each protocol address coding information group as a label for model training, the model learns more location geographical features and generates a more accurate protocol address coding model.
[0073] Further references Figure 3, shows a process 300 of other embodiments of the model training method according to the present disclosure. The model training method comprises the following steps:
[0074] Step 301, performing address segmentation processing on the above protocol address to generate a segmentation information set.
[0075] In some embodiments, an execution entity (e.g. Figure 1 The electronic device 101 shown) can perform address segmentation processing on the above-mentioned protocol address to generate a segmentation information set. Among them, the protocol address can be divided into 4 segments. Each segment of information is segmentation information. That is, the segmentation information set can include 4 segmentation information. Each segment contains 8 binary digits, a total of 32 bits. These four segments are usually represented by dotted decimal notation, such as 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 segmentation information set can include: "192", "168", "1" and "78". Among them, the above-mentioned initial protocol address encoding model includes: an initial word embedding layer, a vector fusion layer and a plurality of initial fully connected layers (FullyConnected Layer) connected in series. Among them, the initial word embedding layer can be a word embedding layer that has not yet been trained. 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. The vector fusion layer can be a network layer that vector fuses each vector. In practice, vector fusion can be vector concatenation.
[0076] As an example, the execution subject may split the 4-segment address information corresponding to the protocol address into 4 segments to obtain a segment information set.
[0077] Step 302: input each segment information in the segment information set into the initial word embedding layer to generate a segment information embedding vector, thereby obtaining a segment information embedding vector set.
[0078] In some embodiments, the execution subject may input each segment information in the segment information set into the initial word embedding layer to generate a segment information embedding vector to obtain a segment information embedding vector set. The segment information embedding vector may be in vector form.
[0079] Step 303: input each segment information embedding vector in the segment information embedding vector set into the vector fusion layer to generate a fusion vector.
[0080] In some embodiments, the execution entity may input each segment information embedding vector in the segment information embedding vector set into the vector fusion layer to generate a fusion vector.
[0081] As an example, the execution entity may input each segmented information embedding vector in the segmented information embedding vector set into the vector fusion layer to splice according to the information position corresponding to each segmented information to generate a fusion vector. For example, the protocol address is "first segmented information. second segmented information. third segmented information. fourth segmented information". The segmented information embedding vector set includes: a first segmented information embedding vector corresponding to the first segmented information, a second segmented information embedding vector corresponding to the second segmented information, a third segmented information embedding vector corresponding to the third segmented information, and a fourth segmented information embedding vector corresponding to the fourth segmented information. The fusion vector may be [first segmented information embedding vector, second segmented information embedding vector, third segmented information embedding vector, third segmented information embedding vector].
[0082] Step 304: input the fused vector into the multiple serially connected initial fully connected layers to generate the protocol address encoding information.
[0083] In some embodiments, the execution entity may input the fusion vector into the plurality of initial fully connected layers connected in series to generate the protocol address encoding information.
[0084] Step 305: divide each protocol address coding information in the above protocol address coding information set to generate a protocol address coding information group set.
[0085] Step 306: for each protocol address coding information group in the protocol address coding information group set, generate a home location distance label corresponding to the protocol address coding information group according to the corresponding address home location group.
[0086] Step 307: Generate a training data set based on the above protocol address coding information set and the corresponding home distance label set.
[0087] Step 308: Perform model training on the initial protocol address encoding model according to the training data set to generate a protocol address encoding model.
[0088] In some embodiments, the specific implementation of steps 305-308 and the technical effects thereof can be referred to in Figure 2 The steps 202-205 in the corresponding embodiment are not described in detail here.
[0089] from Figure 3 It can be seen that Figure 2 Compared with the description of some corresponding embodiments, Figure 3The process 300 of the model training method in some corresponding embodiments uses the initial word embedding layer, vector fusion layer and multiple series-connected initial fully connected layers included in the above-mentioned initial protocol address coding model to enable the subsequently trained protocol address coding model to accurately generate corresponding protocol address coding information in batches.
[0090] Continue to refer Figure 4 , shows a process 400 of some embodiments of the method for generating protocol address encoding information according to the present disclosure. The method for generating protocol address encoding information includes the following steps:
[0091] Step 401, obtaining a target protocol address set.
[0092] In some embodiments, the execution subject (eg, electronic device) of the above-mentioned protocol address encoding information generation method may obtain the target protocol address set in a wired manner or a wireless manner.
[0093] Step 402: input each target protocol address in the target protocol address set into a pre-trained protocol address encoding model to generate target protocol address encoding information, thereby obtaining a target protocol address encoding information set.
[0094] In some embodiments, the execution subject may input each target protocol address in the 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, wherein the protocol address encoding model is generated based on a model training method.
[0095] Here, through encoding processing, the protocol address can be converted into a vector, which can then be used to analyze abnormal behavior in network traffic or identify potential attack patterns. After mapping the protocol address to a vector, it can be combined with geographic location data to analyze network usage in different regions or countries. In user behavior analysis, protocol address encoding information can help identify the user's geographic location, access habits, and other information.
[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 implemented efficiently and accurately.
[0097] Further references Figure 5 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a model training device, and these device embodiments are Figure 2 Corresponding to the method embodiments shown, the model training device can be specifically applied to various electronic devices.
[0098] like Figure 5As shown, a model training device 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. Among them, the encoding unit 501 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 and obtain a protocol address encoding information set, wherein each protocol address has a corresponding address location; the division unit 502 is configured to divide the individual protocol address encoding information in the above-mentioned 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 the target number; the first generation unit 503 is configured to generate, for each protocol address encoding information group in the above-mentioned protocol address encoding information group set, a location distance label corresponding to the above-mentioned protocol address encoding information group according to the corresponding address location group; the second generation unit 504 is configured to generate a training data set according to the above-mentioned protocol address encoding information group set and the corresponding location distance label set; the training unit 505 is configured to perform model training on the above-mentioned initial protocol address encoding model according to the above-mentioned 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 location distance between the first address location and the second address location, wherein the above-mentioned protocol address coding information group includes: first protocol address coding information, second protocol address coding information and third protocol address coding information, the above-mentioned first address location corresponds to the above-mentioned first protocol address coding information, and the above-mentioned second address location corresponds to the above-mentioned second protocol address coding information; determine the second location distance between the above-mentioned first address location and the third address location, wherein the above-mentioned third address location corresponds to the above-mentioned third protocol address coding information; generate a location distance label based on the above-mentioned first location distance and the above-mentioned second location distance.
[0100] In some optional implementations of some embodiments, the first generating unit 503 may be further configured to: determine the distance comparison information between the first home distance and the second home distance as a home distance tag.
[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 multiple series-connected initial fully connected layers. And the encoding unit 501 can be further 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 into the initial word embedding layer to generate a segmentation information embedding vector to obtain a segmentation information embedding vector set; input each segmentation information embedding vector in the segmentation information embedding vector set into the vector fusion layer to generate a fusion vector; input the fusion vector into the multiple series-connected initial fully connected layers to generate the protocol address encoding information.
[0102] In some optional implementations of some embodiments, the apparatus 500 further includes: an address acquisition unit and an information input unit (not shown). The address acquisition unit may be configured to: acquire a target protocol address set. The information input unit may be configured to: input each target protocol address in the 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, wherein the protocol address encoding model is generated based on a model training method.
[0103] It is understandable that the units recorded in the model training device 500 are similar to the reference Figure 2 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the model training device 500 and the units contained therein, and will not be repeated here.
[0104] Further references Figure 6 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a protocol address encoding information generating device. These device embodiments are similar to Figure 4 Corresponding to the method embodiments shown, the protocol address encoding information generating device can be specifically applied to various electronic devices.
[0105] like Figure 6 As shown, a model training device 600 includes: an acquisition unit 601 and an input unit 602. The acquisition unit 601 is configured to acquire a target protocol address; the input unit 602 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 a model training method.
[0106] It can be understood that the units recorded in the protocol address encoding information generating device 600 are similar to those in the reference Figure 4Therefore, the operations, features and beneficial effects described above for the method are also applicable to the protocol address encoding information generating device 600 and the units included therein, and will not be described in detail here.
[0107] Reference below Figure 7 , which shows an electronic device (eg, Figure 1 Schematic diagram of the structure of the electronic device 101)700. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0108] like Figure 7 As shown, the electronic device 700 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory 702 or a program loaded from a storage device 708 into a random access memory 703. 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 via a bus 704. An input / output interface 705 is also connected to the bus 704.
[0109] Typically, the following devices may be connected to the input / output interface 705: an input device 706 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication device 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The electronic device 700 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 7 Each block shown in the figure may represent one device, or may represent multiple devices as required.
[0110] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from a network through a communication device 709, or installed from a storage device 708, or installed from a read-only memory 702. When the computer program is executed by the processing device 701, the above-mentioned functions defined in the method of some embodiments of the present disclosure are executed.
[0111] It should be noted that the computer-readable medium in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk 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 may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In some embodiments of the present disclosure, the computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0112] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0113] The computer-readable medium may be included in the electronic device; or it may exist independently without being assembled into the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: uses the initial protocol address encoding model to encode each protocol address in the acquired protocol address set to generate protocol address encoding information and obtain a protocol address encoding information set, wherein each protocol address has a corresponding address attribution; divides 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 the target number; for each protocol address encoding information group in the protocol address encoding information group set, according to the corresponding address attribution group, generates the attribution distance label corresponding to the protocol address encoding information group; generates a training data set according to the protocol address encoding information group set and the corresponding attribution distance label set; and performs 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 performing the operations of some embodiments of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0115] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0116] The units described in some embodiments of the present disclosure may be implemented by software or by hardware. The described units may also be arranged in a processor, for example, may be described as: a processor includes a coding unit, a division unit, a first generation unit, a second generation unit and a training unit. Among them, the names of these units do not constitute a limitation on the unit itself in some cases. For example, the second generation unit may also be described as "a unit for generating a training data set according to the above-mentioned protocol address coding information group set and the corresponding home distance label set".
[0117] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0118] Some embodiments of the present disclosure also provide a computer program product, including a computer program, which implements any of the above-mentioned model training methods or protocol address encoding information generation methods when executed by a processor.
[0119] The above descriptions are only some preferred embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) and the technical solutions formed.
Claims
1. A model training method, comprising: Using the initial protocol address encoding model, encoding each protocol address in the acquired protocol address set is performed to generate protocol address encoding information, thereby obtaining a protocol address encoding information set, wherein each protocol address has a corresponding address attribution location; Dividing each protocol address coding information in the protocol address coding information set to generate a protocol address coding information group set, wherein the number of protocol address coding information included in each protocol address coding information group is a target number; For each protocol address coding information group in the protocol address coding information group set, generating a home location distance label corresponding to the protocol address coding information group according to the corresponding address home location group; Generate a training data set according to the protocol address coding information set and the corresponding home distance label set; The initial protocol address encoding model is trained according to the training data set to generate a protocol address encoding model.
2. The method according to claim 1, wherein: The generating, according to the corresponding address attribution group, a location distance label corresponding to the protocol address coding information group comprises: Determine a first location distance between a first address location and a second address location, wherein the protocol address coding information group includes: first protocol address coding information, second protocol address coding information and third protocol address coding information, the first address location corresponds to the first protocol address coding information, and the second address location corresponds to the second protocol address coding information; Determine a second location distance between the first address location and a third address location, wherein the third address location corresponds to the third protocol address coding information; A home location distance label is generated according to the first home location distance and the second home location distance.
3. The method according to claim 2, wherein: The generating a home location distance label according to the first home location distance and the second home location distance includes: Distance comparison information between the first home distance and the second home distance is determined as a home distance tag.
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 a plurality of serially connected initial fully connected layers; and The method of using the initial protocol address encoding model to encode each protocol address in the acquired protocol address set to generate protocol address encoding information includes: Performing address segmentation processing on the protocol address to generate a segmentation information set; Input each segment information in the segment information set into the initial word embedding layer to generate a segment information embedding vector, thereby obtaining a segment information embedding vector set; Inputting each segment information embedding vector in the segment information embedding vector set into the vector fusion layer to generate a fusion vector; The fused vector is input into the plurality of serially connected initial fully connected layers to generate the protocol address encoding information.
5. The method according to claim 1, wherein: Before encoding each protocol address in the acquired 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 method further includes: Get the protocol address data set; For each protocol address data in the protocol address data set, the following generation steps are performed: Performing data preprocessing on the protocol address data to generate processed address data, wherein the processed address data includes: a protocol address segment and a corresponding address location; At least one protocol address in the protocol address segment is generated, and the location corresponding to the at least one protocol address is determined to be the address location.
6. A method for generating protocol address coding information, comprising: Get the target protocol address set; Input each target protocol address in the target protocol address set into a pre-trained protocol address encoding model to generate target protocol address encoding information to obtain a target protocol address encoding information set, wherein the protocol address encoding model is generated based on the method described in 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 and obtain a protocol address encoding information set, wherein each protocol address has a corresponding address attribution; a dividing unit, configured to divide each protocol address coding information in the protocol address coding information set to generate a protocol address coding information group set, wherein the number of protocol address coding information included in each protocol address coding information group is a target number; A first generating unit is configured to generate, for each protocol address coding information group in the protocol address coding information group set, a home location distance label corresponding to the protocol address coding information group according to a corresponding address home location group; A second generating unit is configured to generate a training data set according to the protocol address coding information group set and the corresponding home distance label set; The training unit 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.
8. A device for generating protocol address coding information, comprising: an acquisition unit, configured to acquire a target protocol address; An 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 one of claims 1-5.
9. An electronic device, comprising: one or more processors; 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 according to any one of claims 1 to 6.
10. A computer readable medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
11. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Dialogue attribution determination method and device, electronic equipment and storage medium
CN112837672A
Satellite signal attribute judgment method and device based on network protocol
CN116578874A
Address model training method and device, equipment and storage medium
CN117195993A
Data processing method and apparatus, and device and computer medium
WO2023241410A1