WO2022057355A1 - Data packet recognition method and apparatus - Google Patents

Data packet recognition method and apparatus Download PDF

Info

Publication number
WO2022057355A1
WO2022057355A1 PCT/CN2021/101662 CN2021101662W WO2022057355A1 WO 2022057355 A1 WO2022057355 A1 WO 2022057355A1 CN 2021101662 W CN2021101662 W CN 2021101662W WO 2022057355 A1 WO2022057355 A1 WO 2022057355A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
model
data packet
target model
information
Prior art date
Application number
PCT/CN2021/101662
Other languages
French (fr)
Chinese (zh)
Inventor
卢嘉勋
李秉帅
邵云峰
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022057355A1 publication Critical patent/WO2022057355A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition

Definitions

  • the present application relates to the field of artificial intelligence, and in particular, to a method and device for identifying data packets.
  • data packets can be identified through deep learning methods.
  • the data packet identification device can identify data packets generated by existing applications through the following methods: the data packet identification device will obtain a large number of marked data packets, which are data packets generated by existing applications; data packets The packet identification device will identify the characteristic information of each data packet, for example, the keyword of the application corresponding to the data packet; the data packet identification device will repeatedly train the model according to the identified characteristic information of each data packet, and through the training The model identifies newly received packets generated by existing applications.
  • the above-mentioned data packet identification device cannot identify the data packet generated by the newly added application. Therefore, the data packet identification device will again perform model training based on a large number of marked data packets, so that the trained model can identify data packets generated by existing applications and data packets generated by new applications. This process is not only computationally intensive, but also takes a long time to train. In addition, if new applications appear frequently, the data packet identification device needs to perform the above process frequently, and the data overhead and calculation overhead are relatively large.
  • the present application provides a method and device for identifying a data packet, which can perform model training based on the data packet generated by the marked new application in the case of a new application, with a small amount of calculation and a short training time.
  • an embodiment of the present application provides a method for identifying a data packet.
  • the method includes: a first device obtains a first target model, and the first target model is used to extract first feature information of a first data packet, and determine the first target model.
  • the first application in the first application set corresponding to the data packet in the case of satisfying the trigger condition, the first device obtains the second target model, and the second target model is used to extract the second feature information of the second data packet, and determine the first
  • the first application in the first application set is different from the second application in the second application set; the first device acquires the third data packet, according to the first target model and the second target model to determine the first application or the second application corresponding to the third data packet.
  • the first device when a new application appears after using the first target model (the new application is the application in the second application set), the first device does not need to use the marked first application Perform model training on the data packets of the first application set and the data packets of the second application to obtain a model that can identify both the data packets of the applications in the first application set and the data packets of the applications in the second application set.
  • the first device can perform model training according to the marked data packets of the second application to obtain the second target model, and subsequently, identify the data packets of the applications in the first application set according to the first target model and the second target model , or a data packet of an application in the second application set.
  • the first device Because the number of marked data packets of the second application is much smaller than the number of marked data packets of the first application and the number of data packets of the second application, in the method provided by the first aspect, the first device's The amount of computation is small and the training time is short. In addition, in the method provided in the first aspect, in the case of a newly added application, the first device uses the data package of the marked second application for model training, so the marked first application can be released data packets, reducing the cost of data storage.
  • a possible implementation manner, where the first device acquires the second target model includes: the first device receives information from the server of the first initial model and a list of second applications included in the second application set, where the first initial model is based on Determined by the number of applications in the second application set, the list of second applications is used to indicate the correspondence between the second application in the second application set and the output end of the first initial model;
  • the marked data packet of the second application trains the first initial model to obtain the first intermediate model;
  • the first device sends the information of the first intermediate model to the server;
  • the first device receives the information of the second target model from the server, the second
  • the information of the target model is obtained by aggregating information from intermediate models of multiple first devices; the first device obtains the second target model according to the information of the second target model and the first initial model.
  • a device participating in model training such as a first device, can receive information about the first initial model from the server and a list of second applications included in the second application set, and train according to the marked data packets of the second application
  • the first intermediate model is obtained, and the information of the first intermediate model is sent to the server, so that the server aggregates the information of the intermediate models from multiple first devices to obtain the information of the second target model.
  • the first device may receive the information of the second target model from the server, and obtain the second target model according to the information of the second target model and the first initial model.
  • all devices participating in the model training can obtain a model that can finally identify the data packets applied in the second application set.
  • the server does not need to perform model training, but delegates the model training process to the devices participating in the model training.
  • the number of marked data packets used by each device participating in the model training when training the model is also It is less than the number of marked data packets used by the server to train the model. For these devices, the amount of calculation is not large, and it can also save the time of model training.
  • the first device obtains the second target model, and further includes: the first device obtains the data packet of the second application; the first device sends the data packet of the second application to the server; the first device receives the data packet from the server. Annotated data packets of the second application. Based on the above method, the first device can send the data packet of the second application to the server, so that the server can mark the data packet conveniently.
  • the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold; or, the trigger condition is that the number of data packets applied in the second application set is greater than or equal to the second threshold; Alternatively, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold, and the number of data packets applied in the second application set is greater than or equal to the second threshold.
  • the first device when the number of newly added applications reaches the first threshold, or when the number of unidentifiable data packets is greater than the second threshold, or when the number of newly added applications reaches the first threshold, And when the number of unidentifiable data packets is greater than the second threshold, the first device may be triggered to acquire the second target model. In this way, on the one hand, it can be avoided that the first device frequently acquires the second target model, resulting in excessive computational overhead of the first device. On the other hand, it can be avoided that the first device does not acquire the second target model for a long time, resulting in the generation of a large number of unidentified data packets, which affects the use of services.
  • the first device determines the first application or the second application corresponding to the third data packet according to the first target model and the second target model, including: the first device obtains the third data packet according to the first target model.
  • the first output entropy of the data packet, the first output entropy is used to indicate the probability that the application corresponding to the third data packet is the application predicted by the first target model; the first device obtains the second data packet according to the second target model.
  • the output entropy, the second output entropy is used to indicate the probability that the application corresponding to the third data packet is the application predicted by the second target model;
  • the application predicted by the target model is determined as the application corresponding to the third data packet.
  • the first device can determine the application corresponding to the third data packet according to the first output entropy and the second output entropy, thereby realizing the combination of the first target model and the second target model to identify the application.
  • the first device does not need to perform model training according to the marked data packets of the first application and the data packets of the second application to obtain an application that can both identify the first application set
  • the data packets of the second application set are also capable of identifying the data packet models of the applications in the second application set.
  • the method further includes: the first device obtains a second initial model, and the second initial model is determined according to the number of applications in the first application set and the number of applications in the second application set; A device trains a second initial model to obtain a third target model according to the labeling results of the data packets obtained by the first device based on the first target model and the second target model, and the third target model is used to extract third feature information, and according to The third characteristic information determines the application corresponding to the data packet corresponding to the third characteristic information, the third characteristic information includes characteristic information of the data packet corresponding to the third characteristic information, and the data packet corresponding to the third characteristic information is the application in the first application set The data packet, or the data packet of the application in the second application set.
  • the first device can obtain the second initial model, and train the second initial model to obtain the third target model according to the first target model and the labeling result of the data packet obtained by the first device by the second target model. Subsequently, the first device can identify the data packet according to the third target model, which can save time for the first device to identify the data packet. In addition, by continuously compressing the model, the first device can stabilize the size of the model, which is beneficial to the deployment of the model in the system-on-chip.
  • the method further includes: the first device, according to the marked data packets used when acquiring the first target model, and/or the marked data packets used when acquiring the second target model, train the first device.
  • a three-target model is obtained, and a third target model after training is obtained.
  • the first device can train the third target model according to the marked data packet used when acquiring the first target model, and/or the marked data packet used when acquiring the second target model, so that after training The accuracy of the third target model is higher and the identification of data packets is more accurate.
  • the method further includes: the first device receives indication information from a server, where the indication information is used to instruct the first device to retrain a data packet for identifying the first application and the second application The fourth destination model of the packet.
  • the server may instruct the first device to retrain the model, so that the trained model can identify the data packets applied in the first application set and the data packets applied in the second application set.
  • an embodiment of the present application provides a method for identifying a data packet.
  • the method includes: the server obtains information of a first target model, and the first target model is used to extract the first feature information of the first data packet, and determine the first target model.
  • the server does not need to perform model training, but delegates the model training process to the devices (the first device and the second device) participating in the model training, and the server transfers the data from the middle of multiple devices.
  • the information of the model can be aggregated, which reduces the computing overhead of the server.
  • the first device does not need to perform model training according to the marked data packets of the first application and the second application, and obtain a model that can both The data packets of the applications in the first application set are identified, and the model of the data packets of the applications in the second application set can be identified.
  • the first device performs model training according to the marked data packets of the second application to obtain a second target model, and subsequently, identifies the data packets of the applications in the first application set according to the first target model and the second target model, or Data packets of applications in the second set of applications.
  • the number of marked data packets of the second application is much smaller than the number of marked data packets of the first application and the second application, so the calculation amount of the first device is small and the training time is short.
  • the first device uses the data package of the marked second application for model training, so the marked first device can be released. Application data package, reducing the cost of data storage.
  • the server acquiring the information of the second target model includes: the server sending the information of the first initial model and the list of the second applications included in the second application set to the first device, the first initial model is based on the first initial model. The number of applications in the second application set is determined, and the list of the second application is used to indicate the corresponding relationship between the second application in the second application set and the output end of the first initial model; the server receives the first intermediate model from the first device. information, the first intermediate model is obtained by the first device training the first initial model according to the marked data packets of the second application obtained by the first device; the server sends the information of the first initial model and the first initial model to the second device. 2.
  • the server receives the information of the second intermediate model from the second device, and the second intermediate model is obtained by the second device training the first initial model according to the marked data packets of the second application obtained by the second device ; the server aggregates the information of the first intermediate model and the information of the second intermediate model to obtain the information of the second target model.
  • the server can send the information of the first initial model and the list of the second application to the device participating in the model training, such as the first device, so that the first device can train the first initial model according to the marked data packets of the second application. model, obtain the first intermediate model, and send the information of the first intermediate model to the server.
  • the server After receiving the information of the intermediate models from multiple devices, the server aggregates the information of the multiple intermediate models to obtain the information of the second target model, and sends the information of the second target model to the first device so that the first device can According to the information of the second target model and the first initial model, the second target model is obtained.
  • all devices participating in the model training can obtain a model that can finally identify the data packets applied in the second application set.
  • the server does not need to perform model training, but delegates the model training process to the devices participating in the model training.
  • the number of marked data packets used by each device participating in the model training when training the model is also It is less than the number of marked data packets used by the server to train the model. For these devices, the amount of calculation is not large, and it can also save the time of model training.
  • the server obtains the information of the second target model, and further includes: the server receives the data packet of the second application from the first device; the server obtains the marked data packet of the second application according to the data packet of the second application. data packet; the server sends the marked data packet of the second application to the first device. Based on the above method, the server may receive the data packet of the second application from the first device, and mark the data packet, so that the first device can perform model training according to the marked data packet.
  • the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold; or, the trigger condition is that the number of data packets applied in the second application set is greater than or equal to the second threshold; Alternatively, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold, and the number of data packets applied in the second application set is greater than or equal to the second threshold.
  • the server may be triggered to acquire information of the second target model.
  • the server may be triggered to acquire information of the second target model.
  • the method further includes: if the correct rate of identifying the data packets between the first target model and the second target model is less than or equal to a third threshold, the server sends indication information to the first device, and the indication information is used to indicate the first device.
  • a device retrains a fourth target model for identifying packets of the first application and packets of the second application. Based on the above method, when the correct rate of identifying data packets between the first target model and the second target model is less than or equal to the third threshold, the server may instruct the first device to retrain the model, so that the trained model can identify the first application the data packet and the data packet of the second application.
  • an embodiment of the present application provides an apparatus for identifying a data packet, which can implement the method in the first aspect or any possible implementation manner of the first aspect.
  • the apparatus comprises corresponding units or components for carrying out the above-described method.
  • the units included in the apparatus may be implemented by software and/or hardware.
  • the apparatus may be, for example, a first device, or a chip, a chip system, or a processor that can support the first device to implement the above method.
  • an embodiment of the present application provides an apparatus for identifying a data packet, which can implement the method in the second aspect or any possible implementation manner of the second aspect.
  • the apparatus comprises corresponding units or components for carrying out the above-described method.
  • the units included in the apparatus may be implemented by software and/or hardware.
  • the apparatus can be, for example, a server, or a chip, a chip system, or a processor that can support the server to implement the above method.
  • an embodiment of the present application provides an apparatus for identifying a data packet, including: a processor, where the processor is coupled to a memory, and the memory is used to store a program or an instruction, when the program or the instruction is processed by the When the device is executed, the device is made to implement the method described in the first aspect or any possible implementation manner of the first aspect.
  • an embodiment of the present application provides an apparatus for identifying a data packet, including: a processor, the processor is coupled to a memory, and the memory is used to store a program or an instruction, when the program or instruction is processed by the When the device is executed, the device is made to implement the method described in the second aspect or any possible implementation manner of the second aspect.
  • an embodiment of the present application provides an apparatus for identifying a data packet, where the apparatus is configured to implement the method described in the first aspect or any possible implementation manner of the first aspect.
  • an embodiment of the present application provides an apparatus for identifying a data packet, where the apparatus is configured to implement the method described in the second aspect or any possible implementation manner of the second aspect.
  • an embodiment of the present application provides a computer-readable medium on which a computer program or instruction is stored, and when the computer program or instruction is executed, enables a computer to perform the above-mentioned first aspect, or any possibility of the first aspect method described in the implementation of .
  • an embodiment of the present application provides a computer-readable medium on which a computer program or instruction is stored, and when the computer program or instruction is executed, enables a computer to execute the second aspect or any possibility of the second aspect. method described in the implementation of .
  • an embodiment of the present application provides a computer program product, which includes computer program code, and when the computer program code is run on a computer, enables the computer to execute the above-mentioned first aspect, or any possible possibility of the first aspect. Implement the method described in the method.
  • an embodiment of the present application provides a computer program product, which includes computer program code, and when the computer program code is run on a computer, enables the computer to execute the second aspect or any of the possibilities of the second aspect. Implement the method described in the method.
  • an embodiment of the present application provides a chip, including: a processor, where the processor is coupled to a memory, and the memory is used to store a program or an instruction, and when the program or instruction is executed by the processor , so that the chip implements the method described in the first aspect or any possible implementation manner of the first aspect.
  • an embodiment of the present application provides a chip, including: a processor, where the processor is coupled to a memory, and the memory is used to store programs or instructions, and when the programs or instructions are executed by the processor , so that the chip implements the method described in the second aspect or any possible implementation manner of the second aspect.
  • an embodiment of the present application provides a data packet identification system.
  • the system includes the device described in the third aspect and/or the device described in the fourth aspect, or the system includes the device described in the fifth aspect and/or the device described in the sixth aspect, or the system It includes the device of the seventh aspect and/or the device of the eighth aspect.
  • any identification device, chip, computer readable medium, computer program product or identification system of the data packet provided above are all used to execute the corresponding method provided above.
  • beneficial effects that can be achieved reference may be made to the beneficial effects in the corresponding method, which will not be repeated here.
  • an embodiment of the present application provides a method for identifying a data packet.
  • the method includes: acquiring a first target model, where the first target model is used to extract first feature information of the first data packet, and determine the first data packet.
  • the first application in the corresponding first application set; in the case of satisfying the trigger condition, the second target model is obtained, and the second target model is used to extract the second feature information of the second data packet, and determine the corresponding the second application in the second application set, where the first application in the first application set is different from the second application in the second application set; acquire a third data packet, and determine the first application according to the first target model and the second target model The first application or the second application corresponding to the three data packets.
  • the first device when a new application appears after using the first target model (the new application is the application in the second application set), the first device does not need to use the marked first target model.
  • Model training is performed on the data packets of the application and the data packets of the second application to obtain a model that can identify both the data packets of the applications in the first application set and the data packets of the applications in the second application set.
  • the first device can perform model training according to the marked data packets of the second application to obtain the second target model, and subsequently, identify the data packets of the applications in the first application set according to the first target model and the second target model , or a data packet of an application in the second application set.
  • the first device uses the marked data package of the second application to perform model training, so the marked first application can be released. Application data package, reducing the cost of data storage.
  • acquiring the second target model includes: acquiring the marked data package of the second application; acquiring the first initial model and a list of the second applications included in the second application set, where the first initial model is based on Determined by the number of applications in the second application set, the list of second applications is used to indicate the correspondence between the second application in the second application set and the output end of the first initial model; according to the marked data packets of the second application , train the first initial model to obtain the second target model.
  • the first device can train the first initial model according to the marked data package of the second application to obtain the second target model, so that the first device can subsequently determine the first target model according to the first target model and the second target model.
  • the application corresponding to the three data packets.
  • the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold; or, the trigger condition is that the number of data packets applied in the second application set is greater than or equal to the second threshold; Alternatively, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold, and the number of data packets applied in the second application set is greater than or equal to the second threshold.
  • the first device when the number of newly added applications reaches the first threshold, or when the number of unidentifiable data packets is greater than the second threshold, or when the number of newly added applications reaches the first threshold, And when the number of unidentifiable data packets is greater than the second threshold, the first device may be triggered to acquire the second target model. In this way, on the one hand, it can be avoided that the first device frequently acquires the second target model, resulting in excessive computational overhead of the first device. On the other hand, it can be avoided that the first device does not acquire the second target model for a long time, resulting in the generation of a large number of unidentified data packets, which affects the use of services.
  • determining the first application or the second application corresponding to the third data packet according to the first target model and the second target model includes: obtaining the first output of the third data packet according to the first target model entropy, the first output entropy is used to indicate the probability that the application corresponding to the third data packet is an application predicted by the first target model; according to the second target model, the second output entropy of the third data packet is obtained, and the second output entropy is used for Indicate the probability that the application corresponding to the third data packet is the application predicted by the second target model; in the first output entropy and the second output entropy, the application predicted by the target model corresponding to the output entropy with a low value is determined as the third data packet corresponding to Applications.
  • the first device can determine the application corresponding to the third data packet according to the first output entropy and the second output entropy, thereby realizing the combination of the first target model and the second target model to identify the application.
  • the first device does not need to perform model training according to the marked data packets of the first application and the data packets of the second application to obtain an application that can both identify the first application set
  • the data packets of the second application set are also capable of identifying the data packet models of the applications in the second application set.
  • the method further includes: acquiring a second initial model, where the second initial model is determined according to the number of applications in the first application set and the number of applications in the second application set; according to the first target
  • the model and the second target model mark the result of the data packet obtained by the first device, train the second initial model to obtain the third target model, and the third target model is used to extract the third feature information, and determine the third target model according to the third feature information.
  • the application corresponding to the data packet corresponding to the three characteristic information, the third characteristic information includes characteristic information of the data packet corresponding to the third characteristic information, the data packet corresponding to the third characteristic information is the data packet of the application in the first application set, or the second characteristic information A package of apps in the app collection.
  • the first device can obtain the second initial model, and train the second initial model to obtain the third target model according to the first target model and the labeling result of the data packet obtained by the first device by the second target model. Subsequently, the first device can identify the data packet according to the third target model, which can save time for the first device to identify the data packet. In addition, the first device can stabilize the size of the model by continuously compressing the model, which is beneficial to the deployment of the model in the system-on-chip.
  • the method further includes: training the third target model according to the marked data packets used when acquiring the first target model and/or the marked data packets used when acquiring the second target model , to get the third target model after training.
  • the first device can train the third target model according to the marked data packets used when acquiring the first target model, and/or the marked data packets used when acquiring the second target model, so that after training The accuracy of the third target model is higher and the identification of data packets is more accurate.
  • the method further includes: if the correct rate of the first target model and the second target model identifying the data packet is less than or equal to a third threshold, retraining the data packet and the second application for identifying the first application.
  • the fourth destination model of the packet Based on the above method, when the correct rate of identifying data packets between the first target model and the second target model is less than or equal to the third threshold, the first device can retrain the model, so that the trained model can identify the first application set Application data packets and data packets of applications in the second application set.
  • an embodiment of the present application provides a data packet identification device, the device includes: an acquisition module and a determination module; the acquisition module is used to acquire a first target model, and the first target model is used to extract the first data packet The first feature information of the first data packet is used to determine the first application in the first application set corresponding to the first data packet; the obtaining module is also used to obtain a second target model when the trigger condition is met, and the second target model is used to extract The second feature information of the second data packet determines the second application in the second application set corresponding to the second data packet, and the first application in the first application set is different from the second application in the second application set; determining module , which is used to obtain the third data packet, and determine the first application or the second application corresponding to the third data packet according to the first target model and the second target model.
  • the acquisition module is specifically used to acquire the marked data package of the second application; the acquisition module is also specifically used to acquire the first initial model and the list of the second applications included in the second application set, the first An initial model is determined according to the number of applications in the second application set, and the list of second applications is used to indicate the corresponding relationship between the second application in the second application set and the output end of the first initial model; the acquiring module, also specifically It is used to train the first initial model according to the marked data packets of the second application, so as to obtain the second target model.
  • the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold; or, the trigger condition is that the number of data packets applied in the second application set is greater than or equal to the second threshold; Alternatively, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold, and the number of data packets applied in the second application set is greater than or equal to the second threshold.
  • the determination module is specifically used to obtain the first output entropy of the third data packet according to the first target model, and the first output entropy is used to indicate that the application corresponding to the third data packet is predicted by the first target model.
  • the determination module is also specifically used to obtain the second output entropy of the third data packet according to the second target model, and the second output entropy is used to indicate that the application corresponding to the third data packet is predicted by the second target model.
  • the probability of the application; the determining module is further specifically configured to determine the application predicted by the target model corresponding to the output entropy with a lower value among the first output entropy and the second output entropy as the application corresponding to the third data packet.
  • the device further includes: a training module; an acquisition module, further configured to acquire a second initial model, the second initial model is based on the number of applications in the first application set and the number of applications in the second application set The number is determined; the training module is used to train the second initial model to obtain the third target model according to the labeling results of the data packets obtained by the first device by the first target model and the second target model, and the third target model is used for Extract the third feature information, and determine the application corresponding to the data packet corresponding to the third feature information according to the third feature information, the third feature information includes the feature information of the data packet corresponding to the third feature information, and the data packet corresponding to the third feature information. It is a data packet of an application in the first application set, or a data packet of an application in the second application set.
  • the training module is also used to train the third target according to the marked data packets used when acquiring the first target model, and/or the marked data packets used when acquiring the second target model model to obtain the third target model after training.
  • the acquisition module is also used to retrain the data packets and the second data packets for identifying the first application if the correct rate of the first target model and the second target model to identify the data packets is less than or equal to the third threshold.
  • the fourth destination model of the applied packet is also used to retrain the data packets and the second data packets for identifying the first application if the correct rate of the first target model and the second target model to identify the data packets is less than or equal to the third threshold.
  • an embodiment of the present application provides an apparatus for identifying a data packet, including: a processor, where the processor is coupled to a memory, and the memory is used to store a program or an instruction.
  • the apparatus When executed by the processor, the apparatus is made to implement the method described in the sixteenth aspect or any possible implementation manner of the sixteenth aspect.
  • an embodiment of the present application provides an apparatus for identifying a data packet, where the apparatus is configured to implement the method described in the sixteenth aspect or any possible implementation manner of the sixteenth aspect.
  • embodiments of the present application provide a computer-readable medium on which a computer program or instruction is stored, and when the computer program or instruction is executed, causes a computer to execute the above-mentioned sixteenth aspect, or any of the sixteenth aspect.
  • an embodiment of the present application provides a computer program product, which includes computer program code, and when the computer program code runs on a computer, causes the computer to execute the above-mentioned sixteenth aspect or any one of the sixteenth aspects. methods described in possible implementations.
  • an embodiment of the present application provides a chip, including: a processor, where the processor is coupled to a memory, and the memory is used to store programs or instructions, and when the programs or instructions are executed by the processor , the chip is made to implement the method described in the sixteenth aspect or any possible implementation manner of the sixteenth aspect.
  • the identification device, chip, computer readable medium or computer program product of any of the data packets provided above are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can be achieved. Referring to the beneficial effects in the corresponding method, details are not repeated here.
  • FIG. 1 is a schematic diagram of the architecture of a data packet identification system provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a hardware structure of an identification device provided by an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a method for identifying a data packet according to an embodiment of the present application
  • FIG. 4A is a schematic diagram of a first target model provided by an embodiment of the present application.
  • 4B is a schematic diagram of a second target model provided by an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of another data packet identification method provided by an embodiment of the present application.
  • FIG. 6A is a schematic diagram of a third initial model provided by an embodiment of the present application.
  • 6B is a schematic diagram of a first initial model provided by an embodiment of the present application.
  • FIG. 7 is a schematic flowchart of another data packet identification method provided by an embodiment of the present application.
  • FIG. 8 is a schematic flowchart of another data packet identification method provided by an embodiment of the present application.
  • FIG. 9 is a schematic flowchart of another data packet identification method provided by an embodiment of the present application.
  • FIG. 10 is a schematic flowchart of another data packet identification method provided by an embodiment of the present application.
  • FIG. 11 is a schematic flowchart of another data packet identification method provided by an embodiment of the present application.
  • FIG. 13 is a schematic flowchart of another data packet identification method provided by an embodiment of the present application.
  • FIG. 14 is a schematic structural diagram of an apparatus for identifying a data packet according to an embodiment of the present application.
  • 15 is a schematic structural diagram of another data packet identification device provided by an embodiment of the application.
  • 16 is a schematic structural diagram of another data packet identification device provided by an embodiment of the application.
  • 17 is a schematic structural diagram of a chip provided by an embodiment of the present application.
  • FIG. 18 is a schematic diagram of the composition of a data packet identification system according to an embodiment of the present application.
  • federated learning refers to the method of machine learning by uniting different participants (also known as data owners, or clients).
  • participants In federated learning, participants do not need to expose their own data to other participants, managers or coordinators (for example, servers), so federated learning can well protect user privacy and ensure data security.
  • a device in a non-federated learning scenario can perform machine learning based on the data obtained by the device.
  • the following takes a federated learning scenario as an example to introduce the data packet identification system provided by the embodiment of the present application.
  • FIG. 1 it is a schematic structural diagram of a data packet identification system 10 according to an embodiment of the present application.
  • the data packet identification system 10 may include one or more servers 101 (only one is shown) and devices 102 - 104 that may communicate with the server 101 .
  • FIG. 1 is only a schematic diagram, and does not constitute a limitation on the applicable scenarios of the technical solutions provided in the present application.
  • the server 101 may function as a manager or a coordinator. That is, server 101 may manage or coordinate one or more participants (eg, device 102, device 103, or device 104). Exemplarily, the server 101 may determine a device that needs to perform model training (hereinafter referred to as a training device). Subsequently, the server 101 may also send information of the initial model to each training device, where the information of the initial model is used to indicate the initial model that needs to be trained by the training device. The server 101 may also receive information on the intermediate model from each training device, where the information on the intermediate model is used to indicate the intermediate model trained by the training device according to the initial model.
  • a training device e.g., a device that needs to perform model training
  • the server 101 may also receive information on the intermediate model from each training device, where the information on the intermediate model is used to indicate the intermediate model trained by the training device according to the initial model.
  • the server 101 may further aggregate the received intermediate models to obtain the information of the target model, and send the information of the target model to each training device, so that each training device obtains the target model according to the information of the target model, and identifies the target model according to the information of the target model. data pack.
  • device 102, device 103, or device 104 may have the function of a participant. That is, device 102, device 103, or device 104 may perform machine learning or model training.
  • the device 102, the device 103 or the device 104 may receive the information of the initial model from the server 101, and obtain the intermediate model by training according to the initial model. Subsequently, the device 102, the device 103 or the device 104 may send the information of the intermediate model to the server 101, so that the server 101 aggregates the intermediate models obtained by the device 102, the device 103 and the device 104 to obtain the information of the target model.
  • Device 102 , device 103 or device 104 may also receive information from server 101 for the target model. In this way, the device 102, the device 103 or the device 104 can obtain the target model according to the information of the target model, and identify the data packet according to the target model.
  • the server 101 in FIG. 1 may be a device capable of providing services such as computing or applications for participants.
  • the server 101 in FIG. 1 may be a network device, a network cloud engine (NCE), a federated learning server (FLS), or the like.
  • NCE network cloud engine
  • FLS federated learning server
  • the device 102, the device 103 or the device 104 in FIG. 1 may be a device capable of receiving, sending or generating data packets and capable of performing machine learning.
  • the device 102, the device 103, or the device 104 may be a network device, a terminal, an optical network terminal (ONT), a federated learning client (federated learning client, FLC), or the like.
  • ONT optical network terminal
  • FLC federated learning client
  • the above-mentioned network device may be any device with a wireless transceiver function. Including but not limited to: evolved base station (NodeB or eNB or e-NodeB, evolutional Node B) in long term evolution (long term evolution, LTE) system, base station (gNodeB or gNB) in new radio (new radio, NR) system ) or transmitting and receiving point (transmission receiving point/transmission receiving point, TRP), 3GPP subsequent evolution base station, access node in WiFi system, wireless relay node, wireless backhaul node, etc.
  • NodeB or eNB or e-NodeB evolutional Node B
  • long term evolution long term evolution
  • LTE long term evolution
  • gNodeB or gNB new radio
  • TRP transmitting and receiving point
  • 3GPP subsequent evolution base station access node in WiFi system
  • wireless relay node wireless backhaul node, etc.
  • the above-mentioned terminal may be a device with a wireless transceiver function.
  • the above-mentioned terminal may be a mobile phone (mobile phone), a tablet computer (Pad), a computer with a wireless transceiver function, a virtual reality (VR) terminal, an augmented reality (AR) terminal, an industrial control (industrial control) terminal. ), in-vehicle terminals, terminals in self-driving, terminals in assisted driving, etc.
  • a terminal may also sometimes be referred to as terminal equipment, user equipment (UE), access terminal, vehicle-mounted terminal, industrial control terminal, UE unit, UE station, mobile station, mobile station, remote station, remote terminal, mobile equipment, UE terminal equipment, wireless communication equipment, machine terminal, UE proxy or UE device, etc.
  • Terminals can be fixed or mobile.
  • the data packet identification system 10 shown in FIG. 1 is only used for example, and is not used to limit the technical solution of the present application. Those skilled in the art should understand that, in the specific implementation process, the data packet identification system 10 may also include other devices, and the number of network devices and terminals may also be determined according to specific needs, which is not limited.
  • each device in FIG. 1 in this embodiment of the present application may be a functional module in an apparatus.
  • the functional module can be an element in a hardware device, for example, a communication chip or a communication component in a terminal or a network device, or a software functional module running on hardware, or a platform (for example, a cloud Virtualization functions instantiated on the platform).
  • FIG. 2 is a schematic diagram of a hardware structure of an identification device applicable to an embodiment of the present application.
  • the identification device 200 includes at least one processor 201 , a communication line 202 , a memory 203 and at least one communication interface 204 .
  • the processor 201 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more processors for controlling the execution of the programs of the present application. integrated circuit.
  • CPU central processing unit
  • ASIC application-specific integrated circuit
  • Communication line 202 may include a path, such as a bus, for transferring information between the components described above.
  • Communication interface 204 using any transceiver-like device for communicating with other devices or communication networks, such as Ethernet interfaces, radio access network (RAN), wireless local area networks (wireless local area networks, WLAN), etc.
  • RAN radio access network
  • WLAN wireless local area networks
  • Memory 203 may be read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (RAM) or other types of information and instructions It can also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disk storage, CD-ROM storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or capable of carrying or storing desired program code in the form of instructions or data structures and capable of being executed by a computer Access any other medium without limitation.
  • the memory may exist independently and be connected to the processor through the communication line 202 .
  • the memory can also be integrated with the processor.
  • the memory provided by the embodiments of the present application may generally be non-volatile.
  • the memory 203 is used for storing the computer-executed instructions involved in executing the solution of the present application, and the execution is controlled by the processor 201 .
  • the processor 201 is configured to execute the computer-executed instructions stored in the memory 203, thereby implementing the method provided by the embodiments of the present application.
  • the computer-executed instructions in the embodiment of the present application may also be referred to as application code, which is not specifically limited in the embodiment of the present application.
  • the processor 201 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 2 .
  • the identification device 200 may include multiple processors, for example, the processor 201 and the processor 207 in FIG. 2 .
  • processors can be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor.
  • a processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
  • the identification apparatus 200 may further include an output device 205 and an input device 206 .
  • the output device 205 is in communication with the processor 201 and can display information in a variety of ways.
  • the output device 205 may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector (projector) Wait.
  • Input device 206 is in communication with processor 201 and can receive user input in a variety of ways.
  • the input device 206 may be a mouse, a keyboard, a touch screen device, a sensor device, or the like.
  • the above-mentioned identification device 200 may be a general-purpose device or a special-purpose device.
  • the identification device 200 may be a desktop computer, a portable computer, a network server, a personal digital assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, an embedded device, or a similar structure in FIG. 2 . equipment.
  • PDA personal digital assistant
  • This embodiment of the present application does not limit the type of the identification device 200 .
  • a federated learning scenario and a non-federated learning scenario are taken as examples to describe the data packet identification method provided by the embodiment of the present application in detail with reference to FIG. 1 and FIG. 2 .
  • A/B may indicate A or B
  • a and/or may be used to describe There are three kinds of relationships between related objects, for example, A and/or B, which can be expressed as: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural.
  • words such as “first” and “second” may be used to distinguish technical features with the same or similar functions.
  • the words “first”, “second” and the like do not limit the quantity and execution order, and the words “first”, “second” and the like do not limit the difference.
  • words such as “exemplary” or “for example” are used to represent examples, illustrations or illustrations, and any embodiment or design solution described as “exemplary” or “for example” should not be construed are preferred or advantageous over other embodiments or designs.
  • the use of words such as “exemplary” or “such as” is intended to present the relevant concepts in a specific manner to facilitate understanding.
  • the server or the first device may perform some or all of the steps in the embodiments of the present application. These steps are only examples, and the embodiments of the present application may also perform other steps or variations of various steps. In addition, various steps may be performed in different orders presented in the embodiments of the present application, and it may not be necessary to perform all the steps in the embodiments of the present application.
  • the specific structure of the execution body of the data packet identification is not particularly limited in the embodiment of the present application, as long as the program that records the code of the data packet identification method of the embodiment of the present application can be executed according to the embodiment of the present application.
  • the data packet identification method according to the embodiment of the present application only needs to perform communication.
  • the execution body of the data packet identification method provided in this embodiment of the present application may be a server, or a component applied in the server, such as a chip, which is not limited in this application.
  • the execution body of the data packet identification method provided in this embodiment of the present application may be the first device, or a component applied in the first device, such as a chip, which is not limited in this application.
  • the following embodiments are described by taking an example that the execution bodies of the data packet identification method are the server and the first device respectively.
  • a federated learning scenario is used as an example to introduce the data packet identification method provided by the embodiment of the present application. Specifically, reference may be made to the methods shown in FIG. 3 , FIG. 5 , and FIGS. 7 to 11 below.
  • a method for identifying a data packet provided in an embodiment of the present application is applied to a first device.
  • the method for identifying the data packet includes steps 301 to 303 .
  • Step 301 The first device acquires a first target model.
  • the first device may be the device 102 , the device 103 or the device 104 in FIG. 1 .
  • the first device may be a device determined by the server that needs to perform model training.
  • the server may be the server 101 in FIG. 1 .
  • the first target model is used to extract the first feature information of the first data packet, and determine the first application in the first application set corresponding to the first data packet.
  • the first set of applications includes at least one first application.
  • the at least one first application includes applications already installed on the server, the first device, or other devices.
  • the first feature information includes feature information of the first data packet.
  • the first feature information includes a keyword of an application to which the first data packet belongs. It should be understood that the first data packet is generated by the first application in the first application set.
  • the first application set includes and Packet 1 is The generated packet, packet 2 is Taking the generated data packet as an example, the first characteristic information corresponding to the data packet 1 includes Wechat, and the first characteristic information corresponding to the data packet 2 includes Alipay.
  • each data packet generated by the first application corresponds to the first feature information.
  • the first feature information corresponding to the data packets of the same application may be the same or different.
  • the data packet of the application can be understood as the data packet generated by the application.
  • the first target model includes a first target feature extractor and a first target classifier.
  • the first target feature extractor is used to extract the first feature information of the first data packet, for example, the first feature information.
  • the first target classifier is used to determine the first application in the first application set corresponding to the first data packet.
  • the first target model may be as shown in FIG. 4A .
  • the first target model 401 includes a first target feature extractor 402 and a first target classifier 403 .
  • the input of the first target feature extractor 402 is the input of the first target model 401
  • the output of the first target feature extractor 402 is the input of the first target classifier 403
  • the output of the first target classifier 403 is the first target model 401 output.
  • the first target classifier 403 has n output ports, and each output port corresponds to a first application in the first application set.
  • n is the number of applications in the first application set. It can be understood that, among the n output ports, the application corresponding to the port with the highest output value may be determined as the application corresponding to the data packet input to the first target model 401 .
  • the first application set includes and Packet 1 is The generated packet
  • packet 2 is Taking the generated data packet as an example, if the first target model is shown in FIG. 4A , the value of n is 2. Assume that port 1 corresponds to Port 2 corresponds Then the data packet 1 obtains the Wechat through the first target feature extractor 402, and the Wechat is input to the first target classifier 403, and it can be obtained that the output value of port 1 is greater than the output value of port 2, that is, the application corresponding to the data packet 1 is Similarly, data packet 2 obtains Alipay through the first target feature extractor 402, and Alipay is input to the first target classifier 403, and it can be obtained that the output value of port 2 is greater than the output value of port 1, that is, the corresponding application of data packet 2 is
  • a possible implementation manner, where the first device acquires the first target model includes: the first device receives the information of the third initial model from the server and the list of the first applications included in the first application set; The marked data packets of the first application obtained by the device train the third initial model to obtain the third intermediate model; the first device sends the information of the third intermediate model to the server; the first device receives the information of the first target model from the server ; The first device obtains the first target model according to the information of the first model and the third initial model.
  • the specific process of acquiring the first target model by the first device will be described in the method shown in FIG. 5 below.
  • the first device acquires the first target model.
  • Step 302 In the case that the trigger condition is satisfied, the first device acquires the second target model.
  • the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold; or, the trigger condition is that the number of data packets applied in the second application set is greater than or equal to the second threshold; Alternatively, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold, and the number of data packets applied in the second application set is greater than or equal to the second threshold.
  • the first threshold and the second threshold are positive integers.
  • the second application set includes at least one second application.
  • the at least one second application includes an application installed on the server, the first device or other devices after the first device acquires the first target model.
  • the first threshold is 5, as an example, if the number of applications in the second application set is 6, the first device obtains The second target model. If the number of applications in the second application set is 3, the first device does not acquire the second target model.
  • the first device acquires the second target model. If the number of data packets of the first application is 5 and the number of data packets of the second application is 10, the first device does not acquire the second target model.
  • the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold, and the number of data packets applied in the second application set is greater than or equal to the second threshold, the first threshold is 3, and the first threshold is 3.
  • the second threshold is 50
  • the second application set includes two applications, and the number of data packets of the first application and the number of data packets of the second application are both 30, the first device does not obtain the first application.
  • Two-objective model If the second application set includes 4 applications, the number of data packets of the first application and the number of data packets of the second application are both 10, and the number of data packets of the third application and the fourth application is 10. If the numbers are all 5, the first device does not acquire the second target model. If the second application set includes 3 applications, and the number of data packets of the first application, the data packets of the second application and the data packets of the third application are all 25, the first device obtains the first Two-objective model.
  • the server sends the information for instructing the acquisition of the second target model to the first device, the first device receives the information from the server for instructing the acquisition of the second target model, and acquires the first device.
  • Two-objective model when the trigger condition is satisfied, the server sends the information of the first initial model and the list of second applications included in the second application set to the first device, and the first device receives the information of the first initial model and The second application list is obtained, and the second target model is obtained, wherein the information of the first initial model and the introduction of the list of the second application can be referred to the following description in the method shown in FIG. 7 .
  • the server when the trigger condition is satisfied, the server will send the above-mentioned indication information, or the information of the first initial model and the list of the second application to the first device. After receiving the above-mentioned information, the first device will obtain the second target model.
  • the above triggering conditions may be set by the administrator, or may be set by the server as required.
  • the server may instruct the first device to acquire the second target model after monitoring that the trigger condition is satisfied.
  • the administrator may instruct the first device to acquire the second target model. It should be understood that during the operation of the first device, the administrator or the server may reset the trigger condition as required.
  • the second target model is used to extract the second feature information of the second data packet, and determine the second application in the second application set corresponding to the second data packet.
  • the second characteristic information includes characteristic information of the second data packet.
  • the second feature information includes a keyword of an application to which the second data packet belongs. It should be understood that the second data packet is generated by the second application in the second application set.
  • the second application set includes and Packet 1 is The generated packet, packet 2 is Taking the generated data packet as an example, the second characteristic information corresponding to the data packet 1 includes iQIYI, and the second characteristic information corresponding to the data packet 2 includes Tencent.
  • each data packet generated by the second application corresponds to the second feature information.
  • the second feature information corresponding to the data packets of the same application may be the same or different.
  • the second target model includes a second target feature extractor and a second target classifier.
  • the second target feature extractor is the same as the first target feature extractor, and can be used to extract the feature information of the data packet, for example, can be used to extract the second feature information of the second data packet.
  • the second target classifier is configured to determine the second application in the second application set corresponding to the second data packet.
  • the second target model may be as shown in FIG. 4B .
  • the second target model 404 includes a second target feature extractor 405 and a second target classifier 406 .
  • the input of the second target feature extractor 405 is the input of the second target model 404
  • the output of the second target feature extractor 405 is the input of the second target classifier 406,
  • the output of the second target classifier 406 is the second target model 404 output.
  • the second object classifier 406 has m output ports, and each output port corresponds to one application in the second set of applications. m is the number of applications in the second application set. It can be understood that, among the m output ports, the application corresponding to the port with the highest output value may be determined as the application corresponding to the data packet input to the second target model 404 .
  • the second application set includes and Packet 1 is The generated packet, packet 2 is Taking the generated data packet as an example, if the second target model is shown in FIG. 4B , the value of m is 2. Assume that port 1 corresponds to Port 2 corresponds Then the data packet 1 obtains iQIYI through the second target feature extractor 405, and the iQIYI is input to the second target classifier 406, and it can be obtained that the output value of port 1 is greater than the output value of port 2, that is, the corresponding application of data packet 1 is Similarly, packet 2 obtains Tencent through the second target feature extractor 405, and input Tencent into the second target classifier 406, it can be obtained that the output value of port 2 is greater than the output value of port 1, that is, the application corresponding to packet 2 is
  • a possible implementation manner, where the first device acquires the second target model includes: the first device receives the information of the first initial model from the server and the list of second applications included in the second application set; The marked data packets of the second application obtained by the device train the first initial model to obtain the first intermediate model; the first device sends the information of the first intermediate model to the server; the first device receives the information of the second target model from the server ; The first device obtains the second target model according to the information of the second target model and the first initial model.
  • the specific process of acquiring the second target model by the first device will be described in the method shown in FIG. 7 below.
  • the first device will acquire the second target model. That is, before step 303, or after step 303, the first device may acquire the second target model multiple times. The difference is that the applications in the second application set corresponding to the second target model acquired each time are different.
  • the second set of applications includes applications installed on the server, the first device or other devices after the first device acquires the target model last time.
  • the first device obtains the second target model three times as an example
  • the second application set corresponding to the second target model obtained for the first time includes the installation of the first device after obtaining the first target model.
  • the second set of applications corresponding to the second target model acquired for the second time includes applications installed on the server, the first device, or other devices after the first device acquires the second target model for the first time.
  • the second application set corresponding to the second target model acquired for the third time includes applications installed on the server, the first device or other devices after the first device acquires the second target model for the second time.
  • Step 303 The first device acquires the third data packet, and determines the first application or the second application corresponding to the third data packet according to the first target model and the second target model.
  • the first device determines the first application or the second application corresponding to the third data packet according to the first target model and the second target model, including: the first device obtains the third data packet according to the first target model. The first output entropy of the data packet; the first device obtains the second output entropy of the third data packet according to the second target model; The application predicted by the target model is determined as the application corresponding to the third data packet. In this way, the first device can identify the data packet generated by the first application or identify the data packet generated by the second application according to the first target model and the second target model.
  • the first output entropy is used to indicate the probability that the application corresponding to the third data packet is the application predicted by the first target model.
  • the second output entropy is used to indicate the probability that the application corresponding to the third data packet is the application predicted by the second target model.
  • the first output entropy satisfies the following formula: Wherein, H 1 (p 1 ) is the first output entropy. n is the number of output ports of the first target classifier. p 1 (i) is the probability that the application corresponding to the data packet input to the first target model is the application corresponding to the ith port.
  • the second output entropy satisfies the following formula: Wherein, H 2 (p 2 ) is the second output entropy. m is the number of output ports of the second target classifier. p 2 (i) is the probability that the application corresponding to the data packet input to the second target model is the application corresponding to the ith port.
  • the application corresponding to the first target model prediction data package 1 is The application corresponding to the second target model prediction data package 1 is: For example, if the value of the first output entropy is 20 and the value of the second output entropy is 85, the first device determines that the application corresponding to the third data packet is If the value of the first output entropy is 90 and the value of the second output entropy is 15, the first device determines that the application corresponding to the third data packet is
  • the first device determines the first application or the first application corresponding to the third data packet according to the first target model and the second target model acquired multiple times. Second application.
  • the first device determines the first application or the second application corresponding to the third data packet according to the first target model and the second target model obtained multiple times, including: the first device obtains the third data packet according to the first target model. The first output entropy of the data packet; the first device obtains the second output entropy of the third data packet corresponding to each second target model according to the second target model obtained multiple times; the first device combines the first output entropy and the obtained In the obtained second output entropy, the application predicted by the target model corresponding to the output entropy with a low value is determined as the application corresponding to the third data packet.
  • the first device retrains the fourth target model for identifying the data packets of the first application and the data packets of the second application.
  • the indication information is used to instruct the first device to retrain the fourth target model for identifying the data packets of the first application and the data packets of the second application.
  • the fourth target model is obtained by training according to the marked data packets of the first application and the marked data packets of the second application. For the process of the first device retraining the fourth target model for identifying the data packets of the first application and the data packets of the second application, reference may be made to the process of acquiring the first target model by the first device in the foregoing step 301 .
  • the fourth target model is obtained by training according to the marked data packets of the first application and the marked data packets of the second application, and when the first device identifies the data packets according to the first target model and the second target model, is the result inferred from the output entropy. Therefore, the correct rate of identifying the data packet by the fourth target model is greater than the correct rate of the first device identifying the data packet according to the first target model and the second target model.
  • the above-mentioned indication information may be sent by the administrator triggering the server, or it may be sent to the first device when the server detects that the correct rate of the application corresponding to the third data packet determined by the first device is less than or equal to the third threshold. sent by the device.
  • the first device when a new application appears after using the first target model (the new application is the application in the second application set), the first device does not need to use the marked first application Model training is performed on the set and the data packets of the applications in the second application set to obtain a model that can identify both the data packets of the applications in the first application set and the data packets of the applications in the second application set.
  • the first device can perform model training according to the marked data packets of the second application to obtain a second target model, and subsequently, identify the data packets of the applications in the first application set according to the first target model and the second target model, or data packets of applications in the second application set.
  • the calculation of the first device The volume is small and the training time is short.
  • the first device uses the marked data packet of the second application for model training, so the marked first application can be released. data packets, reducing the cost of data storage.
  • step 301 may include steps 3011 to 3015 .
  • Step 3011 The first device receives the information of the third initial model and the list of the first applications from the server.
  • the information of the third initial model is used to indicate the third initial model.
  • the third initial model is determined according to the number of applications in the first application set. That is, the third initial model is an initialized model obtained according to the number of applications in the first application set.
  • the third initial model includes a third initial feature extractor and a third initial classifier.
  • the third initial feature extractor can be updated to the first target feature extractor after training, and the third initial classifier can be updated to the first target classifier after model training.
  • the third initial model may be as shown in FIG. 6A .
  • the third initial model 601 includes a third initial feature extractor 602 and a third initial classifier 603 .
  • the input of the third initial feature extractor 602 is the input of the third initial model 601
  • the output of the third initial feature extractor 602 is the input of the third initial classifier 603
  • the output of the third initial classifier 603 is the third initial model 601 output.
  • the third initial classifier 603 has n output ports, and each output port corresponds to one application in the first application set. n is the number of applications in the first application set.
  • the information of the third initial model includes structural information of the third initial model and parameter information of the third initial model.
  • the structure information of the third initial model is used to indicate the structure of the third initial model, for example, the structure information of the third initial model is used to indicate that the third initial model includes a third initial feature extractor and a third initial classifier.
  • the parameter information of the third initial model is used to indicate parameters of the third initial model, for example, parameters of the third initial feature extractor and parameters of the third initial classifier.
  • the list of the first applications is used to indicate the correspondence between the first application in the first application set and the output end of the third initial model.
  • the correspondence between the first application in the first application set and the output end of the third initial model may be as shown in Table 1.
  • the port corresponding to application 1 is port 1
  • the port corresponding to application 2 is port 2
  • ... the port corresponding to application n-1
  • the port corresponding to application n is port n.
  • the first application in the first application set The output of the third initial model Application 1 port 1 Application 2 port 2 ... ... apply n-1 port n-1 application n port n
  • Step 3012 The first device trains a third initial model according to the marked data packets of the first application obtained by the first device, and obtains a third intermediate model.
  • the marked data packet of the first application obtained by the first device may be marked manually or marked by a machine.
  • the data packet may be marked by the administrator of the first device, or may be marked by the administrator of the server. If the data packet is marked by the administrator of the server, the first device can obtain the data packet of the first application, send the data packet of the first application to the server, and receive the marked data packet of the first application from the server. The data packet of the first application may be received by the first device, or generated by an application on the first device.
  • the data packet may be labelled by the first device, or may be labelled by the server. If the data packet is marked by the server, the first device may obtain the data packet of the first application, send the data packet of the first application to the server, and receive the marked data packet of the first application from the server.
  • the first device updates the third initial model by means of backpropagation according to the marked data packets of the first application obtained by the first device to obtain the third intermediate model. Further, the loss function used in the process of updating the third initial model by the method of backpropagation by the first device satisfies the following formula:
  • L represents a loss function, and the loss function can be used to calculate the gradient of the parameters of the third initial model.
  • N is the number of marked data packets of the first application obtained by the first device.
  • M is the number of applications in the first application set.
  • pic is the predicted probability that the ith data packet belongs to category c.
  • the first device uses the method of back propagation to update the third initial model, and the specific process of obtaining the third intermediate model can be referred to the explanation in the conventional technology, and will not be repeated.
  • Step 3013 The first device sends the information of the third intermediate model to the server.
  • the information of the third intermediate model includes parameters of the third intermediate model.
  • the parameters of the third intermediate model include gradients of the parameters of the third initial model.
  • Step 3014 The first device receives the information of the first target model from the server.
  • the information of the first target model is obtained by aggregating information from intermediate models of multiple first devices.
  • the information of the first target model is used to indicate parameters of the first target model.
  • the parameters of the first target model include gradients of the updated parameters of the third initial model.
  • Step 3015 The first device obtains the first target model according to the information of the first target model and the third initial model.
  • the first device obtains the first target model according to the information of the first target model and the third initial model, including: the first device obtains according to the parameters of the third initial model and the information of the first target model. Parameters of the first target model; the first device replaces the parameters of the third initial model in the third initial model with parameters of the first target model to obtain the first target model.
  • the above steps 3011 to 3015 are described by taking the example that the first device performs one model training to obtain the first target model as an example.
  • the first device may perform model training multiple times to obtain the first target model. That is, in step 3015, the model obtained by the first device according to the information of the first target model and the third initial model may be an incomplete first target model, that is, the model obtained by the first device may not converge.
  • the first device may train the unfinished first target model according to the marked data packets of the first application obtained by the first device, send the trained gradients to the server, receive the aggregated gradients from the server, and A model is obtained according to the aggregated gradient and the above-mentioned unfinished first target model. If the model converges, the model is the first target model. If the model does not converge, the above process is repeated until the model obtained by the first device converges.
  • a device participating in the model training such as the first device, can receive the information of the third initial model and the list of the first applications from the server, and train the third The initial model is obtained, the third intermediate model is obtained, and the information of the third intermediate model is sent to the server, so that the server aggregates the information of the intermediate models from multiple first devices to obtain the information of the first target model.
  • the first device may receive the information of the first target model from the server, and obtain the first target model according to the information of the first target model and the third initial model. In this way, all devices participating in the model training can obtain a model that can finally recognize the data packet of the first application.
  • the server does not need to perform model training, but delegates the model training process to the equipment participating in the model training.
  • the number is also smaller than the number of labeled data packets used by the server to train the model. For these devices, the amount of computation is not large, and it can also save model training time.
  • step 302 may include steps 3021 to 3025 .
  • Step 3021 The first device receives the information of the first initial model and the list of the second applications from the server.
  • the information of the first initial model is used to indicate the first initial model.
  • the first initial model is determined according to the number of applications in the second application set. That is, the first initial model is an initialized model obtained according to the number of applications in the second application set.
  • the first initial model includes a second target feature extractor and a first initial classifier.
  • the second target feature extractor is a feature extractor that multiplexes the first target feature extractor into the first initial model, and subsequently, the first device may not need to train the feature extractor.
  • the first initial classifier can be updated to the second target classifier after model training.
  • the first initial model may not reuse the first target feature extractor.
  • the first initial model includes the first initial feature extractor and the first initial classifier.
  • the first initial feature extractor is an initialized feature extractor obtained by the first device.
  • the first initial model may be as shown in FIG. 6B .
  • the first initial model 604 includes a second target feature extractor 605 and a first initial classifier 606 .
  • the input of the second target feature extractor 605 is the input of the first initial model 604, the output of the second target feature extractor 605 is the input of the first initial classifier 606, and the output of the first initial classifier 606 is the first initial model 604 output.
  • the first initial classifier 606 has m output ports, and each output port corresponds to an application in the second set of applications. m is the number of applications in the second application set.
  • the information of the first initial model includes structural information of the first initial model and parameter information of the first initial model.
  • the structure information of the first initial model is used to indicate the structure of the first initial model, for example, the structure information of the first initial model is used to indicate that the first initial model includes the second target feature extractor and the first initial classifier.
  • the parameter information of the first initial model is used to indicate parameters of the first initial model, for example, parameters of the second target feature extractor and parameters of the first initial classifier.
  • the list of second applications is used to indicate the correspondence between the second application in the second application set and the output end of the first initial model.
  • the correspondence between the second application in the second application set and the output end of the first initial model may be as shown in Table 2.
  • the port corresponding to application 1 is port 1
  • the port corresponding to application 2 is port 2
  • ... the port corresponding to application m-1
  • the port corresponding to application m is port m.
  • the second application in the second set of applications The output of the first initial model Application 1 port 1 Application 2 port 2 ... ... Apply m-1 port m-1 application m port m
  • Step 3022 The first device trains the first initial model according to the marked data packet of the second application obtained by the first device, to obtain a first intermediate model.
  • the marked data packet of the second application obtained by the first device may be marked manually or marked by a machine.
  • the data packet may be marked by the administrator of the first device, or may be marked by the administrator of the server. If the data packet is marked by the administrator of the server, the first device can obtain the data packet of the second application, send the data packet of the second application to the server, and receive the marked data packet of the second application from the server. The data packet of the second application may be received by the first device, or generated by an application on the first device.
  • the data packet may be labelled by the first device, or may be labelled by the server. If the data packet is marked by the server, the first device may obtain the data packet of the second application, send the data packet of the second application to the server, and receive the marked data packet of the second application from the server.
  • the first device updates the first initial model by means of backpropagation according to the marked data packets of the second application obtained by the first device to obtain the first intermediate model. Further, the loss function used in the process of updating the first initial model by the method of backpropagation by the first device satisfies the following formula:
  • L represents the loss function, and the loss function can be used to calculate the parameters of the first initial classifier.
  • N is the number of marked data packets of the second application obtained by the first device.
  • M is the number of applications in the second application set.
  • pic is the predicted probability that the ith data packet belongs to category c.
  • the first device updates the first initial model by the method of back propagation, and the specific process of obtaining the first intermediate model can be referred to the explanation in the conventional technology, and will not be repeated.
  • Step 3023 The first device sends the information of the first intermediate model to the server.
  • the information of the first intermediate model includes parameters of the first intermediate model.
  • the parameters of the first intermediate model include gradients of parameters of the first initial classifier.
  • Step 3024 The first device receives the information of the second target model from the server.
  • the information of the second target model is obtained by aggregating information from intermediate models of multiple first devices.
  • the information of the second target model is used to indicate the parameters of the second target model.
  • the parameters of the second target model include the updated gradients of the parameters of the first initial classifier.
  • Step 3025 The first device obtains the second target model according to the information of the second target model and the first initial model.
  • the first device obtains the second target model according to the information of the second target model and the first initial model, including: the first device obtains the second target model according to the parameters of the first initial classifier and the information of the second target model, Obtain the parameters of the second target classifier; the first device replaces the parameters of the first initial classifier with the parameters of the second target classifier in the first initial model to obtain the second target model.
  • the above steps 3021 to 3025 are described by taking the example that the first device performs one model training to obtain the second target model.
  • the first device may perform model training multiple times to obtain the second target model. That is, in step 3025, the model obtained by the first device according to the information of the second target model and the first initial model may be an unfinished second target model, that is, the model obtained by the first device may not converge.
  • the first device may train the unfinished second target model according to the marked data packets of the second application obtained by the first device, send the trained gradients to the server, receive the aggregated gradients from the server, and A model is obtained based on the aggregated gradient and the above-mentioned unfinished second target model. If the model converges, the model is the second target model. If the model does not converge, the above process is repeated until the model obtained by the first device converges.
  • a device participating in model training such as a first device, can receive information about the first initial model and a list of second applications from the server, and train the first device according to the marked data packets of the second application. From the initial model, the first intermediate model is obtained, and the information of the first intermediate model is sent to the server, so that the server aggregates the information of the intermediate models from multiple first devices to obtain the information of the second target model. Subsequently, the first device may receive the information of the second target model from the server, and obtain the second target model according to the information of the second target model and the first initial model. On the one hand, all devices participating in the model training can obtain a model that can finally recognize the data packets of the second application.
  • the first initial model reuses the first target feature extractor, so when training the model, there is no need to train the feature extractor, which reduces computational overhead.
  • the server does not need to perform model training, but delegates the model training process to the equipment participating in the model training.
  • the number is also smaller than the number of labeled data packets used by the server to train the model. For these devices, the amount of computation is not large, and it can also save model training time.
  • the first device in the case where the first device has acquired the second target model multiple times, when the first device recognizes the third data packet, it needs to acquire the first target model and the plurality of second target models, each of which corresponds to the target model. and then determine the application corresponding to the third data packet according to the obtained multiple output entropies. Therefore, it may take a long time for the first device to identify the third data packet, which affects user experience.
  • the first device can compress the first target model and multiple target models into one target model, and subsequently, identify the third data packet through the compressed target model, which can save the first device from identifying the third data packet time. Specifically, reference may be made to the method shown in FIG. 8 .
  • the method shown in FIG. 3 further includes step 801 and step 802 .
  • Step 801 The first device acquires a second initial model.
  • the second initial model is determined according to the number of applications in the first application set and the number of applications in the second application set. That is, the second initial model is an initialized model obtained according to the number of applications in the first application set and the number of applications in the second application set.
  • the second initial model includes a second initial feature extractor and a second initial classifier.
  • the second initial feature extractor is a feature extractor that multiplexes the first target feature extractor into the second initial model, and subsequently, the first device does not need to train the feature extractor.
  • the second initial classifier is an initialized classifier obtained by the first device.
  • the second initial model may not reuse the first target feature extractor.
  • the feature extractor included in the second initial model is the initialized feature extractor obtained by the first device.
  • the input of the second initial model is the input of the second initial feature extractor
  • the output of the second initial feature extractor is the input of the second initial classifier
  • the output of the second initial classifier is the second initial classifier.
  • the second initial classifier has q output ports, and each output port corresponds to an application in the first application set or the second application set. q is the sum of the number of applications in the first application set and the number of applications in the second application set.
  • the first device creates the second initial model according to the number of applications in the first application set and the number of applications in the second application set.
  • the first device sends the first information to the server, and receives the information of the second initial model from the server.
  • the first information is used to indicate the number of applications in the first application set and the number of applications in the second application set.
  • the information of the second initial model is used to indicate the second initial model.
  • the information of the second initial model includes structural information of the second initial model and parameter information of the second initial model.
  • the structure information of the second initial model is used to indicate that the second initial model includes a second initial feature extractor and a second initial classifier.
  • the parameter information of the second initial model is used to indicate parameters of the second initial model, for example, parameters of the second initial feature extractor and parameters of the second initial classifier.
  • step 801 is performed. where R is an integer greater than 0.
  • Step 802 The first device trains the second initial model to obtain the third target model according to the labeling result of the data packet obtained by the first device by the first target model and the second target model.
  • the labeling result of the first target model and the second target model on the data packet obtained by the first device may be that after the first device obtains the first target model and the second target model, according to the first target model and the second target model The identification result of the data packet. That is, in the process of obtaining the third target model, the first device may use the recognition result obtained by the first device in the process of using the first target model and the second target model to recognize the data packet to train the second initial model. In this way, the first device does not need to store the marked data packets used when acquiring the first target model and the second model, which saves storage overhead.
  • the third target model is used to extract the third feature information, and determine the application corresponding to the data packet corresponding to the third feature information according to the third feature information.
  • the third feature information includes feature information of the data packet corresponding to the third feature information.
  • the third feature information includes a keyword of an application to which the data packet corresponding to the third feature information belongs. It should be understood that the data packet corresponding to the third feature information is the data packet applied in the first application set, or the data packet applied in the second application set.
  • the third target model includes a second initial feature extractor and a third target classifier.
  • the second initial feature extractor is used to extract feature information of the data packet, for example, third feature information.
  • the third target classifier is used to determine the application corresponding to the data packet corresponding to the third feature information.
  • the third target classifier is obtained by training the second initial classifier by the first device.
  • step 3022 for the specific process of training the second initial model to obtain the third target model by the first device according to the labeling results of the data packets obtained by the first device on the basis of the first target model and the second target model, refer to step 3022 above.
  • the process of training the first initial model by the first device according to the marked data packet of the second application obtained by the first device to obtain the first intermediate model will not be repeated.
  • the first device identifies the data packet of the first application or the data packet of the second application according to the third target model.
  • the first device trains the third device according to the marked data packet used when acquiring the first target model and/or the marked data packet used when acquiring the second target model. target model, and obtain the third target model after training.
  • the first device trains the third target model according to the marked data packet used when acquiring the first target model, and/or the marked data packet used when acquiring the second target model, and obtains the trained third target model
  • For the specific process refer to the process of training the first initial model by the first device according to the marked data packet of the second application obtained by the first device in the above step 3022 to obtain the first intermediate model, which will not be repeated.
  • the first device obtains the first target model according to the labeled data packets used, and/ Or, the labeled data packets used when the second target model is acquired and the third target model is trained can improve the accuracy of the model, so that the trained third target model has higher accuracy and more accurate data packet identification.
  • the second initial model can be acquired, and the data packets obtained by the first device can be processed according to the first target model and the second target model. Label the results and train the second initial model to obtain the third target model. Subsequently, the first device can identify the data packet according to the third target model, which can save time for the first device to identify the data packet. In addition, by continuously compressing the model, the first device can stabilize the size of the model, which is beneficial to the deployment of the model in the system-on-chip.
  • FIG. 9 another method for identifying a data packet provided by an embodiment of the present application is applied to a server.
  • the method includes steps 901-904.
  • Step 901 The server obtains information of the first target model.
  • the server may be the server 101 in FIG. 1 .
  • the introduction of the information of the first target model reference may be made to the above-mentioned step 3014 , and the introduction of the first target model may refer to the above-mentioned step 301 .
  • the server acquires the information of the first target model in the case of initialization (for example, the server is powered on for the first time, or the server is restored to factory settings).
  • the server acquiring the information of the first target model includes the following steps A-step E.
  • the following steps are described by taking as an example that the devices determined by the server that need to perform model training are the first device and the second device.
  • the situation in which the server obtains the first target model may refer to the situation that the devices determined by the server to be subjected to model training are the first device and the second device, and details are not repeated. .
  • the first device and the second device may be the devices in FIG. 1 .
  • the second device may be the device 103 or the device 104 in FIG. 1 .
  • the first device is the device 103 in FIG. 1
  • the second device may be the device 102 or the device 104 in FIG. 1 .
  • the first device is the device 104 in FIG. 1
  • the second device may be the device 102 or the device 103 in FIG. 1 .
  • Step A The server sends the information of the third initial model and the list of the first applications included in the first application set to the first device.
  • Step B The server receives the information of the third intermediate model from the first device.
  • Step C The server sends the information of the third initial model and the list of the first applications included in the first application set to the second device.
  • Step D The service receives the information of the fourth intermediate model from the second device.
  • Step E The server aggregates the information of the third intermediate model and the information of the fourth intermediate model to obtain the information of the first target model.
  • the server performs weighted summation of the information of the third intermediate model and the information of the fourth intermediate model to obtain the information of the first target model.
  • the above steps A to E are described by taking the example that the first device and the second device perform one model training, and the server obtains the information of the first target model.
  • the first device and the second device may perform model training multiple times before the server can obtain the information of the first target model. That is, according to the information of the first target model in step E, the obtained model may be an unfinished first target model, that is, according to the information of the first target model in step E, the obtained model may not converge.
  • the server may receive information from the intermediate models of the first device and the second device multiple times, and aggregate the received intermediate models each time to obtain the aggregated information. If the obtained model converges, the model is the first target model. If it does not converge, the above steps are repeated until the obtained model converges.
  • the server may also mark the data packet of the first application.
  • the server may mark the data packet of the first application through the administrator. For example, the server receives the data packet of the first application from the first device; the server obtains the marked data packet of the first application according to the data packet of the first application; the server sends the marked data of the first application to the first device Bag.
  • the server When the server marks the data packet of the first application, the server obtains the marked data packet of the first application according to the data packet of the first application, which includes: the server marks the data packet of the first application, and obtains the marked data packet of the first application. the first application packet.
  • the server When the server marks the data packet of the first application by the administrator, the server obtains the marked data packet of the first application according to the data packet of the first application, including: in response to the input of the administrator, the server receives the marked data packet of the first application. the first application packet.
  • Step 902 The server sends the information of the first target model to the first device.
  • Step 903 In the case that the trigger condition is satisfied, the server obtains the information of the second target model.
  • the server acquiring the information of the second target model includes the following steps a-e.
  • the following steps are described by taking as an example that the devices determined by the server that need to perform model training are the first device and the second device.
  • the information about the second target model obtained by the server may refer to the situation that the devices determined by the server that need model training are the first device and the second device. To repeat.
  • Step a The server sends the information of the first initial model and the list of second applications included in the second application set to the first device.
  • Step b The server receives the information of the first intermediate model from the first device.
  • Step c The server sends the information of the first initial model and the list of second applications included in the second application set to the second device.
  • Step d The service receives the information of the second intermediate model from the second device.
  • Step e The server aggregates the information of the first intermediate model and the information of the second intermediate model to obtain the information of the second target model.
  • the server performs weighted summation of the information of the first intermediate model and the information of the second intermediate model to obtain the information of the second target model.
  • the above steps a to e are described by taking the example that the first device and the second device perform a model training, and the server obtains the information of the second target model as an example.
  • the first device and the second device may perform model training multiple times before the server can obtain the information of the second target model. That is, according to the information of the second target model in step e, the obtained model may be an unfinished second target model, that is, according to the information of the second target model in step e, the obtained model may not converge.
  • the server may receive information from the intermediate models of the first device and the second device multiple times, and aggregate the received intermediate models each time to obtain the aggregated information. If the obtained model converges, the model is the second target model. If it does not converge, the above steps are repeated until the obtained model converges.
  • the server may also mark the data packet of the second application.
  • the server may mark the data packets of the second application through the administrator. For example, the server receives the data packet of the second application from the first device; the server obtains the marked data packet of the second application according to the data packet of the second application; the server sends the marked data of the second application to the first device Bag.
  • the server When the server marks the data packet of the second application, the server obtains the marked data packet of the second application according to the data packet of the second application, which includes: the server marks the data packet of the second application, and obtains the marked data packet of the second application. the data package of the second application.
  • the server When the server marks the data packet of the second application by the administrator, the server obtains the marked data packet of the second application according to the data packet of the second application, including: in response to the administrator's input, the server receives the marked data packet the data package of the second application.
  • Step 904 The server sends the information of the second target model to the first device.
  • the server can monitor the correct rate of the model identification data packet on the first device. If the correct rate of the model identification data packet on the first device is less than or equal to the third threshold, the server sends an indication message to the first device, indicating that The information is used to instruct the first device to retrain a fourth target model for identifying the data packets of the first application and the data packets of the second application.
  • the fourth target model is obtained by training according to the marked data packets of the first application and the marked data packets of the second application.
  • the correct rate of identifying the data packet by the fourth target model is greater than the correct rate of identifying the data packet by the first device according to the first target model and the second target model. In this way, the correct rate of identifying the data packet by the first device can be improved.
  • the server sends indication information to the first device.
  • the server sends the indication information to the first device.
  • the third target model For the introduction of the third target model, reference may be made to the method shown in FIG. 8 above.
  • the server does not need to perform model training, but delegates the model training process to the devices (the first device and the second device) participating in the model training, and the server transfers the information from the intermediate models of multiple devices Aggregation can be performed, which reduces the computing overhead of the server.
  • the number of labeled data packets used by each device participating in model training is also smaller than the number of labeled data packets used by the server when training the model. For these devices, the amount of calculation is not large, and it can save money Model training time.
  • the above-mentioned methods for identifying data packets shown in FIG. 3 , FIG. 5 , FIG. 7 and FIG. 8 are applied to the first device, and the method for identifying data packets shown in FIG. 9 is applied to the server.
  • the method for identifying the data packet provided by the embodiment of the present application is described below from the perspective of the interaction between the first device, the second device and the server.
  • the method for identifying a data packet may include steps 1001 to 1019 .
  • Step 1001 The server sends the information of the third initial model and the list of the first applications included in the first application set to the first device.
  • step 100 For the introduction of step 1001, reference may be made to the description in step A above.
  • the first device receives the information of the third initial model from the server and the list of the first applications included in the first application set.
  • Step 1002 The first device trains a third initial model according to the marked data packets of the first application obtained by the first device, and obtains a third intermediate model.
  • Step 1003 The first device sends the information of the third intermediate model to the server.
  • steps 1002 to 1003 For the introduction of steps 1002 to 1003, reference may be made to the above steps 3012 to 3013.
  • the server receives the information of the third intermediate model from the first device.
  • Step 1004 The server sends the information of the third initial model and the list of the first applications included in the first application set to the second device.
  • step 1004 For the introduction of step 1004, reference may be made to the description in step C above.
  • the second device receives the information of the third initial model and the list of the first applications included in the first application set from the server.
  • Step 1005 The second device trains the third initial model according to the marked data packets of the first application obtained by the second device, and obtains a fourth intermediate model.
  • Step 1006 The second device sends the information of the fourth intermediate model to the server.
  • steps 1005 to 1006 For the introduction of steps 1005 to 1006, reference may be made to the corresponding descriptions in the foregoing steps 3012 to 3013.
  • the server receives the information of the fourth intermediate model from the second device.
  • steps 1001 to 1003 and steps 1004 to 1006 do not limit the execution order of steps 1001 to 1003 and steps 1004 to 1006 .
  • steps 1001 to 1003 may be performed first, and then steps 1004 to 1006 may be performed.
  • steps 1004 to 1006 may also be performed first, and then steps 1001 to 1003 are performed.
  • steps 1004 to 1006 and steps 1001 to 1003 may also be performed simultaneously.
  • Step 1007 The server aggregates the information of the third intermediate model and the information of the fourth intermediate model to obtain the information of the first target model.
  • step 1007 For the description of step 1007, reference may be made to the description of step E above.
  • Step 1008 The server sends the information of the first target model to the first device.
  • the first device receives the information of the first target model from the server.
  • Step 1009 The first device obtains the first target model according to the information of the first target model and the third initial model.
  • step 1009 For the introduction of step 1009, reference may be made to the description in step 3015 above.
  • Step 1010 The server sends the information of the first initial model and the list of second applications included in the second application set to the first device.
  • step 1010 For the introduction of step 1010, reference may be made to the description in step a above.
  • the first device receives information from the server of the first initial model and a list of second applications included in the second application set.
  • Step 1011 The first device trains the first initial model according to the marked data packet of the second application obtained by the first device to obtain a first intermediate model.
  • Step 1012 The first device sends the information of the first intermediate model to the server.
  • steps 1011 to 1012 For the introduction of steps 1011 to 1012, reference may be made to the above steps 3022 to 3023.
  • the server receives the information of the first intermediate model from the first device.
  • Step 1013 The server sends the information of the first initial model and the list of second applications included in the second application set to the second device.
  • step 1013 for the introduction of step 1013, reference may be made to the description in step c above.
  • the second device receives information from the server of the first initial model and a list of second applications included in the second application set.
  • Step 1014 The second device trains the first initial model according to the marked data packet of the second application obtained by the second device, to obtain a second intermediate model.
  • Step 1015 The second device sends the information of the second intermediate model to the server.
  • steps 1014 to 1015 For the introduction of steps 1014 to 1015, reference may be made to the corresponding descriptions in the foregoing steps 3022 to 3023.
  • the server receives the information of the second intermediate model from the second device.
  • steps 1010 to 1012 and steps 1013 to 1015 do not limit the execution order of steps 1010 to 1012 and steps 1013 to 1015 .
  • steps 1010 to 1012 may be performed first, and then steps 1013 to 1015 may be performed.
  • steps 1013 to 1015 may also be performed first, and then steps 1010 to 1012 are performed.
  • steps 1013 to 1015 and steps 1010 to 1012 may be performed simultaneously.
  • Step 1016 The server aggregates the information of the first intermediate model and the information of the second intermediate model to obtain the information of the second target model.
  • step 1016 For the description of step 1016, reference may be made to the description of step e above.
  • Step 1017 The server sends the information of the second target model to the first device.
  • the first device receives the information of the second target model from the server.
  • Step 1018 The first device obtains the second target model according to the information of the second target model and the first initial model.
  • step 1018 For the introduction of step 1018, reference may be made to the description in step 3025 above.
  • Step 1019 The first device acquires the third data packet, and determines the first application or the second application corresponding to the third data packet according to the first target model and the second target model.
  • step 1019 For the introduction of step 1019, reference may be made to the description in step 303 above.
  • the server does not need to perform model training, but delegates the model training process to the devices (the first device and the second device) participating in the model training.
  • the information of the model can be aggregated, which reduces the computing overhead of the server.
  • the first device does not need to use the marked first application set and the second Model training is performed on the data packets of the applications in the application set to obtain a model that can identify both the data packets of the applications in the first application set and the data packets of the applications in the second application set.
  • the first device can perform model training according to the marked data packets of the second application to obtain a second target model, and subsequently, identify the data packets of the applications in the first application set according to the first target model and the second target model, or data packets of applications in the second application set.
  • the number of marked data packets of the second application is much smaller than the number of marked data packets of the first application and the second application, so the calculation amount of the first device is small and the training time is short.
  • the first device uses the data package of the marked second application for model training, so the marked first application can be released. data packets, reducing the cost of data storage.
  • the first device in the case where the first device has acquired the second target model multiple times, when the first device recognizes the third data packet, it needs to acquire the first target model and the plurality of second target models, each of which corresponds to the target model. and then determine the application corresponding to the third data packet according to the obtained multiple output entropies. Therefore, it may take a long time for the first device to identify the third data packet, which affects user experience.
  • the first device can compress the first target model and multiple target models into one target model, and subsequently, identify the third data packet through the compressed target model, which can save the first device from identifying the third data packet time. Specifically, reference may be made to the method shown in FIG. 11 .
  • the method shown in FIG. 10 further includes step 1101 and step 1102 .
  • Step 1101 The first device acquires a second initial model.
  • Step 1102 The first device trains the second initial model to obtain the third target model according to the labeling result of the data packet obtained by the first device by the first target model and the second target model.
  • steps 1101 and 1102 For the introduction of steps 1101 and 1102, reference may be made to the descriptions in steps 801 and 802 above.
  • the second initial model can be acquired, and the data packets obtained by the first device can be processed according to the first target model and the second target model. Label the results and train the second initial model to obtain the third target model. Subsequently, the first device can identify the data packet according to the third target model, which can save time for the first device to identify the data packet. In addition, by continuously compressing the model, the first device can stabilize the size of the model, which is beneficial to the deployment of the model in the system-on-chip.
  • FIG. 12 another method for identifying a data packet provided by an embodiment of the present application.
  • the method includes steps 1201-1203.
  • Step 1201 The first device acquires a first target model.
  • the first apparatus may be the server 101 , the device 102 , the device 103 or the device 104 in FIG. 1 .
  • the first device acquires the first target model when the first device is initialized (for example, the first device is powered on for the first time, or the first device is restored to factory settings).
  • the acquisition of the first target model by the first device includes the following steps 1-3.
  • Step 1 The first device acquires a data packet of the first application in the marked first application set.
  • the data packet of the first application in the marked first application set obtained by the first device may be marked manually or marked by a machine.
  • Step 2 The first device acquires the third initial model and the list of first applications included in the first application set.
  • Step 3 The first device trains the third initial model according to the marked data packets of the first application to obtain the first target model.
  • step 3 For the introduction of step 3, reference may be made to the corresponding description in step 3012 above.
  • Step 1202 In the case that the trigger condition is satisfied, the first device acquires the second target model.
  • the acquisition of the second target model by the first device includes the following steps 4-6.
  • Step 4 The first device acquires the data packet of the second application in the marked second application set.
  • the data packets of the second application in the marked second application set obtained by the first device may be manually marked or machine marked.
  • Step 5 The first device acquires the first initial model and a list of second applications included in the second application set.
  • Step 6 The first device trains the first initial model according to the marked data packets of the second application to obtain the second target model.
  • step 6 For the introduction of step 6, reference may be made to the corresponding description in step 3022 above.
  • the first device will acquire the second target model. That is, before step 1203, or after step 1203, the first device may acquire the second target model for multiple times. The difference is that the applications in the second application set corresponding to the second target model acquired each time are different.
  • the second set of applications includes applications installed on the server, the first device or other devices after the first device acquires the target model last time.
  • Step 1203 The first device acquires the third data packet, and determines the first application or the second application corresponding to the third data packet according to the first target model and the second target model.
  • step 1203 For the introduction of step 1203, reference may be made to the description in step 303 above.
  • the first device when a new application appears after using the first target model (the new application is the application in the second application set), the first device does not need to use the marked first application Model training is performed on the set and the data packets of the applications in the second application set to obtain a model that can identify both the data packets of the applications in the first application set and the data packets of the applications in the second application set.
  • the first device can perform model training according to the marked data packets of the second application to obtain the second target model, and subsequently, identify the data packets of the applications in the first application set according to the first target model and the second target model, or data packets of applications in the second application set.
  • the calculation of the first device The volume is small and the training time is short.
  • the first device uses the data package of the marked second application for model training, so the marked first application can be released. data packets, reducing the cost of data storage.
  • the first device can compress the first target model and multiple target models into one target model, and subsequently, identify the third data packet by using the compressed target model, which can save the first device from identifying the third data packet time. Specifically, reference may be made to the method shown in FIG. 13 .
  • the method shown in FIG. 12 further includes step 1301 and step 1302 .
  • Step 1301 The first device acquires a second initial model.
  • Step 1302 The first device trains the second initial model to obtain the third target model according to the labeling results of the data packets obtained by the first device by the first target model and the second target model.
  • step 1301 and step 1302 For the introduction of step 1301 and step 1302, reference may be made to the description in step 801 and step 802 above.
  • the second initial model can be acquired, and the data packets obtained by the first device can be processed according to the first target model and the second target model. Label the results and train the second initial model to obtain the third target model. Subsequently, the first device can identify the data packet according to the third target model, which can save time for the first device to identify the data packet. In addition, the first device can stabilize the size of the model by continuously compressing the model, which is beneficial to the deployment of the model in the system-on-chip.
  • the above-mentioned first device, server, or first apparatus, etc. include corresponding hardware structures and/or software modules for executing each function.
  • Those skilled in the art should easily realize that the unit and algorithm operations of each example described in conjunction with the embodiments disclosed herein can be implemented in hardware or in the form of a combination of hardware and computer software. Whether a function is performed by hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
  • the first device, the server, or the first device may be divided into functional modules according to the foregoing method examples.
  • each functional module may be divided corresponding to each function, or two or more functions may be integrated into one in the processing module.
  • the above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules. It should be noted that, the division of modules in the embodiments of the present application is schematic, and is only a logical function division, and there may be other division manners in actual implementation.
  • FIG. 14 shows a schematic structural diagram of an apparatus for identifying a data packet.
  • the apparatus may be the first device or a chip or a system-on-chip in the first device, and the apparatus may be used to execute the functions of the first device involved in the foregoing embodiments.
  • the apparatus shown in FIG. 14 includes: an acquisition module 1401 and a determination module 1402 .
  • the obtaining module 1401 is used to obtain the first target model.
  • the first target model is used to extract the first feature information of the first data packet, and determine the first application in the first application set corresponding to the first data packet.
  • the obtaining module 1401 is configured to perform step 301 .
  • the obtaining module 1401 is further configured to obtain the second target model when the trigger condition is satisfied.
  • the second target model is used to extract the second feature information of the second data packet, determine the second application in the second application set corresponding to the second data packet, and the first application and the second application set in the first application set The second application in is different.
  • the obtaining module 1401 is further configured to perform step 302 .
  • the determining module 1402 is further configured to acquire a third data packet, and determine the first application or the second application corresponding to the third data packet according to the first target model and the second target model. Exemplarily, with reference to FIG. 3 , the determination module 1402 is configured to perform step 303 .
  • the acquisition module 1401 is specifically configured to receive the information of the first initial model from the server and the list of second applications included in the second application set, where the first initial model is applied according to the second application set. If the number is determined, the list of second applications is used to indicate the correspondence between the second application in the second application set and the output end of the first initial model; the obtaining module 1401 is also specifically configured to obtain the marked second application obtained by the device.
  • the applied data package trains the first initial model to obtain the first intermediate model; the acquisition module 1401 is also specifically used to send the information of the first intermediate model to the server; the acquisition module 1401 is also specifically used to receive the second target from the server
  • the information of the model, the information of the second target model is obtained by aggregating the information of the intermediate models from a plurality of first devices; the obtaining module 1401 is also specifically used to obtain the information of the second target model and the first initial model according to the information of the second target model and the first initial model. Obtain the second target model.
  • the acquisition module 1401 is also specifically used to acquire the data packet of the second application; the acquisition module 1401 is also specifically used to send the data packet of the second application to the server; the acquisition module 1401 is also specifically used to receive Annotated data packets of the second application from the server.
  • the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold; or, the trigger condition is that the number of data packets applied in the second application set is greater than or equal to the second threshold; Alternatively, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold, and the number of data packets applied in the second application set is greater than or equal to the second threshold.
  • the determination module 1402 is specifically configured to obtain the first output entropy of the third data packet according to the first target model, and the first output entropy is used to indicate that the application corresponding to the third data packet is the first target model The probability of the predicted application; the determination module 1402 is also specifically configured to obtain the second output entropy of the third data packet according to the second target model, and the second output entropy is used to indicate that the application corresponding to the third data packet is the second target model Probability of the predicted application; the determining module 1402 is further specifically configured to determine the application predicted by the target model corresponding to the output entropy with a lower value among the first output entropy and the second output entropy as the application corresponding to the third data packet.
  • the device further includes: a training module; an acquisition module 1401, further configured to acquire a second initial model, where the second initial model is based on the number of applications in the first application set and the number of applications in the second application set The number is determined; the training module is used to label the data packets obtained by the device according to the first target model and the second target model, train the second initial model to obtain the third target model, and the third target model is used to extract the third characteristic information, and the application corresponding to the data packet corresponding to the third characteristic information is determined according to the third characteristic information, the third characteristic information includes characteristic information of the data packet corresponding to the third characteristic information, and the data packet corresponding to the third characteristic information is Data packets of applications in the first application set, or data packets of applications in the second application set.
  • the training module is also used to train the third target according to the marked data packets used when acquiring the first target model, and/or the marked data packets used when acquiring the second target model model to obtain the third target model after training.
  • the apparatus further includes: a receiving module; a receiving module, configured to receive indication information from the server, where the indication information is used to instruct the apparatus to retrain the data packets used to identify the first application and the data packets of the second application the fourth target model.
  • the apparatus is presented in the form of dividing each functional module in an integrated manner.
  • Module herein may refer to a specific ASIC, circuit, processor and memory executing one or more software or firmware programs, integrated logic circuit, and/or other device that may provide the functions described above.
  • the device may take the form shown in FIG. 2 .
  • the processor 201 in FIG. 2 can execute the instructions by calling the computer stored in the memory 203, so that the apparatus executes the data packet identification method in the above method embodiment.
  • the function/implementation process of the acquisition module 1401 and the determination module 1402 in FIG. 14 may be implemented by the processor 201 in FIG. 2 calling the computer-executed instructions stored in the memory 203 .
  • the apparatus provided in this embodiment can perform the above-mentioned data packet identification method, the technical effect that can be obtained can be referred to the above-mentioned method embodiments, which will not be repeated here.
  • FIG. 15 shows a schematic structural diagram of an apparatus for identifying a data packet.
  • the apparatus may be a server or a chip or a system-on-chip in the server, and the apparatus may be used to execute the functions of the server involved in the foregoing embodiments.
  • the apparatus shown in FIG. 15 includes: an acquiring module 1501 and a sending module 1502;
  • the acquiring module 1501 is used for acquiring information of the first target model.
  • the first target model is used to extract the first feature information of the first data packet, and determine the first application in the first application set corresponding to the first data packet.
  • the obtaining module 1501 is configured to perform step 901 .
  • the sending module 1502 is configured to send the information of the first target model to the first device. Exemplarily, with reference to FIG. 9 , the sending module 1502 is configured to perform step 902 .
  • the obtaining module 1501 is further configured to obtain the information of the second target model when the trigger condition is satisfied.
  • the second target model is used to extract the second feature information of the second data packet, determine the second application in the second application set corresponding to the second data packet, and the first application and the second application set in the first application set The second application in is different.
  • the obtaining module 1501 is further configured to perform step 903 .
  • the sending module 1502 is further configured to send the information of the second target model to the first device. Exemplarily, with reference to FIG. 9 , the sending module 1502 is further configured to perform step 904 .
  • the acquisition module 1501 is specifically configured to send the information of the first initial model and the list of the second applications included in the second application set to the first device, where the first initial model is based on the first initial model in the second application set.
  • the number of the second application is determined, and the list of the second application is used to indicate the corresponding relationship between the second application in the second application set and the output end of the first initial model;
  • the obtaining module 1501 is also specifically configured to receive the information from the first device.
  • Information of the first intermediate model, the first intermediate model is obtained by the first device training the first initial model according to the marked data packet of the second application obtained by the first device; the obtaining module 1501 is also specifically used to send the first device to the first device.
  • the second device sends the information of the first initial model and the list of the second application;
  • the obtaining module 1501 is also specifically configured to receive the information of the second intermediate model from the second device, and the second intermediate model is obtained by the second device according to the second device
  • the marked data package of the second application is obtained by training the first initial model;
  • the acquisition module 1501 is also specifically used to aggregate the information of the first intermediate model and the information of the second intermediate model to obtain the second target model Information.
  • the acquisition module 1501 is also specifically used to receive the data packet of the second application from the first device; the acquisition module 1501 is also specifically used to acquire the marked second application according to the data packet of the second application.
  • the data packet of the application; the obtaining module 1501 is further specifically configured to send the marked data packet of the second application to the first device.
  • the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold; or, the trigger condition is that the number of data packets applied in the second application set is greater than or equal to the second threshold; Alternatively, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold, and the number of data packets applied in the second application set is greater than or equal to the second threshold.
  • the sending module 1502 is further configured to send indication information to the first device if the correct rate of the identification data packets of the first target model and the second target model is less than or equal to the third threshold, and the indication information is used to indicate The first device retrains a fourth target model for identifying the data packets of the first application and the data packets of the second application.
  • the apparatus is presented in the form of dividing each functional module in an integrated manner.
  • Module herein may refer to a specific ASIC, circuit, processor and memory executing one or more software or firmware programs, integrated logic circuit, and/or other device that may provide the functions described above.
  • the device may take the form shown in FIG. 2 .
  • the processor 201 in FIG. 2 can execute the instructions by calling the computer stored in the memory 203, so that the apparatus executes the communication method in the above method embodiment.
  • the function/implementation process of the acquiring module 1501 and the sending module 1502 in FIG. 15 may be implemented by the processor 201 in FIG. 2 calling the computer-executed instructions stored in the memory 203 .
  • the function/implementation process of the acquiring module 1501 in FIG. 15 can be implemented by the processor 201 in FIG. 2 calling the computer execution instructions stored in the memory 203, and the function/implementation process of the sending module 1502 in FIG. 2 in the communication interface 204 to achieve.
  • the apparatus provided in this embodiment can perform the above-mentioned data packet identification method, the technical effect that can be obtained can be referred to the above-mentioned method embodiments, which will not be repeated here.
  • FIG. 16 shows a schematic structural diagram of an apparatus for identifying a data packet.
  • the apparatus may be a first apparatus or a chip or a system-on-chip in the first apparatus, and the apparatus may be configured to perform the functions of the first apparatus involved in the foregoing embodiments.
  • the apparatus shown in FIG. 16 includes: an acquisition module 1601 and a determination module 1602 .
  • the obtaining module 1601 is used to obtain the first target model.
  • the first target model is used to extract the first feature information of the first data packet, and determine the first application in the first application set corresponding to the first data packet.
  • the obtaining module 1601 is configured to perform step 1201 .
  • the acquiring module 1601 is further configured to acquire the second target model when the trigger condition is satisfied.
  • the second target model is used to extract the second feature information of the second data packet, determine the second application in the second application set corresponding to the second data packet, and the first application and the second application set in the first application set The second application in is different.
  • the obtaining module 1601 is further configured to perform step 1202 .
  • the determining module 1602 is configured to acquire the third data packet, and determine the first application or the second application corresponding to the third data packet according to the first target model and the second target model. Exemplarily, with reference to FIG. 12 , the determination module 1602 is configured to perform step 1203 .
  • the acquisition module 1601 is specifically used to acquire the data package of the second application in the marked second application set; the acquisition module 1601 is also specifically used to acquire the first initial model and the second application set included.
  • a list of second applications, the first initial model is determined according to the number of applications in the second application set, and the list of second applications is used to indicate the correspondence between the second application in the second application set and the output of the first initial model relationship; the obtaining module 1601 is further specifically configured to train the first initial model according to the marked data package of the second application to obtain the second target model.
  • the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold; or, the trigger condition is that the number of data packets applied in the second application set is greater than or equal to the second threshold; Alternatively, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold, and the number of data packets applied in the second application set is greater than or equal to the second threshold.
  • the determination module 1602 is specifically configured to obtain the first output entropy of the third data packet according to the first target model, and the first output entropy is used to indicate that the application corresponding to the third data packet is the first target model The probability of the predicted application; the determination module 1602 is also specifically configured to obtain the second output entropy of the third data packet according to the second target model, and the second output entropy is used to indicate that the application corresponding to the third data packet is the second target model Probability of the predicted application; the determining module 1602 is further specifically configured to determine, among the first output entropy and the second output entropy, the application predicted by the target model corresponding to the output entropy with a lower value as the application corresponding to the third data packet.
  • the apparatus further includes: a training module; an acquisition module 1601, further configured to acquire a second initial model, where the second initial model is based on the number of applications in the first application set and the number of applications in the second application set The number is determined; the training module is used for the labeling results of the data packets obtained by the first device according to the first target model and the second target model, and trains the second initial model to obtain the third target model.
  • the third target model uses is used to extract the third characteristic information, and determine the application corresponding to the data packet corresponding to the third characteristic information according to the third characteristic information.
  • the third characteristic information includes characteristic information of the data packet corresponding to the third characteristic information, and data corresponding to the third characteristic information.
  • the package is a data package of an application in the first application set, or a data package of an application in the second application set.
  • the training module is also used to train the third target according to the marked data packets used when acquiring the first target model, and/or the marked data packets used when acquiring the second target model
  • the model after getting trained, wants the third target model.
  • the acquisition module 1601 is also used to retrain the data packets used to identify the first application and the first target model if the correct rate of the data packets identified by the first target model and the second target model is less than or equal to the third threshold.
  • the fourth destination model of the packet of the second application is also used to retrain the data packets used to identify the first application and the first target model if the correct rate of the data packets identified by the first target model and the second target model is less than or equal to the third threshold.
  • the fourth destination model of the packet of the second application is also used to retrain the data packets used to identify the first application and the first target model if the correct rate of the data packets identified by the first target model and the second target model is less than or equal to the third threshold.
  • the apparatus is presented in the form of dividing each functional module in an integrated manner.
  • Module herein may refer to a specific ASIC, circuit, processor and memory executing one or more software or firmware programs, integrated logic circuit, and/or other device that may provide the functions described above.
  • the device may take the form shown in FIG. 2 .
  • the processor 201 in FIG. 2 may call the computer to execute the instructions stored in the memory 203, so that the apparatus executes the data packet identification method in the above method embodiment.
  • the function/implementation process of the acquiring module 1601 and the determining module 1602 in FIG. 16 may be implemented by the processor 201 in FIG. 2 calling the computer-executed instructions stored in the memory 203 .
  • the apparatus provided in this embodiment can perform the above-mentioned data packet identification method, the technical effect that can be obtained can be referred to the above-mentioned method embodiments, which will not be repeated here.
  • FIG. 17 is a schematic structural diagram of a chip provided by an embodiment of the present application.
  • Chip 170 includes one or more processors 1701 and interface circuits 1702 .
  • the chip 170 may further include a bus 1703 . in:
  • the processor 1701 may be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above-mentioned method may be completed by an integrated logic circuit of hardware in the processor 1701 or an instruction in the form of software.
  • the aforementioned processor 1701 may be a general purpose processor, a digital communicator (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components .
  • DSP digital communicator
  • ASIC application specific integrated circuit
  • FPGA field programmable gate array
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the interface circuit 1702 is used to transmit or receive data, instructions or information.
  • the processor 1701 can use the data, instructions or other information received by the interface circuit 1702 to perform processing, and can send the processing completion information through the interface circuit 1702 .
  • the chip 170 further includes a memory, which may include a read-only memory and a random access memory, and provides operation instructions and data to the processor.
  • a portion of the memory may also include non-volatile random access memory (NVRAM).
  • NVRAM non-volatile random access memory
  • the memory stores executable software modules or data structures
  • the processor may execute corresponding operations by calling operation instructions stored in the memory (the operation instructions may be stored in the operating system).
  • the chip 170 may be used in a data packet identification apparatus (including a first device, a server, or a first apparatus) involved in the embodiments of the present application.
  • the interface circuit 1702 may be used to output the execution result of the processor 1701 .
  • processor 1701 and the interface circuit 1702 can be implemented by hardware design, software design, or a combination of software and hardware, which is not limited here.
  • FIG. 18 shows a schematic diagram of the composition of a data packet identification system.
  • the data packet identification system 180 may include: a first device 1801 and a server 1802 .
  • FIG. 18 is only an exemplary drawing, and the embodiments of the present application do not limit the devices and the number of devices included in the data packet identification system 180 shown in FIG. 18 .
  • the first device 1801 has the function of the device for identifying the data packet shown in FIG. 14, and is used to obtain the first target model, and when the trigger condition is satisfied, obtain the second target model, and obtain the third data packet, according to The first target model and the second target model determine the first application or the second application corresponding to the third data packet.
  • the server 1802 has the function of the identification device of the data packet shown in FIG. 15, and can be used to obtain the information of the first target model, send the information of the first target model to the first device 1801, obtain the information of the second target model, and send the information of the second target model to the first device 1801.
  • the first device 1802 sends information of the second target model.
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be Incorporation may either be integrated into another device, or some features may be omitted, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place, or may be distributed to multiple different places . Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a readable storage medium.
  • the technical solutions of the embodiments of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, which are stored in a storage medium , including several instructions to make a device (may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk and other mediums that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present application discloses a data packet recognition method and apparatus, which relate to the field of artificial intelligence. In the case where a new application is added, model training may be performed on the basis a data packet generated by the newly added application which is marked, wherein the calculation amount is small, and the training time is short. Said method comprises: acquiring a first target model, the first target model being used to extract first feature information of a first data packet, and determine a first application among a first application set corresponding to the first data packet; when a trigger condition is satisfied, acquiring a second target model, the second target model being used to extract second feature information of a second data packet, and determine a second application among a second application set corresponding to the second data packet; and acquiring a third data packet, and determining, according to the first target model and the second target model, a first application or a second application corresponding to the third data packet.

Description

数据包的识别方法及装置Data packet identification method and device
本申请要求于2020年9月21日提交中国国家知识产权局、申请号为202010998077.8、申请名称为“数据包的识别方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202010998077.8 and the application title "Data Packet Recognition Method and Device", which was submitted to the State Intellectual Property Office of China on September 21, 2020, the entire contents of which are incorporated herein by reference Applying.
技术领域technical field
本申请涉及人工智能领域,尤其涉及数据包的识别方法及装置。The present application relates to the field of artificial intelligence, and in particular, to a method and device for identifying data packets.
背景技术Background technique
随着互联网的高速发展,互联网应用(Application,APP)也越来越多,例如,
Figure PCTCN2021101662-appb-000001
Figure PCTCN2021101662-appb-000002
Figure PCTCN2021101662-appb-000003
等等。这些应用在运行时会生成数据包,不同应用生成的数据包对网络的需求有可能不同。为了实现对不同应用生成的数据包进行差异化管理,首先需要识别每个数据包是哪个应用生成的。
With the rapid development of the Internet, there are more and more Internet applications (Application, APP), for example,
Figure PCTCN2021101662-appb-000001
Figure PCTCN2021101662-appb-000002
and
Figure PCTCN2021101662-appb-000003
etc. These applications generate data packets at runtime, and the data packets generated by different applications may have different network requirements. In order to implement differentiated management of data packets generated by different applications, it is first necessary to identify which application generated each data packet.
目前,能够通过深度学习的方法识别数据包。例如,数据包的识别装置能够通过如下方法识别已存在的应用生成的数据包:数据包的识别装置会获取大量被标注过的数据包,该数据包为已存在的应用生成的数据包;数据包的识别装置会识别每个数据包的特征信息,例如,数据包对应的应用的关键字;数据包的识别装置会根据识别出的每个数据包的特征信息反复训练模型,并通过训练好的模型识别新接收到的已存在的应用生成的数据包。Currently, data packets can be identified through deep learning methods. For example, the data packet identification device can identify data packets generated by existing applications through the following methods: the data packet identification device will obtain a large number of marked data packets, which are data packets generated by existing applications; data packets The packet identification device will identify the characteristic information of each data packet, for example, the keyword of the application corresponding to the data packet; the data packet identification device will repeatedly train the model according to the identified characteristic information of each data packet, and through the training The model identifies newly received packets generated by existing applications.
在互联网的发展过程中,除了已存在的应用之外,还会出现新增应用。在这种情况下,上述数据包的识别装置无法识别新增应用生成的数据包。因此,数据包的识别装置会再次基于大量被标注过的数据包进行模型训练,使得训练后的模型能够识别出已存在的应用生成的数据包和新增应用生成的数据包。这一过程不仅计算量大,而且训练时间长。另外,若新增应用频繁出现,则数据包的识别装置就需要频繁地执行上述过程,数据开销与计算开销较大。In the development process of the Internet, in addition to existing applications, new applications will appear. In this case, the above-mentioned data packet identification device cannot identify the data packet generated by the newly added application. Therefore, the data packet identification device will again perform model training based on a large number of marked data packets, so that the trained model can identify data packets generated by existing applications and data packets generated by new applications. This process is not only computationally intensive, but also takes a long time to train. In addition, if new applications appear frequently, the data packet identification device needs to perform the above process frequently, and the data overhead and calculation overhead are relatively large.
发明内容SUMMARY OF THE INVENTION
本申请提供数据包的识别方法及装置,可以在出现新增应用的情况下,基于被标注过的新增应用生成的数据包进行模型训练,计算量小,并且训练时间短。The present application provides a method and device for identifying a data packet, which can perform model training based on the data packet generated by the marked new application in the case of a new application, with a small amount of calculation and a short training time.
为达到上述目的,本申请的实施例采用如下技术方案:To achieve the above object, the embodiments of the present application adopt the following technical solutions:
第一方面,本申请实施例提供一种数据包的识别方法,该方法包括:第一设备获取第一目标模型,第一目标模型用于提取第一数据包的第一特征信息,确定第一数据包对应的第一应用集合中的第一应用;在满足触发条件的情况下,第一设备获取第二目标模型,第二目标模型用于提取第二数据包的第二特征信息,确定第二数据包对应的第二应用集合中的第二应用,第一应用集合中的第一应用与第二应用集合中的第二应用不同;第一设备获取第三数据包,根据第一目标模型和第二目标模型,确定第三数据包对应的第一应用或第二应用。In a first aspect, an embodiment of the present application provides a method for identifying a data packet. The method includes: a first device obtains a first target model, and the first target model is used to extract first feature information of a first data packet, and determine the first target model. The first application in the first application set corresponding to the data packet; in the case of satisfying the trigger condition, the first device obtains the second target model, and the second target model is used to extract the second feature information of the second data packet, and determine the first The second application in the second application set corresponding to the two data packets, the first application in the first application set is different from the second application in the second application set; the first device acquires the third data packet, according to the first target model and the second target model to determine the first application or the second application corresponding to the third data packet.
上述第一方面提供的方法,在使用第一目标模型后出现新增应用(新增应用即为第二应用集合中的应用)的情况下,第一设备不需要根据被标注过的第一应用的数据包和第二应用的数据包进行模型训练,得到一个既能够识别第一应用集合中的应用的数据包,又能够识别 第二应用集合中的应用的数据包的模型。而第一设备可以根据被标注过的第二应用的数据包进行模型训练,以得到第二目标模型,后续,根据第一目标模型和第二目标模型识别第一应用集合中的应用的数据包,或第二应用集合中的应用的数据包。因为被标注过的第二应用的数据包的数量要远远小于被标注过的第一应用的数据包和第二应用的数据包的数量,所以第一方面提供的方法中,第一设备的计算量小,而且训练时间短。另外,在第一方面提供的方法中,在出现新增应用的情况下,第一设备采用的是被标注过的第二应用的数据包进行模型训练,因此可以释放被标注过的第一应用的数据包,降低了数据存储的成本。In the method provided by the above-mentioned first aspect, when a new application appears after using the first target model (the new application is the application in the second application set), the first device does not need to use the marked first application Perform model training on the data packets of the first application set and the data packets of the second application to obtain a model that can identify both the data packets of the applications in the first application set and the data packets of the applications in the second application set. The first device can perform model training according to the marked data packets of the second application to obtain the second target model, and subsequently, identify the data packets of the applications in the first application set according to the first target model and the second target model , or a data packet of an application in the second application set. Because the number of marked data packets of the second application is much smaller than the number of marked data packets of the first application and the number of data packets of the second application, in the method provided by the first aspect, the first device's The amount of computation is small and the training time is short. In addition, in the method provided in the first aspect, in the case of a newly added application, the first device uses the data package of the marked second application for model training, so the marked first application can be released data packets, reducing the cost of data storage.
一种可能的实现方式,第一设备获取第二目标模型,包括:第一设备接收来自服务器的第一初始模型的信息和第二应用集合包含的第二应用的列表,第一初始模型是根据第二应用集合中应用的个数确定的,第二应用的列表用于指示第二应用集合中的第二应用与第一初始模型的输出端的对应关系;第一设备根据第一设备获得的已标注的第二应用的数据包训练第一初始模型,以得到第一中间模型;第一设备向服务器发送第一中间模型的信息;第一设备接收来自服务器的第二目标模型的信息,第二目标模型的信息是将来自多个第一设备的中间模型的信息进行聚合得到的;第一设备根据第二目标模型的信息和第一初始模型得到第二目标模型。基于上述方法,参与模型训练的设备,例如第一设备,可以接收来自服务器的第一初始模型的信息和第二应用集合包含的第二应用的列表,根据已标注的第二应用的数据包训练第一初始模型,得到第一中间模型,并向服务器发送第一中间模型的信息,以便服务器将来自多个第一设备的中间模型的信息进行聚合,得到第二目标模型的信息。后续,第一设备可以接收来自服务器的第二目标模型的信息,并根据第二目标模型的信息和第一初始模型,得到第二目标模型。一方面,参与模型训练的设备都可以得到最终能够识别第二应用集合中应用的数据包的模型。另一方面,上述方法中,服务器不需要进行模型训练,而是将模型训练的过程下放给参与模型训练的设备,每个参与模型训练的设备在训练模型时使用的已标注数据包的数量也小于服务器训练模型时使用的已标注数据包的数量,对于这些设备来说,计算量也不大,还可以节约模型训练的时间。A possible implementation manner, where the first device acquires the second target model, includes: the first device receives information from the server of the first initial model and a list of second applications included in the second application set, where the first initial model is based on Determined by the number of applications in the second application set, the list of second applications is used to indicate the correspondence between the second application in the second application set and the output end of the first initial model; The marked data packet of the second application trains the first initial model to obtain the first intermediate model; the first device sends the information of the first intermediate model to the server; the first device receives the information of the second target model from the server, the second The information of the target model is obtained by aggregating information from intermediate models of multiple first devices; the first device obtains the second target model according to the information of the second target model and the first initial model. Based on the above method, a device participating in model training, such as a first device, can receive information about the first initial model from the server and a list of second applications included in the second application set, and train according to the marked data packets of the second application For the first initial model, the first intermediate model is obtained, and the information of the first intermediate model is sent to the server, so that the server aggregates the information of the intermediate models from multiple first devices to obtain the information of the second target model. Subsequently, the first device may receive the information of the second target model from the server, and obtain the second target model according to the information of the second target model and the first initial model. On the one hand, all devices participating in the model training can obtain a model that can finally identify the data packets applied in the second application set. On the other hand, in the above method, the server does not need to perform model training, but delegates the model training process to the devices participating in the model training. The number of marked data packets used by each device participating in the model training when training the model is also It is less than the number of marked data packets used by the server to train the model. For these devices, the amount of calculation is not large, and it can also save the time of model training.
一种可能的实现方式,第一设备获取第二目标模型,还包括:第一设备获取第二应用的数据包;第一设备向服务器发送第二应用的数据包;第一设备接收来自服务器的已标注的第二应用的数据包。基于上述方法,第一设备可以将第二应用的数据包发送给服务器,方便服务器对该数据包进行标注。In a possible implementation manner, the first device obtains the second target model, and further includes: the first device obtains the data packet of the second application; the first device sends the data packet of the second application to the server; the first device receives the data packet from the server. Annotated data packets of the second application. Based on the above method, the first device can send the data packet of the second application to the server, so that the server can mark the data packet conveniently.
一种可能的实现方式,触发条件为第二应用集合中应用的个数大于或等于第一阈值;或者,触发条件为第二应用集合中应用的数据包的个数大于或等于第二阈值;或者,触发条件为第二应用集合中应用的个数大于或等于第一阈值,并且第二应用集合中应用的数据包的数量大于或等于第二阈值。基于上述方法,在新增应用的数量达到第一阈值的情况下,或者,在不能识别的数据包的个数大于第二阈值的情况下,或者,在新增应用的数量达到第一阈值,并且不能识别的数据包的个数大于第二阈值的情况下,可以触发第一设备获取第二目标模型。如此,一方面可以避免第一设备频繁获取第二目标模型,导致第一设备的计算开销过大。另一方面可以避免第一设备长时间不获取第二目标模型,导致产生大量的未识别的数据包,影响业务的使用。A possible implementation manner, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold; or, the trigger condition is that the number of data packets applied in the second application set is greater than or equal to the second threshold; Alternatively, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold, and the number of data packets applied in the second application set is greater than or equal to the second threshold. Based on the above method, when the number of newly added applications reaches the first threshold, or when the number of unidentifiable data packets is greater than the second threshold, or when the number of newly added applications reaches the first threshold, And when the number of unidentifiable data packets is greater than the second threshold, the first device may be triggered to acquire the second target model. In this way, on the one hand, it can be avoided that the first device frequently acquires the second target model, resulting in excessive computational overhead of the first device. On the other hand, it can be avoided that the first device does not acquire the second target model for a long time, resulting in the generation of a large number of unidentified data packets, which affects the use of services.
一种可能的实现方式,第一设备根据第一目标模型和第二目标模型,确定第三数据包对应的第一应用或第二应用,包括:第一设备根据第一目标模型,获取第三数据包的第一输出 熵,第一输出熵用于指示第三数据包对应的应用为第一目标模型预测的应用的概率;第一设备根据第二目标模型,获取第三数据包的第二输出熵,第二输出熵用于指示第三数据包对应的应用为第二目标模型预测的应用的概率;第一设备将第一输出熵和第二输出熵中,数值低的输出熵对应的目标模型预测的应用确定为第三数据包对应的应用。基于上述方法,第一设备可以根据第一输出熵和第二输出熵确定第三数据包对应的应用,从而实现了将第一目标模型和第二目标模型结合起来识别应用。如此,在出现新增应用的情况下,第一设备不需要根据被标注过的第一应用的数据包和第二应用的数据包进行模型训练,得到一个既能够识别第一应用集合中的应用的数据包,又能够识别第二应用集合中的应用的数据包的模型。In a possible implementation manner, the first device determines the first application or the second application corresponding to the third data packet according to the first target model and the second target model, including: the first device obtains the third data packet according to the first target model. The first output entropy of the data packet, the first output entropy is used to indicate the probability that the application corresponding to the third data packet is the application predicted by the first target model; the first device obtains the second data packet according to the second target model. The output entropy, the second output entropy is used to indicate the probability that the application corresponding to the third data packet is the application predicted by the second target model; The application predicted by the target model is determined as the application corresponding to the third data packet. Based on the above method, the first device can determine the application corresponding to the third data packet according to the first output entropy and the second output entropy, thereby realizing the combination of the first target model and the second target model to identify the application. In this way, in the case of a newly added application, the first device does not need to perform model training according to the marked data packets of the first application and the data packets of the second application to obtain an application that can both identify the first application set The data packets of the second application set are also capable of identifying the data packet models of the applications in the second application set.
一种可能的实现方式,该方法还包括:第一设备获取第二初始模型,第二初始模型是根据第一应用集合中应用的个数与第二应用集合中应用的个数确定的;第一设备根据第一目标模型和第二目标模型对第一设备获得的数据包的标注结果,训练第二初始模型以得到第三目标模型,第三目标模型用于提取第三特征信息,并根据第三特征信息确定第三特征信息对应的数据包对应的应用,第三特征信息包括第三特征信息对应的数据包的特征信息,第三特征信息对应的数据包为第一应用集合中应用的数据包,或第二应用集合中应用的数据包。基于上述方法,第一设备可以获取第二初始模型,并根据第一目标模型和第二目标模型对第一设备获得的数据包的标注结果,训练第二初始模型以得到第三目标模型。后续,第一设备即可根据第三目标模型识别数据包,可以节约第一设备识别数据包的时间。另外,第一设备通过对模型的不断压缩,可以使得模型尺寸稳定,有利于模型在片上系统部署。A possible implementation manner, the method further includes: the first device obtains a second initial model, and the second initial model is determined according to the number of applications in the first application set and the number of applications in the second application set; A device trains a second initial model to obtain a third target model according to the labeling results of the data packets obtained by the first device based on the first target model and the second target model, and the third target model is used to extract third feature information, and according to The third characteristic information determines the application corresponding to the data packet corresponding to the third characteristic information, the third characteristic information includes characteristic information of the data packet corresponding to the third characteristic information, and the data packet corresponding to the third characteristic information is the application in the first application set The data packet, or the data packet of the application in the second application set. Based on the above method, the first device can obtain the second initial model, and train the second initial model to obtain the third target model according to the first target model and the labeling result of the data packet obtained by the first device by the second target model. Subsequently, the first device can identify the data packet according to the third target model, which can save time for the first device to identify the data packet. In addition, by continuously compressing the model, the first device can stabilize the size of the model, which is beneficial to the deployment of the model in the system-on-chip.
一种可能的实现方式,该方法还包括:第一设备根据获取第一目标模型时使用的已标注的数据包,和/或,获取第二目标模型时使用的已标注的数据包,训练第三目标模型,得到训练后的第三目标模型。基于上述方法,第一设备可以根据获取第一目标模型时使用的已标注的数据包,和/或,获取第二目标模型时使用的已标注的数据包,训练第三目标模型,使得训练后的第三目标模型的精度更高,识别数据包更准确。A possible implementation manner, the method further includes: the first device, according to the marked data packets used when acquiring the first target model, and/or the marked data packets used when acquiring the second target model, train the first device. A three-target model is obtained, and a third target model after training is obtained. Based on the above method, the first device can train the third target model according to the marked data packet used when acquiring the first target model, and/or the marked data packet used when acquiring the second target model, so that after training The accuracy of the third target model is higher and the identification of data packets is more accurate.
一种可能的实现方式,该方法还包括:第一设备接收来自服务器的指示信息,该指示信息用于指示第一设备重新训练用于识别所述第一应用的数据包和所述第二应用的数据包的第四目标模型。基于上述方法,服务器可以指示第一设备重新训练模型,使得训练后的模型可以识别第一应用集合中应用的数据包和第二应用集合中应用的数据包。A possible implementation manner, the method further includes: the first device receives indication information from a server, where the indication information is used to instruct the first device to retrain a data packet for identifying the first application and the second application The fourth destination model of the packet. Based on the above method, the server may instruct the first device to retrain the model, so that the trained model can identify the data packets applied in the first application set and the data packets applied in the second application set.
第二方面,本申请实施例提供一种数据包的识别方法,该方法包括:服务器获取第一目标模型的信息,第一目标模型用于提取第一数据包的第一特征信息,确定第一数据包对应的第一应用集合中的第一应用;服务器向第一设备发送第一目标模型的信息;在满足触发条件的情况下,服务器获取第二目标模型的信息,第二目标模型用于提取第二数据包的第二特征信息,确定第二数据包对应的第二应用集合中的第二应用,第一应用集合中的第一应用与第二应用集合中的第二应用不同;服务器向第一设备发送第二目标模型的信息。In a second aspect, an embodiment of the present application provides a method for identifying a data packet. The method includes: the server obtains information of a first target model, and the first target model is used to extract the first feature information of the first data packet, and determine the first target model. The first application in the first application set corresponding to the data packet; the server sends the information of the first target model to the first device; when the trigger condition is met, the server obtains the information of the second target model, and the second target model is used for extracting the second feature information of the second data packet, and determining the second application in the second application set corresponding to the second data packet, where the first application in the first application set is different from the second application in the second application set; the server Send information of the second target model to the first device.
上述第二方面提供的方法,一方面,服务器不需要进行模型训练,而是将模型训练的过程下放给参与模型训练的设备(第一设备和第二设备),服务器将来自多个设备的中间模型的信息进行聚合即可,降低了服务器的计算开销。另一方面,在使用第一目标模型后出现新增应用的情况下,第一设备不需要根据被标注过的第一应用的数据包和第二应用的数据包进行模型训练,得到一个既能够识别第一应用集合中的应用的数据包,又能够识别第二应用集合中的应用的数据包的模型。第一设备是根据被标注过的第二应用的数据包进行模型训练, 得到第二目标模型,后续,根据第一目标模型和第二目标模型识别第一应用集合中的应用的数据包,或第二应用集合中的应用的数据包。而被标注过的第二应用的数据包的数量要远远小于被标注过的第一应用的数据包和第二应用的数据包的数量,所以第一设备的计算量小,而且训练时间短。另外,在上述第二方面提供的方法中,在出现新增应用的情况下,第一设备采用的是被标注过的第二应用的数据包进行模型训练,因此可以释放被标注过的第一应用的数据包,降低了数据存储的成本。In the method provided by the above second aspect, on the one hand, the server does not need to perform model training, but delegates the model training process to the devices (the first device and the second device) participating in the model training, and the server transfers the data from the middle of multiple devices. The information of the model can be aggregated, which reduces the computing overhead of the server. On the other hand, in the case where a new application appears after using the first target model, the first device does not need to perform model training according to the marked data packets of the first application and the second application, and obtain a model that can both The data packets of the applications in the first application set are identified, and the model of the data packets of the applications in the second application set can be identified. The first device performs model training according to the marked data packets of the second application to obtain a second target model, and subsequently, identifies the data packets of the applications in the first application set according to the first target model and the second target model, or Data packets of applications in the second set of applications. The number of marked data packets of the second application is much smaller than the number of marked data packets of the first application and the second application, so the calculation amount of the first device is small and the training time is short. . In addition, in the method provided in the above second aspect, in the case of a newly added application, the first device uses the data package of the marked second application for model training, so the marked first device can be released. Application data package, reducing the cost of data storage.
一种可能的实现方式,服务器获取第二目标模型的信息,包括:服务器向第一设备发送第一初始模型的信息和第二应用集合包含的第二应用的列表,第一初始模型是根据第二应用集合中应用的个数确定的,第二应用的列表用于指示第二应用集合中的第二应用与第一初始模型的输出端的对应关系;服务器接收来自第一设备的第一中间模型的信息,第一中间模型是第一设备根据第一设备获得的已标注的第二应用的数据包对第一初始模型进行训练得到的;服务器向第二设备发送第一初始模型的信息和第二应用的列表;服务器接收来自第二设备的第二中间模型的信息,第二中间模型是第二设备根据第二设备获得的已标注的第二应用的数据包对第一初始模型进行训练得到的;服务器将第一中间模型的信息和第二中间模型的信息聚合,以得到第二目标模型的信息。基于上述方法,服务器可以向参与模型训练的设备,例如第一设备,发送第一初始模型的信息和第二应用的列表,以便第一设备根据已标注的第二应用的数据包训练第一初始模型,得到第一中间模型,并向服务器发送第一中间模型的信息。服务器接收到来自多个设备的中间模型的信息后,将该多个中间模型的信息进行聚合,得到第二目标模型的信息,并向第一设备发送第二目标模型的信息,以便第一设备根据第二目标模型的信息和第一初始模型,得到第二目标模型。一方面,参与模型训练的设备都可以得到最终能够识别第二应用集合中应用的数据包的模型。另一方面,上述方法中,服务器不需要进行模型训练,而是将模型训练的过程下放给参与模型训练的设备,每个参与模型训练的设备在训练模型时使用的已标注数据包的数量也小于服务器训练模型时使用的已标注数据包的数量,对于这些设备来说,计算量也不大,还可以节约模型训练的时间。A possible implementation manner, the server acquiring the information of the second target model includes: the server sending the information of the first initial model and the list of the second applications included in the second application set to the first device, the first initial model is based on the first initial model. The number of applications in the second application set is determined, and the list of the second application is used to indicate the corresponding relationship between the second application in the second application set and the output end of the first initial model; the server receives the first intermediate model from the first device. information, the first intermediate model is obtained by the first device training the first initial model according to the marked data packets of the second application obtained by the first device; the server sends the information of the first initial model and the first initial model to the second device. 2. A list of applications; the server receives the information of the second intermediate model from the second device, and the second intermediate model is obtained by the second device training the first initial model according to the marked data packets of the second application obtained by the second device ; the server aggregates the information of the first intermediate model and the information of the second intermediate model to obtain the information of the second target model. Based on the above method, the server can send the information of the first initial model and the list of the second application to the device participating in the model training, such as the first device, so that the first device can train the first initial model according to the marked data packets of the second application. model, obtain the first intermediate model, and send the information of the first intermediate model to the server. After receiving the information of the intermediate models from multiple devices, the server aggregates the information of the multiple intermediate models to obtain the information of the second target model, and sends the information of the second target model to the first device so that the first device can According to the information of the second target model and the first initial model, the second target model is obtained. On the one hand, all devices participating in the model training can obtain a model that can finally identify the data packets applied in the second application set. On the other hand, in the above method, the server does not need to perform model training, but delegates the model training process to the devices participating in the model training. The number of marked data packets used by each device participating in the model training when training the model is also It is less than the number of marked data packets used by the server to train the model. For these devices, the amount of calculation is not large, and it can also save the time of model training.
一种可能的实现方式,服务器获取第二目标模型的信息,还包括:服务器接收来自第一设备的第二应用的数据包;服务器根据第二应用的数据包,获取已标注的第二应用的数据包;服务器向第一设备发送已标注的第二应用的数据包。基于上述方法,服务器可以接收来自第一设备的第二应用的数据包,并对该数据包进行标注,以便第一设备根据标注后的数据包进行模型训练。In a possible implementation manner, the server obtains the information of the second target model, and further includes: the server receives the data packet of the second application from the first device; the server obtains the marked data packet of the second application according to the data packet of the second application. data packet; the server sends the marked data packet of the second application to the first device. Based on the above method, the server may receive the data packet of the second application from the first device, and mark the data packet, so that the first device can perform model training according to the marked data packet.
一种可能的实现方式,触发条件为第二应用集合中应用的个数大于或等于第一阈值;或者,触发条件为第二应用集合中应用的数据包的个数大于或等于第二阈值;或者,触发条件为第二应用集合中应用的个数大于或等于第一阈值,并且第二应用集合中应用的数据包的数量大于或等于第二阈值。基于上述方法,在新增应用的数量达到第一阈值的情况下,或者,在不能识别的数据包的个数大于第二阈值的情况下,或者,在新增应用的数量达到第一阈值,并且不能识别的数据包的个数大于第二阈值的情况下,可以触发服务器获取第二目标模型的信息。如此,一方面可以避免服务器频繁获取第二目标模型的信息,导致服务器的计算开销过大。另一方面可以避免服务器长时间不获取第二目标模型的信息,导致产生大量的未识别的数据包,影响业务的使用。A possible implementation manner, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold; or, the trigger condition is that the number of data packets applied in the second application set is greater than or equal to the second threshold; Alternatively, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold, and the number of data packets applied in the second application set is greater than or equal to the second threshold. Based on the above method, when the number of newly added applications reaches the first threshold, or when the number of unidentifiable data packets is greater than the second threshold, or when the number of newly added applications reaches the first threshold, And if the number of unidentifiable data packets is greater than the second threshold, the server may be triggered to acquire information of the second target model. In this way, on the one hand, it can be avoided that the server frequently obtains the information of the second target model, resulting in excessive computing overhead of the server. On the other hand, it can be avoided that the server does not acquire the information of the second target model for a long time, resulting in the generation of a large number of unidentified data packets, which affects the use of services.
一种可能的实现方式,该方法还包括:若第一目标模型和第二目标模型识别数据包的正 确率小于或等于第三阈值,服务器向第一设备发送指示信息,指示信息用于指示第一设备重新训练用于识别所述第一应用的数据包和所述第二应用的数据包的第四目标模型。基于上述方法,在第一目标模型和第二目标模型识别数据包的正确率小于或等于第三阈值的情况下,服务器可以指示第一设备重新训练模型,使得训练后的模型可以识别第一应用的数据包和第二应用的数据包。A possible implementation manner, the method further includes: if the correct rate of identifying the data packets between the first target model and the second target model is less than or equal to a third threshold, the server sends indication information to the first device, and the indication information is used to indicate the first device. A device retrains a fourth target model for identifying packets of the first application and packets of the second application. Based on the above method, when the correct rate of identifying data packets between the first target model and the second target model is less than or equal to the third threshold, the server may instruct the first device to retrain the model, so that the trained model can identify the first application the data packet and the data packet of the second application.
第三方面,本申请实施例提供一种数据包的识别装置,可以实现上述第一方面、或第一方面任一种可能的实现方式中的方法。该装置包括用于执行上述方法的相应的单元或部件。该装置包括的单元可以通过软件和/或硬件方式实现。该装置例如可以为第一设备、或者为可支持第一设备实现上述方法的芯片、芯片系统、或处理器等。In a third aspect, an embodiment of the present application provides an apparatus for identifying a data packet, which can implement the method in the first aspect or any possible implementation manner of the first aspect. The apparatus comprises corresponding units or components for carrying out the above-described method. The units included in the apparatus may be implemented by software and/or hardware. The apparatus may be, for example, a first device, or a chip, a chip system, or a processor that can support the first device to implement the above method.
第四方面,本申请实施例提供一种数据包的识别装置,可以实现上述第二方面、或第二方面任一种可能的实现方式中的方法。该装置包括用于执行上述方法的相应的单元或部件。该装置包括的单元可以通过软件和/或硬件方式实现。该装置例如可以为服务器、或者为可支持服务器实现上述方法的芯片、芯片系统、或处理器等。In a fourth aspect, an embodiment of the present application provides an apparatus for identifying a data packet, which can implement the method in the second aspect or any possible implementation manner of the second aspect. The apparatus comprises corresponding units or components for carrying out the above-described method. The units included in the apparatus may be implemented by software and/or hardware. The apparatus can be, for example, a server, or a chip, a chip system, or a processor that can support the server to implement the above method.
第五方面,本申请实施例提供一种数据包的识别装置,包括:处理器,所述处理器与存储器耦合,所述存储器用于存储程序或指令,当所述程序或指令被所述处理器执行时,使得该装置实现上述第一方面、或第一方面任一种可能的实现方式中所述的方法。In a fifth aspect, an embodiment of the present application provides an apparatus for identifying a data packet, including: a processor, where the processor is coupled to a memory, and the memory is used to store a program or an instruction, when the program or the instruction is processed by the When the device is executed, the device is made to implement the method described in the first aspect or any possible implementation manner of the first aspect.
第六方面,本申请实施例提供一种数据包的识别装置,包括:处理器,所述处理器与存储器耦合,所述存储器用于存储程序或指令,当所述程序或指令被所述处理器执行时,使得该装置实现上述第二方面、或第二方面任一种可能的实现方式中所述的方法。In a sixth aspect, an embodiment of the present application provides an apparatus for identifying a data packet, including: a processor, the processor is coupled to a memory, and the memory is used to store a program or an instruction, when the program or instruction is processed by the When the device is executed, the device is made to implement the method described in the second aspect or any possible implementation manner of the second aspect.
第七方面,本申请实施例提供一种数据包的识别装置,该装置用于实现上述第一方面、或第一方面任一种可能的实现方式中所述的方法。In a seventh aspect, an embodiment of the present application provides an apparatus for identifying a data packet, where the apparatus is configured to implement the method described in the first aspect or any possible implementation manner of the first aspect.
第八方面,本申请实施例提供一种数据包的识别装置,该装置用于实现上述第二方面、或第二方面任一种可能的实现方式中所述的方法。In an eighth aspect, an embodiment of the present application provides an apparatus for identifying a data packet, where the apparatus is configured to implement the method described in the second aspect or any possible implementation manner of the second aspect.
第九方面,本申请实施例提供一种计算机可读介质,其上存储有计算机程序或指令,所述计算机程序或指令被执行时使得计算机执行上述第一方面、或第一方面任一种可能的实现方式中所述的方法。In a ninth aspect, an embodiment of the present application provides a computer-readable medium on which a computer program or instruction is stored, and when the computer program or instruction is executed, enables a computer to perform the above-mentioned first aspect, or any possibility of the first aspect method described in the implementation of .
第十方面,本申请实施例提供一种计算机可读介质,其上存储有计算机程序或指令,所述计算机程序或指令被执行时使得计算机执行上述第二方面、或第二方面任一种可能的实现方式中所述的方法。In a tenth aspect, an embodiment of the present application provides a computer-readable medium on which a computer program or instruction is stored, and when the computer program or instruction is executed, enables a computer to execute the second aspect or any possibility of the second aspect. method described in the implementation of .
第十一方面,本申请实施例提供一种计算机程序产品,其包括计算机程序代码,所述计算机程序代码在计算机上运行时,使得计算机执行上述第一方面、或第一方面任一种可能的实现方式中所述的方法。In an eleventh aspect, an embodiment of the present application provides a computer program product, which includes computer program code, and when the computer program code is run on a computer, enables the computer to execute the above-mentioned first aspect, or any possible possibility of the first aspect. Implement the method described in the method.
第十二方面,本申请实施例提供一种计算机程序产品,其包括计算机程序代码,所述计算机程序代码在计算机上运行时,使得计算机执行上述第二方面、或第二方面任一种可能的实现方式中所述的方法。In a twelfth aspect, an embodiment of the present application provides a computer program product, which includes computer program code, and when the computer program code is run on a computer, enables the computer to execute the second aspect or any of the possibilities of the second aspect. Implement the method described in the method.
第十三方面,本申请实施例提供一种芯片,包括:处理器,所述处理器与存储器耦合,所述存储器用于存储程序或指令,当所述程序或指令被所述处理器执行时,使得该芯片实现上述第一方面、或第一方面任一种可能的实现方式中所述的方法。In a thirteenth aspect, an embodiment of the present application provides a chip, including: a processor, where the processor is coupled to a memory, and the memory is used to store a program or an instruction, and when the program or instruction is executed by the processor , so that the chip implements the method described in the first aspect or any possible implementation manner of the first aspect.
第十四方面,本申请实施例提供一种芯片,包括:处理器,所述处理器与存储器耦合, 所述存储器用于存储程序或指令,当所述程序或指令被所述处理器执行时,使得该芯片实现上述第二方面、或第二方面任一种可能的实现方式中所述的方法。In a fourteenth aspect, an embodiment of the present application provides a chip, including: a processor, where the processor is coupled to a memory, and the memory is used to store programs or instructions, and when the programs or instructions are executed by the processor , so that the chip implements the method described in the second aspect or any possible implementation manner of the second aspect.
第十五方面,本申请实施例提供一种数据包的识别系统。该系统包括上述第三方面所述的装置和/或上述第四方面所述的装置,或者该系统包括上述第五方面所述的装置和/或上述第六方面所述的装置,或者该系统包括上述第七方面所述的装置和/或上述第八方面所述的装置。In a fifteenth aspect, an embodiment of the present application provides a data packet identification system. The system includes the device described in the third aspect and/or the device described in the fourth aspect, or the system includes the device described in the fifth aspect and/or the device described in the sixth aspect, or the system It includes the device of the seventh aspect and/or the device of the eighth aspect.
可以理解的,上述提供的任一种数据包的识别装置、芯片、计算机可读介质、计算机程序产品或数据包的识别系统等均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考对应的方法中的有益效果,此处不再赘述。It can be understood that any identification device, chip, computer readable medium, computer program product or identification system of the data packet provided above are all used to execute the corresponding method provided above. For the beneficial effects that can be achieved, reference may be made to the beneficial effects in the corresponding method, which will not be repeated here.
第十六方面,本申请实施例提供一种数据包的识别方法,该方法包括:获取第一目标模型,第一目标模型用于提取第一数据包的第一特征信息,确定第一数据包对应的第一应用集合中的第一应用;在满足触发条件的情况下,获取第二目标模型,第二目标模型用于提取第二数据包的第二特征信息,确定第二数据包对应的第二应用集合中的第二应用,第一应用集合中的第一应用与第二应用集合中的第二应用不同;获取第三数据包,根据第一目标模型和第二目标模型,确定第三数据包对应的第一应用或第二应用。In a sixteenth aspect, an embodiment of the present application provides a method for identifying a data packet. The method includes: acquiring a first target model, where the first target model is used to extract first feature information of the first data packet, and determine the first data packet. The first application in the corresponding first application set; in the case of satisfying the trigger condition, the second target model is obtained, and the second target model is used to extract the second feature information of the second data packet, and determine the corresponding the second application in the second application set, where the first application in the first application set is different from the second application in the second application set; acquire a third data packet, and determine the first application according to the first target model and the second target model The first application or the second application corresponding to the three data packets.
上述第十六方面提供的方法,在使用第一目标模型后出现新增应用(新增应用即为第二应用集合中的应用)的情况下,第一装置不需要根据被标注过的第一应用的数据包和第二应用的数据包进行模型训练,得到一个既能够识别第一应用集合中的应用的数据包,又能够识别第二应用集合中的应用的数据包的模型。而第一装置可以根据被标注过的第二应用的数据包进行模型训练,以得到第二目标模型,后续,根据第一目标模型和第二目标模型识别第一应用集合中的应用的数据包,或第二应用集合中的应用的数据包。因为被标注过的第二应用应用的数据包的数量要远远小于被标注过的第一应用的数据包和第二应用的数据包的数量,所以第十六方面提供的方法中,第一装置的计算量小,而且训练时间短。另外,在第十六方面提供的方法中,在出现新增应用的情况下,第一装置采用的是被标注过的第二应用的数据包进行模型训练,因此可以释放被标注过的第一应用的数据包,降低了数据存储的成本。In the method provided by the above sixteenth aspect, when a new application appears after using the first target model (the new application is the application in the second application set), the first device does not need to use the marked first target model. Model training is performed on the data packets of the application and the data packets of the second application to obtain a model that can identify both the data packets of the applications in the first application set and the data packets of the applications in the second application set. The first device can perform model training according to the marked data packets of the second application to obtain the second target model, and subsequently, identify the data packets of the applications in the first application set according to the first target model and the second target model , or a data packet of an application in the second application set. Because the number of marked data packets of the second application is much smaller than the marked quantities of the marked data packets of the first application and the second application, in the method provided by the sixteenth aspect, the first The computational complexity of the device is small, and the training time is short. In addition, in the method provided by the sixteenth aspect, in the case of a newly added application, the first device uses the marked data package of the second application to perform model training, so the marked first application can be released. Application data package, reducing the cost of data storage.
一种可能的实现方式,获取第二目标模型,包括:获取已标注的第二应用的数据包;获取第一初始模型和第二应用集合包含的第二应用的列表,第一初始模型是根据第二应用集合中应用的个数确定的,第二应用的列表用于指示第二应用集合中的第二应用与第一初始模型的输出端的对应关系;根据已标注的第二应用的数据包,训练第一初始模型,以得到第二目标模型。基于上述方法,第一装置可以根据已标注的第二应用的数据包,对第一初始模型进行训练,得到第二目标模型,以便第一装置后续根据第一目标模型和第二目标模型确定第三数据包对应的应用。A possible implementation manner, acquiring the second target model includes: acquiring the marked data package of the second application; acquiring the first initial model and a list of the second applications included in the second application set, where the first initial model is based on Determined by the number of applications in the second application set, the list of second applications is used to indicate the correspondence between the second application in the second application set and the output end of the first initial model; according to the marked data packets of the second application , train the first initial model to obtain the second target model. Based on the above method, the first device can train the first initial model according to the marked data package of the second application to obtain the second target model, so that the first device can subsequently determine the first target model according to the first target model and the second target model. The application corresponding to the three data packets.
一种可能的实现方式,触发条件为第二应用集合中应用的个数大于或等于第一阈值;或者,触发条件为第二应用集合中应用的数据包的个数大于或等于第二阈值;或者,触发条件为第二应用集合中应用的个数大于或等于第一阈值,并且第二应用集合中应用的数据包的数量大于或等于第二阈值。基于上述方法,在新增应用的数量达到第一阈值的情况下,或者,在不能识别的数据包的个数大于第二阈值的情况下,或者,在新增应用的数量达到第一阈值,并且不能识别的数据包的个数大于第二阈值的情况下,可以触发第一装置获取第二目标模型。如此,一方面可以避免第一装置频繁获取第二目标模型,导致第一装置的计算开销过大。 另一方面可以避免第一装置长时间不获取第二目标模型,导致产生大量的未识别的数据包,影响业务的使用。A possible implementation manner, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold; or, the trigger condition is that the number of data packets applied in the second application set is greater than or equal to the second threshold; Alternatively, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold, and the number of data packets applied in the second application set is greater than or equal to the second threshold. Based on the above method, when the number of newly added applications reaches the first threshold, or when the number of unidentifiable data packets is greater than the second threshold, or when the number of newly added applications reaches the first threshold, And when the number of unidentifiable data packets is greater than the second threshold, the first device may be triggered to acquire the second target model. In this way, on the one hand, it can be avoided that the first device frequently acquires the second target model, resulting in excessive computational overhead of the first device. On the other hand, it can be avoided that the first device does not acquire the second target model for a long time, resulting in the generation of a large number of unidentified data packets, which affects the use of services.
一种可能的实现方式,根据第一目标模型和第二目标模型,确定第三数据包对应的第一应用或第二应用,包括:根据第一目标模型,获取第三数据包的第一输出熵,第一输出熵用于指示第三数据包对应的应用为第一目标模型预测的应用的概率;根据第二目标模型,获取第三数据包的第二输出熵,第二输出熵用于指示第三数据包对应的应用为第二目标模型预测的应用的概率;将第一输出熵和第二输出熵中,数值低的输出熵对应的目标模型预测的应用确定为第三数据包对应的应用。基于上述方法,第一装置可以根据第一输出熵和第二输出熵确定第三数据包对应的应用,从而实现了将第一目标模型和第二目标模型结合起来识别应用。如此,在出现新增应用的情况下,第一装置不需要根据被标注过的第一应用的数据包和第二应用的数据包进行模型训练,得到一个既能够识别第一应用集合中的应用的数据包,又能够识别第二应用集合中的应用的数据包的模型。A possible implementation manner, determining the first application or the second application corresponding to the third data packet according to the first target model and the second target model includes: obtaining the first output of the third data packet according to the first target model entropy, the first output entropy is used to indicate the probability that the application corresponding to the third data packet is an application predicted by the first target model; according to the second target model, the second output entropy of the third data packet is obtained, and the second output entropy is used for Indicate the probability that the application corresponding to the third data packet is the application predicted by the second target model; in the first output entropy and the second output entropy, the application predicted by the target model corresponding to the output entropy with a low value is determined as the third data packet corresponding to Applications. Based on the above method, the first device can determine the application corresponding to the third data packet according to the first output entropy and the second output entropy, thereby realizing the combination of the first target model and the second target model to identify the application. In this way, in the case of a new application, the first device does not need to perform model training according to the marked data packets of the first application and the data packets of the second application to obtain an application that can both identify the first application set The data packets of the second application set are also capable of identifying the data packet models of the applications in the second application set.
一种可能的实现方式,该方法还包括:获取第二初始模型,第二初始模型是根据第一应用集合中应用的个数与第二应用集合中应用的个数确定的;根据第一目标模型和第二目标模型对第一装置获得的数据包的标注结果,训练第二初始模型以得到第三目标模型,第三目标模型用于提取第三特征信息,并根据第三特征信息确定第三特征信息对应的数据包对应的应用,第三特征信息包括第三特征信息对应的数据包的特征信息,第三特征信息对应的数据包为第一应用集合中应用的数据包,或第二应用集合中应用的数据包。基于上述方法,第一装置可以获取第二初始模型,并根据第一目标模型和第二目标模型对第一装置获得的数据包的标注结果,训练第二初始模型以得到第三目标模型。后续,第一装置即可根据第三目标模型识别数据包,可以节约第一装置识别数据包的时间。另外,第一装置通过对模型的不断压缩,可以使得模型尺寸稳定,有利于模型在片上系统部署。A possible implementation manner, the method further includes: acquiring a second initial model, where the second initial model is determined according to the number of applications in the first application set and the number of applications in the second application set; according to the first target The model and the second target model mark the result of the data packet obtained by the first device, train the second initial model to obtain the third target model, and the third target model is used to extract the third feature information, and determine the third target model according to the third feature information. The application corresponding to the data packet corresponding to the three characteristic information, the third characteristic information includes characteristic information of the data packet corresponding to the third characteristic information, the data packet corresponding to the third characteristic information is the data packet of the application in the first application set, or the second characteristic information A package of apps in the app collection. Based on the above method, the first device can obtain the second initial model, and train the second initial model to obtain the third target model according to the first target model and the labeling result of the data packet obtained by the first device by the second target model. Subsequently, the first device can identify the data packet according to the third target model, which can save time for the first device to identify the data packet. In addition, the first device can stabilize the size of the model by continuously compressing the model, which is beneficial to the deployment of the model in the system-on-chip.
一种可能的实现方式,该方法还包括:根据获取第一目标模型时使用的已标注的数据包,和/或,获取第二目标模型时使用的已标注的数据包,训练第三目标模型,得到训练后的第三目标模型。基于上述方法,第一装置可以根据获取第一目标模型时使用的已标注的数据包,和/或,获取第二目标模型时使用的已标注的数据包,训练第三目标模型,使得训练后的第三目标模型的精度更高,识别数据包更准确。A possible implementation, the method further includes: training the third target model according to the marked data packets used when acquiring the first target model and/or the marked data packets used when acquiring the second target model , to get the third target model after training. Based on the above method, the first device can train the third target model according to the marked data packets used when acquiring the first target model, and/or the marked data packets used when acquiring the second target model, so that after training The accuracy of the third target model is higher and the identification of data packets is more accurate.
一种可能的实现方式,该方法还包括:若第一目标模型和第二目标模型识别数据包的正确率小于或等于第三阈值,重新训练用于识别第一应用的数据包和第二应用的数据包的第四目标模型。基于上述方法,在第一目标模型和第二目标模型识别数据包的正确率小于或等于第三阈值的情况下,第一装置可以重新训练模型,使得训练后的模型可以识别第一应用集合中应用的数据包和第二应用集合中应用的数据包。A possible implementation, the method further includes: if the correct rate of the first target model and the second target model identifying the data packet is less than or equal to a third threshold, retraining the data packet and the second application for identifying the first application. The fourth destination model of the packet. Based on the above method, when the correct rate of identifying data packets between the first target model and the second target model is less than or equal to the third threshold, the first device can retrain the model, so that the trained model can identify the first application set Application data packets and data packets of applications in the second application set.
第十七方面,本申请实施例提供一种数据包的识别装置,该装置包括:获取模块和确定模块;获取模块,用于获取第一目标模型,第一目标模型用于提取第一数据包的第一特征信息,确定第一数据包对应的第一应用集合中的第一应用;获取模块,还用于在满足触发条件的情况下,获取第二目标模型,第二目标模型用于提取第二数据包的第二特征信息,确定第二数据包对应的第二应用集合中的第二应用,第一应用集合中的第一应用与第二应用集合中的第二应用不同;确定模块,用于获取第三数据包,根据第一目标模型和第二目标模型,确定第三数据包对应的第一应用或第二应用。In a seventeenth aspect, an embodiment of the present application provides a data packet identification device, the device includes: an acquisition module and a determination module; the acquisition module is used to acquire a first target model, and the first target model is used to extract the first data packet The first feature information of the first data packet is used to determine the first application in the first application set corresponding to the first data packet; the obtaining module is also used to obtain a second target model when the trigger condition is met, and the second target model is used to extract The second feature information of the second data packet determines the second application in the second application set corresponding to the second data packet, and the first application in the first application set is different from the second application in the second application set; determining module , which is used to obtain the third data packet, and determine the first application or the second application corresponding to the third data packet according to the first target model and the second target model.
一种可能的实现方式,获取模块,具体用于获取已标注的第二应用的数据包;获取模块,还具体用于获取第一初始模型和第二应用集合包含的第二应用的列表,第一初始模型是根据第二应用集合中应用的个数确定的,第二应用的列表用于指示第二应用集合中的第二应用与第一初始模型的输出端的对应关系;获取模块,还具体用于根据已标注的第二应用的数据包,训练第一初始模型,以得到第二目标模型。A possible implementation manner, the acquisition module is specifically used to acquire the marked data package of the second application; the acquisition module is also specifically used to acquire the first initial model and the list of the second applications included in the second application set, the first An initial model is determined according to the number of applications in the second application set, and the list of second applications is used to indicate the corresponding relationship between the second application in the second application set and the output end of the first initial model; the acquiring module, also specifically It is used to train the first initial model according to the marked data packets of the second application, so as to obtain the second target model.
一种可能的实现方式,触发条件为第二应用集合中应用的个数大于或等于第一阈值;或者,触发条件为第二应用集合中应用的数据包的个数大于或等于第二阈值;或者,触发条件为第二应用集合中应用的个数大于或等于第一阈值,并且第二应用集合中应用的数据包的数量大于或等于第二阈值。A possible implementation manner, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold; or, the trigger condition is that the number of data packets applied in the second application set is greater than or equal to the second threshold; Alternatively, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold, and the number of data packets applied in the second application set is greater than or equal to the second threshold.
一种可能的实现方式,确定模块,具体用于根据第一目标模型,获取第三数据包的第一输出熵,第一输出熵用于指示第三数据包对应的应用为第一目标模型预测的应用的概率;确定模块,还具体用于根据第二目标模型,获取第三数据包的第二输出熵,第二输出熵用于指示第三数据包对应的应用为第二目标模型预测的应用的概率;确定模块,还具体用于将第一输出熵和第二输出熵中,数值低的输出熵对应的目标模型预测的应用确定为第三数据包对应的应用。A possible implementation manner, the determination module is specifically used to obtain the first output entropy of the third data packet according to the first target model, and the first output entropy is used to indicate that the application corresponding to the third data packet is predicted by the first target model. The determination module is also specifically used to obtain the second output entropy of the third data packet according to the second target model, and the second output entropy is used to indicate that the application corresponding to the third data packet is predicted by the second target model. The probability of the application; the determining module is further specifically configured to determine the application predicted by the target model corresponding to the output entropy with a lower value among the first output entropy and the second output entropy as the application corresponding to the third data packet.
一种可能的实现方式,该装置还包括:训练模块;获取模块,还用于获取第二初始模型,第二初始模型是根据第一应用集合中应用的个数与第二应用集合中应用的个数确定的;训练模块,用于根据第一目标模型和第二目标模型对第一设备获得的数据包的标注结果,训练第二初始模型以得到第三目标模型,第三目标模型用于提取第三特征信息,并根据第三特征信息确定第三特征信息对应的数据包对应的应用,第三特征信息包括第三特征信息对应的数据包的特征信息,第三特征信息对应的数据包为第一应用集合中应用的数据包,或第二应用集合中应用的数据包。A possible implementation manner, the device further includes: a training module; an acquisition module, further configured to acquire a second initial model, the second initial model is based on the number of applications in the first application set and the number of applications in the second application set The number is determined; the training module is used to train the second initial model to obtain the third target model according to the labeling results of the data packets obtained by the first device by the first target model and the second target model, and the third target model is used for Extract the third feature information, and determine the application corresponding to the data packet corresponding to the third feature information according to the third feature information, the third feature information includes the feature information of the data packet corresponding to the third feature information, and the data packet corresponding to the third feature information. It is a data packet of an application in the first application set, or a data packet of an application in the second application set.
一种可能的实现方式,训练模块,还用于根据获取第一目标模型时使用的已标注的数据包,和/或,获取第二目标模型时使用的已标注的数据包,训练第三目标模型,得到训练后的第三目标模型。A possible implementation, the training module is also used to train the third target according to the marked data packets used when acquiring the first target model, and/or the marked data packets used when acquiring the second target model model to obtain the third target model after training.
一种可能的实现方式,获取模块,还用于若第一目标模型和第二目标模型识别数据包的正确率小于或等于第三阈值,重新训练用于识别第一应用的数据包和第二应用的数据包的第四目标模型。A possible implementation, the acquisition module is also used to retrain the data packets and the second data packets for identifying the first application if the correct rate of the first target model and the second target model to identify the data packets is less than or equal to the third threshold. The fourth destination model of the applied packet.
第十八方面,本申请实施例提供一种数据包的识别装置,包括:处理器,所述处理器与存储器耦合,所述存储器用于存储程序或指令,当所述程序或指令被所述处理器执行时,使得该装置实现上述第十六方面、或第十六方面任一种可能的实现方式中所述的方法。In an eighteenth aspect, an embodiment of the present application provides an apparatus for identifying a data packet, including: a processor, where the processor is coupled to a memory, and the memory is used to store a program or an instruction. When executed by the processor, the apparatus is made to implement the method described in the sixteenth aspect or any possible implementation manner of the sixteenth aspect.
第十九方面,本申请实施例提供一种数据包的识别装置,该装置用于实现上述第十六方面、或第十六方面任一种可能的实现方式中所述的方法。In a nineteenth aspect, an embodiment of the present application provides an apparatus for identifying a data packet, where the apparatus is configured to implement the method described in the sixteenth aspect or any possible implementation manner of the sixteenth aspect.
第二十方面,本申请实施例提供一种计算机可读介质,其上存储有计算机程序或指令,所述计算机程序或指令被执行时使得计算机执行上述第十六方面、或第十六方面任一种可能的实现方式中所述的方法。In a twentieth aspect, embodiments of the present application provide a computer-readable medium on which a computer program or instruction is stored, and when the computer program or instruction is executed, causes a computer to execute the above-mentioned sixteenth aspect, or any of the sixteenth aspect. A possible implementation of the method described in.
第二十一方面,本申请实施例提供一种计算机程序产品,其包括计算机程序代码,所述计算机程序代码在计算机上运行时,使得计算机执行上述第十六方面、或第十六方面任一种可能的实现方式中所述的方法。In a twenty-first aspect, an embodiment of the present application provides a computer program product, which includes computer program code, and when the computer program code runs on a computer, causes the computer to execute the above-mentioned sixteenth aspect or any one of the sixteenth aspects. methods described in possible implementations.
第二十二方面,本申请实施例提供一种芯片,包括:处理器,所述处理器与存储器耦合,所述存储器用于存储程序或指令,当所述程序或指令被所述处理器执行时,使得该芯片实现上述第十六方面、或第十六方面任一种可能的实现方式中所述的方法。In a twenty-second aspect, an embodiment of the present application provides a chip, including: a processor, where the processor is coupled to a memory, and the memory is used to store programs or instructions, and when the programs or instructions are executed by the processor , the chip is made to implement the method described in the sixteenth aspect or any possible implementation manner of the sixteenth aspect.
可以理解的,上述提供的任一种数据包的识别装置、芯片、计算机可读介质或计算机程序产品等均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考对应的方法中的有益效果,此处不再赘述。It can be understood that the identification device, chip, computer readable medium or computer program product of any of the data packets provided above are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can be achieved. Referring to the beneficial effects in the corresponding method, details are not repeated here.
附图说明Description of drawings
图1为本申请实施例提供的数据包的识别系统架构示意图;1 is a schematic diagram of the architecture of a data packet identification system provided by an embodiment of the present application;
图2为本申请实施例提供的识别装置的硬件结构示意图;2 is a schematic diagram of a hardware structure of an identification device provided by an embodiment of the present application;
图3为本申请实施例提供的一种数据包的识别方法的流程示意图;3 is a schematic flowchart of a method for identifying a data packet according to an embodiment of the present application;
图4A为本申请实施例提供的第一目标模型的示意图;4A is a schematic diagram of a first target model provided by an embodiment of the present application;
图4B为本申请实施例提供的第二目标模型的示意图;4B is a schematic diagram of a second target model provided by an embodiment of the present application;
图5为本申请实施例提供的另一种数据包的识别方法的流程示意图;5 is a schematic flowchart of another data packet identification method provided by an embodiment of the present application;
图6A为本申请实施例提供的第三初始模型的示意图;6A is a schematic diagram of a third initial model provided by an embodiment of the present application;
图6B为本申请实施例提供的第一初始模型的示意图;6B is a schematic diagram of a first initial model provided by an embodiment of the present application;
图7为本申请实施例提供的另一种数据包的识别方法的流程示意图;7 is a schematic flowchart of another data packet identification method provided by an embodiment of the present application;
图8为本申请实施例提供的另一种数据包的识别方法的流程示意图;8 is a schematic flowchart of another data packet identification method provided by an embodiment of the present application;
图9为本申请实施例提供的另一种数据包的识别方法的流程示意图;9 is a schematic flowchart of another data packet identification method provided by an embodiment of the present application;
图10为本申请实施例提供的另一种数据包的识别方法的流程示意图;10 is a schematic flowchart of another data packet identification method provided by an embodiment of the present application;
图11为本申请实施例提供的另一种数据包的识别方法的流程示意图;11 is a schematic flowchart of another data packet identification method provided by an embodiment of the present application;
图12为本申请实施例提供的另一种数据包的识别方法的流程示意图;12 is a schematic flowchart of another data packet identification method provided by an embodiment of the present application;
图13为本申请实施例提供的另一种数据包的识别方法的流程示意图;13 is a schematic flowchart of another data packet identification method provided by an embodiment of the present application;
图14为本申请实施例提供的一种数据包的识别装置的结构示意图;14 is a schematic structural diagram of an apparatus for identifying a data packet according to an embodiment of the present application;
图15为本申请实施例提供的另一种数据包的识别装置的结构示意图;15 is a schematic structural diagram of another data packet identification device provided by an embodiment of the application;
图16为本申请实施例提供的另一种数据包的识别装置的结构示意图;16 is a schematic structural diagram of another data packet identification device provided by an embodiment of the application;
图17为本申请实施例提供的一种芯片的结构示意图;17 is a schematic structural diagram of a chip provided by an embodiment of the present application;
图18为本申请实施例提供的一种数据包的识别系统的组成示意图。FIG. 18 is a schematic diagram of the composition of a data packet identification system according to an embodiment of the present application.
具体实施方式detailed description
下面结合附图对本申请实施例的实施方式进行详细描述。The implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
本申请实施例提供的方法可以应用于联邦学习场景,也可以应用于非联邦学习场景。其中,联邦学习是指通过联合不同的参与者(也可以称为数据拥有者,或者客户端)进行机器学习的方法。在联邦学习中,参与者并不需要向其它参与者、管理者或协调者(例如,服务器)暴露自己拥有的数据,因而联邦学习可以很好的保护用户隐私和保障数据安全。而非联邦学习不需要参与者,非联邦学习场景中的设备可以根据该设备获取的数据进行机器学习。下面以联邦学习场景为例,介绍本申请实施例提供的数据包的识别系统。The method provided by the embodiment of the present application can be applied to a federated learning scenario or a non-federated learning scenario. Among them, federated learning refers to the method of machine learning by uniting different participants (also known as data owners, or clients). In federated learning, participants do not need to expose their own data to other participants, managers or coordinators (for example, servers), so federated learning can well protect user privacy and ensure data security. While non-federated learning does not require participants, a device in a non-federated learning scenario can perform machine learning based on the data obtained by the device. The following takes a federated learning scenario as an example to introduce the data packet identification system provided by the embodiment of the present application.
如图1所示,为本申请实施例提供的数据包的识别系统10的架构示意图。图1中,数据包的识别系统10可以包括一个或多个服务器101(仅示出了1个)以及可以与服务器101 进行通信的设备102-设备104。图1仅为示意图,并不构成对本申请提供的技术方案的适用场景的限定。As shown in FIG. 1 , it is a schematic structural diagram of a data packet identification system 10 according to an embodiment of the present application. In FIG. 1 , the data packet identification system 10 may include one or more servers 101 (only one is shown) and devices 102 - 104 that may communicate with the server 101 . FIG. 1 is only a schematic diagram, and does not constitute a limitation on the applicable scenarios of the technical solutions provided in the present application.
在图1中,服务器101可以具备管理者或协调者的功能。也就是说,服务器101可以对一个或多个参与者(例如,设备102、设备103或设备104)进行管理或协调。示例性的,服务器101可以确定需要进行模型训练的设备(以下简称训练设备)。后续,服务器101还可以向每个训练设备发送初始模型的信息,该初始模型的信息用于指示需要训练设备训练的初始模型。服务器101还可以接收来自每个训练设备的中间模型的信息,中间模型的信息用于指示训练设备根据初始模型训练得到的中间模型。后续,服务器101还可以将接收到的中间模型进行聚合得到目标模型的信息,并向每个训练设备发送目标模型的信息,以便每个训练设备根据目标模型的信息得到目标模型,根据目标模型识别数据包。In FIG. 1 , the server 101 may function as a manager or a coordinator. That is, server 101 may manage or coordinate one or more participants (eg, device 102, device 103, or device 104). Exemplarily, the server 101 may determine a device that needs to perform model training (hereinafter referred to as a training device). Subsequently, the server 101 may also send information of the initial model to each training device, where the information of the initial model is used to indicate the initial model that needs to be trained by the training device. The server 101 may also receive information on the intermediate model from each training device, where the information on the intermediate model is used to indicate the intermediate model trained by the training device according to the initial model. Subsequently, the server 101 may further aggregate the received intermediate models to obtain the information of the target model, and send the information of the target model to each training device, so that each training device obtains the target model according to the information of the target model, and identifies the target model according to the information of the target model. data pack.
在图1中,设备102、设备103或设备104可以具备参与者的功能。也就是说,设备102、设备103或设备104可以进行机器学习或者模型训练。示例性的,设备102、设备103或设备104可以接收来自服务器101的初始模型的信息,并根据初始模型训练得到中间模型。后续,设备102、设备103或设备104可以向服务器101发送该中间模型的信息,以便服务器101将设备102、设备103和设备104得到的中间模型进行聚合得到目标模型的信息。设备102、设备103或设备104还可以接收来自服务器101的目标模型的信息。如此,设备102、设备103或设备104即可根据目标模型的信息得到目标模型,根据目标模型识别数据包。In FIG. 1, device 102, device 103, or device 104 may have the function of a participant. That is, device 102, device 103, or device 104 may perform machine learning or model training. Exemplarily, the device 102, the device 103 or the device 104 may receive the information of the initial model from the server 101, and obtain the intermediate model by training according to the initial model. Subsequently, the device 102, the device 103 or the device 104 may send the information of the intermediate model to the server 101, so that the server 101 aggregates the intermediate models obtained by the device 102, the device 103 and the device 104 to obtain the information of the target model. Device 102 , device 103 or device 104 may also receive information from server 101 for the target model. In this way, the device 102, the device 103 or the device 104 can obtain the target model according to the information of the target model, and identify the data packet according to the target model.
图1中的服务器101可以为一种能够为参与者提供计算,或应用等服务的设备。例如,图1中的服务器101可以是网络设备、网络云化引擎(network cloud engine,NCE)或联邦学习服务器(federated learning server,FLS)等。The server 101 in FIG. 1 may be a device capable of providing services such as computing or applications for participants. For example, the server 101 in FIG. 1 may be a network device, a network cloud engine (NCE), a federated learning server (FLS), or the like.
图1中的设备102、设备103或设备104可以为一种能够接收、发送或者生成数据包,并且能够进行机器学习的设备。例如,设备102、设备103或设备104可以为网络设备、终端、光网络设备(optical network terminal,ONT)或联邦学习客户端(federated learning client,FLC)等。The device 102, the device 103 or the device 104 in FIG. 1 may be a device capable of receiving, sending or generating data packets and capable of performing machine learning. For example, the device 102, the device 103, or the device 104 may be a network device, a terminal, an optical network terminal (ONT), a federated learning client (federated learning client, FLC), or the like.
上述网络设备可以是任意一种具有无线收发功能的设备。包括但不限于:长期演进(long term evolution,LTE)系统中的演进型基站(NodeB或eNB或e-NodeB,evolutional Node B),新无线(new radio,NR)系统中的基站(gNodeB或gNB)或收发点(transmission receiving point/transmission reception point,TRP),3GPP后续演进的基站,WiFi系统中的接入节点,无线中继节点,无线回传节点等。The above-mentioned network device may be any device with a wireless transceiver function. Including but not limited to: evolved base station (NodeB or eNB or e-NodeB, evolutional Node B) in long term evolution (long term evolution, LTE) system, base station (gNodeB or gNB) in new radio (new radio, NR) system ) or transmitting and receiving point (transmission receiving point/transmission receiving point, TRP), 3GPP subsequent evolution base station, access node in WiFi system, wireless relay node, wireless backhaul node, etc.
上述终端可以是一种具有无线收发功能的设备。例如,上述终端可以是手机(mobile phone)、平板电脑(Pad)、带无线收发功能的电脑、虚拟现实(virtual reality,VR)终端、增强现实(augmented reality,AR)终端、工业控制(industrial control)中的终端、车载终端、无人驾驶(self driving)中的终端、辅助驾驶中的终端等等。终端有时也可以称为终端设备、用户设备(user equipment,UE)、接入终端、车载终端、工业控制终端、UE单元、UE站、移动站、移动台、远方站、远程终端、移动设备、UE终端设备、无线通信设备、机器终端、UE代理或UE装置等。终端可以是固定的,也可以是移动的。The above-mentioned terminal may be a device with a wireless transceiver function. For example, the above-mentioned terminal may be a mobile phone (mobile phone), a tablet computer (Pad), a computer with a wireless transceiver function, a virtual reality (VR) terminal, an augmented reality (AR) terminal, an industrial control (industrial control) terminal. ), in-vehicle terminals, terminals in self-driving, terminals in assisted driving, etc. A terminal may also sometimes be referred to as terminal equipment, user equipment (UE), access terminal, vehicle-mounted terminal, industrial control terminal, UE unit, UE station, mobile station, mobile station, remote station, remote terminal, mobile equipment, UE terminal equipment, wireless communication equipment, machine terminal, UE proxy or UE device, etc. Terminals can be fixed or mobile.
图1所示的数据包的识别系统10仅用于举例,并非用于限制本申请的技术方案。本领域的技术人员应当明白,在具体实现过程中,数据包的识别系统10还可以包括其他设备,同时也可根据具体需要来确定网络设备和终端的数量,不予限制。The data packet identification system 10 shown in FIG. 1 is only used for example, and is not used to limit the technical solution of the present application. Those skilled in the art should understand that, in the specific implementation process, the data packet identification system 10 may also include other devices, and the number of network devices and terminals may also be determined according to specific needs, which is not limited.
可选的,本申请实施例图1中的各设备,例如服务器101、设备102、设备103或设备104,可以是一个装置内的一个功能模块。可以理解的是,该功能模块既可以是硬件设备中的元件,例如,终端或网络设备中的通信芯片或通信部件,也可以是在硬件上运行的软件功能模块,或者是平台(例如,云平台)上实例化的虚拟化功能。Optionally, each device in FIG. 1 in this embodiment of the present application, for example, the server 101 , the device 102 , the device 103 , or the device 104 , may be a functional module in an apparatus. It can be understood that the functional module can be an element in a hardware device, for example, a communication chip or a communication component in a terminal or a network device, or a software functional module running on hardware, or a platform (for example, a cloud Virtualization functions instantiated on the platform).
例如,图1中的各设备均可以通过图2中的识别装置200来实现。图2所示为可适用于本申请实施例的识别装置的硬件结构示意图。该识别装置200包括至少一个处理器201,通信线路202,存储器203以及至少一个通信接口204。For example, each device in FIG. 1 can be implemented by the identification apparatus 200 in FIG. 2 . FIG. 2 is a schematic diagram of a hardware structure of an identification device applicable to an embodiment of the present application. The identification device 200 includes at least one processor 201 , a communication line 202 , a memory 203 and at least one communication interface 204 .
处理器201可以是一个通用中央处理器(central processing unit,CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。The processor 201 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more processors for controlling the execution of the programs of the present application. integrated circuit.
通信线路202可包括一通路,在上述组件之间传送信息,例如总线。Communication line 202 may include a path, such as a bus, for transferring information between the components described above.
通信接口204,使用任何收发器一类的装置,用于与其他设备或通信网络通信,如以太网接口,无线接入网接口(radio access network,RAN),无线局域网接口(wireless local area networks,WLAN)等。 Communication interface 204, using any transceiver-like device for communicating with other devices or communication networks, such as Ethernet interfaces, radio access network (RAN), wireless local area networks (wireless local area networks, WLAN), etc.
存储器203可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过通信线路202与处理器相连接。存储器也可以和处理器集成在一起。本申请实施例提供的存储器通常可以具有非易失性。其中,存储器203用于存储执行本申请方案所涉及的计算机执行指令,并由处理器201来控制执行。处理器201用于执行存储器203中存储的计算机执行指令,从而实现本申请实施例提供的方法。 Memory 203 may be read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (RAM) or other types of information and instructions It can also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disk storage, CD-ROM storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or capable of carrying or storing desired program code in the form of instructions or data structures and capable of being executed by a computer Access any other medium without limitation. The memory may exist independently and be connected to the processor through the communication line 202 . The memory can also be integrated with the processor. The memory provided by the embodiments of the present application may generally be non-volatile. The memory 203 is used for storing the computer-executed instructions involved in executing the solution of the present application, and the execution is controlled by the processor 201 . The processor 201 is configured to execute the computer-executed instructions stored in the memory 203, thereby implementing the method provided by the embodiments of the present application.
可选的,本申请实施例中的计算机执行指令也可以称之为应用程序代码,本申请实施例对此不作具体限定。Optionally, the computer-executed instructions in the embodiment of the present application may also be referred to as application code, which is not specifically limited in the embodiment of the present application.
在具体实现中,作为一种实施例,处理器201可以包括一个或多个CPU,例如图2中的CPU0和CPU1。In a specific implementation, as an embodiment, the processor 201 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 2 .
在具体实现中,作为一种实施例,识别装置200可以包括多个处理器,例如图2中的处理器201和处理器207。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。In a specific implementation, as an embodiment, the identification device 200 may include multiple processors, for example, the processor 201 and the processor 207 in FIG. 2 . Each of these processors can be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
在具体实现中,作为一种实施例,识别装置200还可以包括输出设备205和输入设备206。输出设备205和处理器201通信,可以以多种方式来显示信息。例如,输出设备205可以是液晶显示器(liquid crystal display,LCD),发光二级管(light emitting diode,LED)显示设备,阴极射线管(cathode ray tube,CRT)显示设备,或投影仪(projector)等。输入设备206和处理器201通信,可以以多种方式接收用户的输入。例如,输入设备206可以是鼠标、键盘、触摸屏设备或传感设备等。In a specific implementation, as an embodiment, the identification apparatus 200 may further include an output device 205 and an input device 206 . The output device 205 is in communication with the processor 201 and can display information in a variety of ways. For example, the output device 205 may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector (projector) Wait. Input device 206 is in communication with processor 201 and can receive user input in a variety of ways. For example, the input device 206 may be a mouse, a keyboard, a touch screen device, a sensor device, or the like.
上述的识别装置200可以是一个通用设备或者是一个专用设备。在具体实现中,识别装置200可以是台式机、便携式电脑、网络服务器、掌上电脑(personal digital assistant,PDA)、移动手机、平板电脑、无线终端设备、嵌入式设备或有图2中类似结构的设备。本申请实施例不限定识别装置200的类型。The above-mentioned identification device 200 may be a general-purpose device or a special-purpose device. In a specific implementation, the identification device 200 may be a desktop computer, a portable computer, a network server, a personal digital assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, an embedded device, or a similar structure in FIG. 2 . equipment. This embodiment of the present application does not limit the type of the identification device 200 .
下面结合图1和图2分别以联邦学习场景和非联邦学习场景为例,对本申请实施例提供的数据包的识别方法进行具体阐述。In the following, a federated learning scenario and a non-federated learning scenario are taken as examples to describe the data packet identification method provided by the embodiment of the present application in detail with reference to FIG. 1 and FIG. 2 .
需要说明的是,本申请下述实施例中各个设备之间的消息名字或消息中各参数的名字等只是一个示例,具体实现中也可以是其他的名字,本申请实施例对此不作具体限定。It should be noted that the names of messages between devices or the names of parameters in the messages in the following embodiments of the present application are just an example, and other names may also be used in specific implementations, which are not specifically limited in the embodiments of the present application. .
需要说明的是,在本申请实施例中,“/”可以表示前后关联的对象是一种“或”的关系,例如,A/B可以表示A或B;“和/或”可以用于描述关联对象存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,其中A,B可以是单数或者复数。It should be noted that, in this embodiment of the present application, "/" may indicate that the related objects are an "or" relationship, for example, A/B may indicate A or B; "and/or" may be used to describe There are three kinds of relationships between related objects, for example, A and/or B, which can be expressed as: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural.
为了便于描述本申请实施例的技术方案,在本申请实施例中,可以采用“第一”、“第二”等字样对功能相同或相似的技术特征进行区分。该“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。在本申请实施例中,“示例性的”或者“例如”等词用于表示例子、例证或说明,被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念,便于理解。In order to facilitate the description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" may be used to distinguish technical features with the same or similar functions. The words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not limit the difference. In the embodiments of the present application, words such as "exemplary" or "for example" are used to represent examples, illustrations or illustrations, and any embodiment or design solution described as "exemplary" or "for example" should not be construed are preferred or advantageous over other embodiments or designs. The use of words such as "exemplary" or "such as" is intended to present the relevant concepts in a specific manner to facilitate understanding.
需要说明的是,在本申请实施例中,对于一种技术特征,通过“第一”、“第二”、“第三”、“第四”、“A”、“B”、“C”和“D”等区分该种技术特征中的技术特征,该“第一”、“第二”、“第三”、“第四”、“A”、“B”、“C”和“D”描述的技术特征间无先后顺序或者大小顺序。It should be noted that, in the embodiments of the present application, for a technical feature, the "first", "second", "third", "fourth", "A", "B", "C" and "D" etc. to distinguish the technical features in this kind of technical features, the "first", "second", "third", "fourth", "A", "B", "C" and "D" "The technical features described are in no order or order of magnitude.
可以理解的,本申请实施例中同一个步骤或者具有相同功能的步骤或者消息在不同实施例之间可以互相参考借鉴。It can be understood that the same step or steps or messages having the same function in the embodiments of the present application may refer to each other for reference between different embodiments.
可以理解的,本申请实施例中,服务器或第一设备可以执行本申请实施例中的部分或全部步骤,这些步骤仅是示例,本申请实施例还可以执行其它步骤或者各种步骤的变形。此外,各个步骤可以按照本申请实施例呈现的不同的顺序来执行,并且有可能并非要执行本申请实施例中的全部步骤。It can be understood that, in the embodiments of the present application, the server or the first device may perform some or all of the steps in the embodiments of the present application. These steps are only examples, and the embodiments of the present application may also perform other steps or variations of various steps. In addition, various steps may be performed in different orders presented in the embodiments of the present application, and it may not be necessary to perform all the steps in the embodiments of the present application.
在本申请实施例中,数据包的识别的执行主体的具体结构,本申请实施例并未特别限定,只要可以通过运行记录有本申请实施例的数据包的识别方法的代码的程序,以根据本申请实施例的数据包的识别方法进行通信即可。例如,本申请实施例提供的数据包的识别方法的执行主体可以是服务器,或者为应用于服务器中的部件,例如,芯片,本申请对此不进行限定。或者,本申请实施例提供的数据包的识别方法的执行主体可以是第一设备,或者为应用于第一设备中的部件,例如,芯片,本申请对此不进行限定。下述实施例以数据包的识别方法的执行主体分别为服务器、第一设备为例进行描述。In the embodiment of the present application, the specific structure of the execution body of the data packet identification is not particularly limited in the embodiment of the present application, as long as the program that records the code of the data packet identification method of the embodiment of the present application can be executed according to the embodiment of the present application. The data packet identification method according to the embodiment of the present application only needs to perform communication. For example, the execution body of the data packet identification method provided in this embodiment of the present application may be a server, or a component applied in the server, such as a chip, which is not limited in this application. Alternatively, the execution body of the data packet identification method provided in this embodiment of the present application may be the first device, or a component applied in the first device, such as a chip, which is not limited in this application. The following embodiments are described by taking an example that the execution bodies of the data packet identification method are the server and the first device respectively.
首先,以联邦学习场景为例介绍本申请实施例提供的数据包的识别方法。具体的,可以参考下述图3、图5、图7-图11所示的方法。First, a federated learning scenario is used as an example to introduce the data packet identification method provided by the embodiment of the present application. Specifically, reference may be made to the methods shown in FIG. 3 , FIG. 5 , and FIGS. 7 to 11 below.
如图3所示,为本申请实施例提供的一种数据包的识别方法,该方法应用于第一设备。该数据包的识别方法包括步骤301-步骤303。As shown in FIG. 3 , a method for identifying a data packet provided in an embodiment of the present application is applied to a first device. The method for identifying the data packet includes steps 301 to 303 .
步骤301:第一设备获取第一目标模型。Step 301: The first device acquires a first target model.
其中,第一设备可以为图1中的设备102、设备103或者设备104。第一设备可以是服务器确定的需要进行模型训练的设备。服务器可以为图1中的服务器101。The first device may be the device 102 , the device 103 or the device 104 in FIG. 1 . The first device may be a device determined by the server that needs to perform model training. The server may be the server 101 in FIG. 1 .
其中,第一目标模型用于提取第一数据包的第一特征信息,确定第一数据包对应的第一应用集合中的第一应用。第一应用集合包括至少一个第一应用。该至少一个第一应用包括已安装在服务器、第一设备或其他设备上的应用。The first target model is used to extract the first feature information of the first data packet, and determine the first application in the first application set corresponding to the first data packet. The first set of applications includes at least one first application. The at least one first application includes applications already installed on the server, the first device, or other devices.
其中,第一特征信息包括第一数据包的特征信息。例如,第一特征信息包括第一数据包所属应用的关键字。应理解,第一数据包是第一应用集合中的第一应用生成的。The first feature information includes feature information of the first data packet. For example, the first feature information includes a keyword of an application to which the first data packet belongs. It should be understood that the first data packet is generated by the first application in the first application set.
示例性的,以第一应用集合包括
Figure PCTCN2021101662-appb-000004
Figure PCTCN2021101662-appb-000005
数据包1为
Figure PCTCN2021101662-appb-000006
生成的数据包,数据包2为
Figure PCTCN2021101662-appb-000007
生成的数据包为例,数据包1对应的第一特征信息包括Wechat,数据包2对应的第一特征信息包括Alipay。
Exemplarily, the first application set includes
Figure PCTCN2021101662-appb-000004
and
Figure PCTCN2021101662-appb-000005
Packet 1 is
Figure PCTCN2021101662-appb-000006
The generated packet, packet 2 is
Figure PCTCN2021101662-appb-000007
Taking the generated data packet as an example, the first characteristic information corresponding to the data packet 1 includes Wechat, and the first characteristic information corresponding to the data packet 2 includes Alipay.
可以理解的,第一应用生成的每个数据包都对应有第一特征信息。同一个应用的数据包对应的第一特征信息可以相同也可以不同。其中,应用的数据包可以理解为应用生成的数据包。It can be understood that each data packet generated by the first application corresponds to the first feature information. The first feature information corresponding to the data packets of the same application may be the same or different. The data packet of the application can be understood as the data packet generated by the application.
一种可能的实现方式,第一目标模型包括第一目标特征提取器和第一目标分类器。其中,第一目标特征提取器用于提取第一数据包的第一特征信息,例如,第一特征信息。第一目标分类器用于确定第一数据包对应的第一应用集合中的第一应用。In a possible implementation manner, the first target model includes a first target feature extractor and a first target classifier. Wherein, the first target feature extractor is used to extract the first feature information of the first data packet, for example, the first feature information. The first target classifier is used to determine the first application in the first application set corresponding to the first data packet.
示例性的,第一目标模型可以如图4A所示。图4A中,第一目标模型401包括第一目标特征提取器402和第一目标分类器403。第一目标特征提取器402的输入为第一目标模型401的输入,第一目标特征提取器402的输出为第一目标分类器403的输入,第一目标分类器403的输出为第一目标模型401的输出。第一目标分类器403有n个输出端口,每个输出端口对应第一应用集合中的一个第一应用。n为第一应用集合中的应用的个数。可以理解的,n个输出端口中,输出值最高的端口对应的应用可以被确定为输入到第一目标模型401的数据包对应的应用。Exemplarily, the first target model may be as shown in FIG. 4A . In FIG. 4A , the first target model 401 includes a first target feature extractor 402 and a first target classifier 403 . The input of the first target feature extractor 402 is the input of the first target model 401, the output of the first target feature extractor 402 is the input of the first target classifier 403, and the output of the first target classifier 403 is the first target model 401 output. The first target classifier 403 has n output ports, and each output port corresponds to a first application in the first application set. n is the number of applications in the first application set. It can be understood that, among the n output ports, the application corresponding to the port with the highest output value may be determined as the application corresponding to the data packet input to the first target model 401 .
示例性的,以第一应用集合包括
Figure PCTCN2021101662-appb-000008
Figure PCTCN2021101662-appb-000009
数据包1是
Figure PCTCN2021101662-appb-000010
生成的数据包,数据包2为
Figure PCTCN2021101662-appb-000011
生成的数据包为例,若第一目标模型如图4A所示,则n的值为2。假设端口1对应
Figure PCTCN2021101662-appb-000012
端口2对应
Figure PCTCN2021101662-appb-000013
则数据包1经过第一目标特征提取器402得到Wechat,将Wechat输入到第一目标分类器403,可以得到端口1的输出值大于端口2的输出值,即数据包1对应的应用是
Figure PCTCN2021101662-appb-000014
同理,数据包2经过第一目标特征提取器402得到Alipay,将Alipay输入到第一目标分类器403,可以得到端口2的输出值大于端口1的输出值,即数据包2对应的应用是
Figure PCTCN2021101662-appb-000015
Exemplarily, the first application set includes
Figure PCTCN2021101662-appb-000008
and
Figure PCTCN2021101662-appb-000009
Packet 1 is
Figure PCTCN2021101662-appb-000010
The generated packet, packet 2 is
Figure PCTCN2021101662-appb-000011
Taking the generated data packet as an example, if the first target model is shown in FIG. 4A , the value of n is 2. Assume that port 1 corresponds to
Figure PCTCN2021101662-appb-000012
Port 2 corresponds
Figure PCTCN2021101662-appb-000013
Then the data packet 1 obtains the Wechat through the first target feature extractor 402, and the Wechat is input to the first target classifier 403, and it can be obtained that the output value of port 1 is greater than the output value of port 2, that is, the application corresponding to the data packet 1 is
Figure PCTCN2021101662-appb-000014
Similarly, data packet 2 obtains Alipay through the first target feature extractor 402, and Alipay is input to the first target classifier 403, and it can be obtained that the output value of port 2 is greater than the output value of port 1, that is, the corresponding application of data packet 2 is
Figure PCTCN2021101662-appb-000015
一种可能的实现方式,第一设备获取第一目标模型,包括:第一设备接收来自服务器的第三初始模型的信息和第一应用集合包含的第一应用的列表;第一设备根据第一设备获得的已标注的第一应用的数据包训练第三初始模型,得到第三中间模型;第一设备向服务器发送第三中间模型的信息;第一设备接收来自服务器的第一目标模型的信息;第一设备根据第一模型的信息和第三初始模型,得到第一目标模型。第一设备获取第一目标模型的具体过程将在下述图5所示的方法中进行阐述。A possible implementation manner, where the first device acquires the first target model, includes: the first device receives the information of the third initial model from the server and the list of the first applications included in the first application set; The marked data packets of the first application obtained by the device train the third initial model to obtain the third intermediate model; the first device sends the information of the third intermediate model to the server; the first device receives the information of the first target model from the server ; The first device obtains the first target model according to the information of the first model and the third initial model. The specific process of acquiring the first target model by the first device will be described in the method shown in FIG. 5 below.
一种可能的实现方式,服务器在初始化(例如,服务器第一次开机,或服务器恢复出厂设置)的情况下,第一设备获取第一目标模型。In a possible implementation manner, when the server is initialized (for example, the server is powered on for the first time, or the server is restored to factory settings), the first device acquires the first target model.
步骤302:在满足触发条件的情况下,第一设备获取第二目标模型。Step 302: In the case that the trigger condition is satisfied, the first device acquires the second target model.
一种可能的实现方式,触发条件为第二应用集合中应用的个数大于或等于第一阈值;或者,触发条件为第二应用集合中应用的数据包的个数大于或等于第二阈值;或者,触发条件为第二应用集合中应用的个数大于或等于第一阈值,并且第二应用集合中应用的数据包的数量大于或等于第二阈值。其中,第一阈值和第二阈值为正整数。A possible implementation manner, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold; or, the trigger condition is that the number of data packets applied in the second application set is greater than or equal to the second threshold; Alternatively, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold, and the number of data packets applied in the second application set is greater than or equal to the second threshold. Wherein, the first threshold and the second threshold are positive integers.
其中,第二应用集合包括至少一个第二应用。该至少一个第二应用包括第一设备获取第一目标模型之后,安装在服务器、第一设备或其他设备上的应用。Wherein, the second application set includes at least one second application. The at least one second application includes an application installed on the server, the first device or other devices after the first device acquires the first target model.
示例性的,以触发条件为第二应用集合中应用的个数大于或等于第一阈值,第一阈值为5为例,若第二应用集合中应用的个数为6,则第一设备获取第二目标模型。若第二应用集合中应用的个数为3,则第一设备不获取第二目标模型。Exemplarily, taking the trigger condition that the number of applications in the second application set is greater than or equal to the first threshold, and the first threshold is 5, as an example, if the number of applications in the second application set is 6, the first device obtains The second target model. If the number of applications in the second application set is 3, the first device does not acquire the second target model.
示例性的,以触发条件为第二应用集合中应用的数据包的个数大于或等于第二阈值,第二阈值为30为例,若第二应用集合包括两个应用,第一个应用的数据包的个数和第二个应用的数据包的个数都为20个,则第一设备获取第二目标模型。若第一个应用的数据包的个数为5个,第二应用的数据包的个数为10个,则第一设备不获取第二目标模型。Exemplarily, taking the trigger condition that the number of data packets applied in the second application set is greater than or equal to the second threshold, and the second threshold is 30, for example, if the second application set includes two applications, the first application If the number of data packets and the number of data packets of the second application are both 20, the first device acquires the second target model. If the number of data packets of the first application is 5 and the number of data packets of the second application is 10, the first device does not acquire the second target model.
示例性的,以触发条件为第二应用集合中应用的个数大于或等于第一阈值,并且第二应用集合中应用的数据包的数量大于或等于第二阈值,第一阈值为3,第二阈值为50为例,若第二应用集合包括两个应用,第一个应用的数据包的个数和第二个应用的数据包的个数都为30个,则第一设备不获取第二目标模型。若第二应用集合包括4个应用,第一个应用的数据包的个数和第二个应用的数据包的个数都为10个,第三个应用和第四个应用的数据包的个数都为5个,则第一设备不获取第二目标模型。若第二应用集合包括3个应用,第一个应用的数据包的个数、第二个应用的数据包和第三个应用的数据包的个数都为25个,则第一设备获取第二目标模型。Exemplarily, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold, and the number of data packets applied in the second application set is greater than or equal to the second threshold, the first threshold is 3, and the first threshold is 3. For example, if the second threshold is 50, if the second application set includes two applications, and the number of data packets of the first application and the number of data packets of the second application are both 30, the first device does not obtain the first application. Two-objective model. If the second application set includes 4 applications, the number of data packets of the first application and the number of data packets of the second application are both 10, and the number of data packets of the third application and the fourth application is 10. If the numbers are all 5, the first device does not acquire the second target model. If the second application set includes 3 applications, and the number of data packets of the first application, the data packets of the second application and the data packets of the third application are all 25, the first device obtains the first Two-objective model.
可以理解的,在满足触发条件的情况下,服务器向第一设备发送用于指示获取第二目标模型的信息,第一设备接收到来自服务器的用于指示获取第二目标模型的信息,获取第二目标模型。或者,在满足触发条件的情况下,服务器向第一设备发送第一初始模型的信息和第二应用集合包含的第二应用的列表,第一设备接收到来自服务器的第一初始模型的信息和第二应用的列表,获取第二目标模型,其中,第一初始模型的信息和第二应用的列表的介绍可以参考下述图7所示方法中所述。也就是说,在触发条件满足的情况下,服务器会向第一设备发送上述指示信息,或者第一初始模型的信息和第二应用的列表,则第一设备接收到上述信息后,获取第二目标模型。It can be understood that when the trigger condition is met, the server sends the information for instructing the acquisition of the second target model to the first device, the first device receives the information from the server for instructing the acquisition of the second target model, and acquires the first device. Two-objective model. Or, when the trigger condition is satisfied, the server sends the information of the first initial model and the list of second applications included in the second application set to the first device, and the first device receives the information of the first initial model and The second application list is obtained, and the second target model is obtained, wherein the information of the first initial model and the introduction of the list of the second application can be referred to the following description in the method shown in FIG. 7 . That is to say, when the trigger condition is satisfied, the server will send the above-mentioned indication information, or the information of the first initial model and the list of the second application to the first device. After receiving the above-mentioned information, the first device will obtain the second target model.
可以理解的,上述触发条件可以是管理员设置的,也可以是服务器根据需要设置的。其中一种情况,服务器监控到触发条件满足,可以指示第一设备获取第二目标模型。其中另一种情况,管理员确定触发第一设备获取第二目标模型的情况下,可以通过服务器指示第一设备获取第二目标模型。应理解,第一设备运行的过程中,管理员或服务器可以根据需要重新设置触发条件。It can be understood that the above triggering conditions may be set by the administrator, or may be set by the server as required. In one case, the server may instruct the first device to acquire the second target model after monitoring that the trigger condition is satisfied. In another case, when the administrator determines to trigger the first device to acquire the second target model, the server may instruct the first device to acquire the second target model. It should be understood that during the operation of the first device, the administrator or the server may reset the trigger condition as required.
其中,第二目标模型用于提取第二数据包的第二特征信息,确定第二数据包对应的第二应用集合中的第二应用。其中,第二特征信息包括第二数据包的特征信息。例如,第二特征信息包括第二数据包所属应用的关键字。应理解,第二数据包是第二应用集合中的第二应用生成的。The second target model is used to extract the second feature information of the second data packet, and determine the second application in the second application set corresponding to the second data packet. Wherein, the second characteristic information includes characteristic information of the second data packet. For example, the second feature information includes a keyword of an application to which the second data packet belongs. It should be understood that the second data packet is generated by the second application in the second application set.
示例性的,以第二应用集合包括
Figure PCTCN2021101662-appb-000016
Figure PCTCN2021101662-appb-000017
数据包1为
Figure PCTCN2021101662-appb-000018
生成的数据包, 数据包2为
Figure PCTCN2021101662-appb-000019
生成的数据包为例,数据包1对应的第二特征信息包括iQIYI,数据包2对应的第二特征信息包括Tencent。
Exemplarily, the second application set includes
Figure PCTCN2021101662-appb-000016
and
Figure PCTCN2021101662-appb-000017
Packet 1 is
Figure PCTCN2021101662-appb-000018
The generated packet, packet 2 is
Figure PCTCN2021101662-appb-000019
Taking the generated data packet as an example, the second characteristic information corresponding to the data packet 1 includes iQIYI, and the second characteristic information corresponding to the data packet 2 includes Tencent.
可以理解的,第二应用生成的每个数据包都对应有第二特征信息。同一个应用的数据包对应的第二特征信息可以相同也可以不同。It can be understood that each data packet generated by the second application corresponds to the second feature information. The second feature information corresponding to the data packets of the same application may be the same or different.
一种可能的实现方式,第二目标模型包括第二目标特征提取器和第二目标分类器。其中,第二目标特征提取器与第一目标特征提取器相同,可以用于提取数据包的特征信息,例如,可以用于提取第二数据包的第二特征信息。第二目标分类器用于确定第二数据包对应的第二应用集合中的第二应用。In a possible implementation manner, the second target model includes a second target feature extractor and a second target classifier. The second target feature extractor is the same as the first target feature extractor, and can be used to extract the feature information of the data packet, for example, can be used to extract the second feature information of the second data packet. The second target classifier is configured to determine the second application in the second application set corresponding to the second data packet.
示例性的,第二目标模型可以如图4B所示。图4B中,第二目标模型404包括第二目标特征提取器405和第二目标分类器406。第二目标特征提取器405的输入为第二目标模型404的输入,第二目标特征提取器405的输出为第二目标分类器406的输入,第二目标分类器406的输出为第二目标模型404的输出。第二目标分类器406有m个输出端口,每个输出端口对应第二应用集合中的一个应用。m为第二应用集合中的应用的个数。可以理解的,m个输出端口中,输出值最高的端口对应的应用可以被确定为输入到第二目标模型404的数据包对应的应用。Exemplarily, the second target model may be as shown in FIG. 4B . In FIG. 4B , the second target model 404 includes a second target feature extractor 405 and a second target classifier 406 . The input of the second target feature extractor 405 is the input of the second target model 404, the output of the second target feature extractor 405 is the input of the second target classifier 406, and the output of the second target classifier 406 is the second target model 404 output. The second object classifier 406 has m output ports, and each output port corresponds to one application in the second set of applications. m is the number of applications in the second application set. It can be understood that, among the m output ports, the application corresponding to the port with the highest output value may be determined as the application corresponding to the data packet input to the second target model 404 .
示例性的,以第二应用集合包括
Figure PCTCN2021101662-appb-000020
Figure PCTCN2021101662-appb-000021
数据包1是
Figure PCTCN2021101662-appb-000022
生成的数据包,数据包2为
Figure PCTCN2021101662-appb-000023
生成的数据包为例,若第二目标模型如图4B所示,则m的值为2。假设端口1对应
Figure PCTCN2021101662-appb-000024
端口2对应
Figure PCTCN2021101662-appb-000025
则数据包1经过第二目标特征提取器405得到iQIYI,将iQIYI输入到第二目标分类器406,可以得到端口1的输出值大于端口2的输出值,即数据包1对应的应用是
Figure PCTCN2021101662-appb-000026
同理,数据包2经过第二目标特征提取器405得到Tencent,将Tencent输入到第二目标分类器406,可以得到端口2的输出值大于端口1的输出值,即数据包2对应的应用是
Figure PCTCN2021101662-appb-000027
Exemplarily, the second application set includes
Figure PCTCN2021101662-appb-000020
and
Figure PCTCN2021101662-appb-000021
Packet 1 is
Figure PCTCN2021101662-appb-000022
The generated packet, packet 2 is
Figure PCTCN2021101662-appb-000023
Taking the generated data packet as an example, if the second target model is shown in FIG. 4B , the value of m is 2. Assume that port 1 corresponds to
Figure PCTCN2021101662-appb-000024
Port 2 corresponds
Figure PCTCN2021101662-appb-000025
Then the data packet 1 obtains iQIYI through the second target feature extractor 405, and the iQIYI is input to the second target classifier 406, and it can be obtained that the output value of port 1 is greater than the output value of port 2, that is, the corresponding application of data packet 1 is
Figure PCTCN2021101662-appb-000026
Similarly, packet 2 obtains Tencent through the second target feature extractor 405, and input Tencent into the second target classifier 406, it can be obtained that the output value of port 2 is greater than the output value of port 1, that is, the application corresponding to packet 2 is
Figure PCTCN2021101662-appb-000027
一种可能的实现方式,第一设备获取第二目标模型,包括:第一设备接收来自服务器的第一初始模型的信息和第二应用集合包含的第二应用的列表;第一设备根据第一设备获得的已标注的第二应用的数据包训练第一初始模型,得到第一中间模型;第一设备向服务器发送第一中间模型的信息;第一设备接收来自服务器的第二目标模型的信息;第一设备根据第二目标模型的信息和第一初始模型,得到第二目标模型。第一设备获取第二目标模型的具体过程将在下述图7所示的方法中进行阐述。A possible implementation manner, where the first device acquires the second target model, includes: the first device receives the information of the first initial model from the server and the list of second applications included in the second application set; The marked data packets of the second application obtained by the device train the first initial model to obtain the first intermediate model; the first device sends the information of the first intermediate model to the server; the first device receives the information of the second target model from the server ; The first device obtains the second target model according to the information of the second target model and the first initial model. The specific process of acquiring the second target model by the first device will be described in the method shown in FIG. 7 below.
可以理解的,每次满足触发条件,第一设备都会获取第二目标模型。也就是说,在步骤303之前,或者,步骤303之后,第一设备可以多次获取第二目标模型。不同的是,每次获取的第二目标模型对应的第二应用集合中的应用不同。第二应用集合包括第一设备上一次获取目标模型之后,安装在服务器、第一设备或其他设备上的应用。It can be understood that each time the trigger condition is met, the first device will acquire the second target model. That is, before step 303, or after step 303, the first device may acquire the second target model multiple times. The difference is that the applications in the second application set corresponding to the second target model acquired each time are different. The second set of applications includes applications installed on the server, the first device or other devices after the first device acquires the target model last time.
示例性的,以步骤301之后,第一设备获取了三次第二目标模型为例,第一次获取到的第二目标模型对应的第二应用集合包括第一设备获取第一目标模型之后,安装在服务器、第一设备或其他设备上的应用。第二次获取到的第二目标模型对应的第二应用集合包括第一设备第一次获取第二目标模型之后,安装在服务器、第一设备或其他设备上的应用。第三次获取到的第二目标模型对应的第二应用集合包括第一设备第二次获取第二目标模型之后,安装在服务器、第一设备或其他设备上的应用。Exemplarily, after step 301, the first device obtains the second target model three times as an example, the second application set corresponding to the second target model obtained for the first time includes the installation of the first device after obtaining the first target model. An application on a server, first device or other device. The second set of applications corresponding to the second target model acquired for the second time includes applications installed on the server, the first device, or other devices after the first device acquires the second target model for the first time. The second application set corresponding to the second target model acquired for the third time includes applications installed on the server, the first device or other devices after the first device acquires the second target model for the second time.
步骤303:第一设备获取第三数据包,根据第一目标模型和第二目标模型,确定第三数 据包对应的第一应用或第二应用。Step 303: The first device acquires the third data packet, and determines the first application or the second application corresponding to the third data packet according to the first target model and the second target model.
一种可能的实现方式,第一设备根据第一目标模型和第二目标模型,确定第三数据包对应的第一应用或第二应用,包括:第一设备根据第一目标模型,获取第三数据包的第一输出熵;第一设备根据第二目标模型,获取第三数据包的第二输出熵;第一设备将第一输出熵和第二输出熵中,数值低的输出熵对应的目标模型预测的应用确定为第三数据包对应的应用。如此,第一设备可以根据第一目标模型和第二目标模型识别出第一应用生成的数据包,或者识别出第二应用生成的数据包。In a possible implementation manner, the first device determines the first application or the second application corresponding to the third data packet according to the first target model and the second target model, including: the first device obtains the third data packet according to the first target model. The first output entropy of the data packet; the first device obtains the second output entropy of the third data packet according to the second target model; The application predicted by the target model is determined as the application corresponding to the third data packet. In this way, the first device can identify the data packet generated by the first application or identify the data packet generated by the second application according to the first target model and the second target model.
其中,第一输出熵用于指示第三数据包对应的应用为第一目标模型预测的应用的概率。第一输出熵的值越大,第三数据包对应的应用为第一目标模型预测的应用的概率越小;第一输出熵的值越小,第三数据包对应的应用为第一目标模型预测的应用的概率越大。第二输出熵用于指示第三数据包对应的应用为第二目标模型预测的应用的概率。第二输出熵的值越大,第三数据包对应的应用为第二目标模型预测的应用的概率越小;第二输出熵的值越小,第三数据包对应的应用为第二目标模型预测的应用的概率越大。The first output entropy is used to indicate the probability that the application corresponding to the third data packet is the application predicted by the first target model. The larger the value of the first output entropy, the smaller the probability that the application corresponding to the third data packet is the application predicted by the first target model; the smaller the value of the first output entropy, the application corresponding to the third data packet is the first target model. The greater the probability of the predicted application. The second output entropy is used to indicate the probability that the application corresponding to the third data packet is the application predicted by the second target model. The larger the value of the second output entropy, the smaller the probability that the application corresponding to the third data packet is the application predicted by the second target model; the smaller the value of the second output entropy, the application corresponding to the third data packet is the second target model The greater the probability of the predicted application.
进一步的,第一输出熵满足如下公式:
Figure PCTCN2021101662-appb-000028
其中,H 1(p 1)为第一输出熵。n为第一目标分类器的输出端口的个数。p 1(i)为输入第一目标模型的数据包对应的应用为第i个端口对应的应用的概率。
Further, the first output entropy satisfies the following formula:
Figure PCTCN2021101662-appb-000028
Wherein, H 1 (p 1 ) is the first output entropy. n is the number of output ports of the first target classifier. p 1 (i) is the probability that the application corresponding to the data packet input to the first target model is the application corresponding to the ith port.
类似的,第二输出熵满足如下公式:
Figure PCTCN2021101662-appb-000029
其中,H 2(p 2)为第二输出熵。m为第二目标分类器的输出端口的个数。p 2(i)为输入第二目标模型的数据包对应的应用为第i个端口对应的应用的概率。
Similarly, the second output entropy satisfies the following formula:
Figure PCTCN2021101662-appb-000029
Wherein, H 2 (p 2 ) is the second output entropy. m is the number of output ports of the second target classifier. p 2 (i) is the probability that the application corresponding to the data packet input to the second target model is the application corresponding to the ith port.
示例性的,以第一目标模型预测数据包1对应的应用为
Figure PCTCN2021101662-appb-000030
第二目标模型预测数据包1对应的应用为
Figure PCTCN2021101662-appb-000031
为例,若第一输出熵的值为20,第二输出熵的值为85,则第一设备确定第三数据包对应的应用为
Figure PCTCN2021101662-appb-000032
若第一输出熵的值为90,第二输出熵的值为15,则第一设备确定第三数据包对应的应用为
Figure PCTCN2021101662-appb-000033
Exemplarily, the application corresponding to the first target model prediction data package 1 is
Figure PCTCN2021101662-appb-000030
The application corresponding to the second target model prediction data package 1 is:
Figure PCTCN2021101662-appb-000031
For example, if the value of the first output entropy is 20 and the value of the second output entropy is 85, the first device determines that the application corresponding to the third data packet is
Figure PCTCN2021101662-appb-000032
If the value of the first output entropy is 90 and the value of the second output entropy is 15, the first device determines that the application corresponding to the third data packet is
Figure PCTCN2021101662-appb-000033
可以理解的,在第一设备获取了多次第二目标模型的情况下,第一设备根据第一目标模型和多次获取的第二目标模型,确定第三数据包对应的第一应用或第二应用。It can be understood that when the first device acquires the second target model multiple times, the first device determines the first application or the first application corresponding to the third data packet according to the first target model and the second target model acquired multiple times. Second application.
进一步的,第一设备根据第一目标模型和多次获取的第二目标模型,确定第三数据包对应的第一应用或第二应用,包括:第一设备根据第一目标模型,获取第三数据包的第一输出熵;第一设备根据多次获取的第二目标模型,获取每个第二目标模型对应的第三数据包的第二输出熵;第一设备将第一输出熵和获取到的第二输出熵中,数值低的输出熵对应的目标模型预测的应用确定为第三数据包对应的应用。Further, the first device determines the first application or the second application corresponding to the third data packet according to the first target model and the second target model obtained multiple times, including: the first device obtains the third data packet according to the first target model. The first output entropy of the data packet; the first device obtains the second output entropy of the third data packet corresponding to each second target model according to the second target model obtained multiple times; the first device combines the first output entropy and the obtained In the obtained second output entropy, the application predicted by the target model corresponding to the output entropy with a low value is determined as the application corresponding to the third data packet.
一种可能的实现方式,若第一设备接收到来自服务器的指示信息,第一设备重新训练用于识别第一应用的数据包和第二应用的数据包的第四目标模型。其中,该指示信息用于指示第一设备重新训练用于识别第一应用的数据包和第二应用的数据包的第四目标模型。第四目标模型是根据已标注的第一应用的数据包和已标注的第二应用的数据包训练得到的。第一设备重新训练用于识别第一应用的数据包和第二应用的数据包的第四目标模型的过程可以参考上述步骤301中第一设备获取第一目标模型的过程。也就是说,第一设备接收到该指示信息后,可以重新执行上述步骤301-步骤303。其中,第四目标模型是根据已标注的第一应用的数据包和已标注的第二应用的数据包训练得到的,而第一设备根据第一目标模型和第二目标模型识别数据包时,是根据输出熵推测出的结果。因此,第四目标模型识别数据包的正确 率大于,第一设备根据第一目标模型和第二目标模型识别数据包的正确率。In a possible implementation manner, if the first device receives the indication information from the server, the first device retrains the fourth target model for identifying the data packets of the first application and the data packets of the second application. Wherein, the indication information is used to instruct the first device to retrain the fourth target model for identifying the data packets of the first application and the data packets of the second application. The fourth target model is obtained by training according to the marked data packets of the first application and the marked data packets of the second application. For the process of the first device retraining the fourth target model for identifying the data packets of the first application and the data packets of the second application, reference may be made to the process of acquiring the first target model by the first device in the foregoing step 301 . That is to say, after the first device receives the indication information, the above steps 301 to 303 may be performed again. Wherein, the fourth target model is obtained by training according to the marked data packets of the first application and the marked data packets of the second application, and when the first device identifies the data packets according to the first target model and the second target model, is the result inferred from the output entropy. Therefore, the correct rate of identifying the data packet by the fourth target model is greater than the correct rate of the first device identifying the data packet according to the first target model and the second target model.
可以理解的,上述指示信息可以是管理员触发服务器发送的,也可以是服务器检测到第一设备确定的第三数据包对应的应用的正确率小于或等于第三阈值的情况下,向第一设备发送的。It can be understood that the above-mentioned indication information may be sent by the administrator triggering the server, or it may be sent to the first device when the server detects that the correct rate of the application corresponding to the third data packet determined by the first device is less than or equal to the third threshold. sent by the device.
基于图3所示的方法,在使用第一目标模型后出现新增应用(新增应用即为第二应用集合中的应用)的情况下,第一设备不需要根据被标注过的第一应用集合和第二应用集合中的应用的数据包进行模型训练,得到一个既能够识别第一应用集合中的应用的数据包,又能够识别第二应用集合中的应用的数据包的模型。而第一设备可以根据被标注过的第二应用的数据包进行模型训练,得到第二目标模型,后续,根据第一目标模型和第二目标模型识别第一应用集合中的应用的数据包,或第二应用集合中的应用的数据包。因为被标注过的第二应用的数据包的数量要远远小于被标注过的第一应用的数据包和第二应用的数据包的数量,所以图3所示方法中,第一设备的计算量小,而且训练时间短。另外,在图3所示方法中,在出现新增应用的情况下,第一设备采用的是被标注过的第二应用的数据包进行模型训练,因此可以释放被标注过的第一应用的数据包,降低了数据存储的成本。Based on the method shown in FIG. 3 , when a new application appears after using the first target model (the new application is the application in the second application set), the first device does not need to use the marked first application Model training is performed on the set and the data packets of the applications in the second application set to obtain a model that can identify both the data packets of the applications in the first application set and the data packets of the applications in the second application set. The first device can perform model training according to the marked data packets of the second application to obtain a second target model, and subsequently, identify the data packets of the applications in the first application set according to the first target model and the second target model, or data packets of applications in the second application set. Because the number of marked data packets of the second application is much smaller than the marked number of data packets of the first application and the second application, in the method shown in FIG. 3, the calculation of the first device The volume is small and the training time is short. In addition, in the method shown in FIG. 3 , in the case of a newly added application, the first device uses the marked data packet of the second application for model training, so the marked first application can be released. data packets, reducing the cost of data storage.
在图3所示方法的一种可能的实现方式中,如图5所示,步骤301可以包括步骤3011-步骤3015。In a possible implementation manner of the method shown in FIG. 3 , as shown in FIG. 5 , step 301 may include steps 3011 to 3015 .
步骤3011:第一设备接收来自服务器的第三初始模型的信息和第一应用的列表。Step 3011: The first device receives the information of the third initial model and the list of the first applications from the server.
其中,第三初始模型的信息用于指示第三初始模型。第三初始模型是根据第一应用集合中应用的个数确定的。也就是说,第三初始模型是根据第一应用集合中应用的个数得到的初始化的模型。例如,第三初始模型包括第三初始特征提取器和第三初始分类器。第三初始特征提取器经过训练后可以更新为第一目标特征提取器,第三初始分类器经过模型训练后可以更新为第一目标分类器。The information of the third initial model is used to indicate the third initial model. The third initial model is determined according to the number of applications in the first application set. That is, the third initial model is an initialized model obtained according to the number of applications in the first application set. For example, the third initial model includes a third initial feature extractor and a third initial classifier. The third initial feature extractor can be updated to the first target feature extractor after training, and the third initial classifier can be updated to the first target classifier after model training.
示例性的,第三初始模型可以如图6A所示。图6A中,第三初始模型601包括第三初始特征提取器602和第三初始分类器603。第三初始特征提取器602的输入为第三初始模型601的输入,第三初始特征提取器602的输出为第三初始分类器603的输入,第三初始分类器603的输出为第三初始模型601的输出。第三初始分类器603有n个输出端口,每个输出端口对应第一应用集合中的一个应用。n为第一应用集合中的应用的个数。Exemplarily, the third initial model may be as shown in FIG. 6A . In FIG. 6A , the third initial model 601 includes a third initial feature extractor 602 and a third initial classifier 603 . The input of the third initial feature extractor 602 is the input of the third initial model 601, the output of the third initial feature extractor 602 is the input of the third initial classifier 603, and the output of the third initial classifier 603 is the third initial model 601 output. The third initial classifier 603 has n output ports, and each output port corresponds to one application in the first application set. n is the number of applications in the first application set.
一种可能的实现方式,第三初始模型的信息包括第三初始模型的结构信息和第三初始模型的参数信息。其中,第三初始模型的结构信息用于指示第三初始模型的结构,例如,第三初始模型的结构信息用于指示第三初始模型包括第三初始特征提取器和第三初始分类器。第三初始模型的参数信息用于指示第三初始模型的参数,例如,第三初始特征提取器的参数以及第三初始分类器的参数。第三初始特征提取器的参数以及第三初始分类器的参数的介绍可以参考常规技术中对特征提取器的参数和分类器的参数的解释说明,不予赘述。In a possible implementation manner, the information of the third initial model includes structural information of the third initial model and parameter information of the third initial model. The structure information of the third initial model is used to indicate the structure of the third initial model, for example, the structure information of the third initial model is used to indicate that the third initial model includes a third initial feature extractor and a third initial classifier. The parameter information of the third initial model is used to indicate parameters of the third initial model, for example, parameters of the third initial feature extractor and parameters of the third initial classifier. For the introduction of the parameters of the third initial feature extractor and the parameters of the third initial classifier, reference may be made to the explanations of the parameters of the feature extractor and the parameters of the classifier in the conventional technology, which will not be repeated.
一种可能的实现方式,第一应用的列表用于指示第一应用集合中的第一应用与第三初始模型的输出端的对应关系。In a possible implementation manner, the list of the first applications is used to indicate the correspondence between the first application in the first application set and the output end of the third initial model.
示例性的,以图6A所示的第三初始模型为例,第一应用集合中的第一应用与第三初始模型的输出端的对应关系可以如表1所示。表1中,应用1对应的端口为端口1,应用2对应的端口为端口2,…,应用n-1对应的端口为端口n-1,应用n对应的端口为端口n。Exemplarily, taking the third initial model shown in FIG. 6A as an example, the correspondence between the first application in the first application set and the output end of the third initial model may be as shown in Table 1. In Table 1, the port corresponding to application 1 is port 1, the port corresponding to application 2 is port 2, ..., the port corresponding to application n-1 is port n-1, and the port corresponding to application n is port n.
表1Table 1
第一应用集合中的第一应用The first application in the first application set 第三初始模型的输出端The output of the third initial model
应用1Application 1 端口1 port 1
应用2 Application 2 端口2 port 2
应用n-1apply n-1 端口n-1port n-1
应用napplication n 端口nport n
步骤3012:第一设备根据第一设备获得的已标注的第一应用的数据包训练第三初始模型,得到第三中间模型。Step 3012: The first device trains a third initial model according to the marked data packets of the first application obtained by the first device, and obtains a third intermediate model.
其中,第一设备获得的已标注的第一应用的数据包可以是人工标注的,也可以是机器标注的。The marked data packet of the first application obtained by the first device may be marked manually or marked by a machine.
以人工标注为例,该数据包可以是第一设备的管理员标注的,也可以是服务器的管理员标注的。若该数据包为服务器的管理员标注的,第一设备可以获取第一应用的数据包,向服务器发送第一应用的数据包,并接收来自服务器的已标注的第一应用的数据包。其中,第一应用的数据包可以是第一设备接收的,或者,第一设备上的应用生成的。Taking manual marking as an example, the data packet may be marked by the administrator of the first device, or may be marked by the administrator of the server. If the data packet is marked by the administrator of the server, the first device can obtain the data packet of the first application, send the data packet of the first application to the server, and receive the marked data packet of the first application from the server. The data packet of the first application may be received by the first device, or generated by an application on the first device.
以机器标注为例,该数据包可以是第一设备标注的,也可以是服务器标注的。若该数据包为服务器标注的,第一设备可以获取第一应用的数据包,向服务器发送第一应用的数据包,并接收来自服务器的已标注的第一应用的数据包。Taking machine labeling as an example, the data packet may be labelled by the first device, or may be labelled by the server. If the data packet is marked by the server, the first device may obtain the data packet of the first application, send the data packet of the first application to the server, and receive the marked data packet of the first application from the server.
一种可能的实现方式,第一设备根据第一设备获得的已标注的第一应用的数据包,采用反向传播的方法更新第三初始模型,得到第三中间模型。进一步的,第一设备采用反向传播的方法更新第三初始模型的过程中使用的损失函数满足如下公式:
Figure PCTCN2021101662-appb-000034
In a possible implementation manner, the first device updates the third initial model by means of backpropagation according to the marked data packets of the first application obtained by the first device to obtain the third intermediate model. Further, the loss function used in the process of updating the third initial model by the method of backpropagation by the first device satisfies the following formula:
Figure PCTCN2021101662-appb-000034
其中,L表示损失函数,该损失函数可以用于计算第三初始模型的参数的梯度。N为第一设备获得的已标注的第一应用的数据包的数量。M为第一应用集合中应用的数量。y ic为指示变量,在第i个数据包的真实类别为c类别的情况下,y ic=1,否则y ic=0。p ic为第i个数据包属于类别c的预测概率。 Wherein, L represents a loss function, and the loss function can be used to calculate the gradient of the parameters of the third initial model. N is the number of marked data packets of the first application obtained by the first device. M is the number of applications in the first application set. y ic is an indicator variable, in the case that the real category of the i-th data packet is category c, y ic =1, otherwise y ic =0. pic is the predicted probability that the ith data packet belongs to category c.
第一设备采用反向传播的方法更新第三初始模型,得到第三中间模型的具体过程,可以参考常规技术中的解释说明,不予赘述。The first device uses the method of back propagation to update the third initial model, and the specific process of obtaining the third intermediate model can be referred to the explanation in the conventional technology, and will not be repeated.
步骤3013:第一设备向服务器发送第三中间模型的信息。Step 3013: The first device sends the information of the third intermediate model to the server.
其中,第三中间模型的信息包括第三中间模型的参数。示例性的,第三中间模型的参数包括第三初始模型的参数的梯度。The information of the third intermediate model includes parameters of the third intermediate model. Exemplarily, the parameters of the third intermediate model include gradients of the parameters of the third initial model.
步骤3014:第一设备接收来自服务器的第一目标模型的信息。Step 3014: The first device receives the information of the first target model from the server.
其中,第一目标模型的信息是将来自多个第一设备的中间模型的信息进行聚合得到的。第一目标模型的信息用于指示第一目标模型的参数。示例性的,第一目标模型的参数包括更新后的第三初始模型的参数的梯度。The information of the first target model is obtained by aggregating information from intermediate models of multiple first devices. The information of the first target model is used to indicate parameters of the first target model. Exemplarily, the parameters of the first target model include gradients of the updated parameters of the third initial model.
步骤3015:第一设备根据第一目标模型的信息和第三初始模型,得到第一目标模型。Step 3015: The first device obtains the first target model according to the information of the first target model and the third initial model.
一种可能的实现方式,第一设备根据第一目标模型的信息和第三初始模型,得到第一目标模型,包括:第一设备根据第三初始模型的参数和第一目标模型的信息,得到第一目标模型的参数;第一设备将第三初始模型中,第三初始模型的参数替换为第一目标模型的参数,得到第一目标模型。A possible implementation manner, the first device obtains the first target model according to the information of the first target model and the third initial model, including: the first device obtains according to the parameters of the third initial model and the information of the first target model. Parameters of the first target model; the first device replaces the parameters of the third initial model in the third initial model with parameters of the first target model to obtain the first target model.
需要说明的是,上述步骤3011-步骤3015是以第一设备进行一次模型训练即得到第一目标模型为例进行介绍的。在实际应用中,第一设备可能进行多次模型训练,才能得到第一目标模型。也就是说,步骤3015中,第一设备根据第一目标模型的信息和第三初始模型,得到的模型可能是一个未完成的第一目标模型,即第一设备得到的模型可能不收敛。后续,第一设备可以根据第一设备获得的已标注的第一应用的数据包训练上述未完成的第一目标模型,将训练得到的梯度发送给服务器,接收来自服务器的聚合后的梯度,并根据聚合后的梯度和上述未完成的第一目标模型,得到一个模型。若该模型收敛,则该模型即为第一目标模型,若该模型不收敛,重复执行上述过程,直至第一设备得到的模型收敛。It should be noted that the above steps 3011 to 3015 are described by taking the example that the first device performs one model training to obtain the first target model as an example. In practical applications, the first device may perform model training multiple times to obtain the first target model. That is, in step 3015, the model obtained by the first device according to the information of the first target model and the third initial model may be an incomplete first target model, that is, the model obtained by the first device may not converge. Subsequently, the first device may train the unfinished first target model according to the marked data packets of the first application obtained by the first device, send the trained gradients to the server, receive the aggregated gradients from the server, and A model is obtained according to the aggregated gradient and the above-mentioned unfinished first target model. If the model converges, the model is the first target model. If the model does not converge, the above process is repeated until the model obtained by the first device converges.
基于图5所示的方法,参与模型训练的设备,例如第一设备,可以接收来自服务器的第三初始模型的信息和第一应用的列表,根据已标注的第一应用的数据包训练第三初始模型,得到第三中间模型,并向服务器发送第三中间模型的信息,以便服务器将来自多个第一设备的中间模型的信息进行聚合,得到第一目标模型的信息。后续,第一设备可以接收来自服务器的第一目标模型的信息,并根据第一目标模型的信息和第三初始模型,得到第一目标模型。如此,参与模型训练的设备都可以得到最终能够识别第一应用的数据包的模型。另外,图5所示的方法中,服务器不需要进行模型训练,而是将模型训练的过程下放给参与模型训练的设备,每个参与模型训练的设备在训练模型时使用的已标注数据包的数量也小于服务器训练模型时使用的已标注数据包的数量,对于这些设备来说,计算量也不大,还可以节约模型训练的时间。Based on the method shown in FIG. 5 , a device participating in the model training, such as the first device, can receive the information of the third initial model and the list of the first applications from the server, and train the third The initial model is obtained, the third intermediate model is obtained, and the information of the third intermediate model is sent to the server, so that the server aggregates the information of the intermediate models from multiple first devices to obtain the information of the first target model. Subsequently, the first device may receive the information of the first target model from the server, and obtain the first target model according to the information of the first target model and the third initial model. In this way, all devices participating in the model training can obtain a model that can finally recognize the data packet of the first application. In addition, in the method shown in Figure 5, the server does not need to perform model training, but delegates the model training process to the equipment participating in the model training. The number is also smaller than the number of labeled data packets used by the server to train the model. For these devices, the amount of computation is not large, and it can also save model training time.
在图3所示方法的一种可能的实现方式中,如图7所示,步骤302可以包括步骤3021-步骤3025。In a possible implementation manner of the method shown in FIG. 3 , as shown in FIG. 7 , step 302 may include steps 3021 to 3025 .
步骤3021:第一设备接收来自服务器的第一初始模型的信息和第二应用的列表。Step 3021: The first device receives the information of the first initial model and the list of the second applications from the server.
其中,第一初始模型的信息用于指示第一初始模型。第一初始模型是根据第二应用集合中应用的个数确定的。也就是说,第一初始模型是根据第二应用集合中应用的个数得到的初始化的模型。例如,第一初始模型包括第二目标特征提取器和第一初始分类器。其中,第二目标特征提取器即为将第一目标特征提取器复用到第一初始模型中的特征提取器,后续,第一设备可以不用训练特征提取器。第一初始分类器经过模型训练后可以更新为第二目标分类器。Wherein, the information of the first initial model is used to indicate the first initial model. The first initial model is determined according to the number of applications in the second application set. That is, the first initial model is an initialized model obtained according to the number of applications in the second application set. For example, the first initial model includes a second target feature extractor and a first initial classifier. The second target feature extractor is a feature extractor that multiplexes the first target feature extractor into the first initial model, and subsequently, the first device may not need to train the feature extractor. The first initial classifier can be updated to the second target classifier after model training.
可以理解的,第一初始模型也可以不复用第一目标特征提取器,在这种情况下,第一初始模型包括第一初始特征提取器和第一初始分类器。第一初始特征提取器为第一设备获取的初始化的特征提取器。It can be understood that the first initial model may not reuse the first target feature extractor. In this case, the first initial model includes the first initial feature extractor and the first initial classifier. The first initial feature extractor is an initialized feature extractor obtained by the first device.
示例性的,第一初始模型可以如图6B所示。图6B中,第一初始模型604包括第二目标特征提取器605和第一初始分类器606。第二目标特征提取器605的输入为第一初始模型604的输入,第二目标特征提取器605的输出为第一初始分类器606的输入,第一初始分类器606的输出为第一初始模型604的输出。第一初始分类器606有m个输出端口,每个输出端口对应第二应用集合中的一个应用。m为第二应用集合中的应用的个数。Exemplarily, the first initial model may be as shown in FIG. 6B . In FIG. 6B , the first initial model 604 includes a second target feature extractor 605 and a first initial classifier 606 . The input of the second target feature extractor 605 is the input of the first initial model 604, the output of the second target feature extractor 605 is the input of the first initial classifier 606, and the output of the first initial classifier 606 is the first initial model 604 output. The first initial classifier 606 has m output ports, and each output port corresponds to an application in the second set of applications. m is the number of applications in the second application set.
一种可能的实现方式,第一初始模型的信息包括第一初始模型的结构信息和第一初始模型的参数信息。其中,第一初始模型的结构信息用于指示第一初始模型的结构,例如,第一初始模型的结构信息用于指示第一初始模型包括第二目标特征提取器和第一初始分类器。第一初始模型的参数信息用于指示第一初始模型的参数,例如,第二目标特征提取器的参数以 及第一初始分类器的参数。第二目标特征提取器的参数以及第一初始分类器的参数的介绍可以参考常规技术中对特征提取器的参数和分类器的参数的解释说明,不予赘述。In a possible implementation manner, the information of the first initial model includes structural information of the first initial model and parameter information of the first initial model. The structure information of the first initial model is used to indicate the structure of the first initial model, for example, the structure information of the first initial model is used to indicate that the first initial model includes the second target feature extractor and the first initial classifier. The parameter information of the first initial model is used to indicate parameters of the first initial model, for example, parameters of the second target feature extractor and parameters of the first initial classifier. For the introduction of the parameters of the second target feature extractor and the parameters of the first initial classifier, reference may be made to the explanations of the parameters of the feature extractor and the parameters of the classifier in the conventional technology, which will not be repeated.
一种可能的实现方式,第二应用的列表用于指示第二应用集合中的第二应用与第一初始模型的输出端的对应关系。In a possible implementation manner, the list of second applications is used to indicate the correspondence between the second application in the second application set and the output end of the first initial model.
示例性的,以图6B所示的第一初始模型为例,第二应用集合中的第二应用与第一初始模型的输出端的对应关系可以如表2所示。表2中,应用1对应的端口为端口1,应用2对应的端口为端口2,…,应用m-1对应的端口为端口m-1,应用m对应的端口为端口m。Exemplarily, taking the first initial model shown in FIG. 6B as an example, the correspondence between the second application in the second application set and the output end of the first initial model may be as shown in Table 2. In Table 2, the port corresponding to application 1 is port 1, the port corresponding to application 2 is port 2, ..., the port corresponding to application m-1 is port m-1, and the port corresponding to application m is port m.
表2Table 2
第二应用集合中的第二应用The second application in the second set of applications 第一初始模型的输出端The output of the first initial model
应用1Application 1 端口1 port 1
应用2 Application 2 端口2 port 2
应用m-1Apply m-1 端口m-1port m-1
应用mapplication m 端口mport m
步骤3022:第一设备根据第一设备获得的已标注的第二应用的数据包训练第一初始模型,得到第一中间模型。Step 3022: The first device trains the first initial model according to the marked data packet of the second application obtained by the first device, to obtain a first intermediate model.
其中,第一设备获得的已标注的第二应用的数据包可以是人工标注的,也可以是机器标注的。The marked data packet of the second application obtained by the first device may be marked manually or marked by a machine.
以人工标注为例,该数据包可以是第一设备的管理员标注的,也可以是服务器的管理员标注的。若该数据包为服务器的管理员标注的,第一设备可以获取第二应用的数据包,向服务器发送第二应用的数据包,并接收来自服务器的已标注的第二应用的数据包。其中,第二应用的数据包可以是第一设备接收的,或者,第一设备上的应用生成的。Taking manual marking as an example, the data packet may be marked by the administrator of the first device, or may be marked by the administrator of the server. If the data packet is marked by the administrator of the server, the first device can obtain the data packet of the second application, send the data packet of the second application to the server, and receive the marked data packet of the second application from the server. The data packet of the second application may be received by the first device, or generated by an application on the first device.
以机器标注为例,该数据包可以是第一设备标注的,也可以是服务器标注的。若该数据包为服务器标注的,第一设备可以获取第二应用的数据包,向服务器发送第二应用的数据包,并接收来自服务器的已标注的第二应用的数据包。Taking machine labeling as an example, the data packet may be labelled by the first device, or may be labelled by the server. If the data packet is marked by the server, the first device may obtain the data packet of the second application, send the data packet of the second application to the server, and receive the marked data packet of the second application from the server.
一种可能的实现方式,第一设备根据第一设备获得的已标注的第二应用的数据包,采用反向传播的方法更新第一初始模型,得到第一中间模型。进一步的,第一设备采用反向传播的方法更新第一初始模型的过程中使用的损失函数满足如下公式:
Figure PCTCN2021101662-appb-000035
In a possible implementation manner, the first device updates the first initial model by means of backpropagation according to the marked data packets of the second application obtained by the first device to obtain the first intermediate model. Further, the loss function used in the process of updating the first initial model by the method of backpropagation by the first device satisfies the following formula:
Figure PCTCN2021101662-appb-000035
其中,L表示损失函数,该损失函数可以用于计算第一初始分类器的参数。N为第一设备获得的已标注的第二应用的数据包的数量。M为第二应用集合中应用的数量。y ic为指示变量,在第i个数据包的真实类别为c类别的情况下,y ic=1,否则y ic=0。p ic为第i个数据包属于类别c的预测概率。 Wherein, L represents the loss function, and the loss function can be used to calculate the parameters of the first initial classifier. N is the number of marked data packets of the second application obtained by the first device. M is the number of applications in the second application set. y ic is an indicator variable, in the case that the real category of the i-th data packet is category c, y ic =1, otherwise y ic =0. pic is the predicted probability that the ith data packet belongs to category c.
第一设备采用反向传播的方法更新第一初始模型,得到第一中间模型的具体过程,可以参考常规技术中的解释说明,不予赘述。The first device updates the first initial model by the method of back propagation, and the specific process of obtaining the first intermediate model can be referred to the explanation in the conventional technology, and will not be repeated.
步骤3023:第一设备向服务器发送第一中间模型的信息。Step 3023: The first device sends the information of the first intermediate model to the server.
其中,第一中间模型的信息包括第一中间模型的参数。示例性的,第一中间模型的参数包括第一初始分类器的参数的梯度。Wherein, the information of the first intermediate model includes parameters of the first intermediate model. Exemplarily, the parameters of the first intermediate model include gradients of parameters of the first initial classifier.
步骤3024:第一设备接收来自服务器的第二目标模型的信息。Step 3024: The first device receives the information of the second target model from the server.
其中,第二目标模型的信息是将来自多个第一设备的中间模型的信息进行聚合得到的。 第二目标模型的信息用于指示第二目标模型的参数。示例性的,第二目标模型的参数包括更新后的第一初始分类器的参数的梯度。The information of the second target model is obtained by aggregating information from intermediate models of multiple first devices. The information of the second target model is used to indicate the parameters of the second target model. Exemplarily, the parameters of the second target model include the updated gradients of the parameters of the first initial classifier.
步骤3025:第一设备根据第二目标模型的信息和第一初始模型,得到第二目标模型。Step 3025: The first device obtains the second target model according to the information of the second target model and the first initial model.
一种可能的实现方式,第一设备根据第二目标模型的信息和第一初始模型,得到第二目标模型,包括:第一设备根据第一初始分类器的参数和第二目标模型的信息,得到第二目标分类器的参数;第一设备将第一初始模型中,第一初始分类器的参数替换为第二目标分类器的参数,得到第二目标模型。In a possible implementation manner, the first device obtains the second target model according to the information of the second target model and the first initial model, including: the first device obtains the second target model according to the parameters of the first initial classifier and the information of the second target model, Obtain the parameters of the second target classifier; the first device replaces the parameters of the first initial classifier with the parameters of the second target classifier in the first initial model to obtain the second target model.
需要说明的是,上述步骤3021-步骤3025是以第一设备进行一次模型训练即得到第二目标模型为例进行介绍的。在实际应用中,第一设备可能进行多次模型训练,才能得到第二目标模型。也就是说,步骤3025中,第一设备根据第二目标模型的信息和第一初始模型,得到的模型可能是一个未完成的第二目标模型,即第一设备得到的模型可能不收敛。后续,第一设备可以根据第一设备获得的已标注的第二应用的数据包训练上述未完成的第二目标模型,将训练得到的梯度发送给服务器,接收来自服务器的聚合后的梯度,并根据聚合后的梯度和上述未完成的第二目标模型,得到一个模型。若该模型收敛,则该模型即为第二目标模型,若该模型不收敛,重复执行上述过程,直至第一设备得到的模型收敛。It should be noted that the above steps 3021 to 3025 are described by taking the example that the first device performs one model training to obtain the second target model. In practical applications, the first device may perform model training multiple times to obtain the second target model. That is, in step 3025, the model obtained by the first device according to the information of the second target model and the first initial model may be an unfinished second target model, that is, the model obtained by the first device may not converge. Subsequently, the first device may train the unfinished second target model according to the marked data packets of the second application obtained by the first device, send the trained gradients to the server, receive the aggregated gradients from the server, and A model is obtained based on the aggregated gradient and the above-mentioned unfinished second target model. If the model converges, the model is the second target model. If the model does not converge, the above process is repeated until the model obtained by the first device converges.
基于图7所示的方法,参与模型训练的设备,例如第一设备,可以接收来自服务器的第一初始模型的信息和第二应用的列表,根据已标注的第二应用的数据包训练第一初始模型,得到第一中间模型,并向服务器发送第一中间模型的信息,以便服务器将来自多个第一设备的中间模型的信息进行聚合,得到第二目标模型的信息。后续,第一设备可以接收来自服务器的第二目标模型的信息,并根据第二目标模型的信息和第一初始模型,得到第二目标模型。一方面,参与模型训练的设备都可以得到最终能够识别第二应用的数据包的模型。另一方面,第一初始模型复用了第一目标特征提取器,因此在训练模型时,不需要训练特征提取器,减少了计算开销。另外,图7所示的方法中,服务器不需要进行模型训练,而是将模型训练的过程下放给参与模型训练的设备,每个参与模型训练的设备在训练模型时使用的已标注数据包的数量也小于服务器训练模型时使用的已标注数据包的数量,对于这些设备来说,计算量也不大,还可以节约模型训练的时间。Based on the method shown in FIG. 7 , a device participating in model training, such as a first device, can receive information about the first initial model and a list of second applications from the server, and train the first device according to the marked data packets of the second application. From the initial model, the first intermediate model is obtained, and the information of the first intermediate model is sent to the server, so that the server aggregates the information of the intermediate models from multiple first devices to obtain the information of the second target model. Subsequently, the first device may receive the information of the second target model from the server, and obtain the second target model according to the information of the second target model and the first initial model. On the one hand, all devices participating in the model training can obtain a model that can finally recognize the data packets of the second application. On the other hand, the first initial model reuses the first target feature extractor, so when training the model, there is no need to train the feature extractor, which reduces computational overhead. In addition, in the method shown in Figure 7, the server does not need to perform model training, but delegates the model training process to the equipment participating in the model training. The number is also smaller than the number of labeled data packets used by the server to train the model. For these devices, the amount of computation is not large, and it can also save model training time.
可以理解的,在第一设备获取了多次第二目标模型的情况下,第一设备识别第三数据包时,需要获取第一目标模型和多个第二目标模型中,每个目标模型对应的输出熵,再根据获取的多个输出熵确定第三数据包对应的应用,因此,第一设备识别第三数据包的时间可能较长,影响用户体验。在这种情况下,第一设备可以将第一目标模型和多个目标模型压缩为一个目标模型,后续,通过压缩后的目标模型识别第三数据包,可以节约第一设备识别第三数据包的时间。具体的,可以参考图8所示的方法。It can be understood that in the case where the first device has acquired the second target model multiple times, when the first device recognizes the third data packet, it needs to acquire the first target model and the plurality of second target models, each of which corresponds to the target model. and then determine the application corresponding to the third data packet according to the obtained multiple output entropies. Therefore, it may take a long time for the first device to identify the third data packet, which affects user experience. In this case, the first device can compress the first target model and multiple target models into one target model, and subsequently, identify the third data packet through the compressed target model, which can save the first device from identifying the third data packet time. Specifically, reference may be made to the method shown in FIG. 8 .
如图8所示,在图3所示方法的一种可能的实现方式中,图3所示的方法还包括步骤801和步骤802。As shown in FIG. 8 , in a possible implementation manner of the method shown in FIG. 3 , the method shown in FIG. 3 further includes step 801 and step 802 .
步骤801:第一设备获取第二初始模型。Step 801: The first device acquires a second initial model.
其中,第二初始模型是根据第一应用集合中应用的个数与第二应用集合中应用的个数确定的。也就是说,第二初始模型是根据第一应用集合中应用的个数与第二应用集合中应用的个数得到的初始化的模型。例如,第二初始模型包括第二初始特征提取器和第二初始分类器。其中,第二初始特征提取器即为将第一目标特征提取器复用到第二初始模型中的特征提取 器,后续,第一设备可以不用训练特征提取器。第二初始分类器为第一设备获取的初始化的分类器。The second initial model is determined according to the number of applications in the first application set and the number of applications in the second application set. That is, the second initial model is an initialized model obtained according to the number of applications in the first application set and the number of applications in the second application set. For example, the second initial model includes a second initial feature extractor and a second initial classifier. Wherein, the second initial feature extractor is a feature extractor that multiplexes the first target feature extractor into the second initial model, and subsequently, the first device does not need to train the feature extractor. The second initial classifier is an initialized classifier obtained by the first device.
可以理解的,第二初始模型也可以不复用第一目标特征提取器,在这种情况下,第二初始模型包括的特征提取器为第一设备获取的初始化的特征提取器。It can be understood that the second initial model may not reuse the first target feature extractor. In this case, the feature extractor included in the second initial model is the initialized feature extractor obtained by the first device.
一种可能的实现方式,第二初始模型的输入为第二初始特征提取器的输入,第二初始特征提取器的输出为第二初始分类器的输入,第二初始分类器的输出为第二初始模型的输出。第二初始分类器有q个输出端口,每个输出端口对应第一应用集合中或第二应用集合中的一个应用。q为第一应用集合中应用的个数和第二应用集合中的应用的个数之和。A possible implementation manner, the input of the second initial model is the input of the second initial feature extractor, the output of the second initial feature extractor is the input of the second initial classifier, and the output of the second initial classifier is the second initial classifier. The output of the initial model. The second initial classifier has q output ports, and each output port corresponds to an application in the first application set or the second application set. q is the sum of the number of applications in the first application set and the number of applications in the second application set.
一种可能的实现方式,第一设备根据第一应用集合中应用的个数与第二应用集合中应用的个数,创建第二初始模型。In a possible implementation manner, the first device creates the second initial model according to the number of applications in the first application set and the number of applications in the second application set.
另一种可能的实现方式,第一设备向服务器发送第一信息,并接收来自服务器的第二初始模型的信息。In another possible implementation manner, the first device sends the first information to the server, and receives the information of the second initial model from the server.
其中,第一信息用于指示第一应用集合中应用的个数与第二应用集合中应用的个数。第二初始模型的信息用于指示第二初始模型。例如,第二初始模型的信息包括第二初始模型的结构信息和第二初始模型的参数信息。其中,第二初始模型的结构信息用于指示第二初始模型包括第二初始特征提取器和第二初始分类器。第二初始模型的参数信息用于指示第二初始模型的参数,例如,第二初始特征提取器的参数以及第二初始分类器的参数。第二初始特征提取器的参数以及第二初始分类器的参数的介绍可以参考常规技术中对特征提取器的参数和分类器的参数的解释说明,不予赘述。The first information is used to indicate the number of applications in the first application set and the number of applications in the second application set. The information of the second initial model is used to indicate the second initial model. For example, the information of the second initial model includes structural information of the second initial model and parameter information of the second initial model. The structure information of the second initial model is used to indicate that the second initial model includes a second initial feature extractor and a second initial classifier. The parameter information of the second initial model is used to indicate parameters of the second initial model, for example, parameters of the second initial feature extractor and parameters of the second initial classifier. For the introduction of the parameters of the second initial feature extractor and the parameters of the second initial classifier, reference may be made to the explanations of the parameters of the feature extractor and the parameters of the classifier in the conventional technology, which will not be repeated.
一种可能的实现方式,第一设备获取了R次第二目标模型之后,执行步骤801。其中,R为大于0的整数。In a possible implementation manner, after the first device acquires the second target model for R times, step 801 is performed. where R is an integer greater than 0.
步骤802:第一设备根据第一目标模型和第二目标模型对第一设备获得的数据包的标注结果,训练第二初始模型以得到第三目标模型。Step 802: The first device trains the second initial model to obtain the third target model according to the labeling result of the data packet obtained by the first device by the first target model and the second target model.
其中,第一目标模型和第二目标模型对第一设备获得的数据包的标注结果可以是第一设备获取第一目标模型和第二目标模型之后,根据第一目标模型和第二目标模型对数据包的识别结果。也就是说,第一设备在得到第三目标模型的过程中,可以使用第一设备在使用第一目标模型和第二目标模型识别数据包的过程中得到的识别结果,训练第二初始模型。如此,第一设备可以不用存储获取第一目标模型和第二模型时使用的已标注的数据包,节省了存储开销。The labeling result of the first target model and the second target model on the data packet obtained by the first device may be that after the first device obtains the first target model and the second target model, according to the first target model and the second target model The identification result of the data packet. That is, in the process of obtaining the third target model, the first device may use the recognition result obtained by the first device in the process of using the first target model and the second target model to recognize the data packet to train the second initial model. In this way, the first device does not need to store the marked data packets used when acquiring the first target model and the second model, which saves storage overhead.
其中,第三目标模型用于提取第三特征信息,并根据第三特征信息确定第三特征信息对应的数据包对应的应用。第三特征信息包括第三特征信息对应的数据包的特征信息。例如,第三特征信息包括第三特征信息对应的数据包所属应用的关键字。应理解,第三特征信息对应的数据包为第一应用集合中应用的数据包,或第二应用集合中应用的数据包。The third target model is used to extract the third feature information, and determine the application corresponding to the data packet corresponding to the third feature information according to the third feature information. The third feature information includes feature information of the data packet corresponding to the third feature information. For example, the third feature information includes a keyword of an application to which the data packet corresponding to the third feature information belongs. It should be understood that the data packet corresponding to the third feature information is the data packet applied in the first application set, or the data packet applied in the second application set.
一种可能的实现方式,第三目标模型包括第二初始特征提取器和第三目标分类器。其中,第二初始特征提取器用于提取数据包的特征信息,例如,第三特征信息。第三目标分类器用于确定第三特征信息对应的数据包对应的应用。第三目标分类器是第一设备对第二初始分类器进行训练得到的。In a possible implementation manner, the third target model includes a second initial feature extractor and a third target classifier. Wherein, the second initial feature extractor is used to extract feature information of the data packet, for example, third feature information. The third target classifier is used to determine the application corresponding to the data packet corresponding to the third feature information. The third target classifier is obtained by training the second initial classifier by the first device.
需要说明的是,第一设备根据第一目标模型和第二目标模型对第一设备获得的数据包的标注结果,训练第二初始模型以得到第三目标模型的具体过程,可以参考上述步骤3022中 第一设备根据第一设备获得的已标注的第二应用的数据包训练第一初始模型,得到第一中间模型的过程,不予赘述。It should be noted that, for the specific process of training the second initial model to obtain the third target model by the first device according to the labeling results of the data packets obtained by the first device on the basis of the first target model and the second target model, refer to step 3022 above. The process of training the first initial model by the first device according to the marked data packet of the second application obtained by the first device to obtain the first intermediate model will not be repeated.
一种可能的实现方式,步骤802之后,第一设备根据第三目标模型识别第一应用的数据包或第二应用的数据包。In a possible implementation manner, after step 802, the first device identifies the data packet of the first application or the data packet of the second application according to the third target model.
一种可能的实现方式,步骤802之后,第一设备根据获取第一目标模型时使用的已标注的数据包,和/或,获取第二目标模型时使用的已标注的数据包,训练第三目标模型,得到训练后的第三目标模型。第一设备根据获取第一目标模型时使用的已标注的数据包,和/或,获取第二目标模型时使用的已标注的数据包,训练第三目标模型,得到训练后的第三目标模型的具体过程,可以参考上述步骤3022中第一设备根据第一设备获得的已标注的第二应用的数据包训练第一初始模型,得到第一中间模型的过程,不予赘述。A possible implementation, after step 802, the first device trains the third device according to the marked data packet used when acquiring the first target model and/or the marked data packet used when acquiring the second target model. target model, and obtain the third target model after training. The first device trains the third target model according to the marked data packet used when acquiring the first target model, and/or the marked data packet used when acquiring the second target model, and obtains the trained third target model For the specific process, refer to the process of training the first initial model by the first device according to the marked data packet of the second application obtained by the first device in the above step 3022 to obtain the first intermediate model, which will not be repeated.
可以理解的,第一目标模型和第二目标模型对第一设备获得的数据包的标注结果有可能有错误,所以第一设备根据获取第一目标模型时使用的已标注的数据包,和/或,获取第二目标模型时使用的已标注的数据包,训练第三目标模型,可以提高模型的精度,使得训练后的第三目标模型的精度更高,识别数据包更准确。It can be understood that there may be errors in the labeling results of the data packets obtained by the first device by the first target model and the second target model, so the first device obtains the first target model according to the labeled data packets used, and/ Or, the labeled data packets used when the second target model is acquired and the third target model is trained can improve the accuracy of the model, so that the trained third target model has higher accuracy and more accurate data packet identification.
基于图8所示的方法,第一设备获取了多次第二目标模型的情况下,可以获取第二初始模型,并根据第一目标模型和第二目标模型对第一设备获得的数据包的标注结果,训练第二初始模型以得到第三目标模型。后续,第一设备即可根据第三目标模型识别数据包,可以节约第一设备识别数据包的时间。另外,第一设备通过对模型的不断压缩,可以使得模型尺寸稳定,有利于模型在片上系统部署。Based on the method shown in FIG. 8 , when the first device has acquired the second target model multiple times, the second initial model can be acquired, and the data packets obtained by the first device can be processed according to the first target model and the second target model. Label the results and train the second initial model to obtain the third target model. Subsequently, the first device can identify the data packet according to the third target model, which can save time for the first device to identify the data packet. In addition, by continuously compressing the model, the first device can stabilize the size of the model, which is beneficial to the deployment of the model in the system-on-chip.
上述图3、图5、图7和图8所示的数据包的识别方法应用于第一设备。下面介绍本申请实施例提供的又一种数据包的识别方法,该方法应用于服务器。The above-mentioned methods for identifying data packets shown in FIG. 3 , FIG. 5 , FIG. 7 and FIG. 8 are applied to the first device. Another method for identifying a data packet provided by an embodiment of the present application is introduced below, and the method is applied to a server.
如图9所示,为本申请实施例提供的又一种数据包的识别方法,该方法应用于服务器。该方法包括步骤901-步骤904。As shown in FIG. 9 , another method for identifying a data packet provided by an embodiment of the present application is applied to a server. The method includes steps 901-904.
步骤901:服务器获取第一目标模型的信息。Step 901: The server obtains information of the first target model.
其中,服务器可以为图1中的服务器101。第一目标模型的信息的介绍可以参考上述步骤3014中所述,第一目标模型的介绍可以参考上述步骤301中所述。The server may be the server 101 in FIG. 1 . For the introduction of the information of the first target model, reference may be made to the above-mentioned step 3014 , and the introduction of the first target model may refer to the above-mentioned step 301 .
一种可能的实现方式,服务器在初始化(例如,服务器第一次开机,或服务器恢复出厂设置)的情况下,获取第一目标模型的信息。In a possible implementation manner, the server acquires the information of the first target model in the case of initialization (for example, the server is powered on for the first time, or the server is restored to factory settings).
一种可能的实现方式,服务器获取第一目标模型的信息包括下述步骤A-步骤E。下述步骤是以服务器确定的需要进行模型训练的设备为第一设备和第二设备为例进行介绍的。服务器确定的需要进行模型训练的设备的数量大于或等于3时,服务器获取第一目标模型的情况可以参考服务器确定的需要进行模型训练的设备为第一设备和第二设备的情况,不予赘述。In a possible implementation manner, the server acquiring the information of the first target model includes the following steps A-step E. The following steps are described by taking as an example that the devices determined by the server that need to perform model training are the first device and the second device. When the number of devices that need to perform model training determined by the server is greater than or equal to 3, the situation in which the server obtains the first target model may refer to the situation that the devices determined by the server to be subjected to model training are the first device and the second device, and details are not repeated. .
其中,第一设备和第二设备可以为图1中的设备。例如,若第一设备为图1中的设备102,则第二设备可以为图1中的设备103或设备104。若第一设备为图1中的设备103,则第二设备可以为图1中的设备102或设备104。若第一设备为图1中的设备104,则第二设备可以为图1中的设备102或设备103。The first device and the second device may be the devices in FIG. 1 . For example, if the first device is the device 102 in FIG. 1 , the second device may be the device 103 or the device 104 in FIG. 1 . If the first device is the device 103 in FIG. 1 , the second device may be the device 102 or the device 104 in FIG. 1 . If the first device is the device 104 in FIG. 1 , the second device may be the device 102 or the device 103 in FIG. 1 .
步骤A:服务器向第一设备发送第三初始模型的信息和第一应用集合包含的第一应用的列表。Step A: The server sends the information of the third initial model and the list of the first applications included in the first application set to the first device.
其中,第三初始模型的信息和第一应用的列表的介绍可以参考上述步骤3011中所述。Wherein, for the information of the third initial model and the introduction of the list of the first application, reference may be made to the above step 3011 .
步骤B:服务器接收来自第一设备的第三中间模型的信息。Step B: The server receives the information of the third intermediate model from the first device.
其中,第三中间模型的信息的介绍可以参考上述步骤3013中的描述。For the introduction of the information of the third intermediate model, reference may be made to the description in the foregoing step 3013 .
步骤C:服务器向第二设备发送第三初始模型的信息和第一应用集合包括的第一应用的列表。Step C: The server sends the information of the third initial model and the list of the first applications included in the first application set to the second device.
步骤D:服务接收来自第二设备的第四中间模型的信息。Step D: The service receives the information of the fourth intermediate model from the second device.
其中,第四中间模型的信息的介绍可以参考上述第三中间模型的信息的描述。For the introduction of the information of the fourth intermediate model, reference may be made to the description of the information of the third intermediate model above.
步骤E:服务器将第三中间模型的信息和第四中间模型的信息聚合,以得到第一目标模型的信息。Step E: The server aggregates the information of the third intermediate model and the information of the fourth intermediate model to obtain the information of the first target model.
一种可能的实现方式,服务器将第三中间模型的信息和第四中间模型的信息进行加权求和,得到第一目标模型的信息。In a possible implementation manner, the server performs weighted summation of the information of the third intermediate model and the information of the fourth intermediate model to obtain the information of the first target model.
需要说明的是,上述步骤A-步骤E是以第一设备和第二设备进行一次模型训练,服务器即得到第一目标模型的信息为例进行介绍的。在实际应用中,第一设备和第二设备可能进行多次模型训练,服务器才能得到第一目标模型的信息。也就是说,根据步骤E中的第一目标模型的信息,得到的模型可能是一个未完成的第一目标模型,即根据步骤E中的第一目标模型的信息,得到的模型可能不收敛。在这种情况下,服务器可以多次接收来自第一设备和第二设备的中间模型的信息,每次对接收到的中间模型的进行进行聚合,得到聚合后的信息,若根据聚合后的信息得到的模型收敛,则该模型即为第一目标模型,若不收敛,则重复执行上述步骤,直到得到的模型收敛。It should be noted that, the above steps A to E are described by taking the example that the first device and the second device perform one model training, and the server obtains the information of the first target model. In practical applications, the first device and the second device may perform model training multiple times before the server can obtain the information of the first target model. That is, according to the information of the first target model in step E, the obtained model may be an unfinished first target model, that is, according to the information of the first target model in step E, the obtained model may not converge. In this case, the server may receive information from the intermediate models of the first device and the second device multiple times, and aggregate the received intermediate models each time to obtain the aggregated information. If the obtained model converges, the model is the first target model. If it does not converge, the above steps are repeated until the obtained model converges.
可以理解的,在步骤A之前,服务器还可以对第一应用的数据包进行标注。或者,服务器可以通过管理员对第一应用的数据包进行标注。例如,服务器接收来自第一设备的第一应用的数据包;服务器根据第一应用的数据包,获取已标注的第一应用的数据包;服务器向第一设备发送已标注的第一应用的数据包。It can be understood that, before step A, the server may also mark the data packet of the first application. Alternatively, the server may mark the data packet of the first application through the administrator. For example, the server receives the data packet of the first application from the first device; the server obtains the marked data packet of the first application according to the data packet of the first application; the server sends the marked data of the first application to the first device Bag.
服务器对第一应用的数据包进行标注的情况下,服务器根据第一应用的数据包,获取已标注的第一应用的数据包,包括:服务器对第一应用的数据包进行标注,得到已标注的第一应用的数据包。When the server marks the data packet of the first application, the server obtains the marked data packet of the first application according to the data packet of the first application, which includes: the server marks the data packet of the first application, and obtains the marked data packet of the first application. the first application packet.
服务器通过管理员对第一应用的数据包进行标注的情况下,服务器根据第一应用的数据包,获取已标注的第一应用的数据包,包括:响应于管理员的输入,服务器接收已标注的第一应用的数据包。When the server marks the data packet of the first application by the administrator, the server obtains the marked data packet of the first application according to the data packet of the first application, including: in response to the input of the administrator, the server receives the marked data packet of the first application. the first application packet.
步骤902:服务器向第一设备发送第一目标模型的信息。Step 902: The server sends the information of the first target model to the first device.
步骤903:在满足触发条件的情况下,服务器获取第二目标模型的信息。Step 903: In the case that the trigger condition is satisfied, the server obtains the information of the second target model.
其中,触发条件的介绍可以参考上述步骤302中所述。第二目标模型的信息的介绍可以参考上述步骤3024中所述。第二目标模型的介绍可以参考上述步骤302中所述。For the introduction of the triggering condition, reference may be made to the description in step 302 above. For the introduction of the information of the second target model, reference may be made to the description in step 3024 above. For the introduction of the second target model, reference may be made to the description in step 302 above.
一种可能的实现方式,服务器获取第二目标模型的信息包括下述步骤a-步骤e。下述步骤是以服务器确定的需要进行模型训练的设备为第一设备和第二设备为例进行介绍的。服务器确定的需要进行模型训练的设备的数量大于或等于3时,服务器获取第二目标模型的信息的情况可以参考服务器确定的需要进行模型训练的设备为第一设备和第二设备的情况,不予赘述。In a possible implementation manner, the server acquiring the information of the second target model includes the following steps a-e. The following steps are described by taking as an example that the devices determined by the server that need to perform model training are the first device and the second device. When the number of devices that need model training determined by the server is greater than or equal to 3, the information about the second target model obtained by the server may refer to the situation that the devices determined by the server that need model training are the first device and the second device. To repeat.
步骤a:服务器向第一设备发送第一初始模型的信息和第二应用集合包含的第二应用的列表。Step a: The server sends the information of the first initial model and the list of second applications included in the second application set to the first device.
其中,第一初始模型的信息和第二应用的列表的介绍可以参考上述步骤3021中所述。For the introduction of the information of the first initial model and the list of the second application, reference may be made to the above step 3021 .
步骤b:服务器接收来自第一设备的第一中间模型的信息。Step b: The server receives the information of the first intermediate model from the first device.
其中,第一中间模型的信息的介绍可以参考上述步骤3023中的描述。For the introduction of the information of the first intermediate model, reference may be made to the description in the foregoing step 3023 .
步骤c:服务器向第二设备发送第一初始模型的信息和第二应用集合包括的第二应用的列表。Step c: The server sends the information of the first initial model and the list of second applications included in the second application set to the second device.
步骤d:服务接收来自第二设备的第二中间模型的信息。Step d: The service receives the information of the second intermediate model from the second device.
其中,第二中间模型的信息的介绍可以参考上述第一中间模型的信息的描述。For the introduction of the information of the second intermediate model, reference may be made to the description of the information of the first intermediate model above.
步骤e:服务器将第一中间模型的信息和第二中间模型的信息聚合,以得到第二目标模型的信息。Step e: The server aggregates the information of the first intermediate model and the information of the second intermediate model to obtain the information of the second target model.
一种可能的实现方式,服务器将第一中间模型的信息和第二中间模型的信息进行加权求和,得到第二目标模型的信息。In a possible implementation manner, the server performs weighted summation of the information of the first intermediate model and the information of the second intermediate model to obtain the information of the second target model.
需要说明的是,上述步骤a-步骤e是以第一设备和第二设备进行一次模型训练,服务器即得到第二目标模型的信息为例进行介绍的。在实际应用中,第一设备和第二设备可能进行多次模型训练,服务器才能得到第二目标模型的信息。也就是说,根据步骤e中的第二目标模型的信息,得到的模型可能是一个未完成的第二目标模型,即根据步骤e中的第二目标模型的信息,得到的模型可能不收敛。在这种情况下,服务器可以多次接收来自第一设备和第二设备的中间模型的信息,每次对接收到的中间模型的进行进行聚合,得到聚合后的信息,若根据聚合后的信息得到的模型收敛,则该模型即为第二目标模型,若不收敛,则重复执行上述步骤,直到得到的模型收敛。It should be noted that, the above steps a to e are described by taking the example that the first device and the second device perform a model training, and the server obtains the information of the second target model as an example. In practical applications, the first device and the second device may perform model training multiple times before the server can obtain the information of the second target model. That is, according to the information of the second target model in step e, the obtained model may be an unfinished second target model, that is, according to the information of the second target model in step e, the obtained model may not converge. In this case, the server may receive information from the intermediate models of the first device and the second device multiple times, and aggregate the received intermediate models each time to obtain the aggregated information. If the obtained model converges, the model is the second target model. If it does not converge, the above steps are repeated until the obtained model converges.
可以理解的,在步骤a之前,服务器还可以对第二应用的数据包进行标注。或者,服务器可以通过管理员对第二应用的数据包进行标注。例如,服务器接收来自第一设备的第二应用的数据包;服务器根据第二应用的数据包,获取已标注的第二应用的数据包;服务器向第一设备发送已标注的第二应用的数据包。It can be understood that, before step a, the server may also mark the data packet of the second application. Alternatively, the server may mark the data packets of the second application through the administrator. For example, the server receives the data packet of the second application from the first device; the server obtains the marked data packet of the second application according to the data packet of the second application; the server sends the marked data of the second application to the first device Bag.
服务器对第二应用的数据包进行标注的情况下,服务器根据第二应用的数据包,获取已标注的第二应用的数据包,包括:服务器对第二应用的数据包进行标注,得到已标注的第二应用的数据包。When the server marks the data packet of the second application, the server obtains the marked data packet of the second application according to the data packet of the second application, which includes: the server marks the data packet of the second application, and obtains the marked data packet of the second application. the data package of the second application.
服务器通过管理员对第二应用的数据包进行标注的情况下,服务器根据第二应用的数据包,获取已标注的第二应用的数据包,包括:响应于管理员的输入,服务器接收已标注的第二应用的数据包。When the server marks the data packet of the second application by the administrator, the server obtains the marked data packet of the second application according to the data packet of the second application, including: in response to the administrator's input, the server receives the marked data packet the data package of the second application.
步骤904:服务器向第一设备发送第二目标模型的信息。Step 904: The server sends the information of the second target model to the first device.
可以理解的,服务器可以监控第一设备上的模型识别数据包的正确率,若第一设备上的模型识别数据包的正确率小于或等于第三阈值,服务器向第一设备发送指示信息,指示信息用于指示第一设备重新训练用于识别第一应用的数据包和第二应用的数据包的第四目标模型。其中,第四目标模型是根据已标注的第一应用的数据包和已标注的第二应用的数据包训练得到的。而第一设备根据第一目标模型和第二目标模型识别数据包时,是根据输出熵推测出的结果。因此,第四目标模型识别数据包的正确率大于,第一设备根据第一目标模型和第二目标模型识别数据包的正确率。如此,可以提高第一设备识别数据包的正确率。It can be understood that the server can monitor the correct rate of the model identification data packet on the first device. If the correct rate of the model identification data packet on the first device is less than or equal to the third threshold, the server sends an indication message to the first device, indicating that The information is used to instruct the first device to retrain a fourth target model for identifying the data packets of the first application and the data packets of the second application. The fourth target model is obtained by training according to the marked data packets of the first application and the marked data packets of the second application. When the first device identifies the data packet according to the first target model and the second target model, it is the result inferred according to the output entropy. Therefore, the correct rate of identifying the data packet by the fourth target model is greater than the correct rate of identifying the data packet by the first device according to the first target model and the second target model. In this way, the correct rate of identifying the data packet by the first device can be improved.
示例性的,若第一目标模型和第二目标模型识别数据包的正确率小于或等于第三阈值,服务器向第一设备发送指示信息。或者,若第三目标模型识别数据包的正确率小于或等于第 三阈值,服务器向第一设备发送指示信息。其中,第三目标模型的介绍可以参考上述图8所示方法中所述。Exemplarily, if the correct rate of identifying the data packets by the first target model and the second target model is less than or equal to the third threshold, the server sends indication information to the first device. Alternatively, if the correct rate of identifying the data packet by the third target model is less than or equal to the third threshold, the server sends the indication information to the first device. For the introduction of the third target model, reference may be made to the method shown in FIG. 8 above.
基于图9所示的方法,服务器不需要进行模型训练,而是将模型训练的过程下放给参与模型训练的设备(第一设备和第二设备),服务器将来自多个设备的中间模型的信息进行聚合即可,降低了服务器的计算开销。而每个参与模型训练的设备在训练模型时使用的已标注数据包的数量也小于服务器训练模型时使用的已标注数据包的数量,对于这些设备来说,计算量也不大,还可以节约模型训练的时间。Based on the method shown in Figure 9, the server does not need to perform model training, but delegates the model training process to the devices (the first device and the second device) participating in the model training, and the server transfers the information from the intermediate models of multiple devices Aggregation can be performed, which reduces the computing overhead of the server. The number of labeled data packets used by each device participating in model training is also smaller than the number of labeled data packets used by the server when training the model. For these devices, the amount of calculation is not large, and it can save money Model training time.
上述图3、图5、图7和图8所示的数据包的识别方法应用于第一设备,图9所示的数据包的识别方法应用于服务器。下面以第一设备、第二设备与服务器交互的角度对本申请实施例提供的数据包的识别方法进行介绍。The above-mentioned methods for identifying data packets shown in FIG. 3 , FIG. 5 , FIG. 7 and FIG. 8 are applied to the first device, and the method for identifying data packets shown in FIG. 9 is applied to the server. The method for identifying the data packet provided by the embodiment of the present application is described below from the perspective of the interaction between the first device, the second device and the server.
如图10所示,为本申请实施例提供的又一种数据包的识别方法,该数据包的识别方法可以包括步骤1001-步骤1019。As shown in FIG. 10 , another method for identifying a data packet provided by an embodiment of the present application, the method for identifying a data packet may include steps 1001 to 1019 .
步骤1001:服务器向第一设备发送第三初始模型的信息和第一应用集合包含的第一应用的列表。Step 1001: The server sends the information of the third initial model and the list of the first applications included in the first application set to the first device.
其中,步骤1001的介绍可以参考上述步骤A中所述。For the introduction of step 1001, reference may be made to the description in step A above.
对应的,第一设备接收来自服务器的第三初始模型的信息和第一应用集合包含的第一应用的列表。Correspondingly, the first device receives the information of the third initial model from the server and the list of the first applications included in the first application set.
步骤1002:第一设备根据第一设备获得的已标注的第一应用的数据包训练第三初始模型,得到第三中间模型。Step 1002: The first device trains a third initial model according to the marked data packets of the first application obtained by the first device, and obtains a third intermediate model.
步骤1003:第一设备向服务器发送第三中间模型的信息。Step 1003: The first device sends the information of the third intermediate model to the server.
步骤1002-步骤1003的介绍可以参考上述步骤3012-步骤3013。For the introduction of steps 1002 to 1003, reference may be made to the above steps 3012 to 3013.
对应的,服务器接收来自第一设备的第三中间模型的信息。Correspondingly, the server receives the information of the third intermediate model from the first device.
步骤1004:服务器向第二设备发送第三初始模型的信息和第一应用集合包括的第一应用的列表。Step 1004: The server sends the information of the third initial model and the list of the first applications included in the first application set to the second device.
其中,步骤1004的介绍可以参考上述步骤C中所述。For the introduction of step 1004, reference may be made to the description in step C above.
对应的,第二设备接收来自服务器的第三初始模型的信息和第一应用集合包含的第一应用的列表。Correspondingly, the second device receives the information of the third initial model and the list of the first applications included in the first application set from the server.
步骤1005:第二设备根据第二设备获得的已标注的第一应用的数据包训练第三初始模型,得到第四中间模型。Step 1005: The second device trains the third initial model according to the marked data packets of the first application obtained by the second device, and obtains a fourth intermediate model.
步骤1006:第二设备向服务器发送第四中间模型的信息。Step 1006: The second device sends the information of the fourth intermediate model to the server.
步骤1005-步骤1006的介绍可以参考上述步骤3012-步骤3013中对应的描述。For the introduction of steps 1005 to 1006, reference may be made to the corresponding descriptions in the foregoing steps 3012 to 3013.
对应的,服务器接收来自第二设备的第四中间模型的信息。Correspondingly, the server receives the information of the fourth intermediate model from the second device.
可以理解的,本申请实施例不限制步骤1001-步骤1003,以及步骤1004-步骤1006的执行顺序。例如,本申请实施例可以先执行步骤1001-步骤1003,再执行步骤1004-步骤1006。本申请实施例也可以先执行步骤1004-步骤1006,再执行步骤1001-步骤1003。本申请实施例还可以同时执行步骤1004-步骤1006,以及步骤1001-步骤1003。It can be understood that the embodiments of the present application do not limit the execution order of steps 1001 to 1003 and steps 1004 to 1006 . For example, in this embodiment of the present application, steps 1001 to 1003 may be performed first, and then steps 1004 to 1006 may be performed. In this embodiment of the present application, steps 1004 to 1006 may also be performed first, and then steps 1001 to 1003 are performed. In this embodiment of the present application, steps 1004 to 1006 and steps 1001 to 1003 may also be performed simultaneously.
步骤1007:服务器将第三中间模型的信息和第四中间模型的信息聚合,以得到第一目标模型的信息。Step 1007: The server aggregates the information of the third intermediate model and the information of the fourth intermediate model to obtain the information of the first target model.
步骤1007的介绍可以参考上述步骤E的介绍。For the description of step 1007, reference may be made to the description of step E above.
步骤1008:服务器向第一设备发送第一目标模型的信息。Step 1008: The server sends the information of the first target model to the first device.
对应的,第一设备接收来自服务器的第一目标模型的信息。Correspondingly, the first device receives the information of the first target model from the server.
步骤1009:第一设备根据第一目标模型的信息和第三初始模型,得到第一目标模型。Step 1009: The first device obtains the first target model according to the information of the first target model and the third initial model.
步骤1009的介绍可以参考上述步骤3015中所述。For the introduction of step 1009, reference may be made to the description in step 3015 above.
步骤1010:服务器向第一设备发送第一初始模型的信息和第二应用集合包含的第二应用的列表。Step 1010: The server sends the information of the first initial model and the list of second applications included in the second application set to the first device.
其中,步骤1010的介绍可以参考上述步骤a中所述。For the introduction of step 1010, reference may be made to the description in step a above.
对应的,第一设备接收来自服务器的第一初始模型的信息和第二应用集合包含的第二应用的列表。Correspondingly, the first device receives information from the server of the first initial model and a list of second applications included in the second application set.
步骤1011:第一设备根据第一设备获得的已标注的第二应用的数据包训练第一初始模型,得到第一中间模型。Step 1011 : The first device trains the first initial model according to the marked data packet of the second application obtained by the first device to obtain a first intermediate model.
步骤1012:第一设备向服务器发送第一中间模型的信息。Step 1012: The first device sends the information of the first intermediate model to the server.
步骤1011-步骤1012的介绍可以参考上述步骤3022-步骤3023。For the introduction of steps 1011 to 1012, reference may be made to the above steps 3022 to 3023.
对应的,服务器接收来自第一设备的第一中间模型的信息。Correspondingly, the server receives the information of the first intermediate model from the first device.
步骤1013:服务器向第二设备发送第一初始模型的信息和第二应用集合包括的第二应用的列表。Step 1013: The server sends the information of the first initial model and the list of second applications included in the second application set to the second device.
其中,步骤1013的介绍可以参考上述步骤c中所述。Wherein, for the introduction of step 1013, reference may be made to the description in step c above.
对应的,第二设备接收来自服务器的第一初始模型的信息和第二应用集合包含的第二应用的列表。Correspondingly, the second device receives information from the server of the first initial model and a list of second applications included in the second application set.
步骤1014:第二设备根据第二设备获得的已标注的第二应用的数据包训练第一初始模型,得到第二中间模型。Step 1014: The second device trains the first initial model according to the marked data packet of the second application obtained by the second device, to obtain a second intermediate model.
步骤1015:第二设备向服务器发送第二中间模型的信息。Step 1015: The second device sends the information of the second intermediate model to the server.
步骤1014-步骤1015的介绍可以参考上述步骤3022-步骤3023中对应的描述。For the introduction of steps 1014 to 1015, reference may be made to the corresponding descriptions in the foregoing steps 3022 to 3023.
对应的,服务器接收来自第二设备的第二中间模型的信息。Correspondingly, the server receives the information of the second intermediate model from the second device.
可以理解的,本申请实施例不限制步骤1010-步骤1012,以及步骤1013-步骤1015的执行顺序。例如,本申请实施例可以先执行步骤1010-步骤1012,再执行步骤1013-步骤1015。本申请实施例也可以先执行步骤1013-步骤1015,再执行步骤1010-步骤1012。本申请实施例还可以同时执行步骤1013-步骤1015,以及步骤1010-步骤1012。It can be understood that the embodiments of the present application do not limit the execution order of steps 1010 to 1012 and steps 1013 to 1015 . For example, in this embodiment of the present application, steps 1010 to 1012 may be performed first, and then steps 1013 to 1015 may be performed. In this embodiment of the present application, steps 1013 to 1015 may also be performed first, and then steps 1010 to 1012 are performed. In this embodiment of the present application, steps 1013 to 1015 and steps 1010 to 1012 may be performed simultaneously.
步骤1016:服务器将第一中间模型的信息和第二中间模型的信息聚合,以得到第二目标模型的信息。Step 1016: The server aggregates the information of the first intermediate model and the information of the second intermediate model to obtain the information of the second target model.
步骤1016的介绍可以参考上述步骤e的介绍。For the description of step 1016, reference may be made to the description of step e above.
步骤1017:服务器向第一设备发送第二目标模型的信息。Step 1017: The server sends the information of the second target model to the first device.
对应的,第一设备接收来自服务器的第二目标模型的信息。Correspondingly, the first device receives the information of the second target model from the server.
步骤1018:第一设备根据第二目标模型的信息和第一初始模型,得到第二目标模型。Step 1018: The first device obtains the second target model according to the information of the second target model and the first initial model.
步骤1018的介绍可以参考上述步骤3025中所述。For the introduction of step 1018, reference may be made to the description in step 3025 above.
步骤1019:第一设备获取第三数据包,根据第一目标模型和第二目标模型,确定第三数据包对应的第一应用或第二应用。Step 1019: The first device acquires the third data packet, and determines the first application or the second application corresponding to the third data packet according to the first target model and the second target model.
步骤1019的介绍可以参考上述步骤303中所述。For the introduction of step 1019, reference may be made to the description in step 303 above.
基于图10所示的方法,一方面,服务器不需要进行模型训练,而是将模型训练的过程 下放给参与模型训练的设备(第一设备和第二设备),服务器将来自多个设备的中间模型的信息进行聚合即可,降低了服务器的计算开销。另一方面,在使用第一目标模型后出现新增应用(新增应用即为第二应用集合中的应用)的情况下,第一设备不需要根据被标注过的第一应用集合和第二应用集合中的应用的数据包进行模型训练,得到一个既能够识别第一应用集合中的应用的数据包,又能够识别第二应用集合中的应用的数据包的模型。而第一设备可以根据被标注过的第二应用的数据包进行模型训练,得到第二目标模型,后续,根据第一目标模型和第二目标模型识别第一应用集合中的应用的数据包,或第二应用集合中的应用的数据包。而被标注过的第二应用的数据包的数量要远远小于被标注过的第一应用的数据包和第二应用的数据包的数量,所以第一设备的计算量小,而且训练时间短。另外,在图10所示方法中,在出现新增应用的情况下,第一设备采用的是被标注过的第二应用的数据包进行模型训练,因此可以释放被标注过的第一应用的数据包,降低了数据存储的成本。Based on the method shown in Figure 10, on the one hand, the server does not need to perform model training, but delegates the model training process to the devices (the first device and the second device) participating in the model training. The information of the model can be aggregated, which reduces the computing overhead of the server. On the other hand, when a new application appears after using the first target model (the new application is the application in the second application set), the first device does not need to use the marked first application set and the second Model training is performed on the data packets of the applications in the application set to obtain a model that can identify both the data packets of the applications in the first application set and the data packets of the applications in the second application set. The first device can perform model training according to the marked data packets of the second application to obtain a second target model, and subsequently, identify the data packets of the applications in the first application set according to the first target model and the second target model, or data packets of applications in the second application set. The number of marked data packets of the second application is much smaller than the number of marked data packets of the first application and the second application, so the calculation amount of the first device is small and the training time is short. . In addition, in the method shown in FIG. 10 , in the case of a newly added application, the first device uses the data package of the marked second application for model training, so the marked first application can be released. data packets, reducing the cost of data storage.
可以理解的,在第一设备获取了多次第二目标模型的情况下,第一设备识别第三数据包时,需要获取第一目标模型和多个第二目标模型中,每个目标模型对应的输出熵,再根据获取的多个输出熵确定第三数据包对应的应用,因此,第一设备识别第三数据包的时间可能较长,影响用户体验。在这种情况下,第一设备可以将第一目标模型和多个目标模型压缩为一个目标模型,后续,通过压缩后的目标模型识别第三数据包,可以节约第一设备识别第三数据包的时间。具体的,可以参考图11所示的方法。It can be understood that in the case where the first device has acquired the second target model multiple times, when the first device recognizes the third data packet, it needs to acquire the first target model and the plurality of second target models, each of which corresponds to the target model. and then determine the application corresponding to the third data packet according to the obtained multiple output entropies. Therefore, it may take a long time for the first device to identify the third data packet, which affects user experience. In this case, the first device can compress the first target model and multiple target models into one target model, and subsequently, identify the third data packet through the compressed target model, which can save the first device from identifying the third data packet time. Specifically, reference may be made to the method shown in FIG. 11 .
如图11所示,在图10所示方法的一种可能的实现方式中,图10所示的方法还包括步骤1101和步骤1102。As shown in FIG. 11 , in a possible implementation manner of the method shown in FIG. 10 , the method shown in FIG. 10 further includes step 1101 and step 1102 .
步骤1101:第一设备获取第二初始模型。Step 1101: The first device acquires a second initial model.
步骤1102:第一设备根据第一目标模型和第二目标模型对第一设备获得的数据包的标注结果,训练第二初始模型以得到第三目标模型。Step 1102: The first device trains the second initial model to obtain the third target model according to the labeling result of the data packet obtained by the first device by the first target model and the second target model.
步骤1101和步骤1102的介绍可以参考上述步骤801和802中所述。For the introduction of steps 1101 and 1102, reference may be made to the descriptions in steps 801 and 802 above.
基于图11所示的方法,第一设备获取了多次第二目标模型的情况下,可以获取第二初始模型,并根据第一目标模型和第二目标模型对第一设备获得的数据包的标注结果,训练第二初始模型以得到第三目标模型。后续,第一设备即可根据第三目标模型识别数据包,可以节约第一设备识别数据包的时间。另外,第一设备通过对模型的不断压缩,可以使得模型尺寸稳定,有利于模型在片上系统部署。Based on the method shown in FIG. 11 , when the first device acquires the second target model multiple times, the second initial model can be acquired, and the data packets obtained by the first device can be processed according to the first target model and the second target model. Label the results and train the second initial model to obtain the third target model. Subsequently, the first device can identify the data packet according to the third target model, which can save time for the first device to identify the data packet. In addition, by continuously compressing the model, the first device can stabilize the size of the model, which is beneficial to the deployment of the model in the system-on-chip.
上述图3、图5、图7-图11所示的数据包的识别方法是以联邦学习场景为例介绍的。下面以非联邦学习场景为例介绍本申请实施例提供的数据包的识别方法。The method for identifying the data packets shown in Figure 3, Figure 5, Figure 7-Figure 11 above is introduced by taking the federated learning scenario as an example. The following takes a non-federated learning scenario as an example to introduce the data packet identification method provided by the embodiment of the present application.
如图12所示,为本申请实施例提供的又一种数据包的识别方法。该方法包括步骤1201-步骤1203。As shown in FIG. 12 , another method for identifying a data packet provided by an embodiment of the present application. The method includes steps 1201-1203.
步骤1201:第一装置获取第一目标模型。Step 1201: The first device acquires a first target model.
其中,第一装置可以为图1中的服务器101、设备102、设备103或者设备104。The first apparatus may be the server 101 , the device 102 , the device 103 or the device 104 in FIG. 1 .
其中,第一目标模型的介绍可以参考上述步骤301中对应的描述。For the introduction of the first target model, reference may be made to the corresponding description in the foregoing step 301 .
一种可能的实现方式,第一装置在初始化(例如,第一装置第一次开机,或第一装置恢复出厂设置)的情况下,获取第一目标模型。In a possible implementation manner, the first device acquires the first target model when the first device is initialized (for example, the first device is powered on for the first time, or the first device is restored to factory settings).
一种可能的实现方式,第一装置获取第一目标模型包括以下步骤1-步骤3。In a possible implementation manner, the acquisition of the first target model by the first device includes the following steps 1-3.
步骤1:第一装置获取已标注的第一应用集合中第一应用的数据包。Step 1: The first device acquires a data packet of the first application in the marked first application set.
其中,第一装置获得的已标注的第一应用集合中第一应用的数据包可以是人工标注的,也可以是机器标注的。The data packet of the first application in the marked first application set obtained by the first device may be marked manually or marked by a machine.
步骤2:第一装置获取第三初始模型和第一应用集合包含的第一应用的列表。Step 2: The first device acquires the third initial model and the list of first applications included in the first application set.
其中,第三初始模型和第一应用的列表的介绍可以参考上述3011中所述。For the introduction of the third initial model and the list of the first application, reference may be made to the description in 3011 above.
步骤3:第一装置根据已标注的第一应用的数据包,训练第三初始模型,以得到第一目标模型。Step 3: The first device trains the third initial model according to the marked data packets of the first application to obtain the first target model.
其中,步骤3的介绍可以参考上述步骤3012中对应的描述。For the introduction of step 3, reference may be made to the corresponding description in step 3012 above.
步骤1202:在满足触发条件的情况下,第一装置获取第二目标模型。Step 1202: In the case that the trigger condition is satisfied, the first device acquires the second target model.
其中,触发条件的介绍可以参考上述步骤302中所述。For the introduction of the triggering condition, reference may be made to the description in step 302 above.
一种可能的实现方式,第一装置获取第二目标模型包括以下步骤4-步骤6。In a possible implementation manner, the acquisition of the second target model by the first device includes the following steps 4-6.
步骤4:第一装置获取已标注的第二应用集合中第二应用的数据包。Step 4: The first device acquires the data packet of the second application in the marked second application set.
其中,第一装置获得的已标注的第二应用集合中第二应用的数据包可以是人工标注的,也可以是机器标注的。The data packets of the second application in the marked second application set obtained by the first device may be manually marked or machine marked.
步骤5:第一装置获取第一初始模型和第二应用集合包含的第二应用的列表。Step 5: The first device acquires the first initial model and a list of second applications included in the second application set.
其中,第一初始模型和第二应用的列表的介绍可以参考上述3021中所述。For the introduction of the list of the first initial model and the second application, reference may be made to the description in 3021 above.
步骤6:第一装置根据已标注的第二应用的数据包,训练第一初始模型,以得到第二目标模型。Step 6: The first device trains the first initial model according to the marked data packets of the second application to obtain the second target model.
其中,步骤6的介绍可以参考上述步骤3022中对应的描述。For the introduction of step 6, reference may be made to the corresponding description in step 3022 above.
可以理解的,每次满足触发条件,第一装置都会获取第二目标模型。也就是说,在步骤1203之前,或者,步骤1203之后,第一装置可以多次获取第二目标模型。不同的是,每次获取的第二目标模型对应的第二应用集合中的应用不同。第二应用集合包括第一装置上一次获取目标模型之后,安装在服务器、第一装置或其他设备上的应用。It can be understood that each time the trigger condition is satisfied, the first device will acquire the second target model. That is, before step 1203, or after step 1203, the first device may acquire the second target model for multiple times. The difference is that the applications in the second application set corresponding to the second target model acquired each time are different. The second set of applications includes applications installed on the server, the first device or other devices after the first device acquires the target model last time.
步骤1203:第一装置获取第三数据包,根据第一目标模型和第二目标模型,确定第三数据包对应的第一应用或第二应用。Step 1203: The first device acquires the third data packet, and determines the first application or the second application corresponding to the third data packet according to the first target model and the second target model.
步骤1203的介绍可以参考上述步骤303中所述。For the introduction of step 1203, reference may be made to the description in step 303 above.
基于图12所示的方法,在使用第一目标模型后出现新增应用(新增应用即为第二应用集合中的应用)的情况下,第一装置不需要根据被标注过的第一应用集合和第二应用集合中的应用的数据包进行模型训练,得到一个既能够识别第一应用集合中的应用的数据包,又能够识别第二应用集合中的应用的数据包的模型。而第一装置可以根据被标注过的第二应用的数据包进行模型训练,得到第二目标模型,后续,根据第一目标模型和第二目标模型识别第一应用集合中的应用的数据包,或第二应用集合中的应用的数据包。因为被标注过的第二应用的数据包的数量要远远小于被标注过的第一应用的数据包和第二应用的数据包的数量,所以图12所示方法中,第一装置的计算量小,而且训练时间短。另外,在图12所示方法中,在出现新增应用的情况下,第一装置采用的是被标注过的第二应用的数据包进行模型训练,因此可以释放被标注过的第一应用的数据包,降低了数据存储的成本。Based on the method shown in FIG. 12 , when a new application appears after using the first target model (the new application is the application in the second application set), the first device does not need to use the marked first application Model training is performed on the set and the data packets of the applications in the second application set to obtain a model that can identify both the data packets of the applications in the first application set and the data packets of the applications in the second application set. The first device can perform model training according to the marked data packets of the second application to obtain the second target model, and subsequently, identify the data packets of the applications in the first application set according to the first target model and the second target model, or data packets of applications in the second application set. Because the number of marked data packets of the second application is much smaller than the marked number of data packets of the first application and the second application, in the method shown in FIG. 12, the calculation of the first device The volume is small and the training time is short. In addition, in the method shown in FIG. 12 , in the case of a newly added application, the first device uses the data package of the marked second application for model training, so the marked first application can be released. data packets, reducing the cost of data storage.
可以理解的,在第一装置获取了多次第二目标模型的情况下,第一装置识别第三数据包时,需要获取第一目标模型和多个第二目标模型中,每个目标模型对应的输出熵,再根据获取的多个输出熵确定第三数据包对应的应用,因此,第一装置识别第三数据包的时间可能较长,影响用户体验。在这种情况下,第一装置可以将第一目标模型和多个目标模型压缩为一 个目标模型,后续,通过压缩后的目标模型识别第三数据包,可以节约第一装置识别第三数据包的时间。具体的,可以参考图13所示的方法。It can be understood that in the case where the first device has acquired the second target model multiple times, when the first device recognizes the third data packet, it needs to acquire the first target model and the plurality of second target models, each of which corresponds to the target model. Then, the application corresponding to the third data packet is determined according to the obtained multiple output entropies. Therefore, it may take a long time for the first device to identify the third data packet, which affects user experience. In this case, the first device can compress the first target model and multiple target models into one target model, and subsequently, identify the third data packet by using the compressed target model, which can save the first device from identifying the third data packet time. Specifically, reference may be made to the method shown in FIG. 13 .
如图13所示,在图12所示方法的一种可能的实现方式中,图12所示的方法还包括步骤1301和步骤1302。As shown in FIG. 13 , in a possible implementation manner of the method shown in FIG. 12 , the method shown in FIG. 12 further includes step 1301 and step 1302 .
步骤1301:第一装置获取第二初始模型。Step 1301: The first device acquires a second initial model.
步骤1302:第一装置根据第一目标模型和第二目标模型对第一装置获得的数据包的标注结果,训练第二初始模型以得到第三目标模型。Step 1302: The first device trains the second initial model to obtain the third target model according to the labeling results of the data packets obtained by the first device by the first target model and the second target model.
步骤1301和步骤1302的介绍可以参考上述步骤801和步骤802中所述。For the introduction of step 1301 and step 1302, reference may be made to the description in step 801 and step 802 above.
基于图13所示的方法,第一装置获取了多次第二目标模型的情况下,可以获取第二初始模型,并根据第一目标模型和第二目标模型对第一装置获得的数据包的标注结果,训练第二初始模型以得到第三目标模型。后续,第一装置即可根据第三目标模型识别数据包,可以节约第一装置识别数据包的时间。另外,第一装置通过对模型的不断压缩,可以使得模型尺寸稳定,有利于模型在片上系统部署。Based on the method shown in FIG. 13 , when the first device acquires the second target model multiple times, the second initial model can be acquired, and the data packets obtained by the first device can be processed according to the first target model and the second target model. Label the results and train the second initial model to obtain the third target model. Subsequently, the first device can identify the data packet according to the third target model, which can save time for the first device to identify the data packet. In addition, the first device can stabilize the size of the model by continuously compressing the model, which is beneficial to the deployment of the model in the system-on-chip.
可以理解的是,上述第一设备、服务器或者第一装置等为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法操作,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。It can be understood that, in order to implement the above-mentioned functions, the above-mentioned first device, server, or first apparatus, etc., include corresponding hardware structures and/or software modules for executing each function. Those skilled in the art should easily realize that the unit and algorithm operations of each example described in conjunction with the embodiments disclosed herein can be implemented in hardware or in the form of a combination of hardware and computer software. Whether a function is performed by hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
本申请实施例可以根据上述方法示例对第一设备、服务器或者第一装置进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In this embodiment of the present application, the first device, the server, or the first device may be divided into functional modules according to the foregoing method examples. For example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one in the processing module. The above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules. It should be noted that, the division of modules in the embodiments of the present application is schematic, and is only a logical function division, and there may be other division manners in actual implementation.
比如,以采用集成的方式划分各个功能模块的情况下,图14示出了一种数据包的识别装置的结构示意图。该装置可以为第一设备或者第一设备中的芯片或者片上系统,该装置可以用于执行上述实施例中涉及的第一设备的功能。For example, in the case of dividing each functional module in an integrated manner, FIG. 14 shows a schematic structural diagram of an apparatus for identifying a data packet. The apparatus may be the first device or a chip or a system-on-chip in the first device, and the apparatus may be used to execute the functions of the first device involved in the foregoing embodiments.
作为一种可能的实现方式,图14所示的装置包括:获取模块1401和确定模块1402。As a possible implementation manner, the apparatus shown in FIG. 14 includes: an acquisition module 1401 and a determination module 1402 .
获取模块1401,用于获取第一目标模型。其中,第一目标模型用于提取第一数据包的第一特征信息,确定第一数据包对应的第一应用集合中的第一应用。示例性的,结合图3,获取模块1401用于执行步骤301。The obtaining module 1401 is used to obtain the first target model. The first target model is used to extract the first feature information of the first data packet, and determine the first application in the first application set corresponding to the first data packet. Exemplarily, with reference to FIG. 3 , the obtaining module 1401 is configured to perform step 301 .
获取模块1401,还用于在满足触发条件的情况下,获取第二目标模型。其中,第二目标模型用于提取第二数据包的第二特征信息,确定第二数据包对应的第二应用集合中的第二应用,第一应用集合中的第一应用与第二应用集合中的第二应用不同。示例性的,结合图2,获取模块1401还用于执行步骤302。The obtaining module 1401 is further configured to obtain the second target model when the trigger condition is satisfied. The second target model is used to extract the second feature information of the second data packet, determine the second application in the second application set corresponding to the second data packet, and the first application and the second application set in the first application set The second application in is different. Exemplarily, with reference to FIG. 2 , the obtaining module 1401 is further configured to perform step 302 .
确定模块1402,还用于获取第三数据包,根据第一目标模型和第二目标模型,确定第三数据包对应的第一应用或第二应用。示例性的,结合图3,确定模块1402用于执行步骤303。The determining module 1402 is further configured to acquire a third data packet, and determine the first application or the second application corresponding to the third data packet according to the first target model and the second target model. Exemplarily, with reference to FIG. 3 , the determination module 1402 is configured to perform step 303 .
一种可能的实现方式,获取模块1401,具体用于接收来自服务器的第一初始模型的信息和第二应用集合包含的第二应用的列表,第一初始模型是根据第二应用集合中应用的个数确 定的,第二应用的列表用于指示第二应用集合中的第二应用与第一初始模型的输出端的对应关系;获取模块1401,还具体用于根据装置获得的已标注的第二应用的数据包训练第一初始模型,以得到第一中间模型;获取模块1401,还具体用于向服务器发送第一中间模型的信息;获取模块1401,还具体用于接收来自服务器的第二目标模型的信息,第二目标模型的信息是将来自多个第一设备的中间模型的信息进行聚合得到的;获取模块1401,还具体用于根据第二目标模型的信息和第一初始模型,以得到第二目标模型。A possible implementation manner, the acquisition module 1401 is specifically configured to receive the information of the first initial model from the server and the list of second applications included in the second application set, where the first initial model is applied according to the second application set. If the number is determined, the list of second applications is used to indicate the correspondence between the second application in the second application set and the output end of the first initial model; the obtaining module 1401 is also specifically configured to obtain the marked second application obtained by the device. The applied data package trains the first initial model to obtain the first intermediate model; the acquisition module 1401 is also specifically used to send the information of the first intermediate model to the server; the acquisition module 1401 is also specifically used to receive the second target from the server The information of the model, the information of the second target model is obtained by aggregating the information of the intermediate models from a plurality of first devices; the obtaining module 1401 is also specifically used to obtain the information of the second target model and the first initial model according to the information of the second target model and the first initial model. Obtain the second target model.
一种可能的实现方式,获取模块1401,还具体用于获取第二应用的数据包;获取模块1401,还具体用于向服务器发送第二应用的数据包;获取模块1401,还具体用于接收来自服务器的已标注的第二应用的数据包。A possible implementation manner, the acquisition module 1401 is also specifically used to acquire the data packet of the second application; the acquisition module 1401 is also specifically used to send the data packet of the second application to the server; the acquisition module 1401 is also specifically used to receive Annotated data packets of the second application from the server.
一种可能的实现方式,触发条件为第二应用集合中应用的个数大于或等于第一阈值;或者,触发条件为第二应用集合中应用的数据包的个数大于或等于第二阈值;或者,触发条件为第二应用集合中应用的个数大于或等于第一阈值,并且第二应用集合中应用的数据包的数量大于或等于第二阈值。A possible implementation manner, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold; or, the trigger condition is that the number of data packets applied in the second application set is greater than or equal to the second threshold; Alternatively, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold, and the number of data packets applied in the second application set is greater than or equal to the second threshold.
一种可能的实现方式,确定模块1402,具体用于根据第一目标模型,获取第三数据包的第一输出熵,第一输出熵用于指示第三数据包对应的应用为第一目标模型预测的应用的概率;确定模块1402,还具体用于根据第二目标模型,获取第三数据包的第二输出熵,第二输出熵用于指示第三数据包对应的应用为第二目标模型预测的应用的概率;确定模块1402,还具体用于将第一输出熵和第二输出熵中,数值低的输出熵对应的目标模型预测的应用确定为第三数据包对应的应用。A possible implementation manner, the determination module 1402 is specifically configured to obtain the first output entropy of the third data packet according to the first target model, and the first output entropy is used to indicate that the application corresponding to the third data packet is the first target model The probability of the predicted application; the determination module 1402 is also specifically configured to obtain the second output entropy of the third data packet according to the second target model, and the second output entropy is used to indicate that the application corresponding to the third data packet is the second target model Probability of the predicted application; the determining module 1402 is further specifically configured to determine the application predicted by the target model corresponding to the output entropy with a lower value among the first output entropy and the second output entropy as the application corresponding to the third data packet.
一种可能的实现方式,该装置还包括:训练模块;获取模块1401,还用于获取第二初始模型,第二初始模型是根据第一应用集合中应用的个数与第二应用集合中应用的个数确定的;训练模块,用于根据第一目标模型和第二目标模型对装置获得的数据包的标注结果,训练第二初始模型以得到第三目标模型,第三目标模型用于提取第三特征信息,并根据第三特征信息确定第三特征信息对应的数据包对应的应用,第三特征信息包括第三特征信息对应的数据包的特征信息,第三特征信息对应的数据包为第一应用集合中应用的数据包,或第二应用集合中应用的数据包。A possible implementation manner, the device further includes: a training module; an acquisition module 1401, further configured to acquire a second initial model, where the second initial model is based on the number of applications in the first application set and the number of applications in the second application set The number is determined; the training module is used to label the data packets obtained by the device according to the first target model and the second target model, train the second initial model to obtain the third target model, and the third target model is used to extract the third characteristic information, and the application corresponding to the data packet corresponding to the third characteristic information is determined according to the third characteristic information, the third characteristic information includes characteristic information of the data packet corresponding to the third characteristic information, and the data packet corresponding to the third characteristic information is Data packets of applications in the first application set, or data packets of applications in the second application set.
一种可能的实现方式,训练模块,还用于根据获取第一目标模型时使用的已标注的数据包,和/或,获取第二目标模型时使用的已标注的数据包,训练第三目标模型,得到训练后的第三目标模型。A possible implementation, the training module is also used to train the third target according to the marked data packets used when acquiring the first target model, and/or the marked data packets used when acquiring the second target model model to obtain the third target model after training.
一种可能的实现方式,装置还包括:接收模块;接收模块,用于接收来自服务器的指示信息,指示信息用于指示装置重新训练用于识别第一应用的数据包和第二应用的数据包的第四目标模型。In a possible implementation manner, the apparatus further includes: a receiving module; a receiving module, configured to receive indication information from the server, where the indication information is used to instruct the apparatus to retrain the data packets used to identify the first application and the data packets of the second application the fourth target model.
其中,上述方法实施例涉及的各操作的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。Wherein, all relevant contents of the operations involved in the foregoing method embodiments can be cited in the functional descriptions of the corresponding functional modules, which will not be repeated here.
在本实施例中,该装置以采用集成的方式划分各个功能模块的形式来呈现。这里的“模块”可以指特定ASIC,电路,执行一个或多个软件或固件程序的处理器和存储器,集成逻辑电路,和/或其他可以提供上述功能的器件。在一个简单的实施例中,本领域的技术人员可以想到该装置可以采用图2所示的形式。In this embodiment, the apparatus is presented in the form of dividing each functional module in an integrated manner. "Module" herein may refer to a specific ASIC, circuit, processor and memory executing one or more software or firmware programs, integrated logic circuit, and/or other device that may provide the functions described above. In a simple embodiment, those skilled in the art can imagine that the device may take the form shown in FIG. 2 .
比如,图2中的处理器201可以通过调用存储器203中存储的计算机执行指令,使得该 装置执行上述方法实施例中的数据包的识别方法。For example, the processor 201 in FIG. 2 can execute the instructions by calling the computer stored in the memory 203, so that the apparatus executes the data packet identification method in the above method embodiment.
示例性的,图14中的获取模块1401和确定模块1402的功能/实现过程可以通过图2中的处理器201调用存储器203中存储的计算机执行指令来实现。Exemplarily, the function/implementation process of the acquisition module 1401 and the determination module 1402 in FIG. 14 may be implemented by the processor 201 in FIG. 2 calling the computer-executed instructions stored in the memory 203 .
由于本实施例提供的装置可执行上述的数据包的识别方法,因此其所能获得的技术效果可参考上述方法实施例,在此不再赘述。Since the apparatus provided in this embodiment can perform the above-mentioned data packet identification method, the technical effect that can be obtained can be referred to the above-mentioned method embodiments, which will not be repeated here.
比如,以采用集成的方式划分各个功能模块的情况下,图15示出了一种数据包的识别装置的结构示意图。该装置可以为服务器或者服务器中的芯片或者片上系统,该装置可以用于执行上述实施例中涉及的服务器的功能。For example, in the case of dividing each functional module in an integrated manner, FIG. 15 shows a schematic structural diagram of an apparatus for identifying a data packet. The apparatus may be a server or a chip or a system-on-chip in the server, and the apparatus may be used to execute the functions of the server involved in the foregoing embodiments.
作为一种可能的实现方式,图15所示的装置包括:获取模块1501和发送模块1502;As a possible implementation manner, the apparatus shown in FIG. 15 includes: an acquiring module 1501 and a sending module 1502;
获取模块1501,用于获取第一目标模型的信息。其中,第一目标模型用于提取第一数据包的第一特征信息,确定第一数据包对应的第一应用集合中的第一应用。示例性的,结合图9,获取模块1501用于执行步骤901。The acquiring module 1501 is used for acquiring information of the first target model. The first target model is used to extract the first feature information of the first data packet, and determine the first application in the first application set corresponding to the first data packet. Exemplarily, with reference to FIG. 9 , the obtaining module 1501 is configured to perform step 901 .
发送模块1502,用于向第一设备发送第一目标模型的信息。示例性的,结合图9,发送模块1502用于执行步骤902。The sending module 1502 is configured to send the information of the first target model to the first device. Exemplarily, with reference to FIG. 9 , the sending module 1502 is configured to perform step 902 .
获取模块1501,还用于在满足触发条件的情况下,获取第二目标模型的信息。其中,第二目标模型用于提取第二数据包的第二特征信息,确定第二数据包对应的第二应用集合中的第二应用,第一应用集合中的第一应用与第二应用集合中的第二应用不同。示例性的,结合图9,获取模块1501还用于执行步骤903。The obtaining module 1501 is further configured to obtain the information of the second target model when the trigger condition is satisfied. The second target model is used to extract the second feature information of the second data packet, determine the second application in the second application set corresponding to the second data packet, and the first application and the second application set in the first application set The second application in is different. Exemplarily, with reference to FIG. 9 , the obtaining module 1501 is further configured to perform step 903 .
发送模块1502,还用于向第一设备发送第二目标模型的信息。示例性的,结合图9,发送模块1502还用于执行步骤904。The sending module 1502 is further configured to send the information of the second target model to the first device. Exemplarily, with reference to FIG. 9 , the sending module 1502 is further configured to perform step 904 .
一种可能的实现方式,获取模块1501,具体用于向第一设备发送第一初始模型的信息和第二应用集合包含的第二应用的列表,第一初始模型是根据第二应用集合中第二应用的个数确定的,第二应用的列表用于指示第二应用集合中的第二应用与第一初始模型的输出端的对应关系;获取模块1501,还具体用于接收来自第一设备的第一中间模型的信息,第一中间模型是第一设备根据第一设备获得的已标注的第二应用的数据包对第一初始模型进行训练得到的;获取模块1501,还具体用于向第二设备发送第一初始模型的信息和第二应用的列表;获取模块1501,还具体用于接收来自第二设备的第二中间模型的信息,第二中间模型是第二设备根据第二设备获得的已标注的第二应用的数据包对第一初始模型进行训练得到的;获取模块1501,还具体用于将第一中间模型的信息和第二中间模型的信息聚合,以得到第二目标模型的信息。A possible implementation manner, the acquisition module 1501 is specifically configured to send the information of the first initial model and the list of the second applications included in the second application set to the first device, where the first initial model is based on the first initial model in the second application set. The number of the second application is determined, and the list of the second application is used to indicate the corresponding relationship between the second application in the second application set and the output end of the first initial model; the obtaining module 1501 is also specifically configured to receive the information from the first device. Information of the first intermediate model, the first intermediate model is obtained by the first device training the first initial model according to the marked data packet of the second application obtained by the first device; the obtaining module 1501 is also specifically used to send the first device to the first device. The second device sends the information of the first initial model and the list of the second application; the obtaining module 1501 is also specifically configured to receive the information of the second intermediate model from the second device, and the second intermediate model is obtained by the second device according to the second device The marked data package of the second application is obtained by training the first initial model; the acquisition module 1501 is also specifically used to aggregate the information of the first intermediate model and the information of the second intermediate model to obtain the second target model Information.
一种可能的实现方式,获取模块1501,还具体用于接收来自第一设备的第二应用的数据包;获取模块1501,还具体用于根据第二应用的数据包,获取已标注的第二应用的数据包;获取模块1501,还具体用于向第一设备发送已标注的第二应用的数据包。A possible implementation manner, the acquisition module 1501 is also specifically used to receive the data packet of the second application from the first device; the acquisition module 1501 is also specifically used to acquire the marked second application according to the data packet of the second application. The data packet of the application; the obtaining module 1501 is further specifically configured to send the marked data packet of the second application to the first device.
一种可能的实现方式,触发条件为第二应用集合中应用的个数大于或等于第一阈值;或者,触发条件为第二应用集合中应用的数据包的个数大于或等于第二阈值;或者,触发条件为第二应用集合中应用的个数大于或等于第一阈值,并且第二应用集合中应用的数据包的数量大于或等于第二阈值。A possible implementation manner, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold; or, the trigger condition is that the number of data packets applied in the second application set is greater than or equal to the second threshold; Alternatively, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold, and the number of data packets applied in the second application set is greater than or equal to the second threshold.
一种可能的实现方式,发送模块1502,还用于若第一目标模型和第二目标模型识别数据包的正确率小于或等于第三阈值,向第一设备发送指示信息,指示信息用于指示第一设备重 新训练用于识别第一应用的数据包和第二应用的数据包的第四目标模型。A possible implementation, the sending module 1502 is further configured to send indication information to the first device if the correct rate of the identification data packets of the first target model and the second target model is less than or equal to the third threshold, and the indication information is used to indicate The first device retrains a fourth target model for identifying the data packets of the first application and the data packets of the second application.
其中,上述方法实施例涉及的各操作的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。Wherein, all relevant contents of the operations involved in the foregoing method embodiments can be cited in the functional descriptions of the corresponding functional modules, which will not be repeated here.
在本实施例中,该装置以采用集成的方式划分各个功能模块的形式来呈现。这里的“模块”可以指特定ASIC,电路,执行一个或多个软件或固件程序的处理器和存储器,集成逻辑电路,和/或其他可以提供上述功能的器件。在一个简单的实施例中,本领域的技术人员可以想到该装置可以采用图2所示的形式。In this embodiment, the apparatus is presented in the form of dividing each functional module in an integrated manner. "Module" herein may refer to a specific ASIC, circuit, processor and memory executing one or more software or firmware programs, integrated logic circuit, and/or other device that may provide the functions described above. In a simple embodiment, those skilled in the art can imagine that the device may take the form shown in FIG. 2 .
比如,图2中的处理器201可以通过调用存储器203中存储的计算机执行指令,使得该装置执行上述方法实施例中的通信方法。For example, the processor 201 in FIG. 2 can execute the instructions by calling the computer stored in the memory 203, so that the apparatus executes the communication method in the above method embodiment.
示例性的,图15中的获取模块1501和发送模块1502的功能/实现过程可以通过图2中的处理器201调用存储器203中存储的计算机执行指令来实现。或者,图15中的获取模块1501的功能/实现过程可以通过图2中的处理器201调用存储器203中存储的计算机执行指令来实现,图12中的发送模块1502的功能/实现过程可以通过图2中的通信接口204来实现。Exemplarily, the function/implementation process of the acquiring module 1501 and the sending module 1502 in FIG. 15 may be implemented by the processor 201 in FIG. 2 calling the computer-executed instructions stored in the memory 203 . Alternatively, the function/implementation process of the acquiring module 1501 in FIG. 15 can be implemented by the processor 201 in FIG. 2 calling the computer execution instructions stored in the memory 203, and the function/implementation process of the sending module 1502 in FIG. 2 in the communication interface 204 to achieve.
由于本实施例提供的装置可执行上述的数据包的识别方法,因此其所能获得的技术效果可参考上述方法实施例,在此不再赘述。Since the apparatus provided in this embodiment can perform the above-mentioned data packet identification method, the technical effect that can be obtained can be referred to the above-mentioned method embodiments, which will not be repeated here.
比如,以采用集成的方式划分各个功能模块的情况下,图16示出了一种数据包的识别装置的结构示意图。该装置可以为第一装置或者第一装置中的芯片或者片上系统,该装置可以用于执行上述实施例中涉及的第一装置的功能。For example, in the case of dividing each functional module in an integrated manner, FIG. 16 shows a schematic structural diagram of an apparatus for identifying a data packet. The apparatus may be a first apparatus or a chip or a system-on-chip in the first apparatus, and the apparatus may be configured to perform the functions of the first apparatus involved in the foregoing embodiments.
作为一种可能的实现方式,图16所示的装置包括:获取模块1601和确定模块1602。As a possible implementation manner, the apparatus shown in FIG. 16 includes: an acquisition module 1601 and a determination module 1602 .
获取模块1601,用于获取第一目标模型。其中,第一目标模型用于提取第一数据包的第一特征信息,确定第一数据包对应的第一应用集合中的第一应用。示例性的,结合图12,获取模块1601用于执行步骤1201。The obtaining module 1601 is used to obtain the first target model. The first target model is used to extract the first feature information of the first data packet, and determine the first application in the first application set corresponding to the first data packet. Exemplarily, with reference to FIG. 12 , the obtaining module 1601 is configured to perform step 1201 .
获取模块1601,还用于在满足触发条件的情况下,获取第二目标模型。其中,第二目标模型用于提取第二数据包的第二特征信息,确定第二数据包对应的第二应用集合中的第二应用,第一应用集合中的第一应用与第二应用集合中的第二应用不同。示例性的,结合图12,获取模块1601还用于执行步骤1202。The acquiring module 1601 is further configured to acquire the second target model when the trigger condition is satisfied. The second target model is used to extract the second feature information of the second data packet, determine the second application in the second application set corresponding to the second data packet, and the first application and the second application set in the first application set The second application in is different. Exemplarily, with reference to FIG. 12 , the obtaining module 1601 is further configured to perform step 1202 .
确定模块1602,用于获取第三数据包,根据第一目标模型和第二目标模型,确定第三数据包对应的第一应用或第二应用。示例性的,结合图12,确定模块1602用于执行步骤1203。The determining module 1602 is configured to acquire the third data packet, and determine the first application or the second application corresponding to the third data packet according to the first target model and the second target model. Exemplarily, with reference to FIG. 12 , the determination module 1602 is configured to perform step 1203 .
一种可能的实现方式,获取模块1601,具体用于获取已标注的第二应用集合中第二应用的数据包;获取模块1601,还具体用于获取第一初始模型和第二应用集合包含的第二应用的列表,第一初始模型是根据第二应用集合中应用的个数确定的,第二应用的列表用于指示第二应用集合中的第二应用与第一初始模型的输出端的对应关系;获取模块1601,还具体用于根据已标注的第二应用的数据包,训练第一初始模型,以得到第二目标模型。A possible implementation manner, the acquisition module 1601 is specifically used to acquire the data package of the second application in the marked second application set; the acquisition module 1601 is also specifically used to acquire the first initial model and the second application set included. A list of second applications, the first initial model is determined according to the number of applications in the second application set, and the list of second applications is used to indicate the correspondence between the second application in the second application set and the output of the first initial model relationship; the obtaining module 1601 is further specifically configured to train the first initial model according to the marked data package of the second application to obtain the second target model.
一种可能的实现方式,触发条件为第二应用集合中应用的个数大于或等于第一阈值;或者,触发条件为第二应用集合中应用的数据包的个数大于或等于第二阈值;或者,触发条件为第二应用集合中应用的个数大于或等于第一阈值,并且第二应用集合中应用的数据包的数量大于或等于第二阈值。A possible implementation manner, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold; or, the trigger condition is that the number of data packets applied in the second application set is greater than or equal to the second threshold; Alternatively, the trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold, and the number of data packets applied in the second application set is greater than or equal to the second threshold.
一种可能的实现方式,确定模块1602,具体用于根据第一目标模型,获取第三数据包的第一输出熵,第一输出熵用于指示第三数据包对应的应用为第一目标模型预测的应用的概 率;确定模块1602,还具体用于根据第二目标模型,获取第三数据包的第二输出熵,第二输出熵用于指示第三数据包对应的应用为第二目标模型预测的应用的概率;确定模块1602,还具体用于将第一输出熵和第二输出熵中,数值低的输出熵对应的目标模型预测的应用确定为第三数据包对应的应用。A possible implementation, the determination module 1602 is specifically configured to obtain the first output entropy of the third data packet according to the first target model, and the first output entropy is used to indicate that the application corresponding to the third data packet is the first target model The probability of the predicted application; the determination module 1602 is also specifically configured to obtain the second output entropy of the third data packet according to the second target model, and the second output entropy is used to indicate that the application corresponding to the third data packet is the second target model Probability of the predicted application; the determining module 1602 is further specifically configured to determine, among the first output entropy and the second output entropy, the application predicted by the target model corresponding to the output entropy with a lower value as the application corresponding to the third data packet.
一种可能的实现方式,该装置还包括:训练模块;获取模块1601,还用于获取第二初始模型,第二初始模型是根据第一应用集合中应用的个数与第二应用集合中应用的个数确定的;训练模块,用于根据第一目标模型和第二目标模型对第一设备获得的数据包的标注结果,训练第二初始模型以得到第三目标模型,第三目标模型用于提取第三特征信息,并根据第三特征信息确定第三特征信息对应的数据包对应的应用,第三特征信息包括第三特征信息对应的数据包的特征信息,第三特征信息对应的数据包为第一应用集合中应用的数据包,或第二应用集合中应用的数据包。A possible implementation manner, the apparatus further includes: a training module; an acquisition module 1601, further configured to acquire a second initial model, where the second initial model is based on the number of applications in the first application set and the number of applications in the second application set The number is determined; the training module is used for the labeling results of the data packets obtained by the first device according to the first target model and the second target model, and trains the second initial model to obtain the third target model. The third target model uses is used to extract the third characteristic information, and determine the application corresponding to the data packet corresponding to the third characteristic information according to the third characteristic information. The third characteristic information includes characteristic information of the data packet corresponding to the third characteristic information, and data corresponding to the third characteristic information. The package is a data package of an application in the first application set, or a data package of an application in the second application set.
一种可能的实现方式,训练模块,还用于根据获取第一目标模型时使用的已标注的数据包,和/或,获取第二目标模型时使用的已标注的数据包,训练第三目标模型,得到训练后想第三目标模型。A possible implementation, the training module is also used to train the third target according to the marked data packets used when acquiring the first target model, and/or the marked data packets used when acquiring the second target model The model, after getting trained, wants the third target model.
一种可能的实现方式,获取模块1601,还用于若第一目标模型和第二目标模型识别数据包的正确率小于或等于第三阈值,重新训练用于识别第一应用的数据包和第二应用的数据包的第四目标模型。A possible implementation, the acquisition module 1601 is also used to retrain the data packets used to identify the first application and the first target model if the correct rate of the data packets identified by the first target model and the second target model is less than or equal to the third threshold. The fourth destination model of the packet of the second application.
其中,上述方法实施例涉及的各操作的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。Wherein, all relevant contents of the operations involved in the foregoing method embodiments can be cited in the functional descriptions of the corresponding functional modules, which will not be repeated here.
在本实施例中,该装置以采用集成的方式划分各个功能模块的形式来呈现。这里的“模块”可以指特定ASIC,电路,执行一个或多个软件或固件程序的处理器和存储器,集成逻辑电路,和/或其他可以提供上述功能的器件。在一个简单的实施例中,本领域的技术人员可以想到该装置可以采用图2所示的形式。In this embodiment, the apparatus is presented in the form of dividing each functional module in an integrated manner. "Module" herein may refer to a specific ASIC, circuit, processor and memory executing one or more software or firmware programs, integrated logic circuit, and/or other device that may provide the functions described above. In a simple embodiment, those skilled in the art can imagine that the device may take the form shown in FIG. 2 .
比如,图2中的处理器201可以通过调用存储器203中存储的计算机执行指令,使得该装置执行上述方法实施例中的数据包的识别方法。For example, the processor 201 in FIG. 2 may call the computer to execute the instructions stored in the memory 203, so that the apparatus executes the data packet identification method in the above method embodiment.
示例性的,图16中的获取模块1601和确定模块1602的功能/实现过程可以通过图2中的处理器201调用存储器203中存储的计算机执行指令来实现。Exemplarily, the function/implementation process of the acquiring module 1601 and the determining module 1602 in FIG. 16 may be implemented by the processor 201 in FIG. 2 calling the computer-executed instructions stored in the memory 203 .
由于本实施例提供的装置可执行上述的数据包的识别方法,因此其所能获得的技术效果可参考上述方法实施例,在此不再赘述。Since the apparatus provided in this embodiment can perform the above-mentioned data packet identification method, the technical effect that can be obtained can be referred to the above-mentioned method embodiments, which will not be repeated here.
图17为本申请实施例提供的一种芯片的结构示意图。芯片170包括一个或多个处理器1701以及接口电路1702。可选的,所述芯片170还可以包含总线1703。其中:FIG. 17 is a schematic structural diagram of a chip provided by an embodiment of the present application. Chip 170 includes one or more processors 1701 and interface circuits 1702 . Optionally, the chip 170 may further include a bus 1703 . in:
处理器1701可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器1701中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器1701可以是通用处理器、数字通信器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其它可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 1701 may be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above-mentioned method may be completed by an integrated logic circuit of hardware in the processor 1701 or an instruction in the form of software. The aforementioned processor 1701 may be a general purpose processor, a digital communicator (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components . Various methods and steps disclosed in the embodiments of this application can be implemented or executed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
接口电路1702用于数据、指令或者信息的发送或者接收。处理器1701可以利用接口电路1702接收的数据、指令或者其它信息,进行加工,可以将加工完成信息通过接口电路1702 发送出去。The interface circuit 1702 is used to transmit or receive data, instructions or information. The processor 1701 can use the data, instructions or other information received by the interface circuit 1702 to perform processing, and can send the processing completion information through the interface circuit 1702 .
可选的,芯片170还包括存储器,存储器可以包括只读存储器和随机存取存储器,并向处理器提供操作指令和数据。存储器的一部分还可以包括非易失性随机存取存储器(NVRAM)。Optionally, the chip 170 further includes a memory, which may include a read-only memory and a random access memory, and provides operation instructions and data to the processor. A portion of the memory may also include non-volatile random access memory (NVRAM).
可选的,存储器存储了可执行软件模块或者数据结构,处理器可以通过调用存储器存储的操作指令(该操作指令可存储在操作系统中),执行相应的操作。Optionally, the memory stores executable software modules or data structures, and the processor may execute corresponding operations by calling operation instructions stored in the memory (the operation instructions may be stored in the operating system).
可选的,芯片170可以使用在本申请实施例涉及的数据包的识别装置(包括第一设备、服务器或第一装置)中。可选的,接口电路1702可用于输出处理器1701的执行结果。关于本申请的一个或多个实施例提供的数据包的识别方法可参考前述各个实施例,这里不再赘述。Optionally, the chip 170 may be used in a data packet identification apparatus (including a first device, a server, or a first apparatus) involved in the embodiments of the present application. Optionally, the interface circuit 1702 may be used to output the execution result of the processor 1701 . For the identification method of the data packet provided by one or more embodiments of the present application, reference may be made to the foregoing embodiments, and details are not repeated here.
需要说明的,处理器1701、接口电路1702各自对应的功能既可以通过硬件设计实现,也可以通过软件设计来实现,还可以通过软硬件结合的方式来实现,这里不作限制。It should be noted that the respective functions of the processor 1701 and the interface circuit 1702 can be implemented by hardware design, software design, or a combination of software and hardware, which is not limited here.
图18示出了的一种数据包的识别系统的组成示意图,如图18所示,该数据包的识别系统180中可以包括:第一设备1801和服务器1802。需要说明的是,图18仅为示例性附图,本申请实施例不限定图18所示数据包的识别系统180包括的设备以及设备的个数。FIG. 18 shows a schematic diagram of the composition of a data packet identification system. As shown in FIG. 18 , the data packet identification system 180 may include: a first device 1801 and a server 1802 . It should be noted that FIG. 18 is only an exemplary drawing, and the embodiments of the present application do not limit the devices and the number of devices included in the data packet identification system 180 shown in FIG. 18 .
其中,第一设备1801具有上述图14所示数据包的识别装置的功能,用于获取第一目标模型,在满足触发条件的情况下,获取第二目标模型,并获取第三数据包,根据第一目标模型和第二目标模型,确定第三数据包对应的第一应用或第二应用。Among them, the first device 1801 has the function of the device for identifying the data packet shown in FIG. 14, and is used to obtain the first target model, and when the trigger condition is satisfied, obtain the second target model, and obtain the third data packet, according to The first target model and the second target model determine the first application or the second application corresponding to the third data packet.
服务器1802具有上述图15所示数据包的识别装置的功能,可以用于获取第一目标模型的信息,向第一设备1801发送第一目标模型的信息,获取第二目标模型的信息,并向第一设备1802发送第二目标模型的信息。The server 1802 has the function of the identification device of the data packet shown in FIG. 15, and can be used to obtain the information of the first target model, send the information of the first target model to the first device 1801, obtain the information of the second target model, and send the information of the second target model to the first device 1801. The first device 1802 sends information of the second target model.
需要说明的是,上述方法实施例涉及的各步骤的所有相关内容均可以援引到该数据包的识别系统180对应节点的功能描述,在此不再赘述。It should be noted that, all relevant contents of the steps involved in the above method embodiments can be cited in the functional description of the corresponding node of the identification system 180 of the data packet, and details are not repeated here.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。From the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions can be allocated as required. It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be Incorporation may either be integrated into another device, or some features may be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place, or may be distributed to multiple different places . Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, which are stored in a storage medium , including several instructions to make a device (may be a single chip microcomputer, a chip, etc.) or a processor (processor) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk and other mediums that can store program codes.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this, and any changes or substitutions within the technical scope disclosed in the present application should be covered within the protection scope of the present application. . Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims (30)

  1. 一种数据包的识别方法,其特征在于,所述方法包括:A method for identifying a data packet, wherein the method comprises:
    第一设备获取第一目标模型,所述第一目标模型用于提取第一数据包的第一特征信息,确定所述第一数据包对应的第一应用集合中的第一应用;The first device acquires a first target model, where the first target model is used to extract the first feature information of the first data packet, and determine the first application in the first application set corresponding to the first data packet;
    在满足触发条件的情况下,所述第一设备获取第二目标模型,所述第二目标模型用于提取第二数据包的第二特征信息,确定所述第二数据包对应的第二应用集合中的第二应用,所述第一应用集合中的第一应用与所述第二应用集合中的第二应用不同;When the trigger condition is met, the first device acquires a second target model, where the second target model is used to extract the second feature information of the second data packet, and determine the second application corresponding to the second data packet a second application in the set, the first application in the first application set is different from the second application in the second application set;
    所述第一设备获取第三数据包,根据所述第一目标模型和所述第二目标模型,确定所述第三数据包对应的所述第一应用或所述第二应用。The first device acquires a third data packet, and determines the first application or the second application corresponding to the third data packet according to the first target model and the second target model.
  2. 根据权利要求1所述的方法,其特征在于,所述第一设备获取第二目标模型,包括:The method according to claim 1, wherein the obtaining, by the first device, the second target model comprises:
    所述第一设备接收来自服务器的第一初始模型的信息和所述第二应用集合包含的第二应用的列表,所述第一初始模型是根据所述第二应用集合中应用的个数确定的,所述第二应用的列表用于指示所述第二应用集合中的第二应用与所述第一初始模型的输出端的对应关系;The first device receives information from a server about a first initial model and a list of second applications included in the second application set, where the first initial model is determined according to the number of applications in the second application set , the list of the second application is used to indicate the corresponding relationship between the second application in the second application set and the output end of the first initial model;
    所述第一设备根据所述第一设备获得的已标注的第二应用的数据包训练所述第一初始模型,以得到第一中间模型;The first device trains the first initial model according to the marked data packet of the second application obtained by the first device to obtain a first intermediate model;
    所述第一设备向所述服务器发送所述第一中间模型的信息;sending, by the first device, the information of the first intermediate model to the server;
    所述第一设备接收来自所述服务器的所述第二目标模型的信息,所述第二目标模型的信息是将来自多个第一设备的中间模型的信息进行聚合得到的;The first device receives information of the second target model from the server, where the information of the second target model is obtained by aggregating information from intermediate models of multiple first devices;
    所述第一设备根据所述第二目标模型的信息和所述第一初始模型得到所述第二目标模型。The first device obtains the second target model according to the information of the second target model and the first initial model.
  3. 根据权利要求2所述的方法,其特征在于,所述第一设备获取第二目标模型,还包括:The method according to claim 2, wherein the first device obtains the second target model, further comprising:
    所述第一设备获取所述第二应用的数据包;obtaining, by the first device, a data packet of the second application;
    所述第一设备向所述服务器发送所述第二应用的数据包;sending, by the first device, the data packet of the second application to the server;
    所述第一设备接收来自所述服务器的所述已标注的第二应用的数据包。The first device receives a data packet of the tagged second application from the server.
  4. 根据权利要求1-3中任一项所述的方法,其特征在于,The method according to any one of claims 1-3, wherein,
    所述触发条件为所述第二应用集合中应用的个数大于或等于第一阈值;或者,The trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold; or,
    所述触发条件为所述第二应用集合中应用的数据包的个数大于或等于第二阈值;或者,The trigger condition is that the number of data packets applied in the second application set is greater than or equal to the second threshold; or,
    所述触发条件为所述第二应用集合中应用的个数大于或等于第一阈值,并且所述第二应用集合中应用的数据包的数量大于或等于第二阈值。The trigger condition is that the number of applications in the second application set is greater than or equal to a first threshold, and the number of data packets applied in the second application set is greater than or equal to a second threshold.
  5. 根据权利要求1-4中任一项所述的方法,其特征在于,所述第一设备根据所述第一目标模型和所述第二目标模型,确定所述第三数据包对应的所述第一应用或所述第二应用,包括:The method according to any one of claims 1-4, wherein the first device determines, according to the first target model and the second target model, the The first application or the second application, including:
    所述第一设备根据所述第一目标模型,获取所述第三数据包的第一输出熵,所述第一输出熵用于指示所述第三数据包对应的应用为所述第一目标模型预测的应用的概率;The first device obtains, according to the first target model, a first output entropy of the third data packet, where the first output entropy is used to indicate that an application corresponding to the third data packet is the first target the probability of application of the model prediction;
    所述第一设备根据所述第二目标模型,获取所述第三数据包的第二输出熵,所述第二输出熵用于指示所述第三数据包对应的应用为所述第二目标模型预测的应用的概率;The first device obtains, according to the second target model, a second output entropy of the third data packet, where the second output entropy is used to indicate that an application corresponding to the third data packet is the second target the probability of application of the model prediction;
    所述第一设备将所述第一输出熵和所述第二输出熵中,数值低的输出熵对应的目标模型预测的应用确定为所述第三数据包对应的应用。The first device determines, among the first output entropy and the second output entropy, the application predicted by the target model corresponding to the output entropy with a lower value as the application corresponding to the third data packet.
  6. 根据权利要求1-5中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-5, wherein the method further comprises:
    所述第一设备获取第二初始模型,所述第二初始模型是根据所述第一应用集合中应用的个数与所述第二应用集合中应用的个数确定的;The first device acquires a second initial model, where the second initial model is determined according to the number of applications in the first application set and the number of applications in the second application set;
    所述第一设备根据所述第一目标模型和所述第二目标模型对所述第一设备获得的数据包的标注结果,训练所述第二初始模型以得到第三目标模型,所述第三目标模型用于提取第三特征信息,并根据所述第三特征信息确定所述第三特征信息对应的数据包对应的应用,所述第三特征信息包括所述第三特征信息对应的数据包的特征信息,所述第三特征信息对应的数据包为所述第一应用集合中应用的数据包,或所述第二应用集合中应用的数据包。The first device trains the second initial model to obtain a third target model according to the labeling results of the data packets obtained by the first device by the first target model and the second target model. The three-target model is used to extract third feature information, and determine the application corresponding to the data package corresponding to the third feature information according to the third feature information, where the third feature information includes data corresponding to the third feature information The feature information of the package, the data package corresponding to the third feature information is the data package applied in the first application set, or the data package applied in the second application set.
  7. 根据权利要求6所述的方法,其特征在于,所述方法还包括:The method according to claim 6, wherein the method further comprises:
    所述第一设备根据获取所述第一目标模型时使用的已标注的数据包,和/或,获取所述第二目标模型时使用的已标注的数据包,训练所述第三目标模型,得到训练后的第三目标模型。The first device trains the third target model according to the marked data packet used when acquiring the first target model, and/or the marked data packet used when acquiring the second target model, The trained third target model is obtained.
  8. 根据权利要求1-7中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-7, wherein the method further comprises:
    所述第一设备接收来自服务器的指示信息,所述指示信息用于指示所述第一设备重新训练用于识别所述第一应用的数据包和所述第二应用的数据包的第四目标模型。The first device receives indication information from the server, the indication information is used to instruct the first device to retrain a fourth target for identifying the data packets of the first application and the data packets of the second application Model.
  9. 一种数据包的识别方法,其特征在于,所述方法包括:A method for identifying a data packet, wherein the method comprises:
    服务器获取第一目标模型的信息,所述第一目标模型用于提取第一数据包的第一特征信息,确定所述第一数据包对应的第一应用集合中的第一应用;The server obtains the information of the first target model, and the first target model is used to extract the first feature information of the first data packet, and determine the first application in the first application set corresponding to the first data packet;
    所述服务器向第一设备发送所述第一目标模型的信息;The server sends the information of the first target model to the first device;
    在满足触发条件的情况下,所述服务器获取第二目标模型的信息,所述第二目标模型用于提取第二数据包的第二特征信息,确定所述第二数据包对应的第二应用集合中的第二应用,所述第一应用集合中的第一应用与所述第二应用集合中的第二应用不同;When the trigger condition is satisfied, the server obtains information of the second target model, and the second target model is used to extract the second feature information of the second data packet, and determine the second application corresponding to the second data packet a second application in the set, the first application in the first application set is different from the second application in the second application set;
    所述服务器向所述第一设备发送所述第二目标模型的信息。The server sends the information of the second target model to the first device.
  10. 根据权利要求9所述的方法,其特征在于,所述服务器获取第二目标模型的信息,包括:The method according to claim 9, wherein the server obtains the information of the second target model, comprising:
    所述服务器向所述第一设备发送第一初始模型的信息和所述第二应用集合包含的第二应用的列表,所述第一初始模型是根据所述第二应用集合中应用的个数确定的,所述第二应用的列表用于指示所述第二应用集合中的第二应用与所述第一初始模型的输出端的对应关系;The server sends information of the first initial model and a list of second applications included in the second application set to the first device, where the first initial model is based on the number of applications in the second application set It is determined that the list of the second application is used to indicate the corresponding relationship between the second application in the second application set and the output end of the first initial model;
    所述服务器接收来自所述第一设备的第一中间模型的信息,所述第一中间模型是所述第一设备根据所述第一设备获得的已标注的第二应用的数据包对所述第一初始模型进行训练得到的;The server receives the information of the first intermediate model from the first device, where the first intermediate model is the pair of the first device to the second application according to the marked data packet of the second application obtained by the first device. obtained by training the first initial model;
    所述服务器向第二设备发送所述第一初始模型的信息和所述第二应用的列表;The server sends the information of the first initial model and the list of the second application to the second device;
    所述服务器接收来自所述第二设备的第二中间模型的信息,所述第二中间模型是所述第二设备根据所述第二设备获得的已标注的第二应用的数据包对所述第一初始模型进行训练得到的;The server receives the information from the second intermediate model of the second device, where the second intermediate model is the data packet of the marked second application obtained by the second device for the second application to the second device. obtained by training the first initial model;
    所述服务器将所述第一中间模型的信息和所述第二中间模型的信息聚合,以得到所述第二目标模型的信息。The server aggregates the information of the first intermediate model and the information of the second intermediate model to obtain the information of the second target model.
  11. 根据权利要求10所述的方法,其特征在于,所述服务器获取第二目标模型的信息,还包括:The method according to claim 10, wherein the server obtains the information of the second target model, further comprising:
    所述服务器接收来自所述第一设备的所述第二应用的数据包;receiving, by the server, a data packet of the second application from the first device;
    所述服务器根据所述第二应用的数据包,获取所述已标注的第二应用的数据包;obtaining, by the server, the marked data packet of the second application according to the data packet of the second application;
    所述服务器向所述第一设备发送所述已标注的第二应用的数据包。The server sends the marked data packet of the second application to the first device.
  12. 根据权利要求9-11中任一项所述的方法,其特征在于,The method according to any one of claims 9-11, wherein,
    所述触发条件为所述第二应用集合中应用的个数大于或等于第一阈值;或者,The trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold; or,
    所述触发条件为所述第二应用集合中应用的数据包的个数大于或等于第二阈值;或者,The trigger condition is that the number of data packets applied in the second application set is greater than or equal to the second threshold; or,
    所述触发条件为所述第二应用集合中应用的个数大于或等于第一阈值,并且所述第二应用集合中应用的数据包的数量大于或等于第二阈值。The trigger condition is that the number of applications in the second application set is greater than or equal to a first threshold, and the number of data packets applied in the second application set is greater than or equal to a second threshold.
  13. 根据权利要求9-12中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 9-12, wherein the method further comprises:
    若所述第一目标模型和所述第二目标模型识别数据包的正确率小于或等于第三阈值,所述服务器向所述第一设备发送指示信息,所述指示信息用于指示所述第一设备重新训练用于识别所述第一应用的数据包和所述第二应用的数据包的第四目标模型。If the correct rate of identifying data packets by the first target model and the second target model is less than or equal to a third threshold, the server sends indication information to the first device, where the indication information is used to indicate the first A device retrains a fourth target model for identifying packets of the first application and packets of the second application.
  14. 一种数据包的识别装置,其特征在于,所述装置包括:获取模块和确定模块;A data packet identification device, characterized in that the device comprises: an acquisition module and a determination module;
    所述获取模块,用于获取第一目标模型,所述第一目标模型用于提取第一数据包的第一特征信息,确定所述第一数据包对应的第一应用集合中的第一应用;The acquisition module is used to acquire a first target model, and the first target model is used to extract the first feature information of the first data packet, and determine the first application in the first application set corresponding to the first data packet ;
    所述获取模块,还用于在满足触发条件的情况下,获取第二目标模型,所述第二目标模型用于提取第二数据包的第二特征信息,确定所述第二数据包对应的第二应用集合中的第二应用,所述第一应用集合中的第一应用与所述第二应用集合中的第二应用不同;The obtaining module is further configured to obtain a second target model when the trigger condition is met, and the second target model is used to extract the second feature information of the second data packet, and determine the corresponding value of the second data packet. a second application in a second application set, where the first application in the first application set is different from the second application in the second application set;
    所述确定模块,还用于获取第三数据包,根据所述第一目标模型和所述第二目标模型,确定所述第三数据包对应的所述第一应用或所述第二应用。The determining module is further configured to acquire a third data packet, and determine the first application or the second application corresponding to the third data packet according to the first target model and the second target model.
  15. 根据权利要求14所述的装置,其特征在于,The apparatus of claim 14, wherein:
    所述获取模块,具体用于接收来自服务器的第一初始模型的信息和所述第二应用集合包含的第二应用的列表,所述第一初始模型是根据所述第二应用集合中应用的个数确定的,所述第二应用的列表用于指示所述第二应用集合中的第二应用与所述第一初始模型的输出端的对应关系;The acquiring module is specifically configured to receive information from a server of a first initial model and a list of second applications included in the second application set, where the first initial model is applied according to the second application set If the number is determined, the list of the second application is used to indicate the correspondence between the second application in the second application set and the output end of the first initial model;
    所述获取模块,还具体用于根据所述装置获得的已标注的第二应用的数据包训练所述第一初始模型,以得到第一中间模型;The obtaining module is further specifically configured to train the first initial model according to the marked data packet of the second application obtained by the device to obtain a first intermediate model;
    所述获取模块,还具体用于向所述服务器发送所述第一中间模型的信息;The obtaining module is further specifically configured to send the information of the first intermediate model to the server;
    所述获取模块,还具体用于接收来自所述服务器的所述第二目标模型的信息,所述第二目标模型的信息是将来自多个第一设备的中间模型的信息进行聚合得到的;The acquiring module is further specifically configured to receive information of the second target model from the server, where the information of the second target model is obtained by aggregating information from the intermediate models of a plurality of first devices;
    所述获取模块,还具体用于根据所述第二目标模型的信息和所述第一初始模型得到所述第二目标模型。The obtaining module is further specifically configured to obtain the second target model according to the information of the second target model and the first initial model.
  16. 根据权利要求15所述的装置,其特征在于,The apparatus of claim 15, wherein:
    所述获取模块,还具体用于获取所述第二应用的数据包;The obtaining module is further specifically configured to obtain the data packet of the second application;
    所述获取模块,还具体用于向所述服务器发送所述第二应用的数据包;The obtaining module is further specifically configured to send the data packet of the second application to the server;
    所述获取模块,还具体用于接收来自所述服务器的所述已标注的第二应用的数据包。The acquiring module is further specifically configured to receive the marked data packet of the second application from the server.
  17. 根据权利要求14-16中任一项所述的装置,其特征在于,The device according to any one of claims 14-16, characterized in that,
    所述触发条件为所述第二应用集合中应用的个数大于或等于第一阈值;或者,The trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold; or,
    所述触发条件为所述第二应用集合中应用的数据包的个数大于或等于第二阈值;或者,The trigger condition is that the number of data packets applied in the second application set is greater than or equal to a second threshold; or,
    所述触发条件为所述第二应用集合中应用的个数大于或等于第一阈值,并且所述第二应用集合中应用的数据包的数量大于或等于第二阈值。The trigger condition is that the number of applications in the second application set is greater than or equal to a first threshold, and the number of data packets applied in the second application set is greater than or equal to a second threshold.
  18. 根据权利要求14-17中任一项所述的装置,其特征在于,The device according to any one of claims 14-17, characterized in that,
    所述确定模块,具体用于根据所述第一目标模型,获取所述第三数据包的第一输出熵,所述第一输出熵用于指示所述第三数据包对应的应用为所述第一目标模型预测的应用的概率;The determining module is specifically configured to obtain the first output entropy of the third data packet according to the first target model, where the first output entropy is used to indicate that the application corresponding to the third data packet is the the probability of the application predicted by the first target model;
    所述确定模块,还具体用于根据所述第二目标模型,获取所述第三数据包的第二输出熵,所述第二输出熵用于指示所述第三数据包对应的应用为所述第二目标模型预测的应用的概率;The determining module is further specifically configured to obtain the second output entropy of the third data packet according to the second target model, where the second output entropy is used to indicate that the application corresponding to the third data packet is the specified one. the probability of the application predicted by the second target model;
    所述确定模块,还具体用于将所述第一输出熵和所述第二输出熵中,数值低的输出熵对应的目标模型预测的应用确定为所述第三数据包对应的应用。The determining module is further specifically configured to determine, among the first output entropy and the second output entropy, the application predicted by the target model corresponding to the output entropy with a lower value as the application corresponding to the third data packet.
  19. 根据权利要求14-18中任一项所述的装置,其特征在于,所述装置还包括:训练模块;The apparatus according to any one of claims 14-18, wherein the apparatus further comprises: a training module;
    所述获取模块,还用于获取第二初始模型,所述第二初始模型是根据所述第一应用集合中应用的个数与所述第二应用集合中应用的个数确定的;The obtaining module is further configured to obtain a second initial model, where the second initial model is determined according to the number of applications in the first application set and the number of applications in the second application set;
    所述训练模块,用于根据所述第一目标模型和所述第二目标模型对所述装置获得的数据包的标注结果,训练所述第二初始模型以得到第三目标模型,所述第三目标模型用于提取第三特征信息,并根据所述第三特征信息确定所述第三特征信息对应的数据包对应的应用,所述第三特征信息包括所述第三特征信息对应的数据包的特征信息,所述第三特征信息对应的数据包为所述第一应用集合中应用的数据包,或所述第二应用集合中应用的数据包。The training module is configured to train the second initial model to obtain a third target model according to the labeling results of the data packets obtained by the device by the first target model and the second target model. The three-target model is used to extract third feature information, and determine the application corresponding to the data package corresponding to the third feature information according to the third feature information, where the third feature information includes data corresponding to the third feature information Feature information of the package, the data package corresponding to the third feature information is the data package applied in the first application set, or the data package applied in the second application set.
  20. 根据权利要求19所述的装置,其特征在于,The apparatus of claim 19, wherein:
    所述训练模块,还用于根据获取所述第一目标模型时使用的已标注的数据包,和/或,获取所述第二目标模型时使用的已标注的数据包,训练所述第三目标模型,得到训练后的第三目标模型。The training module is further configured to train the third target model according to the marked data packets used when acquiring the first target model and/or the marked data packets used when acquiring the second target model. target model, and obtain the third target model after training.
  21. 根据权利要求14-20中任一项所述的装置,其特征在于,所述装置还包括:接收模块;The device according to any one of claims 14-20, wherein the device further comprises: a receiving module;
    所述接收模块,用于接收来自服务器的指示信息,所述指示信息用于指示所述装置重新训练用于识别所述第一应用的数据包和所述第二应用的数据包的第四目标模型。The receiving module is configured to receive indication information from a server, the indication information is used to instruct the apparatus to retrain a fourth target for identifying the data packets of the first application and the data packets of the second application Model.
  22. 一种数据包的识别装置,其特征在于,所述装置包括:获取模块和发送模块;A data packet identification device, characterized in that the device comprises: an acquisition module and a transmission module;
    所述获取模块,用于获取第一目标模型的信息,所述第一目标模型用于提取第一数据包的第一特征信息,确定所述第一数据包对应的第一应用集合中的第一应用;The obtaining module is configured to obtain information of the first target model, and the first target model is used to extract the first feature information of the first data packet, and determine the first data packet in the first application set corresponding to the first data packet. an application;
    所述发送模块,用于向第一设备发送所述第一目标模型的信息;the sending module, configured to send the information of the first target model to the first device;
    所述获取模块,还用于在满足触发条件的情况下,获取第二目标模型的信息,所述第二目标模型用于提取第二数据包的第二特征信息,确定所述第二数据包对应的第二应用集合中的第二应用,所述第一应用集合中的第一应用与所述第二应用集合中的第二应用不同;The obtaining module is further configured to obtain the information of the second target model when the trigger condition is met, and the second target model is used to extract the second feature information of the second data packet, and determine the second data packet a second application in the corresponding second application set, where the first application in the first application set is different from the second application in the second application set;
    所述发送模块,还用于向所述第一设备发送所述第二目标模型的信息。The sending module is further configured to send the information of the second target model to the first device.
  23. 根据权利要求22所述的装置,其特征在于,The apparatus of claim 22, wherein:
    所述获取模块,具体用于向所述第一设备发送第一初始模型的信息和所述第二应用集合包含的第二应用的列表,所述第一初始模型是根据所述第二应用集合中应用的个数确定的,所述第二应用的列表用于指示所述第二应用集合中的第二应用与所述第一初始模型的输出端的对应关系;The acquiring module is specifically configured to send the information of the first initial model and the list of second applications included in the second application set to the first device, where the first initial model is based on the second application set Determined by the number of applications in the second application, the list of the second application is used to indicate the corresponding relationship between the second application in the second application set and the output of the first initial model;
    所述获取模块,还具体用于接收来自所述第一设备的第一中间模型的信息,所述第一中间模型是所述第一设备根据所述第一设备获得的已标注的第二应用的数据包对所述第一初始模型进行训练得到的;The obtaining module is further specifically configured to receive information from a first intermediate model of the first device, where the first intermediate model is a marked second application obtained by the first device according to the first device obtained by training the first initial model with the data package;
    所述获取模块,还具体用于向第二设备发送所述第一初始模型的信息和所述第二应用的列表;The acquiring module is further specifically configured to send the information of the first initial model and the list of the second application to the second device;
    所述获取模块,还具体用于接收来自所述第二设备的第二中间模型的信息,所述第二中 间模型是所述第二设备根据所述第二设备获得的已标注的第二应用的数据包对所述第一初始模型进行训练得到的;The obtaining module is further specifically configured to receive information from a second intermediate model of the second device, where the second intermediate model is a marked second application obtained by the second device according to the second device The data package is obtained by training the first initial model;
    所述获取模块,还具体用于将所述第一中间模型的信息和所述第二中间模型的信息聚合,以得到所述第二目标模型的信息。The acquiring module is further specifically configured to aggregate the information of the first intermediate model and the information of the second intermediate model to obtain the information of the second target model.
  24. 根据权利要求23所述的装置,其特征在于,The device of claim 23, wherein:
    所述获取模块,还具体用于接收来自所述第一设备的所述第二应用的数据包;The acquiring module is further specifically configured to receive a data packet of the second application from the first device;
    所述获取模块,还具体用于根据所述第二应用的数据包,获取所述已标注的第二应用的数据包;The obtaining module is further specifically configured to obtain the marked data packet of the second application according to the data packet of the second application;
    所述获取模块,还具体用于向所述第一设备发送所述已标注的第二应用的数据包。The acquiring module is further specifically configured to send the marked data packet of the second application to the first device.
  25. 根据权利要求22-24中任一项所述的装置,其特征在于,The device according to any one of claims 22-24, characterized in that,
    所述触发条件为所述第二应用集合中应用的个数大于或等于第一阈值;或者,The trigger condition is that the number of applications in the second application set is greater than or equal to the first threshold; or,
    所述触发条件为所述第二应用集合中应用的数据包的个数大于或等于第二阈值;或者,The trigger condition is that the number of data packets applied in the second application set is greater than or equal to a second threshold; or,
    所述触发条件为所述第二应用集合中应用的个数大于或等于第一阈值,并且所述第二应用集合中应用的数据包的数量大于或等于第二阈值。The trigger condition is that the number of applications in the second application set is greater than or equal to a first threshold, and the number of data packets applied in the second application set is greater than or equal to a second threshold.
  26. 根据权利要求22-25中任一项所述的装置,其特征在于,The device according to any one of claims 22-25, characterized in that,
    所述发送模块,还用于若所述第一目标模型和所述第二目标模型识别数据包的正确率小于或等于第三阈值,向所述第一设备发送指示信息,所述指示信息用于指示所述第一设备重新训练用于识别所述第一应用的数据包和所述第二应用的数据包的第四目标模型。The sending module is further configured to send indication information to the first device if the correct rate of the identification data packets of the first target model and the second target model is less than or equal to a third threshold, and the indication information is used instructing the first device to retrain a fourth target model for identifying data packets of the first application and data packets of the second application.
  27. 一种数据包的识别装置,其特征在于,包括:处理器,所述处理器与存储器耦合,所述存储器用于存储程序或指令,当所述程序或指令被所述处理器执行时,使得所述装置执行如权利要求1至8中任一项所述的方法,或者执行如权利要求9至13中任一项所述的方法。A data packet identification device, characterized in that it comprises: a processor, wherein the processor is coupled with a memory, the memory is used for storing programs or instructions, and when the programs or instructions are executed by the processor, the The apparatus performs a method as claimed in any one of claims 1 to 8, or performs a method as claimed in any one of claims 9 to 13.
  28. 一种芯片,其特征在于,包括:处理器,所述处理器与存储器耦合,所述存储器用于存储程序或指令,当所述程序或指令被所述处理器执行时,使得所述芯片执行如权利要求1至8中任一项所述的方法或者如权利要求9至13中任一项所述的方法。A chip, characterized in that it comprises: a processor, the processor is coupled with a memory, the memory is used to store a program or an instruction, and when the program or instruction is executed by the processor, the chip is made to execute A method as claimed in any one of claims 1 to 8 or a method as claimed in any one of claims 9 to 13.
  29. 一种计算机可读介质,其上存储有计算机程序或指令,其特征在于,所述计算机程序或指令被执行时使得计算机执行如权利要求1至8中任一项所述的方法或者如权利要求9至13中任一项所述的方法。A computer-readable medium on which a computer program or instruction is stored, characterized in that, when the computer program or instruction is executed, the computer executes the method according to any one of claims 1 to 8 or the method as claimed in claim 1. The method of any one of 9 to 13.
  30. 一种数据包的识别系统,其特征在于,包括:如权利要求14-21中任一项所述的装置,和/或,如权利要求22-26中任一项所述的装置。A data packet identification system, characterized by comprising: the device according to any one of claims 14-21, and/or the device according to any one of claims 22-26.
PCT/CN2021/101662 2020-09-21 2021-06-22 Data packet recognition method and apparatus WO2022057355A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010998077.8A CN114298116A (en) 2020-09-21 2020-09-21 Data packet identification method and device
CN202010998077.8 2020-09-21

Publications (1)

Publication Number Publication Date
WO2022057355A1 true WO2022057355A1 (en) 2022-03-24

Family

ID=80777490

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/101662 WO2022057355A1 (en) 2020-09-21 2021-06-22 Data packet recognition method and apparatus

Country Status (2)

Country Link
CN (1) CN114298116A (en)
WO (1) WO2022057355A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070106976A1 (en) * 2005-11-07 2007-05-10 International Business Machines Corporation Re-wiring component assemblies in component based user applications
CN104796300A (en) * 2015-03-23 2015-07-22 亚信科技(南京)有限公司 Method and device for data packet feature extraction
CN110300003A (en) * 2018-03-21 2019-10-01 华为技术有限公司 Data processing method and client
WO2020024761A1 (en) * 2018-07-30 2020-02-06 华为技术有限公司 Method and apparatus for generating application identification model
CN111181986A (en) * 2019-12-31 2020-05-19 奇安信科技集团股份有限公司 Data security detection method, model training method, device and computer equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070106976A1 (en) * 2005-11-07 2007-05-10 International Business Machines Corporation Re-wiring component assemblies in component based user applications
CN104796300A (en) * 2015-03-23 2015-07-22 亚信科技(南京)有限公司 Method and device for data packet feature extraction
CN110300003A (en) * 2018-03-21 2019-10-01 华为技术有限公司 Data processing method and client
WO2020024761A1 (en) * 2018-07-30 2020-02-06 华为技术有限公司 Method and apparatus for generating application identification model
CN111181986A (en) * 2019-12-31 2020-05-19 奇安信科技集团股份有限公司 Data security detection method, model training method, device and computer equipment

Also Published As

Publication number Publication date
CN114298116A (en) 2022-04-08

Similar Documents

Publication Publication Date Title
US10788992B2 (en) System and method for efficient access for remote storage devices
CN111226238B (en) Prediction method, terminal and server
US20190268213A1 (en) Network function management method, management unit, and system
CN110958281B (en) Data transmission method and communication device based on Internet of things
CN108021518A (en) A kind of data interactive method and computing device
CN110278161B (en) Message distribution method, device and system based on user mode protocol stack
JP7392139B2 (en) Network data analysis methods, functional entities and electronic devices
US20230042747A1 (en) Message Processing Method and Device, Storage Medium, and Electronic Device
US11483177B2 (en) Dynamic intelligent analytics VPN instantiation and/or aggregation employing secured access to the cloud network device
CN112346833A (en) Task processing method and processor for privacy computation and heterogeneous processing system
US20220300418A1 (en) Maximizing resource bandwidth with efficient temporal arbitration
CN114374609A (en) Deep learning operation running method and system based on RDMA (remote direct memory Access) equipment
US20190215348A1 (en) Beacon sensor advertisement frame
US20230148106A1 (en) Optimized Model Transmission
CN107277163B (en) Equipment remote mapping method and device
WO2022057355A1 (en) Data packet recognition method and apparatus
WO2019062634A1 (en) Communication method and apparatus
CN110727511B (en) Control method for application program, network side device and computer readable storage medium
WO2023020432A1 (en) Computing power request method, computing power allocation method, computing power execution method, and terminal and network-side device
CN114285906B (en) Message processing method and device, electronic equipment and storage medium
CN110391998A (en) A kind of method and apparatus of Business Stream transmission
US20190107971A1 (en) System and method for providing input/output determinism
WO2018010420A1 (en) Wireless network access method, device, terminal, system, and storage medium
CN112511526B (en) Data transmission method, device and readable storage medium
WO2024082099A1 (en) Communication method, electronic device and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21868184

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21868184

Country of ref document: EP

Kind code of ref document: A1