CN110417766B - Protocol analysis method and device - Google Patents

Protocol analysis method and device Download PDF

Info

Publication number
CN110417766B
CN110417766B CN201910659543.7A CN201910659543A CN110417766B CN 110417766 B CN110417766 B CN 110417766B CN 201910659543 A CN201910659543 A CN 201910659543A CN 110417766 B CN110417766 B CN 110417766B
Authority
CN
China
Prior art keywords
protocol
request message
plug
processor plug
processor
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.)
Active
Application number
CN201910659543.7A
Other languages
Chinese (zh)
Other versions
CN110417766A (en
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.)
Shenzhen Cooday Communication Co ltd
Original Assignee
Shenzhen Cooday Communication 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 Shenzhen Cooday Communication Co ltd filed Critical Shenzhen Cooday Communication Co ltd
Priority to CN201910659543.7A priority Critical patent/CN110417766B/en
Publication of CN110417766A publication Critical patent/CN110417766A/en
Application granted granted Critical
Publication of CN110417766B publication Critical patent/CN110417766B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/03Protocol definition or specification 
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2212/00Encapsulation of packets
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the invention is suitable for the technical field of information, and provides a method and a device for protocol analysis, wherein the method comprises the following steps: loading a protocol processor plug-in corresponding to a target client, wherein the protocol processor plug-in is generated based on a preset interface rule; receiving a protocol request message sent by the target client; processing the protocol request message by adopting the protocol processor plug-in, and packaging the processed protocol request message into a protocol common entity; and sending the protocol public entity to a protocol analyzer, and analyzing the protocol public entity through the protocol analyzer. In the embodiment, the plugin core modules are separated, and the protocol receiving and protocol analyzing logics are decoupled, so that the problem of protocol analysis in different scenes can be solved, and developers can develop new protocol analyzing logics without influencing other protocol analyzing modules.

Description

Protocol analysis method and device
Technical Field
The present invention belongs to the field of information technology, and in particular, to a protocol parsing method, a protocol parsing apparatus, a server, and a computer-readable storage medium.
Background
In the era of mobile internet of things, protocol services gradually become an indispensable component for interaction between a client and a platform, and protocol analysis services can enable the client and the platform to transmit data according to a given analysis format.
At present, most intelligent homes and wearable devices support access to the Internet of things platform, and more intelligent devices can directly interact through the Internet of things platform in the future. Because each client accessing the internet of things platform may be provided by different providers, and the protocol formats supported by each client may also be different, the protocol analysis service of the platform may face various modes, and for different clients, protocol analysis needs to be performed according to different analysis modes. Moreover, each time different clients are docked with the platform, modification of codes on the platform is involved, and efficiency is low.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for protocol parsing, so as to solve the problem in the prior art that because there is no uniform protocol parsing mode between an internet of things platform and a client, when parsing modes for different clients are developed, platform codes need to be modified each time, and development efficiency is low.
The first aspect of the embodiment of the present invention provides a protocol parsing method, which is applied to an internet of things platform, and the method includes:
loading a protocol processor plug-in corresponding to a target client, wherein the protocol processor plug-in is generated based on a preset interface rule;
receiving a protocol request message sent by the target client;
processing the protocol request message by adopting the protocol processor plug-in, and packaging the processed protocol request message into a protocol common entity;
and sending the protocol public entity to a protocol analyzer, and analyzing the protocol public entity through the protocol analyzer.
Optionally, the step of loading a protocol processor plug-in corresponding to the target client includes:
scanning a plurality of data packets which are loaded to an Internet of things platform in advance;
extracting a target data packet of a class with a specific annotation identification from the plurality of data packets to obtain a protocol processor plug-in;
and loading the protocol processor plug-ins, wherein the protocol processor plug-ins and the target client have a one-to-one correspondence relationship.
Optionally, after the step of loading the protocol processor plug-in corresponding to the target client, the method further includes:
and registering the protocol processor plug-in.
Optionally, after the step of receiving the protocol request message sent by the target client, the method further includes:
judging whether the protocol request message conforms to a preset data format or not;
if yes, executing the step of processing the protocol request message by adopting the protocol processor plug-in and packaging the processed protocol request message into a protocol public entity;
if not, discarding the protocol request message.
Optionally, the step of processing the protocol request message by using the protocol processor plug-in and encapsulating the processed protocol request message into a protocol common entity includes:
extracting a plurality of protocol contents carried in the protocol request message by adopting the protocol processor plug-in;
and packaging the multiple protocol contents into a protocol common entity according to a preset packaging rule.
Optionally, the parsing, by the protocol parser, the protocol common entity includes:
decapsulating the protocol common entity through the protocol parser to obtain a plurality of protocol contents;
respectively determining public functions corresponding to the protocol contents, and calling the public functions to process the corresponding protocol contents.
Optionally, the multiple protocol content includes:
message interval symbol, message ending symbol, protocol analysis class, protocol processing message queue, whether to push heartbeat queue, whether to answer after receiving message, internal instruction type, internal instruction name, check code, terminal identification ID, protocol data length, protocol data content, protocol data original content, protocol data receiving time stamp, whether to authenticate and attach attribute domain.
A second aspect of the embodiments of the present invention provides a protocol analysis device, which is applied to an internet of things platform, and includes:
the loading module is used for loading a protocol processor plug-in corresponding to the target client, and the protocol processor plug-in is generated based on a preset interface rule;
the receiving module is used for receiving the protocol request message sent by the target client;
the encapsulation module is used for processing the protocol request message by adopting the protocol processor plug-in and encapsulating the processed protocol request message into a protocol public entity;
and the analysis module is used for sending the protocol public entity to a protocol analyzer and analyzing the protocol public entity through the protocol analyzer.
Optionally, the loading module includes:
the data packet scanning sub-module is used for scanning a plurality of data packets which are loaded to the Internet of things platform in advance;
the target data packet extraction submodule is used for extracting a target data packet of a class with a specific annotation identifier from the plurality of data packets to obtain a protocol processor plug-in;
and the protocol processor plug-in loading submodule is used for loading the protocol processor plug-ins, and the protocol processor plug-ins and the target client have one-to-one correspondence.
Optionally, the apparatus further comprises:
and the protocol processor plug-in registration module is used for registering the protocol processor plug-in.
Optionally, the apparatus further comprises:
the data format judging module is used for judging whether the protocol request message conforms to a preset data format or not;
the calling module is used for calling the packaging module if the protocol request message conforms to a preset data format;
and the discarding module is used for discarding the protocol request message if the protocol request message does not conform to the preset data format.
Optionally, the encapsulation module includes:
a protocol content extraction submodule for extracting a plurality of protocol contents carried in the protocol request message by adopting the protocol processor plug-in;
and the protocol common entity encapsulation submodule is used for encapsulating the multiple items of protocol contents into a protocol common entity according to a preset encapsulation rule.
Optionally, the parsing module includes:
the protocol common entity decapsulation submodule is used for decapsulating the protocol common entity through the protocol parser to obtain a plurality of protocol contents;
and the protocol content processing submodule is used for respectively determining the public functions corresponding to the protocol contents and calling the public functions to process the corresponding protocol contents.
Optionally, the multiple protocol content includes:
message interval symbol, message ending symbol, protocol analysis class, protocol processing message queue, whether to push heartbeat queue, whether to answer after receiving message, internal instruction type, internal instruction name, check code, terminal identification ID, protocol data length, protocol data content, protocol data original content, protocol data receiving time stamp, whether to authenticate and attach attribute domain.
A third aspect of embodiments of the present invention provides a server, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method for protocol resolution as described in the first aspect when executing the computer program.
A fourth aspect of embodiments of the present invention provides a computer-readable storage medium, which stores a computer program that, when executed by a processor, implements the steps of the method for protocol resolution as described in the first aspect.
Compared with the prior art, the embodiment of the invention has the following advantages:
according to the embodiment of the invention, by loading the protocol processor plug-in corresponding to the target client, after receiving the protocol request message sent by the target client, the protocol processor plug-in is adopted to process the protocol request message, the processed protocol request message is packaged into the protocol public entity, and then the protocol public entity is analyzed through the protocol analyzer. In the embodiment, the plugin core modules are separated, and the protocol receiving and protocol analyzing logics are decoupled, so that the problem of protocol analysis in different scenes can be solved, and developers can develop new protocol analyzing logics without influencing other protocol analyzing modules.
Secondly, according to the scene needs of the internet of things open platform, the embodiment extracts the protocol processor plug-in for avoiding the intrusion of code development aiming at the situation that different hardware terminals have different protocol standards and different protocol contents, and applies the protocol processor plug-in to different products in a plug-in mode so as to meet the service requirements of different products.
Third, the plug-in architecture in this embodiment well embodies the hollywood principle (Do not call us, well call you) in the design principle, and strips the extended function from the platform overall framework, thereby reducing the complexity of the platform or framework, enabling the extended function to be loosely coupled with the platform or framework, and enabling the extended function and the platform or framework to be independently changed and released while maintaining the interface unchanged, thereby improving the development efficiency of the protocol analysis module and the protocol analysis efficiency.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the embodiments or the description of the prior art will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
FIG. 1 is a schematic diagram of a microkernel architecture of the prior art;
FIG. 2 is a flowchart illustrating steps of a method for protocol resolution according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a protocol resolution framework according to an embodiment of the invention;
FIG. 4 is a schematic diagram of an apparatus for protocol parsing in accordance with an embodiment of the present invention;
fig. 5 is a schematic diagram of a server according to an embodiment of the invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
The technical solution of the present invention will be described below by way of specific examples.
The micro kernel Architecture (also called Plug-in Architecture) is an extensible Architecture that is split in a function-oriented manner, is generally used for implementing product-based applications, and is an ideal Architecture mode for product-based applications or platforms. The microkernel architecture includes two types of components: core systems (core systems) and plug-in modules (plug-in modules). The core system usually contains the minimum business logic and ensures that the plug-ins required by the application can be loaded, unloaded and run, and the plug-in modules are independent of each other and are responsible for realizing the specific business logic. FIG. 1 is a schematic diagram of a microkernel architecture. The core system in fig. 1 has stable functions, and cannot be continuously modified due to the expansion of the service functions, and the plug-in module can be continuously expanded according to the requirements of the service functions. The essence of the micro-kernel architecture is that the change is encapsulated in the plug-in, so that the purpose of quick and flexible expansion is achieved, and the stability of the whole system is not influenced.
In order to solve the problem that in the prior art, because a uniform protocol analysis mode does not exist between an internet of things platform and a client, when the analysis modes for different clients are developed, platform codes need to be modified every time, and the development efficiency is low, in the embodiment, the protocol processor plug-ins for different clients are developed in the internet of things platform in a microkernel architecture mode, so that the analysis modes for different projects and different client protocols can be developed, the development is performed in a plug-in mode under the condition that platform core codes are not invaded, and the access to scenes with different protocol format requirements is facilitated.
Referring to fig. 2, a schematic flowchart illustrating a step flow of a protocol parsing method according to an embodiment of the present invention is shown, which may specifically include the following steps:
s201, loading a protocol processor plug-in corresponding to a target client, wherein the protocol processor plug-in is generated based on a preset interface rule;
it should be noted that the method can be applied to intelligent hardware such as an internet of things platform, an intelligent home and wearable equipment, and direct interaction can be realized by accessing the internet of things platform.
Generally, protocol formats supported by the clients may be different, and for clients developed based on different protocol formats, the internet of things platform needs to provide corresponding protocol parsing services, so that data can be transmitted between the clients and the platform according to a given parsing format.
In the embodiment of the invention, the target client is a client accessing to the platform of the internet of things. For the client, the platform needs to perform protocol analysis on the client according to a certain analysis mode.
In the embodiment of the invention, the Internet of things platform provides a plug-in protocol analysis framework which is used for analyzing the protocol of each client.
Fig. 3 is a schematic diagram of a protocol parsing framework according to an embodiment of the present invention. The framework is composed of a plug-in loader, a plug-in register, a protocol processor plug-in, a protocol analysis interface, a protocol analyzer and a public function library.
The protocol processor plug-in corresponding to the target client can be loaded in the platform in advance, so that the protocol of the target client can be analyzed through the protocol processor plug-in. The protocol processor plug-in may be obtained by scanning a packet recorded in the platform.
In the embodiment of the invention, the plug-in loader can firstly scan a plurality of data packets which are loaded to the platform of the Internet of things in advance; then, extracting a target data packet of the class with the specific annotation identification from the plurality of data packets, obtaining a protocol processor plug-in, and loading the protocol processor plug-in.
In particular implementations, the plug-in loader may load protocol processor plug-ins according to the Annocommand ParserConfig annotation identified class. The class with the AnnocommandeParserConfig annotation identifier is the plug-in parsing class, and the platform can obtain the corresponding protocol processor plug-in by scanning the class with the identifier when starting.
It should be noted that the protocol processor plug-in is generated based on a preset interface rule, which can be understood as a rule that must be followed to invoke the interface. Meanwhile, the protocol processor plug-in also has a one-to-one correspondence with the target client, and the protocol message of the target client can be processed subsequently through the plug-in.
In the embodiment of the present invention, after the plug-in loader loads the protocol processor plug-in, the plug-in may be registered by the plug-in registrar, and encapsulated in a container and loaded in the application context cache.
On the other hand, the plug-in registrar may also open a REST (Representational State Transfer) interface for other applications to call in the internal environment and support hot-writing of protocol processor plug-ins.
S202, receiving a protocol request message sent by the target client;
in the embodiment of the invention, the protocol request message sent by the target client is a message for the internet of things platform to analyze.
Generally, parsing a protocol is to split data according to an agreed rule, and the split data should satisfy a certain data format. For example, the JSON format. Only when the received message conforms to the JSON format, the message can be normally processed, and if the message does not conform to the JSON format, subsequent parsing cannot be performed.
Therefore, in the embodiment of the present invention, after receiving a protocol request message sent by a target client, a platform may first determine whether the protocol request message conforms to a preset data format; if yes, step S203 may be executed, where a protocol processor plug-in is used to process the protocol request message, and the processed protocol request message is encapsulated as a protocol common entity; if not, the protocol request message may be discarded.
S203, processing the protocol request message by adopting the protocol processor plug-in, and packaging the processed protocol request message into a protocol public entity;
in the embodiment of the invention, the purpose of processing the protocol request message by the protocol processor plug-in is to convert the protocol content carried in the message into a protocol common entity and deliver the protocol common entity to the protocol analyzer for processing.
In a specific implementation, after receiving a protocol request message, a protocol processor plug-in may first extract a plurality of protocol contents carried in the message. These protocol contents may include message interval symbol, message end symbol, protocol parsing class, protocol processing message queue, whether to push heartbeat queue, whether to reply after receiving message, internal instruction type, internal instruction name, check code, terminal identification ID, protocol data length, protocol data content, protocol data original content, protocol data receiving timestamp, whether to authenticate, additional attribute field, etc.
And then, according to a preset encapsulation rule, encapsulating the plurality of protocol contents into a protocol common entity, wherein the protocol common entity is adapted to the standard unified by the platform.
Generally, the protocol common entities are defined to include a header, a body, and a trailer. The packet header includes an International Mobile Equipment Identity (IMEI) or a terminal platform identifier (CID), the packet body is a specific protocol content, and the packet tail is an end identifier of the packet.
In general, the message spacers and terminators in the protocol contents are static, and the protocol processor plug-ins need not be modified, being spacers and terminators of the common entity of the protocol.
The encapsulated protocol common entity is sent to a protocol resolver of the platform for uniform processing.
And S204, sending the protocol public entity to a protocol analyzer, and analyzing the protocol public entity through the protocol analyzer.
In the embodiment of the invention, after the protocol analyzer receives the protocol common entity, the entity can be processed according to the uniform processing standard.
In a specific implementation, the protocol parser may decapsulate the received protocol common entity to obtain multiple protocol contents, then determine common functions corresponding to the protocol contents, and call the common functions to process the corresponding protocol contents. The common functions are provided by a common function library in the protocol parsing framework of fig. 3.
For example, a protocol processing message queue obtained by encapsulating a protocol common entity by a protocol parser may be pushed to a corresponding protocol processing message queue according to a queue name under the action of a corresponding common function; whether the information of the heartbeat queue is pushed or not in the protocol common entity can be used for determining whether the heartbeat information is pushed or not to the client; the check code can facilitate the platform to verify the integrity of the data; the terminal identification ID and the protocol ID can ensure the consistency of data for the platform; whether the authentication can be achieved or not is judged, and the platform carries out corresponding processing according to the authentication identification; the additional attribute domain facilitates the platform to retain additional information and facilitate subsequent processing.
In the embodiment of the invention, by loading the protocol processor plug-in corresponding to the target client, after receiving the protocol request message sent by the target client, the protocol processor plug-in is adopted to process the protocol request message, the processed protocol request message is packaged into the protocol common entity, and then the protocol common entity is analyzed by the protocol analyzer. In the embodiment, the plugin core modules are separated, and the protocol receiving and protocol analyzing logics are decoupled, so that the problem of protocol analysis in different scenes can be solved, and developers can develop new protocol analyzing logics without influencing other protocol analyzing modules.
Secondly, according to the scene needs of the internet of things open platform, the embodiment extracts the protocol processor plug-in for avoiding the intrusion of code development aiming at the situation that different hardware terminals have different protocol standards and different protocol contents, and applies the protocol processor plug-in to different products in a plug-in mode so as to meet the service requirements of different products.
Third, the plug-in architecture in this embodiment well embodies the hollywood principle (Do not call us, well call you) in the design principle, and strips the extended function from the platform overall framework, thereby reducing the complexity of the platform or framework, enabling the extended function to be loosely coupled with the platform or framework, and enabling the extended function and the platform or framework to be independently changed and released while maintaining the interface unchanged, thereby improving the development efficiency of the protocol analysis module and the protocol analysis efficiency.
It should be noted that, the sequence numbers of the steps in the foregoing embodiments do not mean the execution sequence, and the execution sequence of each process should be determined by the function and the internal logic of the process, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
Referring to fig. 4, a schematic diagram of a protocol parsing apparatus according to an embodiment of the present invention is shown, where the apparatus may be applied to an internet of things platform, and specifically includes the following modules:
a loading module 401, configured to load a protocol processor plug-in corresponding to a target client, where the protocol processor plug-in is generated based on a preset interface rule;
a receiving module 402, configured to receive a protocol request message sent by the target client;
an encapsulation module 403, configured to process the protocol request message by using the protocol processor plug-in, and encapsulate the processed protocol request message as a protocol common entity;
the parsing module 404 is configured to send the protocol common entity to a protocol parser, and parse the protocol common entity through the protocol parser.
In this embodiment of the present invention, the loading module 401 may specifically include the following sub-modules:
the data packet scanning sub-module is used for scanning a plurality of data packets which are loaded to the Internet of things platform in advance;
the target data packet extraction submodule is used for extracting a target data packet of a class with a specific annotation identifier from the plurality of data packets to obtain a protocol processor plug-in;
and the protocol processor plug-in loading submodule is used for loading the protocol processor plug-ins, and the protocol processor plug-ins and the target client have one-to-one correspondence.
In the embodiment of the present invention, the apparatus may further include the following modules:
and the protocol processor plug-in registration module is used for registering the protocol processor plug-in.
In the embodiment of the present invention, the apparatus may further include the following modules:
the data format judging module is used for judging whether the protocol request message conforms to a preset data format or not;
a calling module, configured to call the encapsulation module 403 if the protocol request message conforms to a preset data format;
and the discarding module is used for discarding the protocol request message if the protocol request message does not conform to the preset data format.
In this embodiment of the present invention, the encapsulation module 403 may specifically include the following sub-modules:
a protocol content extraction submodule for extracting a plurality of protocol contents carried in the protocol request message by adopting the protocol processor plug-in;
and the protocol common entity encapsulation submodule is used for encapsulating the multiple items of protocol contents into a protocol common entity according to a preset encapsulation rule.
In this embodiment of the present invention, the parsing module 404 may specifically include the following sub-modules:
the protocol common entity decapsulation submodule is used for decapsulating the protocol common entity through the protocol parser to obtain a plurality of protocol contents;
and the protocol content processing submodule is used for respectively determining the public functions corresponding to the protocol contents and calling the public functions to process the corresponding protocol contents.
In an embodiment of the present invention, the multiple protocol contents may include:
message interval symbol, message ending symbol, protocol analysis class, protocol processing message queue, whether to push heartbeat queue, whether to answer after receiving message, internal instruction type, internal instruction name, check code, terminal identification ID, protocol data length, protocol data content, protocol data original content, protocol data receiving time stamp, whether to authenticate and attach attribute domain.
For the apparatus embodiment, since it is substantially similar to the method embodiment, it is described relatively simply, and reference may be made to the description of the method embodiment section for relevant points.
Referring to fig. 5, a schematic diagram of a server of one embodiment of the invention is shown. As shown in fig. 5, the server 500 of the present embodiment includes: a processor 510, a memory 520, and a computer program 521 stored in the memory 520 and executable on the processor 510. The processor 510 executes the computer program 521 to implement the steps in various embodiments of the protocol parsing method, such as steps S101 to S104 shown in fig. 1. Alternatively, the processor 510, when executing the computer program 521, implements the functions of each module/unit in the above-described device embodiments, for example, the functions of the modules 401 to 404 shown in fig. 4.
Illustratively, the computer program 521 may be partitioned into one or more modules/units that are stored in the memory 520 and executed by the processor 510 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which may be used to describe the execution of the computer program 521 in the server 500. For example, the computer program 521 may be divided into a loading module, a receiving module, an encapsulating module, and an analyzing module, and the specific functions of each module are as follows:
the loading module is used for loading a protocol processor plug-in corresponding to the target client, and the protocol processor plug-in is generated based on a preset interface rule;
the receiving module is used for receiving the protocol request message sent by the target client;
the encapsulation module is used for processing the protocol request message by adopting the protocol processor plug-in and encapsulating the processed protocol request message into a protocol public entity;
and the analysis module is used for sending the protocol public entity to a protocol analyzer and analyzing the protocol public entity through the protocol analyzer.
The server 500 may be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The server 500 may include, but is not limited to, a processor 510, a memory 520. Those skilled in the art will appreciate that fig. 5 is merely an example of a server 500 and is not intended to limit server 500 and may include more or fewer components than those shown, or some components may be combined, or different components, e.g., server 500 may also include input-output devices, network access devices, buses, etc.
The Processor 510 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 520 may be an internal storage unit of the server 500, such as a hard disk or a memory of the server 500. The memory 520 may also be an external storage device of the server 500, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and so on, which are provided on the server 500. Further, the memory 520 may also include both an internal storage unit and an external storage device of the server 500. The memory 520 is used for storing the computer program 521 and other programs and data required by the server 500. The memory 520 may also be used to temporarily store data that has been output or is to be output.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same. Although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (9)

1. A protocol analysis method is applied to an Internet of things platform and comprises the following steps:
scanning a plurality of data packets which are loaded to an Internet of things platform in advance;
extracting a target data packet of a class having a specific annotation identification from the plurality of data packets;
scanning the target data packet to obtain a protocol processor plug-in corresponding to the target client;
loading the protocol processor plug-in, wherein the protocol processor plug-in is generated based on a preset interface rule;
receiving a protocol request message sent by the target client;
processing the protocol request message by adopting the protocol processor plug-in, and packaging the processed protocol request message into a protocol common entity;
and sending the protocol public entity to a protocol analyzer, and analyzing the protocol public entity through the protocol analyzer.
2. The method of claim 1, after the step of loading the protocol processor plug-in, further comprising:
and registering the protocol processor plug-in.
3. The method according to claim 1, further comprising, after the step of receiving the protocol request message sent by the target client:
judging whether the protocol request message conforms to a preset data format or not;
if yes, executing the step of processing the protocol request message by adopting the protocol processor plug-in and packaging the processed protocol request message into a protocol public entity;
if not, discarding the protocol request message.
4. The method of claim 1, wherein the step of processing the protocol request message by using the protocol processor plug-in and encapsulating the processed protocol request message as a protocol common entity comprises:
extracting a plurality of protocol contents carried in the protocol request message by adopting the protocol processor plug-in;
and packaging the multiple protocol contents into a protocol common entity according to a preset packaging rule.
5. The method of claim 4, wherein the step of parsing the protocol common entity by the protocol parser comprises:
decapsulating the protocol common entity through the protocol parser to obtain a plurality of protocol contents;
respectively determining public functions corresponding to the protocol contents, and calling the public functions to process the corresponding protocol contents.
6. The method of claim 4, wherein the plurality of protocol contents comprises:
message interval symbol, message ending symbol, protocol analysis class, protocol processing message queue, whether to push heartbeat queue, whether to answer after receiving message, internal instruction type, internal instruction name, check code, terminal identification ID, protocol data length, protocol data content, protocol data original content, protocol data receiving time stamp, whether to authenticate and attach attribute domain.
7. The utility model provides a device of agreement analysis, its characterized in that is applied to thing networking platform, the device includes:
the loading module is used for scanning a plurality of data packets which are pre-loaded to the Internet of things platform, extracting a target data packet of a class with a specific annotation identifier from the plurality of data packets, scanning the target data packet, obtaining a protocol processor plug-in corresponding to a target client, and loading the protocol processor plug-in, wherein the protocol processor plug-in is generated based on a preset interface rule;
the receiving module is used for receiving the protocol request message sent by the target client;
the encapsulation module is used for processing the protocol request message by adopting the protocol processor plug-in and encapsulating the processed protocol request message into a protocol public entity;
and the analysis module is used for sending the protocol public entity to a protocol analyzer and analyzing the protocol public entity through the protocol analyzer.
8. A server comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method of protocol resolution according to any of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method of protocol resolution according to any one of claims 1 to 6.
CN201910659543.7A 2019-07-22 2019-07-22 Protocol analysis method and device Active CN110417766B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910659543.7A CN110417766B (en) 2019-07-22 2019-07-22 Protocol analysis method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910659543.7A CN110417766B (en) 2019-07-22 2019-07-22 Protocol analysis method and device

Publications (2)

Publication Number Publication Date
CN110417766A CN110417766A (en) 2019-11-05
CN110417766B true CN110417766B (en) 2021-10-22

Family

ID=68362211

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910659543.7A Active CN110417766B (en) 2019-07-22 2019-07-22 Protocol analysis method and device

Country Status (1)

Country Link
CN (1) CN110417766B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112866182B (en) * 2019-11-28 2023-05-23 浙江宇视科技有限公司 Data docking method, device and computer readable storage medium
CN111083225B (en) * 2019-12-19 2022-09-30 远景智能国际私人投资有限公司 Data processing method and device in Internet of things platform and Internet of things platform
CN111427664B (en) * 2020-03-25 2024-04-12 杭州电子科技大学 Container-based protocol analysis method, device, system and storage medium
CN112134915B (en) * 2020-06-29 2022-10-14 上海金融期货信息技术有限公司 Application layer protocol decoupling universal network processing system
CN111797013A (en) * 2020-06-29 2020-10-20 北京字节跳动网络技术有限公司 Interface detection tool generation method, interface detection method, device, equipment and medium
CN112153048B (en) * 2020-09-24 2021-11-30 珠海格力电器股份有限公司 Information analysis method, information analysis device, information analysis system, storage medium, and electronic device
CN112104670B (en) * 2020-11-11 2021-02-26 北京城市轨道交通咨询有限公司 Method and device for analyzing rail transit data based on link mapping
CN113157335B (en) * 2021-03-31 2023-06-06 北京临近空间飞行器系统工程研究所 Software system design method of extensible plug-in architecture
CN113177013B (en) * 2021-05-24 2022-09-02 石家庄通合电子科技股份有限公司 Baud rate-based serial communication method and multi-serial chip
CN114172978A (en) * 2021-12-30 2022-03-11 中国电信股份有限公司 Multi-protocol equipment access method and related device
CN114422618B (en) * 2021-12-31 2024-01-02 北京千方科技股份有限公司 Cloud-protogenesis-based IOT platform protocol adaptation method, device, equipment and medium
CN116016005A (en) * 2022-12-12 2023-04-25 阿里云计算有限公司 Internet of things equipment access method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104345717A (en) * 2014-10-17 2015-02-11 武汉华大优能信息有限公司 Intelligent remote data acquisition system based on Internet of Things
CN107018209A (en) * 2017-06-08 2017-08-04 郑州云海信息技术有限公司 A kind of method and device for realizing Internet of Things cloud platform
CN107888539A (en) * 2016-09-29 2018-04-06 中兴通讯股份有限公司 Internet-of-things terminal access device and method
CN108965484A (en) * 2018-09-30 2018-12-07 深圳市酷达通讯有限公司 A kind of transmission method of internet of things data, system and terminal
CN109388417A (en) * 2018-09-30 2019-02-26 深圳市酷达通讯有限公司 A kind of update method of communication protocol, system and terminal device
CN109445968A (en) * 2018-11-09 2019-03-08 金瓜子科技发展(北京)有限公司 Service request processing method, device, equipment and the storage medium of different agreement

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102333039B (en) * 2011-10-25 2014-09-17 华为技术有限公司 Method for forwarding message, and method and device for generating table entry
US10732621B2 (en) * 2016-05-09 2020-08-04 Strong Force Iot Portfolio 2016, Llc Methods and systems for process adaptation in an internet of things downstream oil and gas environment
US20190036896A1 (en) * 2017-07-27 2019-01-31 Cisco Technology, Inc. Generic Bootstrapping Architecture (GBA) Based Security Over Constrained Application Protocol (CoAP) for IoT Devices

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104345717A (en) * 2014-10-17 2015-02-11 武汉华大优能信息有限公司 Intelligent remote data acquisition system based on Internet of Things
CN107888539A (en) * 2016-09-29 2018-04-06 中兴通讯股份有限公司 Internet-of-things terminal access device and method
CN107018209A (en) * 2017-06-08 2017-08-04 郑州云海信息技术有限公司 A kind of method and device for realizing Internet of Things cloud platform
CN108965484A (en) * 2018-09-30 2018-12-07 深圳市酷达通讯有限公司 A kind of transmission method of internet of things data, system and terminal
CN109388417A (en) * 2018-09-30 2019-02-26 深圳市酷达通讯有限公司 A kind of update method of communication protocol, system and terminal device
CN109445968A (en) * 2018-11-09 2019-03-08 金瓜子科技发展(北京)有限公司 Service request processing method, device, equipment and the storage medium of different agreement

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"TS-0014-LWM2M_Interworking";ONEM2M TECHNICAL SPECIFICATION;《ONEM2M TECHNICAL SPECIFICATION》;20160830;全文 *

Also Published As

Publication number Publication date
CN110417766A (en) 2019-11-05

Similar Documents

Publication Publication Date Title
CN110417766B (en) Protocol analysis method and device
JP6861720B2 (en) Service implementation methods, devices, and systems based on the FIX protocol
CN110381093B (en) Method and device for converting data protocol, system for transmitting data and electronic equipment
CN112565443A (en) Internet of things data analysis method, device, equipment and storage medium
CN114124929B (en) Cross-network data processing method and device
CN113835902B (en) Data processing method, device, computer equipment and storage medium
CN111294235A (en) Data processing method, device, gateway and readable storage medium
CN111930382A (en) Application page access method, device and equipment
WO2021179156A1 (en) Message processing method, device and system, and server
CN112835632B (en) Method and equipment for calling end capability and computer storage medium
CN111930531A (en) Data processing method, data production method, data consumption method, data production device, data consumption device and data consumption medium
CN112235352A (en) Service dependence combing method and device
CN113495796A (en) Service calling method and related equipment
CN111459819B (en) Software testing method and device, electronic equipment and computer readable medium
US8959088B2 (en) Log management method, log management system, and information processing apparatus
CN114218175A (en) Resource cross-platform sharing method and device, terminal equipment and storage medium
CN114244758A (en) Network diagnosis method, storage medium, electronic device and system of android platform
CN112383617A (en) Method, device, terminal equipment and medium for long connection
CN113760693A (en) Method and apparatus for local debugging of microservice systems
CN111198721A (en) Application program running method and device
CN115225342B (en) Vulnerability scanning method, device, system, electronic device and storage medium
US11570265B2 (en) Data transmission method and system
CN113825166B (en) Base station testing method and device, electronic equipment and storage medium
CN112416621A (en) Method and system for managing and controlling system resources based on Web technology
CN108093004B (en) Method and device for pushing graphs in report

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
GR01 Patent grant
GR01 Patent grant