CN117255042A - Protocol file analysis method, device, equipment and storage medium - Google Patents

Protocol file analysis method, device, equipment and storage medium Download PDF

Info

Publication number
CN117255042A
CN117255042A CN202311188954.5A CN202311188954A CN117255042A CN 117255042 A CN117255042 A CN 117255042A CN 202311188954 A CN202311188954 A CN 202311188954A CN 117255042 A CN117255042 A CN 117255042A
Authority
CN
China
Prior art keywords
protocol
data
byte stream
file
update data
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
CN202311188954.5A
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.)
Wuhu Firelight Network Technology Co ltd
Original Assignee
Wuhu Firelight Network 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 Wuhu Firelight Network Technology Co ltd filed Critical Wuhu Firelight Network Technology Co ltd
Priority to CN202311188954.5A priority Critical patent/CN117255042A/en
Publication of CN117255042A publication Critical patent/CN117255042A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/18Protocol analysers
    • 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/131Protocols for games, networked simulations or virtual reality

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application provides a protocol file analysis method, a device, equipment and a storage medium, wherein the method comprises the following steps: acquiring a received binary byte stream, and writing the binary byte stream into a protocol data buffer area; under the condition that the existence of update data in the protocol data buffer is detected, carrying out identification matching based on the unique identification of the update data; analyzing the update data through a registered callback function under the condition that the identification matching result is a first matching result; and under the condition that the identification matching result is a second matching result, transmitting the updated data to a protocol data pool in a list form, and analyzing through a set reading function. The protocol file analysis mode of the scheme is more flexible, and protocol file processing of multiple programming languages can be supported.

Description

Protocol file analysis method, device, equipment and storage medium
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a protocol file analysis method, a device, equipment and a storage medium.
Background
The development of domestic online games is approximately undergoing three times of end game, page game and hand game. In online game development, the communication protocol is an unavoidable link. It is important for either the client programmer or the server programmer to formulate or select an appropriate communication protocol.
In the related art, when protocol file analysis is performed, different programming languages transmit each other, and when protocol files are processed, interaction between stacks is caused too frequently by interconversion and access between different types, so that analysis efficiency of the protocol files is reduced, and user experience is affected.
Disclosure of Invention
The embodiment of the application provides a protocol file analysis method, a device, equipment and a storage medium, so that the protocol file analysis mode is more flexible, and protocol file processing of multiple programming languages can be supported.
In a first aspect, an embodiment of the present application provides a protocol file parsing method, where the method includes:
acquiring a received binary byte stream, and writing the binary byte stream into a protocol data buffer area;
under the condition that the existence of update data in the protocol data buffer is detected, carrying out identification matching based on the unique identification of the update data;
analyzing the update data through a registered callback function under the condition that the identification matching result is a first matching result;
and under the condition that the identification matching result is a second matching result, transmitting the updated data to a protocol data pool in a list form, and analyzing through a set reading function.
Optionally, the writing the binary byte stream into a protocol data buffer includes:
acquiring a predefined protocol field list;
the binary byte stream is written into a protocol data buffer in list form.
Optionally, the transferring the update data to a protocol data pool in a list form, and resolving by a set reading function includes:
transmitting the update data to a protocol data pool in a list form, acquiring a protocol object type corresponding to the unique identifier of the update data and instantiating a protocol object;
and reading the update data in the protocol data pool through the set reading function, and initializing the protocol object based on the update data.
Optionally, after initializing the protocol object based on the update data, the method further includes:
writing each field data in the protocol object into a common data buffer;
and sending the data of the public data buffer area to the server through the asynchronous sending function of the socket object.
Optionally, before the acquiring the received binary byte stream, the method further includes:
under the condition that the success of parameter transmission analysis is detected through the connection socket function, starting a receiving sub-thread through an asynchronous connection function of a socket object to receive a binary byte stream pushed by a server;
the writing the binary byte stream into a protocol data buffer comprises:
controlling the receiving sub-thread to sleep under the condition that the size of the received binary byte stream is smaller than the size of the packet header;
and under the condition that the size of the received binary byte stream is not smaller than the size of the packet head, creating a protocol data buffer zone, and writing the binary byte stream into the protocol data buffer zone.
Optionally, before the acquiring the received binary byte stream, the method further includes:
the server generates a protocol file through an automatic generation tool.
Optionally, the server generates the protocol file through an automatic generation tool, including:
according to the defined protocol description file, calling corresponding processing functions according to different programming languages through a set field encoder to generate a protocol data file, wherein the protocol description file comprises a unique identifier and field information;
version data is generated through a random UUID generation algorithm;
and forming the version data and the protocol data file into a protocol file.
In a second aspect, an embodiment of the present application further provides a protocol file parsing apparatus, including:
the acquisition module is used for acquiring the received binary byte stream;
a writing module for writing the binary byte stream into a protocol data buffer;
the matching module is used for carrying out identification matching based on the unique identification of the update data under the condition that the update data exists in the protocol data buffer area;
and the analysis module is used for analyzing the update data through the registered callback function when the identification matching result is a first matching result, and transmitting the update data to a protocol data pool in a list form when the identification matching result is a second matching result, and analyzing through the set reading function.
In a third aspect, embodiments of the present application further provide an electronic device, including:
one or more processors;
storage means for storing one or more programs,
and when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the protocol file parsing method described in the embodiments of the present application.
In a fourth aspect, embodiments of the present application also provide a non-volatile storage medium storing computer-executable instructions that, when executed by a computer processor, are configured to perform the protocol file parsing method described in embodiments of the present application.
In a fifth aspect, the embodiments of the present application further provide a computer program product, where the computer program product includes a computer program, where the computer program is stored in a computer readable storage medium, and where at least one processor of the device reads and executes the computer program from the computer readable storage medium, so that the device performs the protocol file parsing method described in the embodiments of the present application.
In the embodiment of the application, the received binary byte stream is obtained, the binary byte stream is written into the protocol data buffer, under the condition that the existence of the update data in the protocol data buffer is detected, the unique identification of the update data is used for identification matching, under the condition that the identification matching result is a first matching result, the registered callback function is used for analyzing the update data, under the condition that the identification matching result is a second matching result, the update data is transmitted into the protocol data pool in a list form, and the analysis is performed through the set reading function. The protocol file analysis mode can process the protocol file by adopting different analysis modes according to different unique identifiers, so that the protocol file analysis mode is more flexible, and the protocol file processing of multiple programming languages can be supported.
Drawings
Fig. 1 is a flowchart of a protocol file parsing method provided in an embodiment of the present application;
FIG. 2 is a flowchart of another protocol file parsing method according to an embodiment of the present disclosure;
FIG. 3 is a flowchart of another protocol file parsing method according to an embodiment of the present disclosure;
fig. 4 is a block diagram of a protocol file parsing apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the embodiments of the application and are not limiting of the embodiments of the application. It should be further noted that, for convenience of description, only some, but not all of the structures related to the embodiments of the present application are shown in the drawings.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type and not limited to the number of objects, e.g., the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
The protocol file analysis method provided by the embodiment of the application can be executed by computing equipment such as a smart phone, a tablet computer, a notebook computer, a desktop computer and the like.
Fig. 1 is a flowchart of a protocol file parsing method provided in an embodiment of the present application, as shown in fig. 1, specifically including the following steps:
step S101, a received binary byte stream is obtained, and the binary byte stream is written into a protocol data buffer area.
In one embodiment, the execution body of the scheme is a client, and the received data is from a server. The server and the client adopt a binary byte stream mode to transmit protocol files. The byte stream mode can save the whole byte size.
Wherein after receiving the binary byte stream, it is written into the protocol data buffer. The protocol data buffer is a buffer created for writing binary byte stream data. Alternatively, a plurality of corresponding protocol data buffers may be pre-created for different programming modes. As for the c# protocol, a protocol data buffer of c# is created, and for the Lua protocol, a protocol data buffer of Lua is created to write data of c# protocol and data of Lua protocol, respectively.
Optionally, for the Lua protocol, when writing the binary byte stream into the protocol data buffer, it includes: a predefined list of protocol fields is obtained and the binary byte stream is written into the protocol data buffer in list form. Different data structure storage modes can be defined in advance according to different protocol forms so as to meet corresponding protocol design and processing requirements.
Step S102, under the condition that the update data in the protocol data buffer is detected, performing identification matching based on the unique identification of the update data.
In one embodiment, in the event that update data is present in the protocol data buffer, a match of the unique identification of the update data is first made. The update data in the protocol data buffer may be updated according to the data in the original protocol data buffer, or the data may be stored for the first time after the original protocol data buffer is created. The method comprises the steps of generating protocol file data by a server, wherein the update data comprises a unique identifier which is correspondingly generated when the server generates the protocol file data. Optionally, different unique identifications correspond to different protocol object types. The client can record the identification and the corresponding protocol object type through the set protocol manager, and at the moment, the unique identification in the update data can be matched to determine the protocol object type corresponding to the unique identification.
And step 103, analyzing the update data through a registered callback function under the condition that the identification matching result is a first matching result.
Step S104, when the result of the identification matching is the second matching result, the updated data is transmitted to a protocol data pool in a list form, and is analyzed through a set reading function.
In one embodiment, different protocol object types are set for different unique identifications. The present solution is described by taking two types of cases as examples. Optionally, the case that the result of the identification matching is the first matching result may correspond to the parsing of the c# protocol file; the case that the result of the identification matching is the second matching result may correspond to the analysis of the Lua protocol file.
And under the condition that the result of the identification matching is the first matching result, analyzing the update data through the registered callback function. Specifically, the protocol object type corresponding to the unique identifier may be found from the protocol manager, then a protocol object is instantiated through the protocol object type, update data is read through a registered callback function to initialize the protocol object, and analysis of the transmission data content may be performed based on the protocol object.
And under the condition that the result of the identification matching is the second matching result, transmitting the updated data to a protocol data pool in a list form, and analyzing through a set reading function. Specifically, it may be: transmitting the update data to a protocol data pool in a list form, acquiring a protocol object type corresponding to the unique identifier of the update data and carrying out instantiation of the protocol object; and reading the update data in the protocol data pool through the set reading function, and initializing the protocol object based on the update data. The protocol data pool is used for storing the received protocol data of each frame. Typically contains a data list of integer type, floating point type, string type and data length. The data list is populated and the data length updated by providing a series of add functions. A reset function to reclaim memory space and an update function to record the total length of each data type are provided internally. Optionally, the foregoing data storage and parameter transfer in the form of a data list in the lua protocol may take other data structures, such as strings, arrays, etc. according to other protocol types or different requirements, where only a unique identifier and a corresponding protocol object type need to be predefined, so that flexible parsing of different protocols may be implemented.
From the above, it can be seen that, by obtaining the received binary byte stream, writing the binary byte stream into the protocol data buffer, performing identification matching based on the unique identifier of the update data when the update data exists in the protocol data buffer, resolving the update data through the registered callback function when the result of the identification matching is the first matching result, and transmitting the update data in the form of a list to the protocol data pool when the result of the identification matching is the second matching result, and resolving through the set reading function. The protocol file analysis mode can process the protocol file by adopting different analysis modes according to different unique identifiers, so that the protocol file analysis mode is more flexible, and the protocol file processing of multiple programming languages can be supported.
On the basis of the above technical solution, after initializing the protocol object based on the update data, the method further includes: writing each field data in the protocol object into a common data buffer; and sending the data of the public data buffer area to the server through the asynchronous sending function of the socket object. When the client sends binary byte stream to the server, each field data of the protocol object is written into a public data buffer area regardless of the processing mode of the programming language, and then the data is sent asynchronously in batches by the socket.
Fig. 2 is a flowchart of another protocol file parsing method provided in an embodiment of the present application, including a network setup connection process, as shown in fig. 2, specifically including:
step S201, under the condition that the success of parameter transmission analysis is detected through the connection socket function, starting a receiving sub-thread through the asynchronous connection function of the socket object to receive the binary byte stream pushed by the server.
The client can analyze the incoming IP address or domain name and port according to the IPv4 and IPv6 modes. If the analysis is successful, the receiving sub-thread is started through the asynchronous connection function of the socket object to receive the binary byte stream pushed by the server. Conversely, if the parsing fails, relevant events are thrown in the next frame of the main thread for the interested receiver to capture.
Step S202, a received binary byte stream is obtained, the receiving sub-thread is controlled to sleep under the condition that the size of the received binary byte stream is smaller than the size of a packet header, a protocol data buffer zone is created under the condition that the size of the received binary byte stream is not smaller than the size of the packet header, and the binary byte stream is written into the protocol data buffer zone.
In one embodiment, when the binary byte stream is buffered, if the number of bytes received is less than the packet header size, the receiving sub-thread is controlled to sleep for the next data receiving operation. If the number of the received bytes is greater than or equal to the size of the packet header, firstly creating a protocol data buffer to store protocol object data, and then recovering the memory occupied by the content buffer object by resetting the data.
Optionally, the method further comprises: receiving thread objects are recovered by disabling the flag bit, and socket objects are recovered by closing the physical connection.
Through the construction mode of the network environment, the client builds the network communication environments of the main server and the cross servers through the socket provided by the system, and the data transmission efficiency is improved.
Step S203, performing identification matching based on the unique identification of the update data when it is detected that the update data exists in the protocol data buffer.
Step S204, when the result of the identification matching is a first matching result, analyzing the update data through a registered callback function, and when the result of the identification matching is a second matching result, transmitting the update data to a protocol data pool in a list form, and analyzing through a set reading function.
From the above, it can be seen that, by obtaining the received binary byte stream, writing the binary byte stream into the protocol data buffer, performing identification matching based on the unique identifier of the update data when the update data exists in the protocol data buffer, resolving the update data through the registered callback function when the result of the identification matching is the first matching result, and transmitting the update data in the form of a list to the protocol data pool when the result of the identification matching is the second matching result, and resolving through the set reading function. The protocol file analysis mode can process the protocol file by adopting different analysis modes according to different unique identifiers, so that the protocol file analysis mode is more flexible, and the protocol file processing of multiple programming languages can be supported.
Fig. 3 is a flowchart of another protocol file parsing method provided in an embodiment of the present application, including a process of generating a protocol file by a server, which specifically includes:
step S301, a server side calls corresponding processing functions according to different programming languages through a set field encoder to generate a protocol data file according to a defined protocol description file, wherein the protocol description file comprises a unique identifier and field information, version data is generated through a random UUID generation algorithm, and the version data and the protocol data file form a protocol file.
The server side can conveniently add or remove the protocol description file, dynamically expand the protocol field and generate different programming language protocol description files required by the client side. The server terminal uses Req head according to the client terminal request protocol when defining the protocol description file, and uses Res head rule to define the server response protocol; aiming at the protocol record file, when the server side defines the protocol record file, each record should be stored according to the JSON format; for the protocol template file, when the server side defines the protocol template file, the template content corresponding to different programming languages is different, and the same parameter part is provided, for example: a reference path, a class name, a parent class name, field initialization, field reading assignment, field writing numerical value and unique identification; for global constant definition, the method mainly comprises a protocol field data type, a programming language type, a derived path related to a protocol description file, a server root path and a client root path.
The protocol file includes version data generated by a random UUID generation algorithm, and a corresponding processing function is called by a set field encoder according to different programming languages to generate the protocol data file. The field encoder mainly comprises a basic data type field encoder, an array type field encoder, a list type field encoder, a dictionary type field encoder and a custom type field encoder. The encoder calls different acquisition reference string list functions, calls different acquisition field declaration string functions, calls different acquisition field reading string functions and calls different acquisition field writing string functions according to the programming language to perform corresponding encoding processing.
The method for generating the protocol file by the automatic tool improves the protocol file manufacturing efficiency of the server and the client programmer, and can efficiently realize field updating, modification and the like of the protocol file.
Step S302, under the condition that the update data in the protocol data buffer is detected, performing identification matching based on the unique identification of the update data.
Step S303, when the result of the identifier matching is a first matching result, resolving the update data through a registered callback function, and when the result of the identifier matching is a second matching result, transmitting the update data in a list form to a protocol data pool, and resolving through a set reading function.
From the above, it can be seen that, by obtaining the received binary byte stream, writing the binary byte stream into the protocol data buffer, performing identification matching based on the unique identifier of the update data when the update data exists in the protocol data buffer, resolving the update data through the registered callback function when the result of the identification matching is the first matching result, and transmitting the update data in the form of a list to the protocol data pool when the result of the identification matching is the second matching result, and resolving through the set reading function. The protocol file analysis mode can process the protocol file by adopting different analysis modes according to different unique identifiers, so that the protocol file analysis mode is more flexible, and the protocol file processing of multiple programming languages can be supported.
Fig. 4 is a block diagram of a protocol file parsing apparatus according to an embodiment of the present application, and as shown in fig. 4, the apparatus is configured to execute the protocol file parsing method provided in the foregoing embodiment, and has functional modules and beneficial effects corresponding to the execution method. As shown in fig. 4, includes an acquisition module 101, a writing module 102, a matching module 103, and a parsing module 104, wherein,
the acquisition module is used for acquiring the received binary byte stream;
a writing module for writing the binary byte stream into a protocol data buffer;
the matching module is used for carrying out identification matching based on the unique identification of the update data under the condition that the update data exists in the protocol data buffer area;
and the analysis module is used for analyzing the update data through the registered callback function when the identification matching result is a first matching result, and transmitting the update data to a protocol data pool in a list form when the identification matching result is a second matching result, and analyzing through the set reading function.
From the above, it can be seen that a received binary byte stream is obtained, and the binary byte stream is written into a protocol data buffer; under the condition that the existence of update data in the protocol data buffer is detected, carrying out identification matching based on the unique identification of the update data; analyzing the update data through a registered callback function under the condition that the identification matching result is a first matching result; and under the condition that the identification matching result is a second matching result, transmitting the updated data to a protocol data pool in a list form, and analyzing through a set reading function. The protocol file analysis mode of the scheme is more flexible, and protocol file processing of multiple programming languages can be supported.
In one possible embodiment, the writing the binary byte stream into a protocol data buffer comprises:
acquiring a predefined protocol field list;
the binary byte stream is written into a protocol data buffer in list form.
In a possible embodiment, the parsing module is specifically configured to:
transmitting the update data to a protocol data pool in a list form, acquiring a protocol object type corresponding to the unique identifier of the update data and instantiating a protocol object;
and reading the update data in the protocol data pool through the set reading function, and initializing the protocol object based on the update data.
In a possible embodiment, the apparatus further comprises a sending module for:
writing each field data in the protocol object into a common data buffer after initializing the protocol object based on the update data;
and sending the data of the public data buffer area to the server through the asynchronous sending function of the socket object.
In a possible embodiment, the apparatus further comprises a receiving module for:
before the received binary byte stream is obtained, under the condition that the parameter transmission analysis is detected to be successful through a connection socket function, starting a receiving sub-thread through an asynchronous connection function of a socket object to receive the binary byte stream pushed by a server;
the writing module is specifically configured to:
controlling the receiving sub-thread to sleep under the condition that the size of the received binary byte stream is smaller than the size of the packet header;
and under the condition that the size of the received binary byte stream is not smaller than the size of the packet head, creating a protocol data buffer zone, and writing the binary byte stream into the protocol data buffer zone.
In a possible embodiment, the apparatus further comprises a file generation module for:
before the received binary byte stream is obtained, the server generates a protocol file through an automatic generation tool.
In a possible embodiment, the file generation module is specifically configured to:
according to the defined protocol description file, calling corresponding processing functions according to different programming languages through a set field encoder to generate a protocol data file, wherein the protocol description file comprises a unique identifier and field information;
version data is generated through a random UUID generation algorithm;
and forming the version data and the protocol data file into a protocol file.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application, and as shown in fig. 5, the device includes a processor 201, a memory 202, an input device 203, and an output device 204; the number of processors 201 in the device may be one or more, one processor 201 being taken as an example in fig. 5; the processor 201, memory 202, input devices 203, and output devices 204 in the apparatus may be connected by a bus or other means, for example in fig. 5. The memory 202 is used as a computer readable storage medium for storing software programs, computer executable programs and modules, such as program instructions/modules corresponding to the protocol file parsing method in the embodiments of the present application. The processor 201 executes various functional applications of the device and data processing by executing software programs, instructions and modules stored in the memory 202, i.e., implements the protocol file parsing method described above. The input device 703 may be used to receive input numeric or character information and to generate key signal inputs related to user settings and function control of the apparatus. The output device 204 may include a display device such as a display screen.
The present application also provides a non-volatile storage medium containing computer executable instructions, which when executed by a computer processor, are configured to perform a protocol file parsing method described in the above embodiments, where the method includes:
acquiring a received binary byte stream, and writing the binary byte stream into a protocol data buffer area;
under the condition that the existence of update data in the protocol data buffer is detected, carrying out identification matching based on the unique identification of the update data;
analyzing the update data through a registered callback function under the condition that the identification matching result is a first matching result;
and under the condition that the identification matching result is a second matching result, transmitting the updated data to a protocol data pool in a list form, and analyzing through a set reading function.
It should be noted that, in the embodiment of the protocol file parsing apparatus, each unit and module included are only divided according to the functional logic, but not limited to the above-mentioned division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for convenience of distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present application.
In some possible implementations, various aspects of the methods provided herein may also be implemented in the form of a program product comprising program code for causing a computer device to perform the steps of the methods described herein above according to various exemplary embodiments of the application, when the program product is run on the computer device, e.g., the computer device may perform the protocol file parsing method described in the examples herein. The program product may be implemented using any combination of one or more readable media.

Claims (10)

1. The protocol file analysis method is characterized by comprising the following steps:
acquiring a received binary byte stream, and writing the binary byte stream into a protocol data buffer area;
under the condition that the existence of update data in the protocol data buffer is detected, carrying out identification matching based on the unique identification of the update data;
analyzing the update data through a registered callback function under the condition that the identification matching result is a first matching result;
and under the condition that the identification matching result is a second matching result, transmitting the updated data to a protocol data pool in a list form, and analyzing through a set reading function.
2. The protocol file parsing method of claim 1, wherein writing the binary byte stream into a protocol data buffer comprises:
acquiring a predefined protocol field list;
the binary byte stream is written into a protocol data buffer in list form.
3. The protocol file parsing method according to claim 1, wherein the transferring the update data in a list form to a protocol data pool, parsing by a set read function, includes:
transmitting the update data to a protocol data pool in a list form, acquiring a protocol object type corresponding to the unique identifier of the update data and instantiating a protocol object;
and reading the update data in the protocol data pool through the set reading function, and initializing the protocol object based on the update data.
4. A protocol file parsing method in accordance with claim 3, further comprising, after initializing the protocol object based on the update data:
writing each field data in the protocol object into a common data buffer;
and sending the data of the public data buffer area to the server through the asynchronous sending function of the socket object.
5. The protocol file parsing method of any one of claims 1-4, further comprising, prior to the obtaining the received binary byte stream:
under the condition that the success of parameter transmission analysis is detected through the connection socket function, starting a receiving sub-thread through an asynchronous connection function of a socket object to receive a binary byte stream pushed by a server;
the writing the binary byte stream into a protocol data buffer comprises:
controlling the receiving sub-thread to sleep under the condition that the size of the received binary byte stream is smaller than the size of the packet header;
and under the condition that the size of the received binary byte stream is not smaller than the size of the packet head, creating a protocol data buffer zone, and writing the binary byte stream into the protocol data buffer zone.
6. The protocol file parsing method of any one of claims 1-4, further comprising, prior to the obtaining the received binary byte stream:
the server generates a protocol file through an automatic generation tool.
7. The protocol file parsing method according to claim 6, wherein the server generates the protocol file by an automated generation tool, comprising:
according to the defined protocol description file, calling corresponding processing functions according to different programming languages through a set field encoder to generate a protocol data file, wherein the protocol description file comprises a unique identifier and field information;
version data is generated through a random UUID generation algorithm;
and forming the version data and the protocol data file into a protocol file.
8. The protocol file analyzing device is characterized in that,
the acquisition module is used for acquiring the received binary byte stream;
a writing module for writing the binary byte stream into a protocol data buffer;
the matching module is used for carrying out identification matching based on the unique identification of the update data under the condition that the update data exists in the protocol data buffer area;
and the analysis module is used for analyzing the update data through the registered callback function when the identification matching result is a first matching result, and transmitting the update data to a protocol data pool in a list form when the identification matching result is a second matching result, and analyzing through the set reading function.
9. An electronic device, the device comprising: one or more processors; storage means for storing one or more programs that when executed by the one or more processors cause the one or more processors to implement the protocol file parsing method of any one of claims 1-7.
10. A non-transitory storage medium storing computer executable instructions which, when executed by a computer processor, are for performing the protocol file parsing method of any one of claims 1-7.
CN202311188954.5A 2023-09-14 2023-09-14 Protocol file analysis method, device, equipment and storage medium Pending CN117255042A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311188954.5A CN117255042A (en) 2023-09-14 2023-09-14 Protocol file analysis method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311188954.5A CN117255042A (en) 2023-09-14 2023-09-14 Protocol file analysis method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117255042A true CN117255042A (en) 2023-12-19

Family

ID=89127341

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311188954.5A Pending CN117255042A (en) 2023-09-14 2023-09-14 Protocol file analysis method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117255042A (en)

Similar Documents

Publication Publication Date Title
JP2019503537A (en) Method and apparatus for processing short link and short link server
CN105183675A (en) USB equipment access method, device and system, terminal and server
CN111683066A (en) Heterogeneous system integration method and device, computer equipment and storage medium
CN110727417A (en) Data processing method and device
CN108388372B (en) Method, device and equipment for self-adapting touch data and storage medium
CN110554877A (en) JSON data analysis method, device, equipment and storage medium
CN113064742A (en) Message processing method, device, equipment and storage medium
CN111369237A (en) Data processing method and device and computer storage medium
CN115794437A (en) Calling method and device of microservice, computer equipment and storage medium
CN112925586B (en) Applet routing method, device, computer equipment and storage medium
CN117255042A (en) Protocol file analysis method, device, equipment and storage medium
CN109005469B (en) Message format conversion method and device, storage medium and android terminal
CN114422164B (en) Five-tuple table entry issuing device and method
CN107992457B (en) Information conversion method, device, terminal equipment and storage medium
JP3920892B2 (en) Terminal device
CN112910910B (en) Method, device, equipment and storage medium for processing OPCDA protocol message
CN112883088A (en) Data processing method, device, equipment and storage medium
CN113434217B (en) Vulnerability scanning method, vulnerability scanning device, computer equipment and medium
CN112130860B (en) JSON object analysis method and device, electronic equipment and storage medium
CN109068170B (en) Storage method, device, terminal and storage medium for barrage message
CN110548285B (en) Game communication control method and device, medium and electronic equipment
CN108418698B (en) Router management method and device
CN114244912A (en) Data transmission method and device, computer equipment and storage medium
US11500710B1 (en) Stand-alone exception handler module
CN109032724B (en) Method, device, terminal and storage medium for processing user-defined bullet screen message

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