CN114253815A - Communication content analysis method and device - Google Patents

Communication content analysis method and device Download PDF

Info

Publication number
CN114253815A
CN114253815A CN202011002555.1A CN202011002555A CN114253815A CN 114253815 A CN114253815 A CN 114253815A CN 202011002555 A CN202011002555 A CN 202011002555A CN 114253815 A CN114253815 A CN 114253815A
Authority
CN
China
Prior art keywords
communication content
field
communication
preset
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
CN202011002555.1A
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.)
Igg Singapore Pte Ltd
Original Assignee
Igg Singapore Pte 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 Igg Singapore Pte Ltd filed Critical Igg Singapore Pte Ltd
Priority to CN202011002555.1A priority Critical patent/CN114253815A/en
Publication of CN114253815A publication Critical patent/CN114253815A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/30Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
    • A63F13/35Details of game servers

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention discloses a method and a device for analyzing communication content, wherein the method comprises the following steps: when monitoring that the game runs, capturing communication contents of the client and the server; determining whether the communication content needs to be restored according to a pre-configured protocol rule; when the communication content needs to be restored, source data are restored from the communication content; analyzing the source data according to the protocol rule to obtain an analysis result; and according to a preset field, separating the analysis result into field contents corresponding to the preset field. The embodiment of the invention can quickly and automatically analyze the interactive content between the client and the server, thereby greatly improving the analysis efficiency of the interactive content and further greatly improving the construction efficiency of the request data.

Description

Communication content analysis method and device
Technical Field
The invention relates to the technical field of communication, in particular to a communication content analysis method and device.
Background
In the development process of the network game, a stress test is often required to be performed on a project to verify whether a target server can support an expected number of players to experience the game and to discover a performance bottleneck and a performance defect which may exist in the server. Usually, the load of the server is constructed in a manner of simulating a player robot. In order to truly simulate the specific interactive content between the player client and the server, the pressure measurement implementer needs to know the details of the communication protocol, the corresponding structure in the program code and the serialization method, so as to construct the actual request data. However, the pressure measurement operator needs to spend a lot of time and effort in understanding the details of the communication protocol, the corresponding structure in the program code, and the serialization method.
Therefore, the invention aims to solve the technical problem that interactive content analysis efficiency between the player client and the server is low in the prior art, and further the requested data construction efficiency is low.
Disclosure of Invention
The invention aims to provide a communication content analysis method, a communication content analysis device, computer equipment and a readable storage medium, which are used for solving the technical defect that interactive content analysis efficiency between a player client and a server is low and further request data construction efficiency is low in the prior art.
According to an aspect of the present invention, there is provided a communication content analysis method, including the steps of:
when monitoring that the game runs, capturing communication contents of the client and the server;
judging whether the communication content needs to be restored or not according to a pre-configured protocol rule;
when the communication content needs to be restored, source data are restored from the communication content;
analyzing the source data according to the protocol rule to obtain an analysis result;
and according to a preset field, separating the analysis result into field contents corresponding to the preset field.
Optionally, the method further comprises:
matching the pre-configured dynamic data parameterization identification with the field content corresponding to the preset field;
and obtaining dynamic data corresponding to the dynamic data parameterization identification according to the matching result, and identifying the dynamic data.
Optionally, the method further comprises:
storing the communication contents in a preset ordered queue, wherein the ordered queue is marked with the time sequence of each communication content;
reading the communication content from the ordered queue.
Optionally, the protocol rule includes a message header, a message body, and a size endian, where the message header includes a message length, a status bit, and a data composition form, where the status bit includes a first status bit and a second status bit, the first status bit is used to indicate whether to perform a decompression operation, and the second status bit is used to indicate whether to perform a decryption operation.
Optionally, the restoring source data from the communication content includes:
acquiring a corresponding state bit from the communication content, and judging whether to execute decompression and/or decryption operation according to the state bit;
and when the decompression and/or decryption operation is executed, the decompression and/or decryption operation is executed on the data corresponding to the status bit to obtain the source data.
Optionally, the determining whether to perform a decompression and/or decryption operation according to the status bit includes:
when the first state bit is a first preset value, judging to execute the decompression operation;
and when the second state bit is a second preset value, judging to execute the decryption operation.
Optionally, the protocol rule includes a general message field, and the separating, according to a preset field, the parsing result into field contents corresponding to the preset field includes:
matching the preset field with the general message field;
screening a target result corresponding to the preset field from the analysis result according to the matching result;
and separating the target result into the field content corresponding to the preset field.
In order to achieve the above object, the present invention further provides a communication content analysis device, which specifically includes the following components:
the capturing module is used for capturing communication contents of the client and the server when the game running is monitored;
the judging module is used for judging whether the communication content needs to be restored or not according to a protocol rule configured in advance;
the restoring module is used for restoring source data from the communication content when the communication content needs to be restored;
the analysis module is used for analyzing the source data according to the protocol rule to obtain an analysis result;
and the separation module is used for separating the analysis result into field contents corresponding to the preset fields according to the preset fields.
In order to achieve the above object, the present invention further provides a computer device, which specifically includes: a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the communication content analysis method introduced above when executing the computer program.
In order to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the communication content analysis method introduced above.
The communication content analysis method, the communication content analysis device, the computer equipment and the readable storage medium capture communication contents of a client and a server by configuring protocol rules, determine whether the communication contents need to be restored according to the configured protocol rules, restore source data from the communication contents when the communication contents need to be restored, analyze the source data according to the protocol rules to obtain an analysis result, and divide the analysis result into field contents corresponding to preset fields according to the preset fields. According to the embodiment of the invention, the communication content between the client and the server is captured and analyzed according to the configured protocol rule, so that the interactive content between the client and the server can be rapidly and automatically analyzed, the analysis efficiency of the interactive content is greatly improved, and the construction efficiency of the request data is improved.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is an alternative application environment diagram of a communication content analysis method provided by the embodiment of the present disclosure;
fig. 2 is an alternative flow chart of a communication content analysis method provided by the embodiment of the present disclosure;
fig. 3 is a schematic flow chart of another alternative communication content analysis method provided in the embodiment of the present disclosure;
fig. 4 is a schematic diagram illustrating an alternative specific flowchart of step S104 in fig. 2;
fig. 5 is a schematic diagram illustrating an alternative specific flowchart of step S300 in fig. 4;
FIG. 6 is a graph illustrating the result of an exemplary partitioning effect according to an embodiment of the present disclosure;
fig. 7 is a schematic diagram illustrating an alternative specific flowchart of step S108 in fig. 2;
fig. 8 is a schematic flow chart of another alternative communication content analysis method provided in the embodiment of the present disclosure;
fig. 9 is a schematic diagram of an alternative program module of a communication content analysis apparatus according to an embodiment of the present disclosure;
fig. 10 is a schematic diagram of an alternative hardware architecture of a computer device according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The following describes a communication content analysis method according to the present invention with reference to the accompanying drawings.
Fig. 1 is an alternative application environment diagram of the communication content analysis method of the present invention. Fig. 1 includes a terminal and a game server. When the client side and the game server carry out data interaction, accurate request data of the virtual player are quickly constructed according to an analysis result by acquiring communication content in the interaction process and analyzing the communication content.
Fig. 2 is an alternative flow chart of the method for analyzing communication content according to the present invention. It is to be understood that the flow charts in the embodiments of the present method are not used to limit the order of executing the steps, and a computer device is taken as an executing subject to be described as an example below. The computer devices may include mobile terminals such as mobile phones, tablet computers, notebook computers, palmtop computers, Personal Digital Assistants (PDAs), Portable Media Players (PMPs), navigation devices, wearable devices, smart bands, pedometers, and fixed terminals such as Digital TVs, desktop computers, and the like.
As shown in fig. 2, the method specifically includes the following steps:
step S100: and when the game running is monitored, capturing the communication content of the client and the server.
Specifically, when the client starts and starts the game, the communication content in the interaction process of the client and the server is captured. The communication content includes an uplink message and a downlink message.
In an exemplary embodiment, as shown in fig. 3, the method further includes steps S200 and S202:
step S200: and storing the communication contents in a preset ordered queue, wherein the ordered queue is marked with the time sequence of each communication content.
Step S202: reading the communication content from the ordered queue.
Specifically, the communication contents may be stored in the ordered queue sequentially in time order by storing the communication contents in a preset ordered queue. Then, the communication contents are sequentially read from the ordered queue. In the embodiment, by adopting a mode based on the ordered queue, analysis of data in the interaction process of the client and the server can be sequentially acquired and processed.
Step S102: and judging whether the communication content needs to be restored or not according to a pre-configured protocol rule.
In practical applications, when configuring the protocol rule, since the encryption or compression needs to consume the processor resources, it can be configured whether the data needs to be compressed or encrypted to reduce the resource consumption of the processor. For example, the configuration is such that only communication contents having a message body exceeding 256 bytes or more are compressed or encrypted, and communication contents having a message body not exceeding 256 bytes are not compressed or encrypted. If the communication content is compressed and/or encrypted, it is determined that the communication content needs to be restored (including decompression and/or decryption).
Step S104: and when the communication content needs to be restored, restoring source data from the communication content.
Specifically, if the communication content needs to be decompressed or decrypted, the source data is decompressed or decrypted from the communication content.
In an exemplary embodiment, as shown in fig. 4, the step S104 may include a step S300 and a step S302.
Step S300: and acquiring a corresponding message state bit from the communication content, and judging whether to execute decompression and/or decryption operation according to the message state bit.
Illustratively, the protocol rules may include a message header, a message body, and a size endian. The message header may include a message length, status bits, and a data composition form, where the status bits may include a first status bit and a second status bit, the first status bit is used to indicate whether to perform a decompression operation, and the second status bit is used to indicate whether to perform a decryption operation. And judging whether to execute decompression operation according to the numerical value of the first state, and judging whether to execute decryption operation according to the numerical value of the second state. In practical applications, the number of bytes occupied by the message header can be freely configured according to the needs of users, for example, the message header can be configured to occupy 2 bytes, 4 bytes, and the like. The size endianness is used to indicate the order in which data is transmitted in the network. Of course, in practical applications, the protocol rule may be freely set according to the user requirement, and is not limited herein.
In an exemplary embodiment, as shown in fig. 5, the step S300 may include steps S400 and S402:
step S400: and when the first state bit is a first preset value, judging to execute the decompression operation.
Step S402: and when the second state bit is a second preset value, judging to execute the decryption operation.
In practical applications, a predetermined byte in the protocol rule can be customized to represent the status bit. The preset bits of the status bits may represent compression and decompression or encryption and decryption. The first preset value and the second preset value are both binary values such as 0 or 1. For example, the 1 st bit of the nth byte is configured to be compressed and decompressed, the 2 nd bit is configured to be encrypted and decrypted, the 1 st bit of the nth byte is 0, which indicates that no compression is required and no decompression operation is required; the 1 st bit of the nth byte is 1, which indicates compression and needs to perform decompression operation; the 2 nd bit of the nth byte is 0, which indicates that no encryption is required and no decryption operation is required to be performed; the 2 nd bit of the nth byte is 1, which indicates that encryption and decryption are required. Of course, 0 may be configured to indicate compression, and 1 to indicate no compression; 0 represents encryption, and 1 represents no encryption, which is not limited in the embodiment of the present invention. By judging the first status bit and the second status bit, whether to execute decompression and/or decryption operation can be quickly determined so as to quickly acquire source data from the communication content.
Step S302: and when the decompression and/or decryption operation is executed, the decompression and/or decryption operation is executed on the communication content to obtain the source data.
Step S106: and analyzing the source data according to the protocol rule to obtain an analysis result.
In an exemplary embodiment, the protocol rule includes a general message field, and the source data is analyzed according to the general message field to obtain a field content corresponding to each general message field, that is, to obtain an analysis result. Illustratively, the generic message field includes an upstream or downstream of the message, a protocol type, an IP address, a port number, a message length, a message type, a check, a default padding, and the like.
Step S108: and according to a preset field, separating the analysis result into field contents corresponding to the preset field.
In practical application, meaningful fields, namely preset fields, are screened from the general message fields. And then, according to the preset field, separating the analysis result into field contents corresponding to the preset field. The preset field may include, for example, an uplink or a downlink of the message, a protocol type, an IP address, a port number, a message length, a message type, and message data. An exemplary partitioning effect result diagram is shown in fig. 6, for example, the first line of data in fig. 6 is upstream data, the protocol type is TCP protocol, the IP address is 120.33.34.212, the port number is 9300, the message length is 41, the message type is 5203, and the message data is 38306466376238662d396433372d3435.
In an exemplary embodiment, as shown in fig. 7, the step S108 includes steps S500 to S504:
step S500: and matching the preset field with the general message field.
Step S502: and screening out a target result corresponding to the preset field from the analysis result according to the matching result.
Step S504: and separating the target result into the field content corresponding to the preset field.
With continuing reference to fig. 6, fig. 6 separates the uplink and downlink, TCP protocol, IP address, protocol type, IP address, port number, message length, message type, message data, etc. by vertical lines. Of course, in other embodiments, the target result may be separated by other reference signs including, but not limited to, quotation marks, semicolons, brackets, connecting lines, and the like. By screening out the target result corresponding to the preset field from the analysis result and separating the target result by using a separation number, the field content corresponding to the meaningful field can be obtained according to the user requirement, and the user experience is improved.
In an exemplary embodiment, as shown in fig. 8, the method further includes steps S600 and S602:
step S600: and matching the pre-configured dynamic data parameterization identifier with the field content corresponding to the preset field.
Step S602: and obtaining dynamic data corresponding to the dynamic data parameterization identification according to the matching result, and identifying the dynamic data.
Specifically, please refer to fig. 6, in fig. 6, the ninth row of data is uplink data, the protocol type is TCP protocol, the IP address is 120.33.34.212, the port number is 9300, the message length is 44, the message type is 5205, the message data is 00000000[9beb6501]00000000aa8a …, and the dynamic data in the message data is parameterized and identified according to the dynamic data parameterized identifier. For example, in fig. 6, the dynamic data parameterization identifies an account (ID) where the client logs in, and the identification may include, but is not limited to: and identifying the account ID of the client login by a bracket and a highlighted form. For example, the ninth line of data in fig. 6 has dynamic data identified by parentheses and a highlight of 9be 6501. By configuring the dynamic data parameterization identifier, the position and the content of the dynamic data in the communication content can be visually displayed, and the user experience is greatly improved.
In practical applications, the existing request data construction method includes:
1. by the developer of the corresponding project: based on the knowledge and mastery of project codes by the developers of the project, the actual requests of the players are constructed by packaging a test client tool by fully utilizing the existing codes. However, the implementers in this method have limitations and can only be completed by the developers of the project, however, often at the end of the project, the developers need to rush the development task of milestones, and there is no time to construct the request data. In addition, since most developers are not professional performance quality personnel, good results cannot be obtained without familiarity with the activities and implementation rules of stress testing.
2. Done by personnel in the non-development sector: the staff knows the rules of the player request messages by reading the protocols and codes of the projects or help documents, and knows the interaction process (including data format, instruction sequence and the like) of the player and the server by communicating with the server developer in detail, and passes continuous trial and error and verification. And finally, the pressure measurement implementing personnel realize a simulation client tool which accords with the actual interaction rule according to the verification result. However, this method has requirements for programming language and capability of the simulation client implementer, and since few help documents can accurately describe details of the project, it is costly to communicate the simulation client implementer with the developer of the project. In addition, because the content of the interaction between the client and the server is complicated, the related interaction instructions and data are huge, continuous communication, trial and error and correction are needed in the implementation process, and the implementation efficiency is low.
In the embodiment of the invention, after the dynamic data is identified, the dynamic data is obtained, and the dynamic data in the message data is parameterized. And then constructing a plurality of communication contents according to the protocol rules, the parameterized message data of the dynamic data and the dynamic data of each client so as to simulate the specific interactive contents of the player client and the server. For example: when a real request data is simulated, a plurality of dynamic data are constructed, the constructed dynamic data are respectively replaced to the dynamic data parameterization positions, and then a complete request data is constructed according to the protocol rule. By identifying the dynamic data and parameterizing the dynamic data, the construction efficiency of the communication content is greatly improved, and the labor cost is greatly reduced. According to the embodiment of the invention, the dynamic data can be replaced to the dynamic data parameterization position according to the protocol rule without knowing the game program code by the implementer, so that the real request data can be easily and quickly constructed, the construction efficiency of the request data is greatly improved, the development efficiency is improved, and the communication cost is reduced.
In an exemplary embodiment, the method further comprises: and outputting the field contents corresponding to the preset fields according to the time sequence.
In an exemplary embodiment, according to the time sequence of the communication content in the ordered queue, the field content corresponding to the preset field obtained after the communication content is analyzed is sequentially output. With reference to fig. 6, the time sequence of the communication content corresponding to the first row of data is prior to the time sequence of the communication content corresponding to the second row of data. By outputting the field contents corresponding to the preset fields according to the time sequence, the user experience is further improved.
The communication content analysis method provided by the embodiment of the invention captures the communication content of the client and the server by configuring the protocol rule, determines whether the communication content needs to be restored according to the configured protocol rule, restores source data from the communication content when the communication content needs to be restored, analyzes the source data according to the protocol rule to obtain an analysis result, and divides the analysis result into field contents corresponding to the preset field according to the preset field. According to the embodiment of the invention, the communication content between the client and the server is captured and analyzed according to the configured protocol rule, so that the interactive content between the client and the server can be rapidly and automatically analyzed, the analysis efficiency of the interactive content is greatly improved, and the construction efficiency of the request data is improved.
Based on the communication content analysis method provided in the above embodiment, the present embodiment provides a communication content analysis apparatus. Specifically, fig. 9 shows an alternative configuration block diagram of the communication content analysis apparatus, which is partitioned into one or more program modules, which are stored in a storage medium and executed by one or more processors, to complete the present invention. The program module referred to in the present invention is a series of computer program instruction segments capable of performing a specific function, and describes the execution process of the communication content analysis device in the storage medium better than the program itself, and the following description will specifically describe the function of each program module in this embodiment.
As shown in fig. 9, the communication content analysis device specifically includes the following components:
and the capturing module 201 is configured to capture communication content of the client and the server when it is monitored that the game runs.
Specifically, after the client is started, the capturing module 201 starts to monitor whether the game starts to run, and when the game starts to run, captures the communication content in the interactive process between the client and the server. The communication content includes an uplink message and a downlink message. In an exemplary embodiment, after the client is started, an analysis listener may be further started, and when the analysis listener hears that the game starts to run, communication content in the interaction process is grabbed on a communication link between the client and the server.
In an exemplary embodiment, the communication content analysis apparatus may further include a storage module and a reading module, where the storage module is configured to store the communication content in a preset ordered queue, and the ordered queue is marked with a time sequence of each communication content; the reading module is used for reading the communication content from the ordered queue.
Specifically, the communication contents may be stored in the ordered queue sequentially in time order by storing the communication contents in a preset ordered queue. Then, the communication contents are sequentially read from the ordered queue. In the embodiment, by adopting a mode based on the ordered queue, analysis of data in the interaction process of the client and the server can be sequentially acquired and processed.
The determining module 202 is configured to determine whether the communication content needs to be restored according to a pre-configured protocol rule.
In practical applications, when configuring the protocol rule, since the encryption or compression needs to consume the processor resources, it can be configured whether the data needs to be compressed or encrypted to reduce the resource consumption of the processor. For example, the configuration is such that only communication contents having a message body exceeding 256 bytes or more are compressed or encrypted, and communication contents having a message body not exceeding 256 bytes are not compressed or encrypted. If the communication content is compressed and/or encrypted, it is determined that the communication content needs to be restored (including decompression and/or decryption).
A restoring module 203, configured to restore source data from the communication content when the communication content needs to be restored.
Specifically, if the communication content needs to be decompressed or decrypted, the source data is decompressed or decrypted from the communication content.
In an exemplary embodiment, the restoring module 203 may be specifically configured to: and acquiring corresponding state bits from the communication content, and judging whether to execute decompression and/or decryption operation according to the state bits.
Illustratively, the protocol rules may include a message header, a message body, and a size endian. The message header may include a message length, status bits, and a data composition form, where the status bits may include a first status bit and a second status bit, the first status bit is used to indicate whether to perform a decompression operation, and the second status bit is used to indicate whether to perform a decryption operation. The determining module 202 determines whether to perform a decompression operation according to the value of the first state, and determines whether to perform a decryption operation according to the value of the second state. In practical applications, the number of bytes occupied by the message header can be freely configured according to the needs of users, for example, the message header can be configured to occupy 2 bytes, 4 bytes, and the like. The size endianness is used to indicate the order in which data is transmitted in the network. Of course, in practical applications, the protocol rule may be freely set according to the user requirement, and is not limited herein.
In an exemplary embodiment, the determining module 202 may be specifically configured to:
and when the first state bit is a first preset value, judging to execute the decompression operation.
And when the second state bit is a second preset value, judging to execute the decryption operation.
In practical applications, a predetermined byte in the protocol rule can be customized to represent the status bit. The preset bits of the status bits may represent compression and decompression or encryption and decryption. The first preset value and the second preset value are both binary values such as 0 or 1. For example, the 1 st bit of the nth byte is configured to be compressed and decompressed, the 2 nd bit is configured to be encrypted and decrypted, the 1 st bit of the nth byte is 0, which indicates that no compression is required and no decompression operation is required; the 1 st bit of the nth byte is 1, which indicates compression and needs to perform decompression operation; the 2 nd bit of the nth byte is 0, which indicates that no encryption is required and no decryption operation is required to be performed; the 2 nd bit of the nth byte is 1, which indicates that encryption and decryption are required. Of course, 0 may be configured to indicate compression, and 1 to indicate no compression; 0 represents encryption, and 1 represents no encryption, which is not limited in the embodiment of the present invention. By judging the first status bit and the second status bit, whether to execute decompression and/or decryption operation can be quickly determined so as to quickly acquire source data from the communication content.
The restoring module 203 is further configured to, when the decompressing and/or decrypting operation is performed, perform the decompressing and/or decrypting operation on the communication content to obtain the source data.
In a specific embodiment, the restoring module 203 may specifically include a decompressing module and a decrypting module, where the decompressing module is configured to perform a decompressing operation on the communication content, and the decrypting module is configured to perform a decrypting operation on the communication content.
And the analysis module 204 is configured to analyze the source data according to the protocol rule to obtain an analysis result.
In an exemplary embodiment, the protocol rule includes a general message field, and the source data is analyzed according to the general message field to obtain a field content corresponding to each general message field, that is, to obtain an analysis result. Illustratively, the generic message field includes an upstream or downstream of the message, a protocol type, an IP address, a port number, a message length, a message type, a check, a default padding, and the like.
The separating module 205 is configured to separate the parsing result into field contents corresponding to a preset field according to the preset field.
In practical application, meaningful fields, namely preset fields, are screened from the general message fields. And then, according to the preset field, separating the analysis result into field contents corresponding to the preset field. The preset field may include, for example, an uplink or a downlink of the message, a protocol type, an IP address, a port number, a message length, a message type, and message data. An exemplary partitioning effect result diagram is shown in fig. 6, for example, the first line of data in fig. 6 is upstream data, the protocol type is TCP protocol, the IP address is 120.33.34.212, the port number is 9300, the message length is 41, the message type is 5203, and the message data is 38306466376238662d396433372d3435.
In an exemplary embodiment, the partitioning module 205 may include a matching unit, a screening unit, and a partitioning unit:
the matching unit is used for matching the preset field with the general message field.
And the screening unit is used for screening the target result corresponding to the preset field from the analysis result according to the matching result.
The separating unit is used for separating the target result into the field content corresponding to the preset field.
With continuing reference to fig. 6, fig. 6 separates the uplink and downlink, TCP protocol, IP address, protocol type, IP address, port number, message length, message type, message data, etc. by vertical lines. Of course, in other embodiments, the target result may be separated by other reference signs including, but not limited to, quotation marks, semicolons, brackets, connecting lines, and the like. By screening out the target result corresponding to the preset field from the analysis result and separating the target result by using a separation number, the field content corresponding to the meaningful field can be obtained according to the user requirement, and the user experience is improved.
In an exemplary embodiment, the communication content analysis apparatus may further include an execution unit and an identification unit.
And the operation unit is used for matching the pre-configured dynamic data parameterization identifier with the field content corresponding to the preset field.
And the identification unit is used for acquiring the dynamic data corresponding to the dynamic data parameterization identification according to the matching result and identifying the dynamic data.
Specifically, please refer to fig. 6, in fig. 6, the ninth row of data is uplink data, the protocol type is TCP protocol, the IP address is 120.33.34.212, the port number is 9300, the message length is 44, the message type is 5205, the message data is 00000000[9beb6501]00000000aa8a …, and the dynamic data in the message data is parameterized and identified according to the dynamic data parameterized identifier. For example, in fig. 6, the dynamic data parameterization identifies an account (ID) where the client logs in, and the identification may include, but is not limited to: and identifying the account ID of the client login by a bracket and a highlighted form. For example, the ninth line of data in fig. 6 has dynamic data identified by parentheses and a highlight of 9be 6501. By configuring the dynamic data parameterization identifier, the position and the content of the dynamic data in the communication content can be visually displayed, and the user experience is greatly improved.
In practical applications, the existing request data construction method includes:
1. by the developer of the corresponding project: based on the knowledge and mastery of project codes by the developers of the project, the actual requests of the players are constructed by packaging a test client tool by fully utilizing the existing codes. However, the implementers in this method have limitations and can only be completed by the developers of the project, however, often at the end of the project, the developers need to rush the development task of milestones, and there is no time to construct the request data. In addition, since most developers are not professional performance quality personnel, good results cannot be obtained without familiarity with the activities and implementation rules of stress testing.
2. Done by personnel in the non-development sector: the staff knows the rules of the player request messages by reading the protocols and codes of the projects or help documents, and knows the interaction process (including data format, instruction sequence and the like) of the player and the server by communicating with the server developer in detail, and passes continuous trial and error and verification. And finally, the pressure measurement implementing personnel realize a simulation client tool which accords with the actual interaction rule according to the verification result. However, this method has requirements for programming language and capability of the simulation client implementer, and since few help documents can accurately describe details of the project, it is costly to communicate the simulation client implementer with the developer of the project. In addition, because the content of the interaction between the client and the server is complicated, the related interaction instructions and data are huge, continuous communication, trial and error and correction are needed in the implementation process, and the implementation efficiency is low.
In an embodiment of the present invention, the communication content analysis apparatus further includes an acquisition unit, a parameterization unit, and a construction unit. When the identification unit identifies the dynamic data, the acquisition unit acquires the dynamic data, and the parameterization unit parameterizes the dynamic data in the message data. Then, the construction unit constructs a plurality of communication contents according to the protocol rule, the parameterized message data of the dynamic data and the dynamic data of each client so as to simulate the specific interactive contents of the player client and the server. For example: when a real request data is simulated, a plurality of dynamic data are constructed, the constructed dynamic data are respectively replaced to the dynamic data parameterization positions, and then a complete request data is constructed according to the protocol rule. By identifying the dynamic data and parameterizing the dynamic data, the construction efficiency of the communication content is greatly improved, and the labor cost is greatly reduced. According to the embodiment of the invention, the dynamic data can be replaced to the dynamic data parameterization position according to the protocol rule without knowing the game program code by the implementer, so that the real request data can be easily and quickly constructed, the construction efficiency of the request data is greatly improved, the development efficiency is improved, and the communication cost is reduced.
In an exemplary embodiment, the communication content analysis apparatus further includes an output module configured to: and outputting the field contents corresponding to the preset fields according to the time sequence.
In an exemplary embodiment, according to the time sequence of the communication content in the ordered queue, the output module sequentially outputs the field content corresponding to the preset field, which is obtained after the communication content is analyzed. With reference to fig. 6, the time sequence of the communication content corresponding to the first row of data is prior to the time sequence of the communication content corresponding to the second row of data. By outputting the field contents corresponding to the preset fields according to the time sequence, the user experience is further improved.
The communication content analysis device provided by the embodiment of the invention captures the communication content of the client and the server by configuring the protocol rule, determines whether the communication content needs to be restored according to the configured protocol rule, restores source data from the communication content when the communication content needs to be restored, analyzes the source data according to the protocol rule to obtain an analysis result, and divides the analysis result into field contents corresponding to the preset field according to the preset field. According to the embodiment of the invention, the communication content between the client and the server is captured and analyzed according to the configured protocol rule, so that the interactive content between the client and the server can be analyzed quickly and automatically, the analysis efficiency of the interactive content is greatly improved, and the construction efficiency of the request data is greatly improved.
The embodiment also provides a computer device, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server or a rack server (including an independent server or a server cluster composed of a plurality of servers) capable of executing programs, and the like. As shown in fig. 10, the computer device 30 of the present embodiment includes at least, but is not limited to: a memory 301, a processor 302 communicatively coupled to each other via a system bus. It is noted that FIG. 10 only shows the computer device 30 having components 301 and 302, but it is understood that not all of the shown components are required and that more or fewer components may be implemented instead.
In this embodiment, the memory 301 (i.e., the readable storage medium) includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the storage 301 may be an internal storage unit of the computer device 30, such as a hard disk or a memory of the computer device 30. In other embodiments, the memory 301 may also be an external storage device of the computer device 30, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the computer device 30. Of course, the memory 301 may also include both internal and external storage devices for the computer device 30. In the present embodiment, the memory 301 is generally used for storing an operating system and various types of application software installed in the computer device 30, such as the program codes of the communication content analysis apparatus of the above-described embodiment. In addition, the memory 301 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 302 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 302 generally serves to control the overall operation of the computer device 30.
Specifically, in this embodiment, the processor 302 is configured to execute a program of a communication content analysis method stored in the processor 302, and when executed, the program of the communication content analysis method implements the following steps:
when monitoring that the game runs, capturing communication contents of the client and the server;
judging whether the communication content needs to be restored or not according to a pre-configured protocol rule;
when the communication content needs to be restored, source data are restored from the communication content;
analyzing the source data according to the protocol rule to obtain an analysis result;
and according to a preset field, separating the analysis result into field contents corresponding to the preset field.
For the specific embodiment of the process of the above method steps, reference may be made to the above embodiments, and details of this embodiment are not repeated herein.
The present embodiments also provide a computer readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application mall, etc., having stored thereon a computer program that when executed by a processor implements the method steps of:
when monitoring that the game runs, capturing communication contents of the client and the server;
judging whether the communication content needs to be restored or not according to a pre-configured protocol rule;
when the communication content needs to be restored, source data are restored from the communication content;
analyzing the source data according to the protocol rule to obtain an analysis result;
and according to a preset field, separating the analysis result into field contents corresponding to the preset field.
For the specific embodiment of the process of the above method steps, reference may be made to the above embodiments, and details of this embodiment are not repeated herein.
The computer device and the readable storage medium provided in this embodiment capture communication content of a client and a server by configuring a protocol rule, determine whether the communication content needs to be restored according to the configured protocol rule, when the communication content needs to be restored, restore source data from the communication content, analyze the source data according to the protocol rule to obtain an analysis result, and partition the analysis result into field content corresponding to a preset field according to the preset field. According to the embodiment of the invention, the communication content between the client and the server is captured and analyzed according to the configured protocol rule, so that the interactive content between the client and the server can be analyzed quickly and automatically, the analysis efficiency of the interactive content is greatly improved, and the construction efficiency of the request data is improved.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A method for analyzing communication content, the method comprising:
when monitoring that the game runs, capturing communication contents of the client and the server;
judging whether the communication content needs to be restored or not according to a pre-configured protocol rule;
when the communication content needs to be restored, source data are restored from the communication content;
analyzing the source data according to the protocol rule to obtain an analysis result;
and according to a preset field, separating the analysis result into field contents corresponding to the preset field.
2. The communication content analysis method according to claim 1, wherein the method further comprises:
matching the pre-configured dynamic data parameterization identification with the field content corresponding to the preset field;
and obtaining dynamic data corresponding to the dynamic data parameterization identification according to the matching result, and identifying the dynamic data.
3. The communication content analysis method according to claim 1, wherein the method further comprises:
storing the communication contents in a preset ordered queue, wherein the ordered queue is marked with the time sequence of each communication content;
reading the communication content from the ordered queue.
4. The method according to claim 1, wherein the protocol rule includes a message header, a message body, and a size endianness, the message header includes a message length, status bits, and a data component form, wherein the status bits include a first status bit and a second status bit, the first status bit is used to indicate whether to perform a decompression operation, and the second status bit is used to indicate whether to perform a decryption operation.
5. The communication content analysis method of claim 4, wherein the restoring source data from the communication content comprises:
acquiring a corresponding state bit from the communication content, and judging whether to execute decompression and/or decryption operation according to the state bit;
and when the decompression and/or decryption operation is executed, the decompression and/or decryption operation is executed on the data corresponding to the status bit to obtain the source data.
6. The method for analyzing communication content according to claim 5, wherein said determining whether to perform decompression and/or decryption operations according to the status bit comprises:
when the first state bit is a first preset value, judging to execute the decompression operation;
and when the second state bit is a second preset value, judging to execute the decryption operation.
7. The method for analyzing communication contents according to claim 1, wherein the protocol rule includes a general message field, and the separating the parsing result into field contents corresponding to a preset field according to the preset field includes:
matching the preset field with the general message field;
screening a target result corresponding to the preset field from the analysis result according to the matching result;
and separating the target result into the field content corresponding to the preset field.
8. An apparatus for analyzing communication contents, the apparatus comprising:
the capturing module is used for capturing communication contents of the client and the server when the game running is monitored;
the judging module is used for judging whether the communication content needs to be restored or not according to a protocol rule configured in advance;
the restoring module is used for restoring source data from the communication content when the communication content needs to be restored;
the analysis module is used for analyzing the source data according to the protocol rule to obtain an analysis result;
and the separation module is used for separating the analysis result into field contents corresponding to the preset fields according to the preset fields.
9. A computer device, the computer device comprising: memory, processor and computer program stored on the memory and executable on the processor, characterized in that the steps of the communication content analysis method of any of claims 1 to 7 are implemented by the processor when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the communication content analysis method according to any one of claims 1 to 7.
CN202011002555.1A 2020-09-22 2020-09-22 Communication content analysis method and device Pending CN114253815A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011002555.1A CN114253815A (en) 2020-09-22 2020-09-22 Communication content analysis method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011002555.1A CN114253815A (en) 2020-09-22 2020-09-22 Communication content analysis method and device

Publications (1)

Publication Number Publication Date
CN114253815A true CN114253815A (en) 2022-03-29

Family

ID=80789618

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011002555.1A Pending CN114253815A (en) 2020-09-22 2020-09-22 Communication content analysis method and device

Country Status (1)

Country Link
CN (1) CN114253815A (en)

Similar Documents

Publication Publication Date Title
CN109302522B (en) Test method, test device, computer system, and computer medium
CN107665233B (en) Database data processing method and device, computer equipment and storage medium
CN106484611B (en) Fuzzy test method and device based on automatic protocol adaptation
CN109376088B (en) Automatic test system and automatic test method
CN108255701B (en) Scene testing method and mobile terminal
CN107404418B (en) Internet product testing method, device, equipment and storage medium
CN110377440B (en) Information processing method and device
CN106941501B (en) Data communication method and device
CN110297776B (en) Detection report generation and reception methods, devices, equipment and storage medium
CN111026439B (en) Application program compatibility method, device, equipment and computer storage medium
CN112631590B (en) Component library generation method, device, electronic equipment and computer readable medium
CN112416458A (en) Preloading method and device based on ReactNative, computer equipment and storage medium
CN112333186A (en) Data communication method, device, equipment and storage medium
US20030172186A1 (en) Method, system and program product for transcoding content
CN111752820B (en) gRPC interface pressure test method, computer equipment and storage medium
CN114185808A (en) Automatic testing method and device, electronic equipment and computer readable storage medium
CN114221866A (en) Method, device and medium for upgrading terminal
WO2019237239A1 (en) Data test method and apparatus, device/terminal/server and computer readable storage medium
CN114253815A (en) Communication content analysis method and device
CN116662302A (en) Data processing method, device, electronic equipment and storage medium
CN111107100B (en) Equipment for transmitting industrial protocol flow message
CN112379967B (en) Simulator detection method, device, equipment and medium
KR101824699B1 (en) Apparatus and method for analyzing android application, and computer-readable medium storing program for method thereof
CN114416596A (en) Application testing method and device, computer equipment and storage medium
CN114385509A (en) Null pointer object detection method, null pointer object detection device, computer equipment and storage medium

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