CN109257352A - Resolve packet method, apparatus, electronic equipment and storage medium - Google Patents

Resolve packet method, apparatus, electronic equipment and storage medium Download PDF

Info

Publication number
CN109257352A
CN109257352A CN201811113425.8A CN201811113425A CN109257352A CN 109257352 A CN109257352 A CN 109257352A CN 201811113425 A CN201811113425 A CN 201811113425A CN 109257352 A CN109257352 A CN 109257352A
Authority
CN
China
Prior art keywords
layer
data packet
resolver
current
parsing
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN201811113425.8A
Other languages
Chinese (zh)
Inventor
李景城
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Huya Information Technology Co Ltd
Original Assignee
Guangzhou Huya Information Technology Co Ltd
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 Guangzhou Huya Information Technology Co Ltd filed Critical Guangzhou Huya Information Technology Co Ltd
Priority to CN201811113425.8A priority Critical patent/CN109257352A/en
Publication of CN109257352A publication Critical patent/CN109257352A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Communication Control (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present invention provides a kind of resolve packet method, apparatus, electronic equipment and storage medium;Wherein, the method is applied in the resolution system including several mutually independent resolvers, and each resolver corresponds to a type of agreement;The described method includes: recording the protocol label of each layer of requested data packet;When receiving requested data packet, according to the protocol label of each layer of recorded data packet, the resolver of each layer of data packet is determined respectively;According to the parsing of each layer of data packet sequence, corresponding resolver is called to parse corresponding layer, sequentially to obtain the parsing result of the data packet.Thus the quantity of the resolver configured needed for the present invention can be reduced simplifies the configuration of resolver, and reduces the development cost of resolver.

Description

Resolve packet method, apparatus, electronic equipment and storage medium
Technical field
The present invention relates to technical field of data processing more particularly to resolve packet technical fields.
Background technique
In traditional resolve packet technology, if the agreement number of plies and/or protocol type that data packet is included are different, Corresponding resolver is also different.That is, corresponding resolver also must be packet if a data packet includes two layer protocols Resolver containing type and all identical two layer protocol of sequence with two layer protocol.For example, it is assumed that the first data packet includes The sequence of three layer protocols, three layer protocol is sequentially ABC;Second data packet include two layer protocols, two layer protocol it is suitable Sequence is sequentially AB;Third data packet includes two layer protocols, and the sequence of two layer protocol is sequentially BA.So, receiving end also must It must be configured with three resolvers for being respectively used to the first data packet of parsing, the second data packet and third data packet;A wherein parsing Device is the resolver that comprising three layer protocols and three layer protocols sequence is ABC, and another resolver is comprising two layer protocols and two layers Protocol sequence is the resolver of AB, last resolver is the resolver that comprising two layer protocols and two layers of protocol sequence is BA.
It follows that in the related technology, a resolver is only used for parsing a type of data packet, if you need to parse not The data packet of same type must then configure corresponding multiple resolvers, therefore resolver deployment cost is higher.And the configuration of resolver Complexity also can increasing and promoted with the data pack protocol number of plies.
Summary of the invention
Based on this, the present invention provides a kind of resolve packet method, apparatus, electronic equipment and computer-readable storage medium Matter.
According to a first aspect of the embodiments of the present invention, the present invention provides a kind of resolve packet method, the method is answered For in the resolution system including several mutually independent resolvers, wherein each resolver corresponds to a type of agreement;Institute The method of stating includes:
Record the protocol label of each layer of requested data packet;
When receiving requested data packet, according to the protocol label of each layer of recorded data packet, data packet is determined respectively The resolver of each layer;
According to the parsing of each layer of data packet sequence, corresponding resolver is sequentially called to parse corresponding layer, it is described to obtain The parsing result of data packet.
According to a second aspect of the embodiments of the present invention, corresponding with the resolve packet method, the present invention also provides one Kind resolve packet device, described device include:
Parsing module, including mutually independent several resolvers;Each resolver corresponds to a type of agreement, each solution Parser is for parsing the layer for corresponding to agreement in data packet;
Logging modle, for recording the protocol label of each layer of requested data packet;
First processing module, for when receiving requested data packet, according to the protocol label of each layer of the data packet, The resolver of each layer of data packet is determined respectively;According to the parsing of each layer of data packet sequence, corresponding resolver is sequentially called to parse Corresponding layer, to obtain the parsing result of the data packet.
According to a third aspect of the embodiments of the present invention, a kind of electronic equipment is provided, the electronic equipment includes:
Processor;
Memory, for storing the computer program that can be executed by the processor;
Wherein, the step of realizing the resolve packet method when processor executes described program.
According to a fourth aspect of the embodiments of the present invention, the present invention also provides a kind of computer readable storage mediums, thereon The step of being stored with computer program, the resolve packet method realized when described program is executed by processor.
By above technical scheme, the embodiment of the present invention includes at least following advantageous effects:
The embodiment of the present invention, which passes through, is integrated in a resolution system for several resolvers for respectively corresponding a type of agreement In, and by sequentially calling corresponding resolver to solve the corresponding layer of data packet according to the protocol label of each layer of data packet Analysis realizes that a resolver only needs not having to multiple resolvers nested layer by layer comprising a kind of agreement, does not also need to appoint in advance solid Fixed parsing sequence, as long as calling corresponding resolver corresponding to data packet according to the protocol sequence of each layer of data packet in parsing Layer parsed.So the embodiment of the present invention does not need configuration comprising multi-layer protocol and the sequence of multi-layer protocol is unique Resolver, advantageously reduce needed for configure resolver quantity, simplify resolver configuration, and reduce resolver exploitation Cost.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not It can the limitation present invention.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows and meets implementation of the invention Example, and be used to explain the principle of the present invention together with specification.
Fig. 1 is a kind of present invention application scenarios signal of resolve packet method shown according to an exemplary embodiment Figure;
Fig. 2 is a kind of present invention structural schematic diagram of resolution system shown according to an exemplary embodiment;
Fig. 3 is a kind of present invention flow chart of resolve packet method shown according to an exemplary embodiment;
Fig. 4 is the tool of the step S12 in a kind of present invention resolve packet method shown according to an exemplary embodiment Body flow chart of steps;
Fig. 5 is the flow chart of the present invention another resolve packet method shown according to an exemplary embodiment;
Fig. 6 is a kind of present invention structural block diagram of resolve packet device shown according to an exemplary embodiment;
Fig. 7 is the structural block diagram for a kind of electronic equipment that the present invention is illustrated according to one.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all embodiments consistented with the present invention.On the contrary, they be only with it is such as appended The example of device and method being described in detail in claims, some aspects of the invention are consistent.
It is only to be not intended to limit the invention merely for for the purpose of describing particular embodiments in terminology used in the present invention. It is also intended in the present invention and the "an" of singular used in the attached claims, " described " and "the" including majority Form, unless the context clearly indicates other meaning.It is also understood that term "and/or" used herein refers to and wraps It may be combined containing one or more associated any or all of project listed.
It will be appreciated that though various information, but this may be described using term first, second, third, etc. in the present invention A little information should not necessarily be limited by these terms.These terms are only used to for same type of information being distinguished from each other out.For example, not departing from In the case where the scope of the invention, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as One information.Depending on context, word as used in this " if " can be construed to " ... when " or " when ... When " or " in response to determination ".
It, at present can only be by the inclusion of the resolver of multi-layer protocol to the number of respective type in resolve packet technical field It is parsed according to packet, that is, the number of plies for the multi-layer protocol that resolver is included and parsing sequence all must be with the numbers of required parsing It is identical with protocol sequence according to the agreement number of plies for wrapping included.Therefore, it if you need to parse different types of data packet, must just configure pair The multiple resolvers answered, the quantity and higher cost of the resolver of required configuration;And the configuration complexity of a resolver It can increasing and promoted with the data pack protocol number of plies.
Based on this, to overcome above-mentioned technical problem present in the relevant technologies, the embodiment of the invention provides a kind of data Packet analyzing method, apparatus, electronic equipment and computer readable storage medium, if by the way that a type of agreement will be respectively corresponded Dry resolver is integrated in a resolution system, and by sequentially calling corresponding resolver according to the protocol label of each layer of data packet The corresponding layer of data packet is parsed, realizes that a resolver only needs not having to multiple parsings nested layer by layer comprising a kind of agreement Device does not need to appoint fixed parsing sequence in advance, as long as being called in parsing according to the protocol sequence of each layer of data packet yet Corresponding resolver parses the corresponding layer of data packet.So the embodiment of the present invention does not need configuration and includes multilayer The unique resolver of the sequence of agreement and multi-layer protocol, the quantity of the resolver configured needed for advantageously reducing, simplifies resolver Configuration, and reduce resolver development cost.
In the embodiment of the present invention, as shown in Figure 1, Fig. 1 is a kind of present invention data shown according to an exemplary embodiment The application scenarios schematic diagram of Packet analyzing method, the resolve packet method can be applied in receiving end and/or transmitting terminal, with Receiving end and/or transmitting terminal is set to have the function of parsing data packet.Wherein, the receiving end or the transmitting terminal can be following At least one: server-side, client, exploitation end.For example, the resolve packet method can be applied at least one of Scene: in live scene, main broadcaster end is to server-side in response to the parsing of the transmitted data packet of its request, and main broadcaster end is to clothes The parsing for the data packet that business end or the rear end TAF of server-side are pushed, parsing of the server-side to data packet transmitted by main broadcaster end, Parsing of the server-side to data packet transmitted by another server-side.
Before executing the resolve packet method, the pre-configured resolve packet method of the present invention Application environment, for example, the corresponding program module of the good resolve packet method is developed, so that the resolve packet method It can be applied in above-mentioned mentioned any scene.Wherein, as shown in Fig. 2, Fig. 2 is the present invention according to an exemplary embodiment A kind of structural schematic diagram of the resolution system shown;It is pre-configured with what a resolution system, the resolution system includes several phases Mutual independent resolver, each resolver correspond to a type of agreement, and data are equipped between each resolver and data packet Coffret.Wherein, the resolver that the resolution system is included may include: Jce resolver, Json resolver and make by oneself The resolver of adopted agreement.The Jce resolver can be used for parsing one layer that protocol type in data packet is Jce agreement;It is described Json resolver can be used for parsing one layer that protocol type in data packet is Json agreement;The resolver of the custom protocol It can be used for parsing one layer that protocol type is corresponded in data packet, wherein the custom protocol refers to non-international standard Agreement, for example, the transport protocol of data packet has voluntarily been arranged at certain ends according to itself use demand.
In one embodiment, the resolution system can also include several data structure functions.Each data structure Function corresponds to a type of data structure.Hereinafter, resolver is according to the data structure of data packet n-th layer to n-th layer During being parsed, corresponding data structure function can be called, by the data of n-th layer according to corresponding data structure It is parsed.Wherein, n is positive integer.In other embodiments, several data structure functions can not belong to described Resolution system.
It is illustrated next, being provided for the embodiments of the invention resolve packet method.
As shown in figure 3, Fig. 3 is a kind of present invention application of resolve packet method shown according to an exemplary embodiment Schematic diagram of a scenario;Fig. 3 is a kind of present invention flow chart of resolve packet method shown according to an exemplary embodiment, this reality Apply a resolve packet method the following steps are included:
S10 records the protocol label of each layer of requested data packet;
S11 when receiving requested data packet, according to the protocol label of each layer of recorded data packet, determines number respectively According to the resolver for wrapping each layer;
S12 calls corresponding resolver to parse corresponding layer, sequentially according to the parsing of each layer of data packet sequence to obtain The parsing result of the data packet.
It, can be in terminal request data to the record of the protocol label of each layer of requested data packet in the step S10 It is recorded when packet.Wherein, by the relevant technologies it is found that since requested data packet is terminal activly request, so terminal When request data package, so that it may the protocol type for knowing each layer of requested data packet, it can also be according to protocol class Type knows the data structure of each layer data.Therefore, for convenience of subsequent parsing, the present embodiment has recorded number by step S10 According to the corresponding protocol label of protocol type for wrapping each layer, the protocol label is a kind of and matched label of protocol type, for example, Assuming that wherein one layer of protocol type is Json to data packet, then the content of corresponding protocol label can be " Json ".At other In example, one-to-one identifier can be specified for every kind of agreement in advance, using identifier as protocol label, for example, agreement Type is that the content of the protocol label of Json can be " J1 ".
In the step S11, it can be accomplished by the following way and corresponding resolver is determined according to protocol label: parse The note with the content matching of protocol label is added in the member variable of the entity class of the program of device, for example, when protocol label When content is " Json ", the content of the note may be " Json ";As long as it is matched with protocol label to find note as a result, Resolver, so that it may determine resolver corresponding to protocol label.It can be contacted respectively to be built by protocol label and note The interface of a resolver realizes the calling to resolver.Wherein, how to realize to be built according to protocol label and can contact each solution The interface of parser learns that this will not be repeated here in combination with the relevant technologies.
It is determined before starting to parse data packet in addition, the determination of the resolver of each layer of data packet can be, it can also be with It is to be determined layer by layer during parsing data packet.Wherein it is possible to determine that data packet is each before starting to parse data packet The resolver of layer can refer to: before parsing data packet, according to the protocol label of each layer recorded, use needed for first determining Resolver and resolver calling sequence;In this case, when parsing, it is corresponding that data packet can be first input into first layer Resolver;After first layer is parsed, the data packet (second layer for being equivalent to data packet) after one parsing is inputted To the corresponding resolver of the second layer;After the second layer is parsed, the data packet after parsing twice (is equivalent to data packet Third layer) it is input to the corresponding resolver of third layer;Thus it recycles, until the parsing of complete paired data packet the last layer, obtains The parsing result of the data packet.It can determine the resolver of each layer of data packet layer by layer during parsing data packet It can refer to: corresponding resolver first being determined according to the protocol label of data packet first layer, and data packet is input to first layer Corresponding resolver;After first layer is parsed, corresponding resolver is determined further according to the protocol label of the second layer, and will The second layer is input to the corresponding resolver of the second layer;After the second layer is parsed, determined further according to the protocol label of third layer Good corresponding resolver, and third layer is input to the corresponding resolver of third layer;Thus it recycles, until complete paired data packet is most The parsing of later layer obtains the parsing result of the data packet.Wherein, the parsing result refers to that data packet is yet completely resolved Afterwards, obtained to apply data.
It can be seen from the above, the execution sequence of the step S11 and the step S12 are not unique, and the step S11 Being with the content in the step S12 can be cross one another, that is, as shown in figure 4, Fig. 4 is that the present invention is exemplary according to one Implement the specific steps flow chart of the step S12 in a kind of resolve packet method exemplified, the step S12 may include Following steps:
S121, the current layer for detecting the data packet whether there is the agreement not parsed, if so, executing following steps:
S12a determines the resolver and data structure of current layer according to the protocol label of current layer;
Current layer is input in the resolver of the current layer by S12b, by the resolver of the current layer according to institute Data structure parsing current layer is stated, next layer of data packet current layer is obtained;
S12c will parse the resulting next layer of current layer as current desired parsing, and recycle the step S121, directly To the last layer for having parsed data packet.
Step S12a~the S12c can be found in aforementioned related content to the specific resolving of data packet, not go to live in the household of one's in-laws on getting married herein It states.Wherein it is possible to which the current layer for detecting the data packet is accomplished by the following way with the presence or absence of the agreement not parsed: due to number Data documented by each layer according to packet can all record the protocol type of data packet, so, when according to data packet current layer institute When the data of record can find protocol type information, so that it may be considered as and detect that data packet current layer has the association not parsed View.Conversely, working as, the data according to documented by data packet current layer do not find protocol type information or documented data are entirely When using data, so that it may determine that current layer is that there is no the agreements not parsed.
In addition, if the step S121 can also include: to detect that there is no do not parse the data packet current layer Agreement, then it represents that data packet has been parsed.At this point it is possible to export the parsing result of the data packet.
There are identical resolvers to avoid in resolution system, further to lower deployment cost and the raising of resolution system The effective rate of utilization of each resolver, and the practicability of the enhancing resolve packet method, in one embodiment, based on aforementioned On the basis of any embodiment, the corresponding protocol type of all resolvers is different.
To make the resolve packet method that can not only parse the data packet of terminal activly request, moreover it is possible to which parsing is sent Pushed data packet is held, it, can one to enhance the practicability of the resolve packet method and further decrease parsing cost It in the embodiment of choosing, is based on the basis of aforementioned any embodiment, as shown in figure 5, Fig. 5 is the present invention according to an exemplary implementation The flow chart of another resolve packet method exemplified, when receiving the data packet to be resolved of push, the method is also wrapped Include following steps:
S20 obtains the protocol label and data of first layer according to data documented by the data packet first layer to be resolved Structure;
S21 determines corresponding first layer resolver according to the protocol label of the first layer, and passes through the first layer solution Parser parses the first layer according to the data structure, obtains next layer of data packet to be resolved;
S22 will parse the resulting next layer of current layer as current desired parsing, and detection current layer, which whether there is, not to be solved The agreement of analysis, if so, executing following steps:
S2a obtains the protocol label of current layer, and determines corresponding current layer solution according to the protocol label of the current layer Parser;
S2b determines the data structure of current layer by current layer resolver data according to documented by current layer;
S2c parses current layer according to the data structure of the current layer by the current layer resolver, obtains current layer Next layer;
S2d recycles the step S22, until having parsed the last layer of the data packet to be resolved.
In embodiments of the present invention, the data that the server-side that the data packet to be resolved of push refers to is pushed from trend receiving end Packet, the non-reception end activly request gained of the data packet.
The data packet to be resolved of the embodiment of the present invention is one kind when receiving for receiving end, first layer Protocol type and data structure known to but other layers all unknown data packet of protocol type and data structure.For described Data packet to be resolved is not in the prior art, because before the transmission of prior art progress data packet, must be requested that hair The agreement number of plies and protocol type of data packet are appointed in sending end and receiving end in advance, that is, receiving end is before receiving data packet, The agreement number of plies and all layers of protocol type of data packet must be known in advance.So the prior art is unable to complete to this at all The parsing of the data packet to be resolved of inventive embodiments.
But the embodiment of the present invention is by providing technical solution documented by the step S20~S22, may be implemented pair The parsing of the data packet to be resolved.Because the resolver in the embodiment of the present invention is relatively independent and each resolver A type of agreement is corresponded to, fixed parsing sequence is had no between resolver, for example, being resolved to the data packet to be resolved A certain layer when, it is determining further according to protocol label by the current protocol label of data acquisition documented by a certain layer It, can be by calling corresponding resolver to parse a certain layer to corresponding resolver.So can be according to required The data packet of parsing flexibly calls corresponding resolver in order, without in advance according to the agreement number of plies and protocol class of data packet Type appoints the resolver of permanent order.As a result, the embodiment of the present invention by based on the resolution system to push come to Parsing data packet is parsed, and is realized before received data packet, does not need to know that data packet includes several layer protocols and each layer in advance Protocol type, be conducive to save data packet transmit before the rendezvous protocol number of plies and protocol type this program, data of being more convenient for The transmission and parsing of packet.
To realize when not finding the resolver of required agreement, it is new can to notify that developer goes to increase according to current demand Resolver, to further enhance the practicability of the resolve packet method, in an optional embodiment, the data Packet analyzing method can with the following steps are included:
S30 sends missing information to exploitation end when not finding corresponding resolver according to protocol label.
Wherein, the missing information includes protocol type corresponding to the resolver that currently lacks.
Developer can further improve the parsing according to the missing information after receiving the missing information System.For example, the resolver currently lacked can be increased in the resolution system, and the calling for establishing the resolver connects Mouthful.How to increase resolver in resolution system can be found in the aforementioned phase of the embodiment of the present invention with the calling interface for establishing resolver Hold inside the Pass and learns that this will not be repeated here in conjunction with the relevant technologies.
The embodiment of the present invention to exploitation end by sending when not finding corresponding resolver according to protocol label as a result, Missing information can help to develop end and further improve resolution system, so as to meet the parsing of a greater variety of data packets, Further enhance the practicability of the method;And resolution system to improve process simple, reduce development difficulty.
Corresponding with aforementioned data Packet analyzing method, the present invention also provides a kind of resolve packet devices, as shown in fig. 6, Fig. 6 is a kind of present invention structural block diagram of resolve packet device shown according to an exemplary embodiment, the data packet solution Analysis apparatus 300 includes:
Parsing module 301, including mutually independent several resolvers;Each resolver corresponds to a type of agreement, often A resolver is for parsing the layer for corresponding to agreement in data packet;
Logging modle 302, for recording the protocol label of each layer of requested data packet;
First processing module 303, for when receiving requested data packet, according to the association of each layer of recorded data packet It assesses a bid for tender label, determines the resolver of each layer of data packet respectively;According to the parsing of each layer of data packet sequence, corresponding parsing is sequentially called Device parses corresponding layer, to obtain the parsing result of the data packet.
In an optional embodiment, the corresponding protocol type of all resolvers is different.
In an optional embodiment, it is based on the basis of aforementioned any device embodiment, the first processing module 303 It is specifically used for:
The current layer for detecting the data packet whether there is the agreement not parsed, if so, executing following steps:
According to the protocol label of current layer, the resolver and data structure of current layer are determined;
Current layer is input in the resolver of the current layer;
After the resolver of the current layer is received to current layer parsing, the data packet current layer that is returned it is next Layer;
The resulting next layer of current layer as current desired parsing will be parsed, and recycles the detection data packet Current layer whether there is the step of agreement not parsed, until having parsed the last layer of data packet.
In an optional embodiment, it is based on the basis of aforementioned any device embodiment, the resolve packet device 300 can also include Second processing module, and the Second processing module is used for:
In the data packet to be resolved for receiving push, according to data documented by the first layer of the data packet to be resolved, Identification obtains the protocol label of the first layer of the data packet to be resolved;
According to the protocol label of the first layer of the data packet to be resolved, the first layer of the data packet to be resolved is obtained Data structure, and determine corresponding first layer resolver;
The data packet to be resolved is input in the first layer resolver;
After the first layer resolver is received to the parsing of the first layer of the data packet to be resolved, the number to be resolved that is returned According to next layer of packet;
The resulting next layer of current layer as current desired parsing will be parsed, detection current layer, which whether there is, not to be parsed Agreement, if so, executing following steps:
The data according to documented by current layer, identification obtain the protocol label of current layer;
Corresponding current layer resolver is determined according to the protocol label of the current layer;
Current layer is input in the current layer resolver;
After the current layer resolver is received to current layer parsing, next layer of the current layer returned;
Recycle it is described by the resulting next layer current layer as current desired parsing is parsed the step of, until parsed institute State the last layer of data packet to be resolved.
In an optional embodiment, it is based on the basis of aforementioned any device embodiment, the resolve packet device It can also include sending module.The sending module is used for when receiving missing information, sends the missing information to exploitation end; The missing information includes protocol type corresponding to the resolver of missing, and the missing information is by first processing module 303 Or Second processing module transmission when not finding corresponding resolver according to protocol label.
The function of modules and the realization process of effect are specifically detailed in the above method and correspond to step in described device It realizes, this will not be repeated here.
For device embodiment, since it corresponds essentially to embodiment of the method, so related place is referring to method reality Apply the part explanation of example.The apparatus embodiments described above are merely exemplary, wherein described be used as separation unit The module of explanation may or may not be physically separated.Can select according to the actual needs part therein or Person's whole module realizes the purpose of disclosure scheme.Those of ordinary skill in the art are not the case where making the creative labor Under, it can it understands and implements.
It is corresponding with aforementioned data Packet analyzing method, the present invention also provides a kind of electronic equipment of resolve packet device, As shown in fig. 7, Fig. 7 is the structural block diagram for a kind of electronic equipment that the present invention is illustrated according to one, the electronic equipment 400 Include:
Processor 401;
Memory 402, for storing the computer program that can be executed by the processor;
Wherein, the step of resolve packet method in any of the preceding embodiments is realized when the processor executes described program Suddenly.
In one embodiment, the electronic equipment of the embodiment of the present invention can have data processing function, data to deposit to be a kind of The electronic equipment of function and data transmission-receiving function is stored up, which can be computer equipment or mobile end equipment.
It is corresponding with the embodiment of aforementioned data bag data analytic method, in one exemplary embodiment, the present invention also provides A kind of non-transitorycomputer readable storage medium, is stored thereon with computer program.The computer program is by the electricity The step of processor of sub- equipment realizes resolve packet method in any of the preceding embodiments when executing.
In embodiments of the present invention, can be used one or more wherein include program code storage medium (including But be not limited to magnetic disk storage, CD-ROM, optical memory etc.) on the form of computer program product implemented.Computer can It include permanent and non-permanent, removable and non-removable media with storage medium, it can be by any method or technique Lai real Existing information storage.Information can be computer readable instructions, data structure, the module of program or other data.Computer is deposited The example of storage media includes but is not limited to: phase change memory (PRAM), static random access memory (SRAM), dynamic randon access Memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electrically erasable are read-only Memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM), digital multi CD (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices or any other Non-transmission medium, can be used for storage can be accessed by a computing device information.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to its of the disclosure Its embodiment.The disclosure is intended to cover any variations, uses, or adaptations of the disclosure, these modifications, purposes or Person's adaptive change follows the general principles of this disclosure and including the undocumented common knowledge in the art of the disclosure Or conventional techniques.The description and examples are only to be considered as illustrative, and the true scope and spirit of the disclosure are by following Claim is pointed out.
It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and And various modifications and changes may be made without departing from the scope thereof.The scope of the present disclosure is only limited by the accompanying claims.
The foregoing is merely the preferred embodiments of the disclosure, not to limit the disclosure, all essences in the disclosure Within mind and principle, any modification, equivalent substitution, improvement and etc. done be should be included within the scope of disclosure protection.

Claims (10)

1. a kind of resolve packet method, which is characterized in that applied to the resolution system including several mutually independent resolvers In, wherein each resolver corresponds to a type of agreement;The described method includes:
Record the protocol label of each layer of requested data packet;
When receiving requested data packet, according to the protocol label of each layer of recorded data packet, each layer of data packet is determined respectively Resolver;
According to the parsing of each layer of data packet sequence, corresponding resolver is called to parse corresponding layer, sequentially to obtain the data The parsing result of packet.
2. the method according to claim 1, wherein the corresponding protocol type of all resolvers is different.
3. the method according to claim 1, wherein the parsing sequence according to each layer of the data packet, according to Sequence calls corresponding resolver to parse corresponding layer, comprising:
The current layer for detecting the data packet whether there is the agreement not parsed, if so, executing following steps:
According to the protocol label of current layer, the resolver and data structure of current layer are determined;
Current layer is input in the resolver of the current layer, by the resolver of the current layer according to the data structure Current layer is parsed, next layer of data packet current layer is obtained;
The resulting next layer of current layer as current desired parsing will be parsed, and recycles the current of the detection data packet The step of layer is with the presence or absence of the agreement not parsed, until having parsed the last layer of data packet.
4. the method according to claim 1, wherein when receiving the data packet to be resolved of push, the method Further include:
According to data documented by the data packet first layer to be resolved, the protocol label and data structure of first layer are obtained;
Corresponding first layer resolver is determined according to the protocol label of the first layer, and passes through the first layer resolver foundation The data structure parses the first layer, obtains next layer of data packet to be resolved;
The resulting next layer of current layer as current desired parsing will be parsed, detection current layer whether there is the association not parsed View, if so, executing following steps:
The protocol label of current layer is obtained, and corresponding current layer resolver is determined according to the protocol label of the current layer;
By current layer resolver data according to documented by current layer, the data structure of current layer is determined;
Current layer is parsed according to the data structure of the current layer by the current layer resolver, obtains the next of current layer Layer;
Recycle it is described by the resulting next layer current layer as current desired parsing is parsed the step of, until described in parse to Parse the last layer of data packet.
5. method according to any one of claims 1 to 4, which is characterized in that corresponding when not found according to protocol label When resolver, the method also includes:
Missing information is sent to exploitation end;The missing information includes protocol type corresponding to the resolver that currently lacks.
6. a kind of data analysis device characterized by comprising
Parsing module, including mutually independent several resolvers;Each resolver corresponds to a type of agreement, each resolver For being parsed to the layer for corresponding to agreement in data packet;
Logging modle, for recording the protocol label of each layer of requested data packet;
First processing module, for when receiving requested data packet, according to the protocol label of each layer of recorded data packet, The resolver of each layer of data packet is determined respectively;According to the parsing of each layer of data packet sequence, corresponding resolver is sequentially called to parse Corresponding layer, to obtain the parsing result of the data packet.
7. device according to claim 6, which is characterized in that the corresponding protocol type of all resolvers is different.
8. device according to claim 6, which is characterized in that the first processing module is specifically used for:
The current layer for detecting the data packet whether there is the agreement not parsed, if so, executing following steps:
According to the protocol label of current layer, the resolver and data structure of current layer are determined;
Current layer is input in the resolver of the current layer;
After the resolver of the current layer is received to current layer parsing, next layer of the data packet current layer returned;
The resulting next layer of current layer as current desired parsing will be parsed, and recycles the current of the detection data packet The step of layer is with the presence or absence of the agreement not parsed, until having parsed the last layer of data packet.
9. a kind of electronic equipment characterized by comprising
Processor;
Memory, for storing the computer program that can be executed by the processor;
Wherein, the step of any one of Claims 1 to 5 the method is realized when the processor executes described program.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that described program is processed The step of any one of Claims 1 to 5 the method is realized when device executes.
CN201811113425.8A 2018-09-25 2018-09-25 Resolve packet method, apparatus, electronic equipment and storage medium Pending CN109257352A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811113425.8A CN109257352A (en) 2018-09-25 2018-09-25 Resolve packet method, apparatus, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811113425.8A CN109257352A (en) 2018-09-25 2018-09-25 Resolve packet method, apparatus, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN109257352A true CN109257352A (en) 2019-01-22

Family

ID=65047762

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811113425.8A Pending CN109257352A (en) 2018-09-25 2018-09-25 Resolve packet method, apparatus, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109257352A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111092880A (en) * 2019-12-13 2020-05-01 支付宝(杭州)信息技术有限公司 Network traffic data extraction method and device
CN112153048A (en) * 2020-09-24 2020-12-29 珠海格力电器股份有限公司 Information analysis method, information analysis device, information analysis system, storage medium, and electronic device
CN112631603A (en) * 2020-12-30 2021-04-09 文思海辉智科科技有限公司 Word string analysis method and system and electronic equipment
CN112751845A (en) * 2020-12-28 2021-05-04 北京恒光信息技术股份有限公司 Network protocol analysis method, system and device
CN112788013A (en) * 2020-12-30 2021-05-11 成都科来网络技术有限公司 WEB side online multi-layer protocol data packet decoding method and device
CN115987836A (en) * 2022-12-28 2023-04-18 上海天旦网络科技发展有限公司 Cloud network flow analysis method and system with extensible levels

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1744594A (en) * 2004-08-30 2006-03-08 北京航空航天大学 Web service transmsision protocol adaptor and its generating method
US20080092222A1 (en) * 2006-10-11 2008-04-17 Infineon Technologies Ag Router chip and method of selectively blocking network traffic in a router chip
CN101958902A (en) * 2010-09-30 2011-01-26 北京锐安科技有限公司 Method and device for resolving network data packet
CN103812937A (en) * 2014-02-13 2014-05-21 北京邮电大学 Access and adaption system of equipment for Internet of Things
CN105323300A (en) * 2014-06-19 2016-02-10 凯为公司 Method of handling large protocol layers for configurable extraction of layer information and an apparatus thereof
CN106982150A (en) * 2017-03-27 2017-07-25 重庆邮电大学 A kind of mobile Internet user behavior analysis method based on Hadoop

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1744594A (en) * 2004-08-30 2006-03-08 北京航空航天大学 Web service transmsision protocol adaptor and its generating method
US20080092222A1 (en) * 2006-10-11 2008-04-17 Infineon Technologies Ag Router chip and method of selectively blocking network traffic in a router chip
CN101958902A (en) * 2010-09-30 2011-01-26 北京锐安科技有限公司 Method and device for resolving network data packet
CN103812937A (en) * 2014-02-13 2014-05-21 北京邮电大学 Access and adaption system of equipment for Internet of Things
CN105323300A (en) * 2014-06-19 2016-02-10 凯为公司 Method of handling large protocol layers for configurable extraction of layer information and an apparatus thereof
CN106982150A (en) * 2017-03-27 2017-07-25 重庆邮电大学 A kind of mobile Internet user behavior analysis method based on Hadoop

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111092880A (en) * 2019-12-13 2020-05-01 支付宝(杭州)信息技术有限公司 Network traffic data extraction method and device
CN111092880B (en) * 2019-12-13 2022-08-09 支付宝(杭州)信息技术有限公司 Network traffic data extraction method and device
CN112153048A (en) * 2020-09-24 2020-12-29 珠海格力电器股份有限公司 Information analysis method, information analysis device, information analysis system, storage medium, and electronic device
CN112751845A (en) * 2020-12-28 2021-05-04 北京恒光信息技术股份有限公司 Network protocol analysis method, system and device
CN112751845B (en) * 2020-12-28 2022-12-02 北京恒光信息技术股份有限公司 Network protocol analysis method, system and device
CN112631603A (en) * 2020-12-30 2021-04-09 文思海辉智科科技有限公司 Word string analysis method and system and electronic equipment
CN112788013A (en) * 2020-12-30 2021-05-11 成都科来网络技术有限公司 WEB side online multi-layer protocol data packet decoding method and device
CN115987836A (en) * 2022-12-28 2023-04-18 上海天旦网络科技发展有限公司 Cloud network flow analysis method and system with extensible levels

Similar Documents

Publication Publication Date Title
CN109257352A (en) Resolve packet method, apparatus, electronic equipment and storage medium
CN108093070B (en) Internet of things data service middleware system
CN110266713A (en) Intranet and extranet communication means, device, system and proxy server and storage medium
CN102571947B (en) Processing method proxy method, device and system
WO2017140216A1 (en) Method and device for network load balancing, control, and network interaction
CN109445968A (en) Service request processing method, device, equipment and the storage medium of different agreement
EP1949595A2 (en) Method for the construction and execution of a distributed workflow in a communication system
CN106657180B (en) Information transmission method and device for cloud service, terminal equipment and system
CN107463453A (en) Method, apparatus, equipment and the storage medium to be communicated between same terminal different application
CN106909325B (en) Log printing method and device and log printing system
CN114205342B (en) Service debugging routing method, electronic equipment and medium
CN109614147A (en) A kind of PHY register reading/writing method and device
CN111064804A (en) Network access method and device
WO2008121462A1 (en) Scriptable object model for network based services
CN109743378A (en) Information transmission system, information-pushing method and electronic equipment
CN109327435A (en) Media resource acquisition methods, device and gateway
CN109819070B (en) Network address translation method
CN109150844B (en) Method, device and system for determining digital certificate
CN107040613A (en) A kind of message transmitting method and system
CN104219257A (en) Web real-time communication method, system, server and client
CN106878243A (en) Method for processing business and device
CN108255955A (en) A kind of data processing method and device
CN110022332B (en) Hypertext transfer security protocol proxy method, device, equipment and medium
CN114285859B (en) Data processing method, device, equipment and storage medium for middle layer block chain service
CN104969533B (en) A kind of data package processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190122

RJ01 Rejection of invention patent application after publication