CN110740131B - Data processing method and device, electronic equipment and storage medium - Google Patents

Data processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110740131B
CN110740131B CN201910944757.9A CN201910944757A CN110740131B CN 110740131 B CN110740131 B CN 110740131B CN 201910944757 A CN201910944757 A CN 201910944757A CN 110740131 B CN110740131 B CN 110740131B
Authority
CN
China
Prior art keywords
target
data packet
communication data
data
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910944757.9A
Other languages
Chinese (zh)
Other versions
CN110740131A (en
Inventor
仝瑶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN201910944757.9A priority Critical patent/CN110740131B/en
Publication of CN110740131A publication Critical patent/CN110740131A/en
Application granted granted Critical
Publication of CN110740131B publication Critical patent/CN110740131B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

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

Abstract

The present disclosure shows a data processing method, apparatus, electronic device and storage medium, which are applied to a long connection proxy tool built between a target client and a target server, and first obtain a communication data packet between the target client and the target server; then, decoding the communication data packet by adopting a preset protocol to obtain readable data; and finally, displaying the readable data on a display interface of the long connection agent tool. According to the scheme, the communication bridge between the target server and the target client is borne through the long-connection agent tool, all communication data packets pass through the agent tool, the agent tool can acquire the communication data packets and decode the communication data packets to obtain readable data which can be displayed on a display interface, and a user can quickly locate communication faults and the like according to the readable data.

Description

Data processing method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a data processing method and apparatus, an electronic device, and a storage medium.
Background
In the mobile internet, TCP communication connections of a target client and a target server are divided into a short connection and a long connection. Traditional HTTP is a short connection, which establishes a connection each time data is requested, and disconnects the connection immediately after the data is sent, and is only a one-way request from the target client to the target server. Correspondingly, a long connection is a connection that establishes a connection path for a long time, and during the connection, both parties can send packets to each other at any time. The long connection is more suitable for a scene that data is frequently transmitted between a target client and a target server than the short connection, and the application of the long connection is gradually widened in practice, such as live broadcast, competitive games and the like.
In software development, many working scenarios require seeing or intercepting communication data between a target client and a target server. At present, a mature http request packet capturing tool Charles is used for capturing a data packet of an http protocol between a target client and a target server, and has functions of capturing a packet, simulating transmission, intercepting a message and the like, however, charles is limited by the http protocol and cannot capture a data packet of a long connection. The WireShark can catch network packets of all protocols, including UDP protocol and TCP protocol, and has the functions of interception and filtering, however, the packets caught by the WireShark are in a message format of a network layer and have no readability.
Disclosure of Invention
The present disclosure provides a data processing method, an apparatus, an electronic device, and a storage medium, so as to at least solve the problem in the related art that a long connection data packet cannot be intercepted or the intercepted data packet does not have readability. The technical scheme of the disclosure is as follows:
according to a first aspect of the present disclosure, there is provided a data processing method applied to a long connection proxy tool built between a target client and a target server, the method including:
acquiring a communication data packet between the target client and the target server;
decoding the communication data packet by adopting a preset protocol to obtain readable data;
and displaying the readability data on a display interface of the long connection agency tool.
In an optional implementation manner, before the step of obtaining the communication data packet between the target client and the target server, the method further includes:
receiving a connection request sent by the target client;
sending the connection request to the target server;
and according to the response of the target server, establishing a long connection between the target client and the target server through the long connection agent tool.
In an optional implementation manner, the step of decoding the communication data packet by using a preset protocol to obtain the readability data includes:
and decoding the communication data packet by adopting a preset protobuf protocol to obtain readable data.
In an optional implementation manner, the long-connection broker tool includes a proxy client and a proxy server based on a Netty framework, the proxy server is connected to the target client and the proxy server, respectively, and the proxy client is further connected to the target server.
In an optional implementation manner, after the step of presenting the readable data on the display interface of the long connection broker tool, the method further includes:
acquiring data to be issued;
converting the data to be issued into binary data;
and sending the binary data to the target client.
In an optional implementation manner, after the step of decoding the communication data packet by using a preset protocol to obtain the readability data, the method further includes:
acquiring the message type of the communication data packet;
when the message type meets a preset condition, discarding the communication data packet;
and when the message type does not meet the preset condition, sending the communication data packet to the target client or the target server.
According to a second aspect of the present disclosure, there is provided a data processing apparatus applied to a long connection broker tool built between a target client and a target server, the apparatus comprising:
a first obtaining module configured to obtain a communication data packet between the target client and the target server;
the decoding module is configured to decode the communication data packet by adopting a preset protocol to obtain readable data;
a presentation module configured to present the readability data on a display interface of the long-connection broker tool.
In an optional implementation, the apparatus further includes:
a receiving module configured to receive a connection request sent by the target client;
a first sending module configured to send the connection request to the target server;
a connection module configured to establish a long connection between the target client and the target server through the long connection broker according to a response of the target server.
In an optional implementation manner, the communication data packet is a binary data stream, and the decoding module is specifically configured to:
and decoding the communication data packet by adopting a preset protobuf protocol to obtain readability data.
In an optional implementation manner, the long-connection broker tool includes a proxy client and a proxy server based on a Netty framework, the proxy server is connected to the target client and the proxy server, respectively, and the proxy client is further connected to the target server.
In an optional implementation, the apparatus further includes:
the second acquisition module is configured to acquire the data to be issued;
the conversion module is configured to convert the data to be transmitted into binary data;
a second sending module configured to send the binary data to the target client.
In an optional implementation, the apparatus further includes:
a third obtaining module configured to obtain a message type of the communication data packet;
a discarding module configured to discard the communication data packet when the message type meets a preset condition;
and the third sending module is configured to send the communication data packet to the target client or the target server when the message type does not meet a preset condition.
According to a third aspect of the present disclosure, there is provided an electronic apparatus comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the data processing method of the first aspect.
According to a fourth aspect of the present disclosure, there is provided a storage medium having instructions that, when executed by a processor of an electronic device, enable the electronic device to perform the data processing method according to the first aspect.
According to a fifth aspect of the present disclosure, there is provided a computer program product, wherein the instructions of the computer program product, when executed by a processor of an electronic device, enable the electronic device to perform the data processing method according to the first aspect.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
the technical scheme of the disclosure provides a data processing method, a data processing device, electronic equipment and a storage medium, which are applied to a long connection agent tool built between a target client and a target server, and firstly, a communication data packet between the target client and the target server is obtained; then, decoding the communication data packet by adopting a preset protocol to obtain readable data; and finally, displaying the readable data on a display interface of the long connection agent tool. According to the scheme, the communication bridge between the target server and the target client is borne through the long-connection agent tool, all communication data packets pass through the agent tool, the agent tool can acquire the communication data packets and decode the communication data packets to obtain readable data which can be displayed on a display interface, and a user can quickly locate communication faults and the like according to the readable data.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a flow chart illustrating a method of data processing according to an exemplary embodiment.
Fig. 2 is a flow diagram illustrating the establishment of a long connection in accordance with an example embodiment.
FIG. 3 is a flow diagram illustrating simulated delivery of data according to an example embodiment.
Fig. 4 is a flow diagram illustrating an interception of a communication packet in accordance with an exemplary embodiment.
Fig. 5 is a block diagram illustrating the structure of a long connection broker in accordance with an exemplary embodiment.
FIG. 6 is a block diagram illustrating a data processing device according to an example embodiment.
FIG. 7 is a block diagram illustrating an electronic device in accordance with an example embodiment.
FIG. 8 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Fig. 1 is a flowchart illustrating a data processing method according to an exemplary embodiment, and the method is applied to a long connection broker tool built between a target client and a target server, as shown in fig. 1, and may include the following steps.
In step S11, a communication data packet between the target client and the target server is acquired.
The long connection agent tool can be realized based on a Netty framework, and Netty is a network communication framework developed based on non-blocking IO.
In a specific implementation, the long connection proxy tool may include a proxy client and a proxy server based on a Netty framework, the proxy server is connected with the target client and the proxy server, respectively, and the proxy client is further connected with the target server, as shown in fig. 5.
The mobile phone client (target client) is connected with the proxy server, the proxy server is connected with the proxy client, and the proxy client is connected with the actual server (target server). When the target client sends data to the proxy server, the proxy server sends the data to the proxy client, and the proxy client forwards the data to the target server. The same is true of the target server sending data to the target client, in turn. The long connection broker acts like an intermediary to pass through messages between the target client and the target server. The long-connection broker may retrieve all long-connection communication packets transmitted between the target client and the target server.
In step S12, a preset protocol is adopted to decode the communication data packet, so as to obtain readable data.
In a specific implementation, when the communication data packet is a binary data stream, a preset protobuf protocol may be used to decode the communication data packet, so as to obtain readability data.
Each communication data packet transmitted between the target client and the target server passes through the long connection proxy tool, but the communication data packets are binary data streams and have no readability, the binary data streams (communication data packets) can be decoded through a protocol agreed in advance, and then the decoded data with readability are displayed on a display interface of the long connection proxy tool, so that a user can clearly know the data flow direction between the target client and the target server.
In step S13, the readability data is displayed on the display interface of the long connection broker tool.
The display interface of the long connection agent tool may be, for example, a web page. The readability data is data readable by the user, and may be in the form of, for example, chinese, english, etc.
In the data processing method provided by this embodiment, a communication bridge between the target server and the target client is supported by the long connection proxy, all communication data packets pass through the proxy, and the proxy can acquire the communication data packets and decode the communication data packets to obtain readable data that can be presented on the display interface.
During software development, when a software product encounters a defect associated with a long connection message, a tester can easily and conveniently infer whether the target client or the target server is defective using the long connection broker tool. For example, the target server sends a long connection data message to a mobile phone terminal (target client), but the client is not shown, if the long connection agent tool receives the message, it indicates that the problem is that the long connection agent tool is a target client with a high probability, but if the long connection agent tool does not receive the message, the problem is that the long connection agent tool is a target server with a high probability. By adopting the agent tool, a user can quickly locate the cause of the problem and improve the working efficiency.
In an optional implementation manner of this embodiment, referring to fig. 2, before step S11, the method may further include:
in step S21, a connection request sent by the target client is received.
In step S22, the connection request is transmitted to the target server.
In step S23, a long connection is established between the target client and the target server through the long connection broker according to the response of the target server.
In the specific implementation, a mobile phone client (target client) is connected with a proxy server, when the proxy server receives a long connection request of the mobile phone client, a proxy client is created and connected with an actual server (target server), the proxy server sends the long connection request to the proxy client, and then the proxy client sends the long connection request to the target server, so that a long connection is established between the target client and the target server, and the target server and the target client can communicate through the long connection.
In an optional implementation manner of this embodiment, after step S13, referring to fig. 3, the data processing method provided in this embodiment may further include:
in step S31, data to be delivered is acquired.
The data to be issued can be readability data input by a user on a long connection agent tool display interface.
In step S32, the data to be transmitted is converted into binary data.
In a specific implementation, an encoder may be encapsulated, and the encoder may convert, based on a preset protobuf protocol, readability data (data to be issued) input on a display interface by a user into binary data that can be transmitted in a network layer.
In step S33, the binary data is transmitted to the target client.
In a specific implementation, the binary data obtained by conversion can be directly issued to a target client through the proxy server. Therefore, a user using the long connection agent tool can easily input the analog communication data (to-be-issued data) to be issued on the display interface and then issue the analog communication data to the mobile phone client (target client).
In daily software development, a user needs to know the performance of a target client after receiving various messages under many conditions, but the messages are often difficult to realize through the target server, for example, at the initial stage of software development, the code of the target server is not ready, and under these conditions, the long-connection agent tool can be used for issuing simulation data to the target client, so that the development of the code of the target client is completed more smoothly, and the quality of a software product is ensured.
In an optional implementation manner of this embodiment, after step S12, referring to fig. 4, the data processing method provided in this embodiment may further include:
in step S41, the message type of the communication packet is acquired.
In a specific implementation, after the protocol is used to decode the communication data packet, the message type of the communication data packet may be output.
In step S42, when the message type meets the preset condition, the communication data packet is discarded.
The preset condition may be a preset message type that the target server or the target client is not expected to receive, that is, a message type that the long connection broker tool is required to filter.
In a specific implementation, if the message type of the communication data packet obtained by the long connection proxy tool meets a preset condition, that is, the message type is a type to be filtered, the message data packet may be directly discarded and is not sent to the target client or the target server.
In step S43, when the message type does not meet the preset condition, the communication data packet is sent to the target client or the target server.
In a specific implementation, if the message type of the communication data packet acquired by the long connection proxy does not meet the preset condition, that is, the message type is not the type needing filtering, the communication data packet may be issued to the target client or the target server through the proxy.
In some scenarios, software development and testing personnel need to observe the performance of the target client when a certain long connection message is not received, and with the long connection agent, the message can be intercepted, so that the message is not issued to the target client.
According to the data processing method provided by the embodiment, the long connection packet capturing function is realized through the long connection agent tool arranged between the target server and the target client, the captured communication data packet can be converted into readable data, and the problem that no mature long connection packet capturing tool exists in the current software field is solved; in addition, the long connection agent tool also has the function of simulating the sending of long connection data and the function of intercepting the long connection data.
FIG. 6 is a block diagram illustrating a data processing apparatus according to an example embodiment. Referring to fig. 6, the apparatus applied to a long connection broker tool built between a target client and a target server may include:
a first obtaining module 61 configured to obtain a communication data packet between the target client and the target server;
a decoding module 62 configured to decode the communication data packet by using a preset protocol to obtain readability data;
a presentation module 63 configured to present the readable data on a display interface of the long-connection agent.
The long connection agent tool can be realized based on a Netty framework, wherein Netty is a network communication framework developed based on non-blocking IO.
In a specific implementation, the long connection proxy tool may include a proxy client and a proxy server based on a Netty framework, the proxy server is connected to the target client and the proxy server, respectively, and the proxy client is further connected to the target server, as shown in fig. 5.
The mobile phone client (target client) is connected with the proxy server, the proxy server is connected with the proxy client, and the proxy client is connected with the actual server (target server). When the target client sends data to the proxy server, the proxy server sends the data to the proxy client, and the proxy client forwards the data to the target server. The same is true of the target server sending data to the target client, in turn. The long connection broker acts like an intermediary to pass through messages between the target client and the target server. The first obtaining module 61 may obtain all long connection communication packets transmitted between the target client and the target server.
In a specific implementation, when the communication data packet is a binary data stream, the decoding module 62 may decode the communication data packet by using a preset protobuf protocol to obtain the readability data.
Each communication data packet transmitted between the target client and the target server passes through the long connection agent, but the communication data packets are binary data streams and have no readability, the decoding module 62 can decode the binary data streams (communication data packets) through a protocol agreed in advance, and then the decoded data with readability is presented on a display interface of the long connection agent, so that a user can clearly know the data flow direction between the target client and the target server.
The display interface of the long connection agent tool may be, for example, a web page. The readability data is data readable by the user, and may be in the form of, for example, chinese, english, etc.
The data processing apparatus provided in this embodiment accepts a communication bridge between the target server and the target client through the long connection proxy, and all communication data packets pass through the proxy, and the proxy can acquire the communication data packets and decode the communication data packets to obtain readable data that can be presented on the display interface.
In an optional implementation, the apparatus further includes:
a receiving module configured to receive a connection request sent by the target client;
a first sending module configured to send the connection request to the target server;
a connection module configured to establish a long connection between the target client and the target server through the long connection broker according to a response of the target server.
In the specific implementation, a mobile phone client (target client) is connected with a proxy server, when the proxy server (provided with a receiving module) receives a long connection request of the mobile phone client, a proxy client is created and connected with an actual server (target server), the proxy server sends the long connection request to the proxy client, and then the proxy client (provided with a first sending module) sends the long connection request to the target server, so that the connecting module establishes a long connection between the target client and the target server, and the target server and the target client can communicate through the long connection.
In an optional implementation manner, the apparatus further includes:
the second acquisition module is configured to acquire the data to be issued;
the conversion module is configured to convert the data to be transmitted into binary data;
a second sending module configured to send the binary data to the target client.
The data to be issued acquired by the second acquisition module can be readability data input by a user on a long connection agent tool display interface.
In a specific implementation, the conversion module may encapsulate an encoder, and the encoder may convert, based on a preset protobuf protocol, readability data (to-be-transmitted data) input on a display interface by a user into binary data that can be transmitted in a network layer.
In a specific implementation, the second sending module may directly send the converted binary data to the target client through the proxy server. Therefore, a user using the long connection agent tool can easily input the analog communication data (to-be-issued data) to be issued on the display interface and then issue the analog communication data to the mobile phone client (target client).
In an optional implementation manner, the apparatus further includes:
a third obtaining module configured to obtain a message type of the communication data packet;
a discarding module configured to discard the communication data packet when the message type meets a preset condition;
and the third sending module is configured to send the communication data packet to the target client or the target server when the message type does not meet a preset condition.
In a specific implementation, after the protocol is used to decode the communication data packet, the message type of the communication data packet may be output, and the third obtaining module may obtain the message type of the communication data packet.
The preset condition may be a preset message type that the target server or the target client is not expected to receive, that is, a message type that the long connection broker tool is required to filter.
In a specific implementation, if the message type of the communication data packet obtained by the long connection proxy tool meets a preset condition, that is, the message type is a type to be filtered, the discarding module may directly discard the message data packet and does not issue the message data packet to the target client or the target server.
If the message type of the communication data packet acquired by the long connection agent tool does not meet the preset condition, that is, the message type is not the type needing filtering, the third sending module can send the communication data packet to the target client or the target server through the agent tool.
The data processing apparatus provided in this embodiment implements a long connection packet capturing function through a long connection agent tool disposed between a target server and a target client, and can also convert captured communication data packets into readable data, thereby solving the problem that no mature long connection packet capturing tool exists in the current software field; in addition, the long connection agent tool also has the function of simulating the sending of long connection data and the function of intercepting the long connection data.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 7 is a block diagram of one type of electronic device 800 shown in the present disclosure. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 7, electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and a communication component 816.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform the data processing methods described in any of the embodiments. The data processing method is applied to a long connection agent tool set up between a target client and a target server, and comprises the following steps:
acquiring a communication data packet between the target client and the target server;
decoding the communication data packet by adopting a preset protocol to obtain readable data;
and displaying the readability data on a display interface of the long connection agency tool.
Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operation at the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 806 provides power to the various components of the electronic device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.
The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 800 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the electronic device 800. For example, the sensor assembly 814 may detect an open/closed state of the device 800, the relative positioning of components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in the position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, orientation or acceleration/deceleration of the electronic device 800, and a change in the temperature of the electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 may access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the data processing methods described in any of the embodiments. The data processing method is applied to a long connection agent tool set up between a target client and a target server, and comprises the following steps:
acquiring a communication data packet between the target client and the target server;
decoding the communication data packet by adopting a preset protocol to obtain readability data;
and displaying the readability data on a display interface of the long connection agency tool.
In an exemplary embodiment, a non-transitory computer readable storage medium including instructions, such as the memory 804 including instructions, executable by the processor 820 of the electronic device 800 to perform the data processing method of any of the embodiments is also provided. The data processing method is applied to a long connection agent tool set up between a target client and a target server, and comprises the following steps:
acquiring a communication data packet between the target client and the target server;
decoding the communication data packet by adopting a preset protocol to obtain readable data;
and displaying the readability data on a display interface of the long connection agent tool.
For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, which comprises readable program code executable by the processor 820 of the device 800 to perform the data processing method of any of the embodiments. The data processing method is applied to a long connection agent tool set up between a target client and a target server, and comprises the following steps:
acquiring a communication data packet between the target client and the target server;
decoding the communication data packet by adopting a preset protocol to obtain readable data;
and displaying the readability data on a display interface of the long connection agency tool.
Alternatively, the program code may be stored in a storage medium of the apparatus 800, which may be a non-transitory computer readable storage medium, for example, ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
Fig. 8 is a block diagram of one type of electronic device 1900 shown in the present disclosure. For example, electronic device 1900 may be provided as a target server.
Referring to fig. 8, electronic device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the data processing method of any embodiment. The data processing method is applied to a long connection agent tool set up between a target client and a target server, and comprises the following steps:
acquiring a communication data packet between the target client and the target server;
decoding the communication data packet by adopting a preset protocol to obtain readable data;
and displaying the readability data on a display interface of the long connection agent tool.
The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input/output (I/O) interface 1958. The electronic device 1900 may operate based on an operating system, such as Windows Server, macOSXTM, unixTM, linuxTM, freeBSDTM, or the like, stored in the memory 1932.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
A1, a data processing method, which is applied to a long connection agent tool set up between a target client and a target server, the method comprises the following steps:
acquiring a communication data packet between the target client and the target server;
decoding the communication data packet by adopting a preset protocol to obtain readable data;
and displaying the readability data on a display interface of the long connection agency tool.
A2, according to the method described in A1, before the step of obtaining the communication data packet between the target client and the target server, further including:
receiving a connection request sent by the target client;
sending the connection request to the target server;
and according to the response of the target server, establishing a long connection between the target client and the target server through the long connection agent tool.
A3, according to the method described in A1, the communication data packet is a binary data stream, and the step of decoding the communication data packet by using a preset protocol to obtain readability data includes:
and decoding the communication data packet by adopting a preset protobuf protocol to obtain readable data.
A4, according to the method of A1, the long connection agent tool comprises a proxy client and a proxy server based on a Netty framework, the proxy server is respectively connected with the target client and the proxy server, and the proxy client is also connected with the target server.
A5, after the step of displaying the readability data on the display interface of the long-connection agent tool, according to the method of any one of A1 to A4, further comprising:
acquiring data to be issued;
converting the data to be issued into binary data;
and sending the binary data to the target client.
A6, according to the method described in any one of A1 to A4, after the step of decoding the communication data packet by using a preset protocol to obtain readability data, the method further includes:
acquiring the message type of the communication data packet;
when the message type meets a preset condition, discarding the communication data packet;
and when the message type does not accord with the preset condition, sending the communication data packet to the target client or the target server.
A7, a data processing device, which is applied to a long connection agent tool built between a target client and a target server, the device comprises:
a first obtaining module configured to obtain a communication data packet between the target client and the target server;
the decoding module is configured to decode the communication data packet by adopting a preset protocol to obtain readable data;
a presentation module configured to present the readability data on a display interface of the long-connection broker tool.
A8, the apparatus according to A7, further comprising:
a receiving module configured to receive a connection request sent by the target client;
a first sending module configured to send the connection request to the target server;
a connection module configured to establish a long connection between the target client and the target server through the long connection broker according to a response of the target server.
A9, the apparatus of A7, wherein the communication data packet is a binary data stream, and the decoding module is specifically configured to:
and decoding the communication data packet by adopting a preset protobuf protocol to obtain readable data.
The device according to the above A7, wherein the long connection proxy tool includes a proxy client and a proxy server based on a Netty framework, the proxy server is connected to the target client and the proxy server, and the proxy client is further connected to the target server.
A11, the apparatus according to any one of A7 to a10, further comprising:
the second acquisition module is configured to acquire the data to be issued;
the conversion module is configured to convert the data to be transmitted into binary data;
a second sending module configured to send the binary data to the target client.
A12, the apparatus of any one of A7 to a10, further comprising:
a third obtaining module configured to obtain a message type of the communication data packet;
a discarding module configured to discard the communication data packet when the message type meets a preset condition;
and the third sending module is configured to send the communication data packet to the target client or the target server when the message type does not meet a preset condition.

Claims (12)

1. A data processing method applied to a long connection broker tool built between a target client and a target server, the method comprising:
acquiring a communication data packet between the target client and the target server;
decoding the communication data packet by adopting a preset protocol to obtain readable data; the communication data packet is a binary data stream;
displaying the readability data on a display interface of the long connection agent tool;
after the step of decoding the communication data packet by using the preset protocol to obtain the readability data, the method further includes:
acquiring the message type of the communication data packet;
when the message type meets a preset condition, discarding the communication data packet;
and when the message type does not meet the preset condition, sending the communication data packet to the target client or the target server.
2. The method of claim 1, further comprising, prior to the step of obtaining the communication data packet between the target client and the target server:
receiving a connection request sent by the target client;
sending the connection request to the target server;
and according to the response of the target server, establishing a long connection between the target client and the target server through the long connection agent tool.
3. The method of claim 1, wherein the communication data packet is a binary data stream, and the step of decoding the communication data packet using a predetermined protocol to obtain the readability data comprises:
and decoding the communication data packet by adopting a preset protobuf protocol to obtain readable data.
4. The method of claim 1, wherein the long-connection agent comprises a proxy client and a proxy server based on a Netty framework, the proxy server being connected to the target client and the proxy server, respectively, the proxy client being further connected to the target server.
5. The method of any of claims 1 to 4, further comprising, after the step of presenting the readability data on the display interface of the long-connection agent, the step of:
acquiring data to be issued;
converting the data to be issued into binary data;
and sending the binary data to the target client.
6. A data processing apparatus for use in a long connection broker tool built between a target client and a target server, the apparatus comprising:
a first obtaining module configured to obtain a communication data packet between the target client and the target server;
the decoding module is configured to decode the communication data packet by adopting a preset protocol to obtain readability data; the communication data packet is a binary data stream;
a presentation module configured to present the readability data on a display interface of the long-connection broker tool;
the device further comprises:
a third obtaining module configured to obtain a message type of the communication data packet;
a discarding module configured to discard the communication data packet when the message type meets a preset condition;
a third sending module, configured to send the communication data packet to the target client or the target server when the message type does not meet a preset condition.
7. The apparatus of claim 6, further comprising:
a receiving module configured to receive a connection request sent by the target client;
a first sending module configured to send the connection request to the target server;
a connection module configured to establish a long connection between the target client and the target server through the long connection broker according to a response of the target server.
8. The apparatus of claim 6, wherein the communication data packet is a binary data stream, and wherein the decoding module is specifically configured to:
and decoding the communication data packet by adopting a preset protobuf protocol to obtain readable data.
9. The apparatus of claim 6, wherein the long-connection broker tool comprises a proxy client and a proxy server based on a Netty framework, the proxy server being connected to the target client and the proxy server, respectively, the proxy client being further connected to the target server.
10. The apparatus according to any one of claims 7-9, further comprising:
the second acquisition module is configured to acquire the data to be issued;
the conversion module is configured to convert the data to be transmitted into binary data;
a second sending module configured to send the binary data to the target client.
11. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the data processing method of any one of claims 1 to 5.
12. A storage medium in which instructions, when executed by a processor of an electronic device, enable the electronic device to perform the data processing method of any one of claims 1 to 5.
CN201910944757.9A 2019-09-30 2019-09-30 Data processing method and device, electronic equipment and storage medium Active CN110740131B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910944757.9A CN110740131B (en) 2019-09-30 2019-09-30 Data processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910944757.9A CN110740131B (en) 2019-09-30 2019-09-30 Data processing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110740131A CN110740131A (en) 2020-01-31
CN110740131B true CN110740131B (en) 2022-11-04

Family

ID=69268483

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910944757.9A Active CN110740131B (en) 2019-09-30 2019-09-30 Data processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110740131B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111416855A (en) * 2020-03-16 2020-07-14 杭州涂鸦信息技术有限公司 Method and system for converting protocol data and object data
CN112491810B (en) * 2020-11-09 2021-09-21 珠海格力电器股份有限公司 Data connection method and mobile terminal
CN113704016B (en) * 2021-08-26 2023-07-28 北京百度网讯科技有限公司 Cloud function component diagnosis method, device, equipment and storage medium
CN114025016B (en) * 2021-10-18 2024-03-15 中国联合网络通信集团有限公司 Data forwarding method, device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106790683A (en) * 2017-02-10 2017-05-31 合网络技术(北京)有限公司 Network data display methods and device based on mobile terminal
CN109120696A (en) * 2018-08-17 2019-01-01 百度在线网络技术(北京)有限公司 Method and apparatus for sending data
CN109547567A (en) * 2018-12-25 2019-03-29 北京市天元网络技术股份有限公司 Act on behalf of connection method and device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104699612B (en) * 2015-03-25 2019-05-31 北京嘀嘀无限科技发展有限公司 For processing method, equipment and the system in software test
CN106936875B (en) * 2015-12-30 2019-11-15 南京理工大学 Improvement TCP agent method based on wide area network data compression
CN109088844B (en) * 2017-06-13 2021-03-19 腾讯科技(深圳)有限公司 Information interception method, terminal, server and system
CN108363662A (en) * 2018-01-29 2018-08-03 深圳壹账通智能科技有限公司 A kind of applied program testing method, storage medium and terminal device
CN109474603B (en) * 2018-11-27 2023-05-30 平安科技(深圳)有限公司 Data packet grabbing processing method and terminal equipment
CN109922053A (en) * 2019-02-22 2019-06-21 北京三快在线科技有限公司 Data transmission method, device, electronic equipment and readable storage medium storing program for executing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106790683A (en) * 2017-02-10 2017-05-31 合网络技术(北京)有限公司 Network data display methods and device based on mobile terminal
CN109120696A (en) * 2018-08-17 2019-01-01 百度在线网络技术(北京)有限公司 Method and apparatus for sending data
CN109547567A (en) * 2018-12-25 2019-03-29 北京市天元网络技术股份有限公司 Act on behalf of connection method and device

Also Published As

Publication number Publication date
CN110740131A (en) 2020-01-31

Similar Documents

Publication Publication Date Title
CN110740131B (en) Data processing method and device, electronic equipment and storage medium
CN105100829B (en) Video content intercept method and device
US10212025B2 (en) Router management method, router and mobile terminal
CN109714415B (en) Data processing method and device
EP2978202A1 (en) Calling method, device and system
EP3223147A2 (en) Method for accessing virtual desktop and mobile terminal
CN110493627B (en) Multimedia content synchronization method and device
CN108924491B (en) Video stream processing method and device, electronic equipment and storage medium
CN110619097A (en) Two-dimensional code generation method and device, electronic equipment and storage medium
CN111259246A (en) Information pushing method and device, electronic equipment and storage medium
CN111010314A (en) Communication test method and device for terminal equipment, routing equipment and storage medium
CN111385349B (en) Communication processing method, communication processing device, terminal, server and storage medium
CN112291631A (en) Information acquisition method, device, terminal and storage medium
CN107885016B (en) Holographic projection method and device
CN113259226A (en) Information synchronization method and device, electronic equipment and storage medium
CN109040651B (en) Video communication method and device
CN106412481B (en) Reminding method, device and terminal based on VoLTE video calling
CN110933773B (en) Link monitoring method and device
CN110121056B (en) Cross-regional video networking monitoring video acquisition method and device
CN110908904A (en) Method and device for debugging fast application and electronic equipment
CN110213531B (en) Monitoring video processing method and device
CN110858921A (en) Program video processing method and device
CN110263211B (en) Resource synchronization method and device
CN109068085B (en) Call processing method and device
CN114157520A (en) Project state acquisition method and device, electronic 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
GR01 Patent grant
GR01 Patent grant