CN110120895B - Method, device, medium and electronic equipment for testing communication of mobile terminal - Google Patents
Method, device, medium and electronic equipment for testing communication of mobile terminal Download PDFInfo
- Publication number
- CN110120895B CN110120895B CN201910290512.9A CN201910290512A CN110120895B CN 110120895 B CN110120895 B CN 110120895B CN 201910290512 A CN201910290512 A CN 201910290512A CN 110120895 B CN110120895 B CN 110120895B
- Authority
- CN
- China
- Prior art keywords
- data
- communication
- message
- characteristic information
- sending
- 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
Links
- 230000006854 communication Effects 0.000 title claims abstract description 230
- 238000004891 communication Methods 0.000 title claims abstract description 221
- 238000000034 method Methods 0.000 title claims abstract description 178
- 238000012360 testing method Methods 0.000 title claims abstract description 59
- 230000008569 process Effects 0.000 claims abstract description 134
- 238000012986 modification Methods 0.000 claims description 17
- 230000004048 modification Effects 0.000 claims description 17
- 238000004590 computer program Methods 0.000 claims description 10
- 238000010295 mobile communication Methods 0.000 claims description 9
- 238000010276 construction Methods 0.000 claims description 5
- 230000000694 effects Effects 0.000 abstract description 6
- 230000005540 biological transmission Effects 0.000 description 16
- 238000010586 diagram Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 7
- 238000011156 evaluation Methods 0.000 description 5
- 230000004044 response Effects 0.000 description 5
- 239000003795 chemical substances by application Substances 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 238000012546 transfer Methods 0.000 description 4
- 238000012795 verification Methods 0.000 description 4
- 208000024780 Urticaria Diseases 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 3
- 208000001848 dysentery Diseases 0.000 description 3
- 238000010998 test method Methods 0.000 description 3
- 230000009471 action Effects 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 101001094649 Homo sapiens Popeye domain-containing protein 3 Proteins 0.000 description 1
- 101000608234 Homo sapiens Pyrin domain-containing protein 5 Proteins 0.000 description 1
- 101000578693 Homo sapiens Target of rapamycin complex subunit LST8 Proteins 0.000 description 1
- 102100027802 Target of rapamycin complex subunit LST8 Human genes 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/50—Testing arrangements
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The application provides a method, a device, a medium and electronic equipment for testing communication of a mobile terminal. In order to test the communication process, the process is arranged between the sending end process and the receiving end process and used as an agent process, the message sent by the sending end process is received and recorded, then the message sent by the sending end process is simulated, a second message is generated, and the second message is sent to the receiving end process. Therefore, the normal operation of communication is ensured, and the efficiency and the effect of testing are also ensured.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a method, a device, a medium and electronic equipment for testing communication of a mobile terminal.
Background
In the application program development process, testing is an indispensable workflow.
At present, the domestic mobile terminal testing technology belongs to manual operation at a low-end level, and an automatic testing tool is lacked for testing functions and performance. The normalization and rationality of the process, and the understanding of the testing concept are all quite insufficient from the realization technology.
For the test of network communication, because the breakpoint setting in the data transmission process cannot be realized and the unknown property of the network communication equipment in the black box state in the data transmission path cannot be realized, the test result can only be obtained by statically analyzing the data of the sending terminal and the data of the receiving terminal. Therefore, the method has the characteristic of difficulty in testing the dynamic communication process. In particular a mobile terminal with a wireless connection.
In order to solve the above problems, a network data packet is currently acquired in a packet capturing manner. That is, the data packets transmitted and received by the network are intercepted in the dynamic communication process, so as to analyze the content of the network data packets, thereby achieving the purpose of testing.
However, since the network data packet exists in a form based on the byte stream and is in a connected state, the readability of the data packet acquired after packet capturing is poor, and data analysis is difficult. Meanwhile, the packet capturing process is to passively intercept data and cannot initiate active test, so that the flexibility of network test is also lacked.
Disclosure of Invention
The present invention is directed to a method, an apparatus, a medium, and an electronic device for testing communication of a mobile terminal, which are capable of solving at least one of the above-mentioned problems. The specific scheme is as follows:
according to a specific implementation manner of the present invention, in a first aspect, a method for testing communication of a mobile terminal is provided, including:
in a first working mode, the process receives a first message sent by a sending end process through a mobile communication network; the first message is a message generated according to a first communication protocol;
analyzing the first message according to the first communication protocol to acquire a first data body and a plurality of first attribute information, wherein the first attribute information is communication attribute information divided according to a format of the first communication protocol and at least comprises a plurality of first communication characteristic information associated with the process;
acquiring second communication characteristic information associated with the first communication characteristic information;
and generating a second message according to the first communication protocol, the second communication characteristic information and the first data body, and sending the second message to a receiving terminal process.
Preferably, after the analyzing the first message according to the first communication protocol to obtain the first data volume and the plurality of first attribute information, the method further includes:
and storing the first data body and the first attribute information in a first data set.
Preferably, after the analyzing the first message according to the first communication protocol to obtain the first data volume and the plurality of first attribute information, the method further includes:
extracting first user characteristic information from the first data body according to a preset sending end characteristic identifier;
and storing the first user characteristic information and the first communication characteristic information in a second data set.
Preferably, the method further comprises:
under a second working mode, acquiring the first user characteristic information and the first attribute information according to the incidence relation of the first data set and the second data set;
and displaying the first user characteristic information and the first attribute information on a display device according to a preset display format.
Preferably, the acquiring the second communication feature information associated with the first communication feature information includes:
obtaining the first data set from a preset third data set and the communication characteristic information is associated with second communication characteristic information.
Preferably, after the analyzing the first message according to the first communication protocol to obtain the first data volume and the plurality of first attribute information, the method further includes:
judging whether the first data body comprises preset request connection information or not;
and if so, establishing a first communication connection with the process of the sending end according to the first communication protocol.
Preferably, after the generating a second message according to the first communication protocol, the second communication characteristic information, and the first data volume, and sending the second message to a receiving end process, the method further includes:
and establishing a second communication connection with the receiving end process according to the first communication protocol.
Preferably, the generating a second message according to the first communication protocol, the second communication feature information, and the first data body includes:
acquiring the first data volume;
modifying the first data body according to a preset modification rule and generating a second data body;
and generating a second message according to the first communication protocol, the second communication characteristic information and the second data body.
Preferably, the modifying the first data volume and generating the second data volume according to a preset modification rule includes:
obtaining first data and first modified data associated with the first data from a fourth data set;
judging whether the first data volume comprises second data matched with the first data or not;
if yes, replacing all the second data in the first data body with the first modification data, and generating a second data body.
Preferably, the method further comprises:
under a third working mode, generating a third data volume according to a preset data construction rule;
and generating a third message according to the first communication protocol, preset third communication characteristic information and the third data body, and sending the third message to the receiving terminal process.
Preferably, the sending the third message to the receiving end process includes:
and sending the third message to the receiving end process according to a preset sending rule.
According to a second aspect of the present invention, there is provided an apparatus for testing communication of a mobile terminal, including:
a receiving unit, configured to receive, in a first working mode, a first message sent by a sending end process through a mobile communication network; the first message is a message generated according to a first communication protocol;
the analysis unit is used for analyzing the first message according to the first communication protocol to acquire a first data body and a plurality of first attribute information, wherein the first attribute information is divided according to the format of the first communication protocol and at least comprises a plurality of first communication characteristic information associated with the process;
an acquisition unit, configured to acquire second communication characteristic information associated with the first communication characteristic information;
and the sending unit is used for generating a second message according to the first communication protocol, the second communication characteristic information and the first data body and sending the second message to a receiving end process.
According to a third aspect, the present invention provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements a method of editing content in a document as described in any one of the above.
According to a fourth aspect of the present invention, there is provided an electronic apparatus including: one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a method of editing content in a document as claimed in any preceding claim.
Compared with the prior art, the scheme of the embodiment of the invention at least has the following beneficial effects:
the application provides a method, a device, a medium and electronic equipment for testing communication of a mobile terminal. The method comprises the following steps: in a first working mode, the process receives a first message sent by a sending end process through a mobile communication network; the first message is a message generated according to a first communication protocol; analyzing the first message according to the first communication protocol to acquire a first data body and a plurality of first attribute information, wherein the first attribute information is communication attribute information divided according to a format of the first communication protocol and at least comprises a plurality of first communication characteristic information associated with the process; acquiring second communication characteristic information associated with the first communication characteristic information; and generating a second message according to the first communication protocol, the second communication characteristic information and the first data body, and sending the second message to a receiving terminal process.
In order to test the communication process, the process is arranged between the sending end process and the receiving end process and used as an agent process, the message sent by the sending end process is received and recorded, then the message sent by the sending end process is simulated, a second message is generated, and the second message is sent to the receiving end process. Therefore, the normal operation of communication is ensured, and the efficiency and the effect of testing are also ensured.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
fig. 1 shows a flow chart of a method of testing mobile terminal communications according to an embodiment of the invention;
FIG. 2 illustrates a block diagram of elements of a method of testing communications of a mobile terminal, in accordance with an embodiment of the present invention;
fig. 3 shows a schematic diagram of an electronic device connection structure according to an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. 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 terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the description of the invention and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise, and "the plural" typically includes at least two.
It should be understood that the term "and/or" as used herein is merely one type of association that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
It should be understood that although the terms first, second, third, etc. may be used to describe technical names in embodiments of the present disclosure, the technical names should not be limited to the terms. These terms are only used to distinguish between technical names. For example, a first verification signature may also be referred to as a second verification signature, and similarly, a second verification signature may also be referred to as a first verification signature, without departing from the scope of embodiments of the present disclosure.
The words "if", as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a good 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 good or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another like element in a commodity or device comprising the element.
Alternative embodiments of the present invention are described in detail below with reference to the accompanying drawings.
The first embodiment provided by the present application, that is, an embodiment of a method for testing communication of a mobile terminal.
The present embodiment is described in detail below with reference to fig. 1, where fig. 1 is a flowchart of a method for testing a mobile terminal communication according to the present embodiment.
Step S101, in a first working mode, the process receives a first message sent by a sending end process through a mobile communication network; the first message is a message generated according to a first communication protocol.
The first operating mode may be a Debug mode, that is, a test mode. In the Debug mode, the process related to communication may be run in a running environment specifically set for testing. That is, the process and the sender process both operate in Debug mode. For example, in normal web browsing, a web browser may automatically obtain a plurality of connection paths for acquiring web information, where the connection paths are dynamically generated according to a network condition during connection, and the web browser may select one of the optimal connection paths as a connection path for acquiring the web information this time, so that the connection path is not unique, and in order to ensure that effective test communication information is acquired, a unique connection path is assigned between processes related to communication in a Debug mode.
And the sending end process runs in the mobile terminal. The mobile terminal or called mobile communication terminal refers to a computer device which can be used in moving, and broadly includes a mobile phone, a notebook, a tablet computer, a POS machine and even a vehicle-mounted computer. In a software system, the Mobile terminal must have an operating system, such as Windows Mobile, symbian, palm, android, iOS, and the like. Software developed based on an operating system platform is referred to as an application. An application refers to a computer program for performing one or more specific tasks, which is run in a user mode, which can interact with a user, and which has a visual user interface. The system can be a client or a server.
The Mobile communication network (Mobile Web) refers to a mode that a Mobile terminal is connected to a public network without a fixed device to realize internet access. Web services, such as the world wide Web, WAP, and i-mode, which are primarily browser-based; the receiving end of the mobile network is connected with the server.
A process, in a narrow sense, an instance of an application that is running is referred to as a process. The process is a running activity of a program with certain independent functions for a certain data set.
The process may be executed in the mobile terminal, or may be executed in a client or a server.
The first communication protocol is a common communication protocol, and is a set of communication rules among all devices (network servers, computers, switches, routers, firewalls, and the like) on a network, and specifies the format that information must adopt during communication and the meaning of the formats. There are many protocols in each layer of the network, and the protocols of the receiving and sending parties on the same layer must be identical, otherwise one party will not recognize the information sent by the other party. I.e. the protocol of the network request and the response must be consistent. The network protocols generally include file transfer protocol FTP, electronic mail protocol (SMTP, POP3, IMAP), hypertext transfer protocol HTTP, communication protocol (NetBEUI, IPX/SPX, NWLink, TCP/IP), etc.
In network communication, a message is a carrier of data transmission, and contains data information to be transmitted, and the message transmitted each time is different in length. The network equipment encapsulates the transmission data in the message according to the rules and conventions specified by the communication protocol and sends the transmission data out, the network equipment executes transmission action according to the communication protocol encapsulated in the message, and finally, the message is transmitted to a destination or discarded after timeout. The first message is a message generated according to a first communication protocol.
Typically, a message, includes a header and transmission data. Such as messages generated according to the TCP protocol.
Step S102, analyzing the first message according to the first communication protocol to obtain a first data volume and a plurality of first attribute information, where the first attribute information is communication attribute information divided according to a format of the first communication protocol and at least includes a plurality of first communication feature information associated with the process.
The first message exists in a binary form in the transmission process, so that the transmission data acquired in a packet capturing form is difficult to identify.
In this embodiment, the process is used as a proxy process, and is used as a bridge to connect the sender process and the receiver process. And analyzing the first message according to the first communication protocol, so that the information of the first message which is easy to read and identify can be acquired.
The first data body comprises transmission data in a message. For example, in the messages of the TCP protocol, it refers to transmission data; a request message generated according to the hypertext transfer protocol HTTP, in which data (i.e. transfer data) is requested.
The first attribute information is communication attribute information recorded in a header according to a format of a communication protocol. Typically, a message includes a plurality of communication attribute information. For example: a sending port, a receiving port, a sending end IP address, a receiving end IP address, a check code, a message length, a header length and a user protocol in a TCP protocol, wherein the sending port, the receiving port, the sending end IP address and the receiving end IP address belong to the first communication characteristic information; the first attribute information comprises a request line and a request header, wherein a domain name in the request header belongs to the first communication characteristic information.
After the analyzing the first message according to the first communication protocol to obtain a first data volume and a plurality of first attribute information, the method further comprises:
and step S102-1, storing the first data body and the first attribute information in a first data set.
A data set, also known as a data set, or data set, is a collection of data. Is made up of one or more data tables. Such as a data table in a database.
The first data set belongs to the data set.
The purpose of storing the first data volume and the first attribute information in the first data set is to facilitate browsing test data or analyzing the test data so as to find out problems in data communication in the test data.
After the analyzing the first message according to the first communication protocol to obtain a first data volume and a plurality of first attribute information, the method further comprises:
and S102-11, extracting first user characteristic information from the first data body according to a preset sending end characteristic identification.
For example, the first message is a message generated by a TCP protocol, and the first data volume is obtained after parsing according to the first communication protocol, where the first data volume includes USER login information, for example, the first data volume includes "… … # USER: sa # … …", where a delimiter of each field of "#" may obtain fields "USER: sa" and "USER:" as the preset sending-end feature identifier through "#", and the first USER feature information may be obtained through the preset sending-end feature identifier: "Sa".
And S102-12, storing the first user characteristic information and the first communication characteristic information in a second data set.
The second data set belongs to a data set, e.g. a data table in a database.
For example, continuing the above example, the first message is a message generated by a TCP protocol, and the first communication characteristic information is obtained after parsing, for example, the sending port: 21. receiving port: 22. the IP address of the sending end: 168.177.1.10 and the receiving end IP address: 168.177.2.10, the first user characteristic information: "Sa", transmission port: 21. receiving port: 22. the IP address of the sending end: 168.177.1.10 and the receiving end IP address: 168.177.2.10, saved to said second data set.
The method further comprises the steps of:
and S102-21, in a second working mode, acquiring the first user characteristic information and the first attribute information according to the incidence relation of the first data set and the second data set.
The first data set comprising: the first data volume and the first attribute information. The first attribute information at least includes first communication characteristic information, such as: the first communication characteristic information includes: a sending port, a receiving port, a sending end IP address and a receiving end IP address.
The second data set includes the first user characteristic information and the first communication characteristic information.
The association relationship between the first data set and the second data set, that is, the data information in the first data set and the data information in the second data set are associated together through the common first communication feature information. Thereby acquiring the first user characteristic information and the first attribute information having the common first communication characteristic information.
And S102-22, displaying the first user characteristic information and the first attribute information on a display device according to a preset display format.
Since the first attribute information includes numeric information, which is easily garbled when displayed, it is necessary to convert the numeric information into character string information that is easily recognized and displayed by a user. For example, the transmission port: 21 and receiving port: 22; characters are required to represent the sending port: "21" and the receiving port: "22".
Step S103, acquiring second communication characteristic information associated with the first communication characteristic information.
The first communication characteristic information and the second communication characteristic information have a one-to-one correspondence relationship. The association relationship may be stored in a memory or included in a file.
Preferably, the acquiring the second communication feature information associated with the first communication feature information includes:
and acquiring second communication characteristic information associated with the first communication characteristic information from a preset third data set.
The third data set belongs to a data set, e.g. a data table in a database.
The third data set can simultaneously store a plurality of information of the association relationship, so that when a plurality of sending end processes send messages simultaneously, the process can automatically forward the messages to different receiving end processes.
Step S104, generating a second message according to the first communication protocol, the second communication characteristic information and the first data body, and sending the second message to a receiving end process.
The receiving end process is associated with the second communication characteristic information. The system can be a client or a server. That is, if the sending end is a client, the receiving end is a server; and if the sending end is the server end, the receiving end is the client end.
In this embodiment, the process is used as a proxy process, and is used as a bridge to connect the sending-end process and the receiving-end process together.
That is, during normal communication, the sending end process should be directly connected to the receiving end process for communication. In order to test the communication process, the process is arranged between the sending end process and the receiving end process to serve as an agent process, the message sent by the sending end process is received and recorded, then the message sent by the sending end process is simulated, a second message is generated, and the second message is sent to the receiving end process. Therefore, normal operation of communication is guaranteed, and testing efficiency and testing effect are guaranteed.
In order to improve the testing efficiency and reduce the risk brought by modifying the testing program, the embodiment also provides an embodiment for automatically generating the test case.
Generating a second message according to the first communication protocol, the second communication characteristic information and the first data volume, comprising the following steps:
and step S104-1, acquiring the first data body.
And S104-2, modifying the first data body according to a preset modification rule and generating a second data body.
The preset modification rule is a rule for automatically modifying the message in the communication process.
Preferably, the modifying the first data volume and generating the second data volume according to a preset modification rule includes:
step S104-2-1, first data and first modification data associated with the first data are obtained from the fourth data set.
The fourth data set belongs to a data set, for example, a data table in a database, the data table stores a plurality of data records, and each data record stores first data and first modification data associated with the first data; the first data is the data to be modified in the first data; the first modification data is data to replace the first data in the first data.
And S104-2-2, judging whether the first data body comprises second data matched with the first data or not.
For example, the first data volume is "he has recently acquired urticaria and needs to be treated quickly. "the first data is" hives ", the first modified data is" dysentery ", and there are two of the second data" hives "in the first data volume.
And step S104-2-3, if yes, replacing all the second data in the first data body with the first modified data, and generating a second data body.
For example, continuing with the above example, replacing the second data in the first data volume with the first modified data being "dysentery", the second data volume "he has recently got dysentery and needs to be treated sooner. "
And step S104-3, generating a second message according to the first communication protocol, the second communication characteristic information and the second data body.
The communication process must be based on the communication connection established between the two parties to communicate messages with each other. The embodiment also provides an embodiment for establishing communication connection.
For example, after the first message is analyzed according to the TCP protocol, a first data body including "SYN" information is obtained, which indicates that the sending-end process initiates a request for establishing a network connection to the process.
After the analyzing the first message according to the first communication protocol to obtain a first data volume and a plurality of first attribute information, the method further comprises:
and S102-31, judging whether the first data body comprises preset request connection information.
For example, if the first communication protocol is a TCP protocol, the preset request connection information is "SYN" information; it is determined whether "SYN" information is included in the first data volume.
And S102-32, if yes, establishing a first communication connection with the sending end process according to the first communication protocol.
For example, continuing with the above example, if the first data volume includes "SYN" information, the communication connection between the sending-end process and the local process is established through three-way handshake according to the TCP protocol.
Further, in this embodiment, if the sending end process establishes a communication connection with the receiving end process, a communication connection also needs to be established between the sending end process and the receiving end process.
After the second message is generated according to the first communication protocol, the second communication characteristic information and the first data body and is sent to a receiving end process, the method further comprises the following steps:
and S102-41, establishing a second communication connection with the receiving end process according to the first communication protocol.
For example, continuing with the above example, if the first communication protocol is a TCP protocol, and the first data body includes "SYN" information, thereby generating the second message, sending the second message to the receiving end process, that is, sending a request connection message to the receiving end process, then establishing a communication connection between the process and the receiving end process through three-way handshake according to the TCP protocol.
The purpose is to realize that the process serves as a bridge and realize data communication between the process of the sending end and the process of the receiving end.
The embodiment also provides an embodiment of the pressure test for network communication.
Pressure tests, also known as strength tests, load tests. The method simulates the communication environment of practical application and the system load of a user in the using process, and runs the tested process for a long time or a large load to test the performance, reliability and stability of the tested system.
The method further comprises the following steps:
step S201, in a third working mode, generating a third data volume according to a preset data construction rule.
In the third operating mode, i.e. the pressure test mode.
For example, the preset data construction rule is: starting with the third data volume being 1, the value of the third data volume is increased up to 1000 on condition that the step length is 1.
Step S202, generating a third message according to the first communication protocol, preset third communication characteristic information and the third data body, and sending the third message to the receiving terminal process.
The preset third communication characteristic information can be communication characteristic information which is designated, and the process sends a message generated according to the communication characteristic information and the third data body to a receiving end process; or several pieces of communication characteristic information stored in the data set, and the process sends the message generated according to the several pieces of communication characteristic information and the third data body to a plurality of receiving end processes.
Preferably, the sending the third message to the receiving end process includes:
and sending the third message to the receiving end process according to a preset sending rule.
The preset transmission rule is, for example, the frequency of transmitting messages and/or the number of transmissions.
In this embodiment, in order to test a communication process, the process is set between the sending end process and the receiving end process as an agent process, and receives and records a message sent by the sending end process, and then imitates the message sent by the sending end process, generates a second message, and sends the second message to the receiving end process. Therefore, the normal operation of communication is ensured, and the efficiency and the effect of testing are also ensured.
Corresponding to the first embodiment provided by the present application, the present application also provides a second embodiment, namely, a device for testing mobile terminal communication. Since the second embodiment is basically similar to the first embodiment, the description is simple, and the relevant portions should be referred to the corresponding description of the first embodiment. The device embodiments described below are merely illustrative.
Fig. 2 shows an embodiment of an apparatus for testing communication of a mobile terminal provided in the present application. Fig. 2 is a block diagram of a device for testing mobile terminal communication according to an embodiment of the present disclosure.
Referring to fig. 2, the present application provides an apparatus for testing communication of a mobile terminal, including: analysis section 201, analysis section 202, acquisition section 203, and transmission section 204.
A receiving unit 201, configured to receive, in a first working mode, a first message sent by a sending end process through a mobile communication network; the first message is a message generated according to a first communication protocol;
an analyzing unit 202, configured to analyze the first message according to the first communication protocol to obtain a first data volume and a plurality of first attribute information, where the first attribute information is attribute information divided according to a format of the first communication protocol and at least includes a plurality of first communication feature information associated with the process;
an obtaining unit 203, configured to obtain second communication characteristic information associated with the first communication characteristic information;
a sending unit 204, configured to generate a second message according to the first communication protocol, the second communication feature information, and the first data volume, and send the second message to a receiving process.
The parsing unit 202 further includes:
and the saving first data set subunit is used for saving the first data body and the first attribute information in a first data set.
The parsing unit 202 further includes:
the extracting subunit is used for extracting first user characteristic information from the first data volume according to a preset sending end characteristic identifier;
and the second data set storage subunit is used for storing the first user characteristic information and the first communication characteristic information in a second data set.
The device further comprises:
the association unit is used for acquiring the first user characteristic information and the first attribute information according to the association relation between the first data set and the second data set in a second working mode;
and the display unit is used for displaying the first user characteristic information and the first attribute information on a display device according to a preset display format.
In the acquiring unit 203, the method includes:
and the communication characteristic information acquiring subunit is used for acquiring second communication characteristic information associated with the first communication characteristic information from a preset third data set.
The parsing unit 202 further includes:
a connection request information judging subunit, configured to judge whether the first data volume includes preset connection request information;
and establishing a first communication connection subunit, configured to establish, if the output result of the judgment request connection information subunit is "yes", a first communication connection with the sending end process according to the first communication protocol.
The transmitting unit 204 further includes:
and establishing a second communication connection subunit, configured to establish a second communication connection with the receiving end process according to the first communication protocol.
The transmitting unit 204 includes:
an acquiring data volume subunit, configured to acquire the first data volume;
the data body modification subunit is used for modifying the first data body according to a preset modification rule and generating a second data body;
and the second message generating subunit is configured to generate a second message according to the first communication protocol, the second communication characteristic information, and the second data body.
In the modified data volume subunit, the following are included:
a obtain first modified data subunit operable to obtain first data and first modified data associated with the first data from a fourth data set;
a second data judging subunit, configured to judge whether the first data volume includes second data that matches the first data;
and a second data body generation subunit, configured to replace all the second data in the first data body with the first modified data and generate a second data body if the output result of the second data body judgment subunit is "yes".
The device, still include:
a third data volume generating unit, configured to generate a third data volume according to a preset data construction rule in a third working mode;
and the third message sending unit is used for generating a third message according to the first communication protocol, preset third communication characteristic information and the third data body, and sending the third message to the receiving end process.
In the sending the third message unit, comprising:
and the third message sending subunit is configured to send the third message to the receiving end process according to a preset sending rule.
In this embodiment, in order to test a communication process, the process is set between the sending end process and the receiving end process as an agent process, and receives and records a message sent by the sending end process, and then imitates the message sent by the sending end process, generates a second message, and sends the second message to the receiving end process. Therefore, the normal operation of communication is ensured, and the efficiency and the effect of testing are also ensured.
The third embodiment of the present disclosure provides a computer storage medium for testing communication of a mobile terminal, where the computer storage medium stores computer-executable instructions that can execute the method for testing communication of a mobile terminal according to the first embodiment.
The present embodiment provides a fourth embodiment, that is, an electronic device, configured to test a communication method of a mobile terminal, where the electronic device includes: at least one processor; and a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of testing mobile terminal communications as described in the first embodiment.
Referring to fig. 3, a schematic structural diagram of an electronic device suitable for implementing an embodiment of the disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
Referring to fig. 3, the electronic device may include a processing means (e.g., a central processing unit, a graphic processor, etc.) 401 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 402 or a program loaded from a storage means 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for the operation of the electronic apparatus 4 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
Generally, the following devices may be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 407 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 408 including, for example, tape, hard disk, etc.; and a communication device 409. The communication means 409 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While fig. 3 illustrates an electronic device having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 409, or from the storage device 408, or from the ROM 402. The computer program performs the above-described functions defined in the methods of the embodiments of the present disclosure when executed by the processing device 401.
It should be noted that the computer readable medium of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring at least two internet protocol addresses; sending a node evaluation request comprising the at least two internet protocol addresses to node evaluation equipment, wherein the node evaluation equipment selects the internet protocol addresses from the at least two internet protocol addresses and returns the internet protocol addresses; receiving an internet protocol address returned by the node evaluation equipment; wherein the obtained internet protocol address indicates an edge node in the content distribution network.
Alternatively, the computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving a node evaluation request comprising at least two internet protocol addresses; selecting an internet protocol address from the at least two internet protocol addresses; returning the selected internet protocol address; wherein the received internet protocol address indicates an edge node in the content distribution network.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".
Claims (12)
1. A method for testing communication of a mobile terminal is characterized by comprising the following steps:
in a first working mode, the process receives a first message sent by a sending end process through a mobile communication network; the first message is generated according to a first communication protocol, the first working mode comprises a testing mode, and in the testing mode, a unique connecting path is appointed between processes related to communication;
analyzing the first message according to the first communication protocol to obtain a first data volume and a plurality of first attribute information, wherein the first attribute information is communication attribute information divided according to a format of the first communication protocol and at least comprises a plurality of first communication characteristic information associated with the process, and the first communication characteristic information comprises: a sending port, a receiving port, a sending end IP address and a receiving end IP address;
acquiring second communication characteristic information associated with the first communication characteristic information;
generating a second message according to the first communication protocol, the second communication characteristic information and the first data volume, and sending the second message to a receiving end process; wherein
Generating a second message according to the first communication protocol, the second communication characteristic information and the first data volume, including: acquiring the first data volume; modifying the first data body according to a preset modification rule and generating a second data body; generating a second message according to the first communication protocol, the second communication characteristic information and the second data body;
the modifying the first data body and generating a second data body according to a preset modification rule comprises: obtaining first data and first modified data associated with the first data from a fourth data set; judging whether the first data volume comprises second data matched with the first data or not; if yes, replacing all the second data in the first data body with the first modification data, and generating a second data body.
2. The method of claim 1, wherein after parsing the first message according to the first communication protocol to obtain a first data volume and a plurality of first attribute information, further comprising:
and storing the first data body and the first attribute information in a first data set.
3. The method of claim 2, wherein after parsing the first message according to the first communication protocol to obtain a first data volume and a plurality of first attribute information, further comprising:
extracting first user characteristic information from the first data body according to a preset sending end characteristic identification;
and storing the first user characteristic information and the first communication characteristic information in a second data set.
4. The method of claim 3, further comprising:
under a second working mode, acquiring the first user characteristic information and the first attribute information according to the incidence relation of the first data set and the second data set;
and displaying the first user characteristic information and the first attribute information on a display device according to a preset display format.
5. The method of claim 1, wherein the obtaining the second communication feature information associated with the first communication feature information comprises:
and acquiring second communication characteristic information associated with the first communication characteristic information from a preset third data set.
6. The method of claim 1, wherein after parsing the first message according to the first communication protocol to obtain a first data volume and a plurality of first attribute information, further comprising:
judging whether the first data body comprises preset request connection information or not;
and if so, establishing a first communication connection with the process of the sending end according to the first communication protocol.
7. The method of claim 6, wherein after generating a second message according to the first communication protocol, the second communication characteristic information, and the first data body, and sending the second message to a receiving process, the method further comprises:
and establishing a second communication connection with the receiving end process according to the first communication protocol.
8. The method of claim 1, further comprising:
under a third working mode, generating a third data volume according to a preset data construction rule;
and generating a third message according to the first communication protocol, preset third communication characteristic information and the third data body, and sending the third message to the receiving terminal process.
9. The method of claim 8, wherein the sending the third message to the receiver process comprises:
and sending the third message to the receiving end process according to a preset sending rule.
10. An apparatus for testing communication of a mobile terminal, comprising:
a receiving unit, configured to receive, in a first working mode, a first message sent by a sending end process through a mobile communication network by the process; the first message is generated according to a first communication protocol, the first working mode comprises a testing mode, and in the testing mode, a unique connecting path is appointed between processes related to communication;
an analyzing unit, configured to analyze the first message according to the first communication protocol to obtain a first data volume and a plurality of first attribute information, where the first attribute information is attribute information divided according to a format of the first communication protocol, and at least includes a plurality of first communication feature information associated with the process, and the first communication feature information includes: a sending port, a receiving port, a sending end IP address and a receiving end IP address;
an acquisition unit configured to acquire second communication characteristic information associated with the first communication characteristic information;
a sending unit, configured to generate a second message according to the first communication protocol, the second communication feature information, and the first data volume, and send the second message to a receiving end process; wherein
Generating a second message according to the first communication protocol, the second communication characteristic information and the first data volume, including: acquiring the first data volume; modifying the first data body according to a preset modification rule and generating a second data body; generating a second message according to the first communication protocol, the second communication characteristic information and the second data body;
the modifying the first data body and generating a second data body according to a preset modification rule comprises: obtaining first data and first modified data associated with the first data from a fourth data set; judging whether the first data volume comprises second data matched with the first data or not; if yes, replacing all the second data in the first data body with the first modification data, and generating a second data body.
11. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method according to any one of claims 1 to 9.
12. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to carry out the method of any of claims 1 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910290512.9A CN110120895B (en) | 2019-04-11 | 2019-04-11 | Method, device, medium and electronic equipment for testing communication of mobile terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910290512.9A CN110120895B (en) | 2019-04-11 | 2019-04-11 | Method, device, medium and electronic equipment for testing communication of mobile terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110120895A CN110120895A (en) | 2019-08-13 |
CN110120895B true CN110120895B (en) | 2023-01-17 |
Family
ID=67521025
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910290512.9A Active CN110120895B (en) | 2019-04-11 | 2019-04-11 | Method, device, medium and electronic equipment for testing communication of mobile terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110120895B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113806210B (en) * | 2020-06-16 | 2024-07-26 | 北京字节跳动网络技术有限公司 | Test method, test equipment, test system and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101877728A (en) * | 2010-06-25 | 2010-11-03 | 中兴通讯股份有限公司 | Method and device for converting and forwarding network addresses |
CN102761534A (en) * | 2011-04-29 | 2012-10-31 | 北京瑞星信息技术有限公司 | Method and device for realizing transparent proxy of media access control layer |
CN105656943A (en) * | 2016-03-15 | 2016-06-08 | 上海缔安科技股份有限公司 | Application data interception system and method |
CN105978852A (en) * | 2016-04-14 | 2016-09-28 | 北京北信源软件股份有限公司 | Network equipment access history information determination method, equipment and switch |
CN107278360A (en) * | 2017-06-16 | 2017-10-20 | 唐全德 | A kind of system for realizing network interconnection, method and device |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104243344B (en) * | 2014-10-11 | 2018-06-19 | 网宿科技股份有限公司 | A kind of effective data packets catching method and request Redirect Server |
US11516106B2 (en) * | 2018-06-27 | 2022-11-29 | Intel Corporation | Protocol analyzer for monitoring and debugging high-speed communications links |
CN109150631B (en) * | 2018-10-16 | 2021-10-08 | 湖南中车时代通信信号有限公司 | Rail transit signal system simulation interface management server |
CN109450736B (en) * | 2018-12-11 | 2021-03-30 | 杭州网易再顾科技有限公司 | Network interface test method and device, medium and computing equipment |
-
2019
- 2019-04-11 CN CN201910290512.9A patent/CN110120895B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101877728A (en) * | 2010-06-25 | 2010-11-03 | 中兴通讯股份有限公司 | Method and device for converting and forwarding network addresses |
CN102761534A (en) * | 2011-04-29 | 2012-10-31 | 北京瑞星信息技术有限公司 | Method and device for realizing transparent proxy of media access control layer |
CN105656943A (en) * | 2016-03-15 | 2016-06-08 | 上海缔安科技股份有限公司 | Application data interception system and method |
CN105978852A (en) * | 2016-04-14 | 2016-09-28 | 北京北信源软件股份有限公司 | Network equipment access history information determination method, equipment and switch |
CN107278360A (en) * | 2017-06-16 | 2017-10-20 | 唐全德 | A kind of system for realizing network interconnection, method and device |
Also Published As
Publication number | Publication date |
---|---|
CN110120895A (en) | 2019-08-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107040609B (en) | Network request processing method and device | |
CN112738791B (en) | User information correlation backfill method, device, equipment and medium based on 5G core network | |
US10613717B2 (en) | Reproducing state of source environment when image was screen captured on a different computing device using resource location, resource navigation and positional metadata embedded in image | |
CN111177617A (en) | Web direct operation and maintenance method and device based on operation and maintenance management system and electronic equipment | |
US20140122567A1 (en) | Preemptive framework for accessing short urls | |
CN111447170B (en) | Data processing method and system, computer system and computer readable medium | |
CN104834588B (en) | The method and apparatus for detecting resident formula cross site scripting loophole | |
US12052328B2 (en) | Deriving proxy stability without network inspection | |
CN113923057A (en) | Data processing method and device for satellite measurement, operation and control platform, electronic equipment and medium | |
US8880108B2 (en) | Short message processing method and apparatus | |
CN110120895B (en) | Method, device, medium and electronic equipment for testing communication of mobile terminal | |
CN111767229A (en) | Performance test method, device and equipment | |
CN110764983A (en) | Test method, device, medium and electronic equipment | |
CN110908921A (en) | Game problem positioning method and device, electronic equipment and storage medium | |
CN114071544A (en) | Network testing method and device and electronic equipment | |
CN116633823A (en) | Different-network broadband user identification method, device, equipment and storage medium | |
CN108345508A (en) | Interface calls test method and device | |
WO2023082605A1 (en) | Http message extraction method and apparatus, and medium and device | |
CN116866082A (en) | Cloud network-based security assessment system and method | |
CN116781782A (en) | Request processing method, request processing device, electronic equipment and storage medium | |
CN114285774A (en) | Flow recording method and device, electronic equipment and storage medium | |
CN111382038B (en) | Method, device, electronic equipment and storage medium for reporting service data | |
CN107316377A (en) | A kind of invoice checking method applied based on mobile phone | |
CN115391770A (en) | Program monitoring method, device, electronic equipment and computer readable storage medium | |
CN112749078A (en) | Buried point testing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |