CN110380937B - Network testing method and device applied to electronic equipment - Google Patents

Network testing method and device applied to electronic equipment Download PDF

Info

Publication number
CN110380937B
CN110380937B CN201910670598.8A CN201910670598A CN110380937B CN 110380937 B CN110380937 B CN 110380937B CN 201910670598 A CN201910670598 A CN 201910670598A CN 110380937 B CN110380937 B CN 110380937B
Authority
CN
China
Prior art keywords
network
server
access
electronic device
information
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
CN201910670598.8A
Other languages
Chinese (zh)
Other versions
CN110380937A (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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN201910670598.8A priority Critical patent/CN110380937B/en
Publication of CN110380937A publication Critical patent/CN110380937A/en
Application granted granted Critical
Publication of CN110380937B publication Critical patent/CN110380937B/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
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present disclosure provides a network test method applied to an electronic device, including: acquiring network information for a network of an electronic device; determining connection information between the electronic equipment and the server according to the network information; under the condition that the connection information represents that the electronic equipment is not connected with the server, sending an access request to the server to obtain an access result; and determining the network state of the network according to the access result. The disclosure also provides a network test device applied to the electronic equipment, the electronic equipment and a computer readable storage medium.

Description

Network testing method and device applied to electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a network testing method and apparatus applied to an electronic device, and a computer-readable storage medium.
Background
With the rapid development of electronic technology, various application programs used in electronic devices have been developed in order to provide various functions to users.
In implementing the disclosed concept, the inventors found that there are at least the following problems in the related art: network signals of the mobile terminal are often unstable, and in a weak network environment, a user often cannot normally use functions provided in an application program, so that user experience is poor. In order to determine the network state of the electronic device, the network may be detected in a Ping manner or a long connection heartbeat packet manner. In the conventional Ping mode, there is a security risk when network detection is performed, and therefore, in order to avoid the security risk, the server generally disables Ping, so that the Ping mode cannot effectively determine the network state. In the long connection heartbeat packet mode, because the heartbeat packet is sent to the server periodically, unnecessary performance loss of the server end exists in the network detection process. In addition, the two methods determine the network state according to the detection result only once, so that the problem of poor network jitter resistance is solved.
Disclosure of Invention
In view of the above, the present disclosure provides a network testing method and apparatus applied to an electronic device, which can ensure security without consuming additional performance.
One aspect of the present disclosure provides a network test method applied to an electronic device, including: acquiring network information for a network of an electronic device; determining connection information between the electronic equipment and the server according to the network information; under the condition that the connection information represents that the electronic equipment is not connected with the server, sending an access request to the server to obtain an access result; and determining the network state of the network according to the access result.
According to an embodiment of the present disclosure, the network information includes traffic information and/or a request record; the determining connection information includes: in the case where the traffic information characterizes that the electronic device does not have traffic flow and the request record does not include a record of the request sent to the server, it is determined that the connection information characterizes that the electronic device is not connected to the server.
According to the embodiment of the disclosure, the network state is used for representing whether the network meets the condition; the determining the network status of the electronic device includes: under the condition that the access result represents that the server is not successfully accessed, determining that the network state representation network of the electronic equipment does not meet the condition; and under the condition that the detection result represents that the server is successfully accessed, determining that the network state representation network of the electronic equipment meets the condition.
According to an embodiment of the present disclosure, in a case that it is determined that a network state representation network of an electronic device does not satisfy a condition, the network testing method applied to the electronic device further includes: controlling the electronic equipment to start a reminding function so as to provide prompt information for a user, wherein the prompt information represents that the network does not meet the conditions; under the condition that the network state representation network of the electronic equipment meets the condition, the network testing method applied to the electronic equipment further comprises the following steps: and controlling the electronic equipment to close the reminding function.
According to an embodiment of the present disclosure, the network information includes network change information; the sending the access request to the server includes: and in the case that the network change information represents that the network has jitter, sending the access request to the server after a first preset time period.
According to an embodiment of the present disclosure, the network information includes a request record; the sending the access request to the server includes: sending an access request to a server to obtain a first access result; and under the condition that the first access result represents that the server is not successfully accessed and the request record does not include the record of the request sent to the server in a second preset time period after the access request is sent, resending the access request to obtain a second access result. Wherein the network state of the electronic device is determined according to the first access result and the second access result.
According to an embodiment of the present disclosure, the sending the access request to the server includes: and periodically sending at least two access requests to the server in a third preset time period to obtain at least two access results which are respectively in one-to-one correspondence with the at least two access requests, wherein the network state of the electronic equipment is determined according to the at least two access results.
Another aspect of the present disclosure provides a network test apparatus applied to an electronic device, the apparatus including: the network information acquisition module is used for acquiring network information of a network of the electronic equipment; the connection information determining module is used for determining connection information between the electronic equipment and the server according to the network information; the access request sending module is used for sending an access request to the server to obtain an access result under the condition that the connection information represents that the electronic equipment is not connected with the server; and the network state determining module is used for determining the network state of the network according to the access result.
According to an embodiment of the present disclosure, the network information includes traffic information and/or a request record, and the connection information determining module is configured to: in the case where the traffic information characterizes that the electronic device does not have traffic flow and the request record does not include a record of the request sent to the server, it is determined that the connection information characterizes that the electronic device is not connected to the server.
According to the embodiment of the disclosure, the network state is used for representing whether the network meets the condition; the network state determination module is configured to: under the condition that the access result represents that the server is not successfully accessed, determining that the network state representation network of the electronic equipment does not meet the condition; and under the condition that the detection result represents that the server is successfully accessed, determining that the network state representation network of the electronic equipment meets the condition.
According to an embodiment of the present disclosure, the network testing apparatus applied to the electronic device further includes a function control module, configured to control the electronic device to start a reminding function to provide a user with a prompt message when the network state determination module determines that the network state representation network of the electronic device does not satisfy the condition, where the prompt message represents that the network does not satisfy the condition. Or, the function control module is configured to control the electronic device to close the reminding function when the network state determination module determines that the network state representation network of the electronic device satisfies the condition.
According to an embodiment of the disclosure, the network information includes network change information, and the access request sending module is configured to send the access request to the server after a first predetermined period of time when the network change information indicates that there is jitter in the network.
According to an embodiment of the present disclosure, the network information includes a request record, and the access request sending module is configured to perform the following operations: sending an access request to a server to obtain a first access result; and under the condition that the first access result represents that the server is not successfully accessed and the request record does not include the record of the request sent to the server in a second preset time period after the access request is sent, resending the access request to obtain a second access result. The network state determining module is used for determining the network state of the electronic equipment according to the first access result and the second access result.
According to an embodiment of the present disclosure, the access request sending module is configured to perform the following operations: and periodically sending at least two access requests to the server in a third preset time period to obtain at least two access results which are respectively in one-to-one correspondence with the at least two access requests. The network state determining module is used for determining the network state of the electronic equipment according to the at least two access results.
Another aspect of the present disclosure provides an electronic device including: one or more processors; a memory for storing one or more instructions, wherein the one or more instructions, when executed by the one or more processors, cause the one or more processors to implement the file processing method as described above.
Another aspect of the present disclosure provides a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to implement a file processing method as described above.
Another aspect of the present disclosure provides a computer program comprising computer executable instructions for implementing the file processing method as described above when executed.
According to the embodiment of the present disclosure, an access request is transmitted to a server only in case that it is determined that there is no connection between an electronic device and the server, to determine a network status according to an access result. Compared with the test method for regularly sending the heartbeat packet in the related art, the performance consumption of an additional server side can be avoided; compared with a testing method by a Ping mode, the safety risk can be avoided.
Drawings
Fig. 1 schematically illustrates an application scenario of a network testing method and apparatus applied to an electronic device according to an embodiment of the present disclosure;
fig. 2 schematically shows a flowchart of a network testing method applied to an electronic device according to a first exemplary embodiment of the present disclosure;
fig. 3 schematically shows a flowchart of a network testing method applied to an electronic device according to a second exemplary embodiment of the present disclosure;
fig. 4 schematically shows a flowchart of a network testing method applied to an electronic device according to a third exemplary embodiment of the present disclosure;
fig. 5 schematically shows a flowchart of a network test method applied to an electronic device according to a fourth exemplary embodiment of the present disclosure;
fig. 6 schematically shows a flowchart of a network test method applied to an electronic device according to a fifth exemplary embodiment of the present disclosure;
fig. 7 is a block diagram schematically illustrating a structure of a network test apparatus applied to an electronic device according to an embodiment of the present disclosure; and
fig. 8 schematically shows a block diagram of an electronic device adapted to perform a network test method applied to the electronic device according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a convention analogous to "A, B or at least one of C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B or C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
The embodiment of the disclosure provides a network test method applied to electronic equipment. The method comprises the following steps: acquiring network information for a network of an electronic device; determining connection information between the electronic equipment and the server according to the network information; under the condition that the connection information represents that the electronic equipment is not connected with the server, sending an access request to the server to obtain an access result; and determining the network state of the network according to the access result.
Fig. 1 schematically illustrates an application scenario 100 of the network testing method and apparatus applied to an electronic device according to an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of an application scenario in which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, but does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, an application scenario 100 according to an embodiment of the present disclosure includes terminal devices 101, 102, 103 and a server 104, and the terminal devices 101, 102, 103 and the server 104 are connected in communication through a network 105. The network 105 may include, among other things, various connection types such as wired and/or wireless communication links, and so forth.
The terminal devices 101, 102, 103 may be, for example, web browsing enabled and/or may be installed with various client applications, among others. The terminal devices 101, 102, 103 may for example comprise, but are not limited to, desktop computers, laptop portable computers, tablet computers or smart phones, etc. The terminal devices 101, 102, 103 may be used, for example, to provide various functions to a user in response to user operations.
The server 104 may be a server providing various services, and the server 104 may be, for example, a background management server (for example only) interacting with the terminal devices 101, 102, 103 via the network 105 to provide support for various applications running on the terminal devices 101, 102, 103. The server 104 may transmit various information (e.g., picture information, text information, etc.) to the terminal apparatuses 101, 102, 103, for example, in response to a request transmitted by the terminal apparatuses 101, 102, 103.
When the terminal apparatus 101, 102, 103 runs the application, for example, the network state of the network currently used by the terminal apparatus 101, 102, 103 may be determined according to the access result fed back by the server 104 in response to the access request sent by the application.
It should be noted that the network test method applied to the electronic device provided by the embodiment of the present disclosure may be generally executed by the terminal devices 101, 102, and 103. Accordingly, the network test device applied to the electronic device provided by the embodiment of the present disclosure may be set in the application program installed in the terminal device 101, 102, 103.
It should be understood that the types of terminal devices, networks, network base stations, and servers in fig. 1 are merely illustrative. There may be any type of terminal device, network base station, and server, as desired for implementation.
Fig. 2 schematically shows a flowchart of a network testing method applied to an electronic device according to a first exemplary embodiment of the present disclosure.
As shown in fig. 2, the network testing method applied to the electronic device according to the embodiment of the present disclosure includes operations S210 to S240.
In operation S210, network information for a network of an electronic device is acquired.
According to embodiments of the present disclosure, the network for the electronic device may include, for example, a broadband network (wired broadband or wireless broadband) or a cellular network (e.g., 2G, 3G, 4G, or 5G), etc. The electronic device can interact with the server through the network to acquire audio and video information, text information or picture information from the server.
According to an embodiment of the disclosure, the network information may include, for example, traffic information and a request record of the interaction of the electronic device with the server. The traffic information may include, for example, downlink traffic information and uplink traffic information. The flow information may be obtained by, for example, calling an API (Application Programming Interface) provided by an operating system of the electronic device. The request record may be obtained, for example, by parsing a log (log file) stored in the electronic device.
In operation S220, connection information between the electronic device and the server is determined according to the network information.
According to the embodiment of the disclosure, when the flow information represents that the electronic device has the circulation information at the current moment (for example, the downlink flow is not 0), it is described that the electronic device can normally interact with the server through the application program, so that it is determined that the connection information represents that the electronic device and the server are connectable. The server may be, for example, a server that provides a background service for an application program running on the electronic device.
According to an embodiment of the present disclosure, it is considered that when the traffic information characterizes the electronic device not having the circulation information at the present time, it may be characterized that the electronic device does not request any information at present. Therefore, in order to distinguish the state where information is not requested from the state where information cannot be requested, it is also possible to determine whether there is traffic information by analyzing the request record within a predetermined period (for example, within 10 min) before the current time. For example, in the case that there is a record of the request sent to the server in the request record, it indicates that the current network is available, and the electronic device and the server are connected (for example, it may refer to a connection between the electronic device and the server).
According to the embodiment of the disclosure, when the flow information indicates that the electronic device does not have the circulation information at the current time, and the request record in a predetermined period before the current time does not include the record of the request sent to the server, it is indicated that the electronic device and the server do not interact in the predetermined period, and the electronic device and the server are not connected. In this case, it is necessary to determine whether the current network is normally available by sending an access request to the server. The following operations S230 to S240 are thus performed.
In operation S230, in the case that the connection information indicates that the electronic device is not connected to the server, an access request is sent to the server, and an access result is obtained. In operation S240, a network status of the network is determined according to the access result.
According to an embodiment of the present disclosure, the operation S230 may include, for example: and sending a request for accessing the static resource of the server to the server through an http protocol. Accordingly, the access results obtained may include, for example: accessing to obtain static resources or not accessing to obtain static resources. When the static resource is obtained by access, the server is indicated to be successfully accessed; and when the static resource is obtained without access, the server is represented as being unsuccessfully accessed. Thus, the access result may also be used to characterize whether the server was successfully accessed. Wherein the static resource comprises a resource that the source code does not change in the case of multiple accesses. The static resource may include, for example, a resource such as a picture or text stored in the server.
According to an embodiment of the present disclosure, the network status may be used to characterize whether the network satisfies a condition, for example. The condition may be that the network is in a state capable of normal use. The state that can be used normally refers to a state that a request can be successfully sent through the network, and in order to guarantee that the request is successfully sent, the transmission rate of the network may be greater than a predetermined rate (e.g., 10 bits/s) or the like, for example. Thus, the condition may also be that the transmission rate is greater than the predetermined rate.
The above operation S240 may include, for example: and under the condition that the access result represents that the access server is not successfully accessed, determining that the network state representation network of the electronic equipment does not meet the condition. And under the condition that the detection result represents that the server is successfully accessed, determining that the network state representation network of the electronic equipment meets the condition.
In summary, the network testing method applied to the electronic device according to the embodiment of the present disclosure sends the access request as the test data only when it is determined that the electronic device is not connected to the server, so as to determine the network status according to the access result. Compared with the method for performing network test by adopting a Ping mode or a long connection heartbeat packet mode in the related technology, the method can avoid the safety risk and can avoid the consumption of extra performance of the server side.
According to an embodiment of the present disclosure, in order to avoid an inaccurate test result due to network jitter, the timing of sending the access request in operation S240 may be determined according to change information of the network, for example. Thereby retransmitting the access request in case it is determined that the network is not jittery to improve the test accuracy.
Fig. 3 schematically shows a flowchart of a network testing method applied to an electronic device according to a second exemplary embodiment of the present disclosure.
As shown in fig. 3, operation S230 of sending an access request may be implemented, for example, by operation S330.
In operation S330, in a case that the connection information indicates that the electronic device is not connected to the server and the network change information indicates that the network has jitter, an access request is sent to the server after a first predetermined period of time, and an access result is obtained.
In order to perform the above-described operation S330, when the network information is acquired in operation S210, network change information may also be acquired as the network information. Moreover, in order to accurately determine the sending time of the access request, after the traffic information and the request record are obtained, the network change information of the electronic equipment can be monitored in real time in the process of executing the test method.
According to an embodiment of the present disclosure, the network change information may include, for example, whether jitter exists in the network or not. The network jitter can be obtained by testing the transmission delay time of the test data packet by using an ICMP request response message of a TCP/IP network, for example, if different data packet delay times exist in the transmission process, it indicates that the network has jitter, and the network change information indicates that the network has jitter. Alternatively, the network change information may be obtained by real-time monitoring through an operating system (e.g., an Android system, an iOS system, a Windows system, or a Mac system) of the electronic device.
In case that it is determined that the network change information represents that the network has jitter, in order to avoid inaccurate test results due to the jitter, an access request may be sent to the server after the first predetermined period of time by operation S330. The first predetermined time period can be set according to a network jitter rule to ensure that the current time and the time after the first predetermined time period correspond to different states of network jitter. For example, the network jitter is in a valley state at the current time, and the network jitter is in a non-valley state after a first predetermined period, which may be 5 s. Alternatively, the electronic apparatus may be provided with a port for adjusting the first predetermined period, for example, to adjust the first predetermined period in response to an operation by a user.
In summary, the network testing method applied to the electronic device according to the embodiment of the present disclosure may improve the testing accuracy to a certain extent by setting the delay time for sending the access request under the condition of jitter, and thus improve the user experience.
According to the embodiment of the disclosure, in order to avoid the situation that the test result is inaccurate due to network jitter, for example, in the case of access failure, access retry can be performed after the second predetermined time period. In order to quickly determine the network state, the request record can be monitored in real time before access retry. When determining that the request record exists, determining that the network is normal; in the case where it is determined that there is no request record, a retry policy is executed to perform an access retry.
Fig. 4 schematically shows a flowchart of a network testing method applied to an electronic device according to a third exemplary embodiment of the present disclosure.
As shown in fig. 4, operation S230 of transmitting an access request may be implemented by, for example, operations S431 to S432. Accordingly, operation S240 of determining the network status may be implemented through operation S440.
In operation S431, in the case that the connection information indicates that the electronic device is not connected to the server, an access request is sent to the server, resulting in a first access result. In operation S432, in case that the first access result indicates that the server is not successfully accessed and the request record does not include a record of the request sent to the server within a second predetermined time period after the access request is sent, the access request is resent, resulting in a second access result.
According to an embodiment of the present disclosure, a method of sending the access request in operation S431 is similar to the method of sending the access request in operation S230 described in fig. 2, and is not described herein again.
According to an embodiment of the present disclosure, after acquiring a request record within a predetermined period of time before the current time by operation S210, for example, an access record generated in real time may also be acquired. Operation S432 may include, for example: and under the condition that the first access result represents that the server is not successfully accessed, determining whether the access records generated in real time include the record of sending the request to the server in a second preset time period after the access request is sent. If the current network exists, the current network can enable the electronic equipment to interact with the server, so that the current network can be determined to meet the conditions. If not, there may be two cases, one is that the electronic device and the server do not interact in the second predetermined period of time, and the other is that the electronic device and the server cannot interact in the second predetermined period of time. To determine whether the current network enables the electronic device to interact with the server, the access request may be sent again to probe for a second access result.
According to an embodiment of the present disclosure, the second predetermined period of time may be set according to a network jitter rule, for example, to ensure that the current time and the time after the second predetermined period of time correspond to different states of the network jitter, respectively. For example, the network jitter is in a valley state at the current time, and the network jitter is in a peak state after a second predetermined period of time, which may be, for example, 3s or the like. According to an embodiment of the present disclosure, the electronic apparatus may be provided with, for example, a port for setting the second predetermined period to set the second predetermined period in response to a user operation.
After the second access result is obtained, the network status may be determined through operation S440. In operation S440, a network status of the electronic device is determined according to the first access result and the second access result. The operation S440 may include, for example: in the case that the first access result represents unsuccessful access to the server and the second access result represents successful access to the server, it is indicated that the first access request is an access failure due to network jitter. In this case, the network is normally usable, thereby determining that the network satisfies the condition. And under the condition that the first access result and the second access result both represent that the server is not successfully accessed, determining that the network has no jitter, and the current network state is not good and does not meet the condition.
In summary, the embodiment of the present disclosure can effectively avoid the situation of inaccurate test caused by network jitter by performing access retry. Therefore, the test accuracy is improved, and the user experience is improved.
According to the embodiment of the disclosure, in order to avoid the situation that the test result is inaccurate due to the network jitter, for example, the access request can be sent for multiple times within a third predetermined time period (for example, 10s), and the network jitter situation and the situation that the network does not meet the condition are distinguished according to the obtained multiple access results.
Fig. 5 schematically shows a flowchart of a network testing method applied to an electronic device according to a fourth exemplary embodiment of the present disclosure.
As shown in fig. 5, operation S230 of sending an access request may be implemented, for example, by operation S530. Accordingly, operation S240 of determining the network status may be implemented, for example, by operation S540.
In operation S530, in a case that the connection information indicates that the electronic device is not connected to the server, at least two access requests are periodically sent to the server within a third predetermined time period, and at least two access results are obtained, wherein the at least two access results are respectively in one-to-one correspondence with the at least two access requests. In operation S540, a network status of the electronic device is determined according to the at least two access results.
According to an embodiment of the present disclosure, the third predetermined period of time may be determined according to a network jitter rule, so as to ensure that the third predetermined period of time has both a period of time corresponding to a peak segment of the network jitter and a period of time corresponding to a valley segment of the network jitter. The electronic device may be provided with a port for setting the third predetermined period, for example, to set the third predetermined period in response to a user operation. The period for sending at least two access requests may be set according to actual requirements, and for example, the period may be 1 s.
According to an embodiment of the present disclosure, operation S540 may include, for example: and in the case that the at least two access results have the access result which is used for representing the successful access to the server, the network is normal or the network is jittered. And in the case that each access result in the at least two access results represents unsuccessful access to the server, indicating that the network does not satisfy the condition.
In summary, the embodiment of the present disclosure determines the network status by periodically sending the access request and integrating a plurality of access results, so as to effectively avoid the situation of inaccurate test caused by network jitter. Therefore, the test accuracy is improved, the network jitter resistance effect of the test method is improved, and the user experience is improved.
According to the embodiment of the disclosure, when the network state is determined not to meet the condition, the user can timely know the network state to timely adjust the network for the electronic device. The embodiment of the disclosure can also control the electronic device to prompt the user in time when the network state is determined not to meet the condition.
Fig. 6 schematically shows a flowchart of a network testing method applied to an electronic device according to a fifth exemplary embodiment of the present disclosure.
As shown in fig. 6, the network test method applied to the electronic device according to the embodiment of the present disclosure may further include operation S650 in addition to operation S210 to operation S240. This operation S650 may be merged into the same operation as operation S240, for example.
In operation S650, it is determined whether the network status indicates that the network satisfies a condition.
Under the condition that the network state representation network does not meet the conditions, the electronic equipment can be controlled to remind the user that the network cannot meet the conditions in time. Therefore, as shown in fig. 6, the network testing method according to the embodiment of the present disclosure may further include an operation S660 of controlling the electronic device to start a reminding function, so as to provide a prompt message to the user.
According to the embodiment of the disclosure, the prompt information may be, for example, text information, audio information, or any other information, and the prompt information may be used to characterize that the network does not satisfy the condition. According to the embodiment of the disclosure, the type of the prompt message may be set according to the user requirement, for example. The prompt message may also be, for example, a text message sent to a communication client account registered by the user, and the disclosure does not limit this.
In order to avoid waste of unnecessary resources caused by the electronic device turning on the reminding function under the condition that the network state representation network satisfies the condition, as shown in fig. 6, the network testing method according to the embodiment of the disclosure may further include operation S670 of controlling the electronic device to turn off the reminding function. Therefore, when the network state represents that the network meets the conditions, the prompt information cannot be sent to the user, and the user does not need to pay attention to the state.
In summary, according to the embodiment of the disclosure, by controlling the switch of the reminding function of the electronic device, the user can be prompted in time under the condition that the network does not meet the condition (for example, the network signal is weak), so that the user can adjust the network in time, and the user experience is improved.
Fig. 7 schematically shows a block diagram of a network test apparatus applied to an electronic device according to an embodiment of the present disclosure.
As shown in fig. 7, the network test apparatus 700 applied to the electronic device according to the embodiment of the present disclosure includes a network information obtaining module 710, a connection information determining module 720, an access request sending module 730, and a network status determining module 740.
The network information acquiring module 710 is used to acquire network information for a network of the electronic device (operation S210).
The connection information determining module 720 is configured to determine connection information between the electronic device and the server according to the network information (operation S220).
The access request sending module 730 is configured to send an access request to the server to obtain an access result when the connection information indicates that the electronic device and the server are not connected (operation S230).
The network status determining module 740 is configured to determine a network status of the network according to the access result (operation S240).
According to an embodiment of the present disclosure, the network information includes traffic information and/or a request record, and the connection information determining module 720 may be configured to: in the case where the traffic information characterizes that the electronic device does not have traffic flow and the request record does not include a record of the request sent to the server, it is determined that the connection information characterizes that the electronic device is not connected to the server.
According to the embodiment of the disclosure, the network state is used for representing whether the network meets the condition. The network status determination module 740 may be configured to: under the condition that the access result represents that the server is not successfully accessed, determining that the network state representation network of the electronic equipment does not meet the condition; and under the condition that the detection result represents that the server is successfully accessed, determining that the network state representation network of the electronic equipment meets the condition.
According to an embodiment of the present disclosure, as shown in fig. 7, the network testing apparatus 700 applied to the electronic device further includes a function control module 750, configured to control the electronic device to start a prompt function to provide a user with prompt information when the network state determining module 740 determines that the network state of the electronic device indicates that the network does not satisfy the condition (operation S660). Alternatively, the function control module 750 is configured to control the electronic device to turn off the reminding function if the network status determination module 740 determines that the network status of the electronic device indicates that the network meets the condition (operation S670).
According to an embodiment of the present disclosure, the network information includes network change information, and the access request sending module 730 is configured to send the access request to the server after a first predetermined period of time if the connection information indicates that the electronic device and the server are not connected and the network change information indicates that network jitter exists (operation S330).
According to an embodiment of the present disclosure, the network information includes a request record, and the access request sending module 730 is configured to perform the following operations: sending an access request to the server, obtaining a first access result (operation S431); in a case where the first access result indicates that the server is not successfully accessed and the request record does not include a record of the request transmitted to the server within a second predetermined period after the transmission of the access request, the access request is retransmitted, resulting in a second access result (operation S432). The network status determining module 740 is configured to determine a network status of the electronic device according to the first access result and the second access result (operation S440).
According to an embodiment of the present disclosure, the access request sending module 730 is configured to perform the following operations: periodically transmitting at least two access requests to the server for a third predetermined period of time, resulting in at least two access results that respectively correspond one-to-one to the at least two access requests (operation S530). The network status determining module 740 is configured to determine a network status of the electronic device according to the at least two access results (operation S540).
Any number of modules, sub-modules, units, sub-units, or at least part of the functionality of any number thereof according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in any other reasonable manner of hardware or firmware by integrating or packaging a circuit, or in any one of or a suitable combination of software, hardware, and firmware implementations. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the disclosure may be at least partially implemented as a computer program module, which when executed may perform the corresponding functions.
For example, any plurality of the network information acquisition module 710, the connection information determination module 720, the access request transmission module 730, the network status determination module 740, and the function control module 750 may be combined in one module/unit/sub-unit to be implemented, or any one of the modules/units/sub-units may be split into a plurality of modules/units/sub-units. Alternatively, at least part of the functionality of one or more of these modules/units/sub-units may be combined with at least part of the functionality of other modules/units/sub-units and implemented in one module/unit/sub-unit. According to an embodiment of the present disclosure, at least one of the network information obtaining module 710, the connection information determining module 720, the access request sending module 730, the network status determining module 740, and the function control module 750 may be at least partially implemented as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or implemented by any one of three implementations of software, hardware, and firmware, or by a suitable combination of any several of them. Alternatively, at least one of the network information acquisition module 710, the connection information determination module 720, the access request transmission module 730, the network status determination module 740, and the function control module 750 may be at least partially implemented as a computer program module that, when executed, may perform a corresponding function.
Fig. 8 schematically shows a block diagram of an electronic device adapted to perform a network test method applied to the electronic device according to an embodiment of the present disclosure. The electronic device shown in fig. 8 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.
As shown in fig. 8, an electronic device 800 according to an embodiment of the present disclosure includes a processor 801 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. The processor 801 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 801 may also include onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flows according to embodiments of the present disclosure.
In the RAM 803, various programs and data necessary for the operation of the electronic apparatus 800 are stored. The processor 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. The processor 801 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 802 and/or RAM 803. Note that the programs may also be stored in one or more memories other than the ROM 802 and RAM 803. The processor 801 may also perform various operations of method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
Electronic device 800 may also include input/output (I/O) interface 805, input/output (I/O) interface 805 also connected to bus 804, according to an embodiment of the present disclosure. Electronic device 800 may also include one or more of the following components connected to I/O interface 805: an input portion 806 including a keyboard, a mouse, and the like; an output section 807 including a signal such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 808 including a hard disk and the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. A drive 810 is also connected to the I/O interface 805 as necessary. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as necessary, so that a computer program read out therefrom is mounted on the storage section 808 as necessary.
According to embodiments of the present disclosure, method flows according to embodiments of the present disclosure 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 storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 809 and/or installed from the removable medium 811. The computer program, when executed by the processor 801, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples may include, but are not limited to: 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), 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.
For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM 802 and/or RAM 803 described above and/or one or more memories other than the ROM 802 and RAM 803.
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 or flowchart illustration, and combinations of blocks in the block diagrams 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.
It will be appreciated by those skilled in the art that the foregoing describes embodiments of the disclosure. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (8)

1. A network test method applied to electronic equipment comprises the following steps:
acquiring network information of a network for the electronic equipment, wherein the network information comprises network change information or request records;
determining connection information between the electronic equipment and a server according to the network information;
under the condition that the connection information represents that the electronic equipment is not connected with the server, sending an access request to the server to obtain an access result; and
determining the network state of the network according to the access result;
wherein, in a case that the network information includes network change information, the sending an access request to the server includes: under the condition that the network change information represents that the network has jitter, sending the access request to the server after a first preset time period;
or, in a case that the network information includes a request record, the sending the access request to the server includes:
sending an access request to the server to obtain a first access result;
resending the access request to obtain a second access result if the first access result indicates that the server is not successfully accessed and the request record does not include a record of requests sent to the server within a second predetermined period of time after the access request is sent,
wherein the network status of the electronic device is determined according to the first access result and the second access result.
2. The method of claim 1, wherein the network information comprises traffic information and a request record; determining the connection information comprises:
determining that the connection information characterizes no connection between the electronic device and the server if the traffic information characterizes that the electronic device does not have traffic and the request record does not include a record of a request sent to the server.
3. The method of claim 1, wherein the network status is used to characterize whether the network satisfies a condition; determining the network status of the electronic device comprises:
determining that the network state of the electronic device characterizes that the network does not satisfy a condition if the access result characterizes that the server is not successfully accessed;
and determining that the network state of the electronic equipment represents that the network meets the condition under the condition that the access result represents that the server is successfully accessed.
4. The method of claim 3, wherein:
in an instance in which it is determined that the network state of the electronic device characterizes that the network does not satisfy a condition, the method further comprises: controlling the electronic equipment to start a reminding function so as to provide prompt information for a user, wherein the prompt information represents that the network does not meet the conditions;
in an instance in which it is determined that the network state of the electronic device characterizes that the network satisfies a condition, the method further includes: and controlling the electronic equipment to close the reminding function.
5. The method of claim 1, wherein sending an access request to the server comprises:
periodically sending at least two access requests to the server within a third predetermined period of time, obtaining at least two access results respectively corresponding to the at least two access requests one to one,
wherein the network status of the electronic device is determined according to the at least two access results.
6. A network test device applied to electronic equipment comprises:
a network information acquisition module for acquiring network information of a network for the electronic device;
the connection information determining module is used for determining the connection information between the electronic equipment and the server according to the network information;
the access request sending module is used for sending an access request to the server to obtain an access result under the condition that the connection information represents that the electronic equipment is not connected with the server; and
the network state determining module is used for determining the network state of the network according to the access result;
the access request sending module is used for sending an access request to the server after a first preset time period when the connection information represents that the electronic equipment is not connected with the server and the network change information represents that the network has jitter;
the network information includes a request record, and the access request sending module is configured to perform the following operations:
sending an access request to the server to obtain a first access result;
resending the access request to obtain a second access result if the first access result indicates that the server is not successfully accessed and the request record does not include a record of requests sent to the server within a second predetermined period of time after the access request is sent,
wherein the network status of the electronic device is determined according to the first access result and the second access result.
7. An electronic device, comprising:
one or more processors; and
a storage device for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-5.
8. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to carry out the method of any one of claims 1 to 5.
CN201910670598.8A 2019-07-23 2019-07-23 Network testing method and device applied to electronic equipment Active CN110380937B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910670598.8A CN110380937B (en) 2019-07-23 2019-07-23 Network testing method and device applied to electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910670598.8A CN110380937B (en) 2019-07-23 2019-07-23 Network testing method and device applied to electronic equipment

Publications (2)

Publication Number Publication Date
CN110380937A CN110380937A (en) 2019-10-25
CN110380937B true CN110380937B (en) 2021-08-31

Family

ID=68255548

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910670598.8A Active CN110380937B (en) 2019-07-23 2019-07-23 Network testing method and device applied to electronic equipment

Country Status (1)

Country Link
CN (1) CN110380937B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104601412A (en) * 2015-02-12 2015-05-06 中国工商银行股份有限公司 Independent test network system and establishing method thereof
CN107181624A (en) * 2017-06-30 2017-09-19 联想(北京)有限公司 A kind of method for connecting network, electronic equipment and computer-readable storage medium
CN107580336A (en) * 2017-10-30 2018-01-12 努比亚技术有限公司 A kind of method for connecting network, terminal and computer-readable recording medium
CN108064071A (en) * 2018-02-13 2018-05-22 广东欧珀移动通信有限公司 Method for connecting network, device, storage medium and electronic equipment
CN108934056A (en) * 2018-06-20 2018-12-04 联想(北京)有限公司 The control method and system of electronic equipment
CN108965042A (en) * 2018-05-31 2018-12-07 Oppo广东移动通信有限公司 Acquisition methods, device, terminal device and the storage medium of network delay

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030054811A1 (en) * 2001-09-18 2003-03-20 Willtech International, Inc. Method and apparatus for automatic call tests in wireless networks
US20080077686A1 (en) * 2006-09-26 2008-03-27 Dinesh Kumar Subhraveti System and Method for Replication of Network State for Transparent Recovery of Network Connections
WO2008099403A2 (en) * 2007-02-16 2008-08-21 Forescout Technologies A method and device for determining network device status
JP5157668B2 (en) * 2008-06-19 2013-03-06 富士通株式会社 Communication apparatus and communication method
US8351358B2 (en) * 2009-05-27 2013-01-08 Venturi Wireless, Inc. Channel state transition optimization
CN104301235B (en) * 2013-07-18 2018-10-02 腾讯科技(深圳)有限公司 The control method and device of network flow
CN106304136B (en) * 2015-05-27 2020-06-30 阿里巴巴集团控股有限公司 Method, system, controller and simulated mobile equipment for acquiring network state information
CN105263175A (en) * 2015-10-29 2016-01-20 华为技术有限公司 Networking method for intelligent equipment, intelligent equipment and mobile terminal
CN106385517A (en) * 2016-08-31 2017-02-08 广州视源电子科技股份有限公司 Audio frequency conversation realization method and system, and intelligent conference device
CN106453907A (en) * 2016-10-19 2017-02-22 广东欧珀移动通信有限公司 Control method and device for terminal application
CN107463437B (en) * 2017-07-31 2020-01-31 Oppo广东移动通信有限公司 Application control method and device, storage medium and electronic equipment
CN108280024B (en) * 2017-12-29 2021-06-22 五八有限公司 Flow distribution strategy testing method and device and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104601412A (en) * 2015-02-12 2015-05-06 中国工商银行股份有限公司 Independent test network system and establishing method thereof
CN107181624A (en) * 2017-06-30 2017-09-19 联想(北京)有限公司 A kind of method for connecting network, electronic equipment and computer-readable storage medium
CN107580336A (en) * 2017-10-30 2018-01-12 努比亚技术有限公司 A kind of method for connecting network, terminal and computer-readable recording medium
CN108064071A (en) * 2018-02-13 2018-05-22 广东欧珀移动通信有限公司 Method for connecting network, device, storage medium and electronic equipment
CN108965042A (en) * 2018-05-31 2018-12-07 Oppo广东移动通信有限公司 Acquisition methods, device, terminal device and the storage medium of network delay
CN108934056A (en) * 2018-06-20 2018-12-04 联想(北京)有限公司 The control method and system of electronic equipment

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Bridging the Social and Wireless Networking Divide: Information Dissemination in Integrated Cellular and Opportunistic Networks;Jie Hu;《IEEE Access》;20150915;第3卷;全文 *
基于正常简档聚类的自适应异常检测技术研究;李斌;《中国优秀硕士学位论文全文数据库信息科技辑》;20100415(第4期);全文 *
网络信息主动探测技术的研究与实现;张涛等;《计算机工程与应用》;20060701(第31期);全文 *

Also Published As

Publication number Publication date
CN110380937A (en) 2019-10-25

Similar Documents

Publication Publication Date Title
JP7280380B2 (en) Method and apparatus for determining analytics on terminal behavior
US7921215B2 (en) Method and apparatus for optimizing and prioritizing the creation of a large number of VPN tunnels
US9769012B2 (en) Notification normalization
US11200086B1 (en) Asynchronous transactions reported as critical path
CN111694674B (en) Message distribution processing method, device, equipment and storage medium
US9942305B2 (en) Method and apparatus for resource downloading over a network from multiple sources
US20150227412A1 (en) Server performance correction using remote server actions
US11316930B2 (en) Connection control method and device
CN110661673A (en) Heartbeat detection method and device
KR102362262B1 (en) Electronic apparatus for verifying code and method thereof
CN110380937B (en) Network testing method and device applied to electronic equipment
EP3806403A1 (en) Apparatus and method for managing message transmission delay
CN108804152B (en) Method and device for adjusting configuration parameters
JP2014041404A (en) Terminal service monitoring device
CN115934378A (en) Service data processing method and device, electronic equipment and storage medium
CN113411228B (en) Network condition determining method and server
CN114244700A (en) Port processing method and device, electronic equipment and computer readable storage medium
CN108934056B (en) Control method and system of electronic equipment
US9467897B2 (en) Method and system for managing a temporary block flow in a data communication network environment
CN113839828A (en) Network quality detection method, device, terminal equipment and medium
CN111278047A (en) Method, system, electronic device and medium for processing CSI of non-serving cell
RU2608881C2 (en) Method and system for controlling turbo mode
US20220182409A1 (en) Concealed monitor communications from a task in a trusted execution environment
US11176011B2 (en) Apparatus and method for transmitting fuzzing data for one-way protocol software fuzzing
US11165870B2 (en) Connection control 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