CN111585841A - Automatic test method and related device - Google Patents

Automatic test method and related device Download PDF

Info

Publication number
CN111585841A
CN111585841A CN202010359733.XA CN202010359733A CN111585841A CN 111585841 A CN111585841 A CN 111585841A CN 202010359733 A CN202010359733 A CN 202010359733A CN 111585841 A CN111585841 A CN 111585841A
Authority
CN
China
Prior art keywords
test
electronic device
electronic equipment
related data
module
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.)
Granted
Application number
CN202010359733.XA
Other languages
Chinese (zh)
Other versions
CN111585841B (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.)
Shenzhen Launch Technology Co Ltd
Original Assignee
Shenzhen Launch Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Launch Technology Co Ltd filed Critical Shenzhen Launch Technology Co Ltd
Priority to CN202010359733.XA priority Critical patent/CN111585841B/en
Publication of CN111585841A publication Critical patent/CN111585841A/en
Application granted granted Critical
Publication of CN111585841B publication Critical patent/CN111585841B/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/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application discloses an automatic detection method, which is applied to electronic equipment, wherein the electronic equipment comprises a networking module, and the method comprises the following steps: s1: after receiving an automatic test instruction, powering on the networking module; s2: repeatedly testing the network condition of the electronic equipment, and recording test related data of each test; s3: restarting the electronic equipment until the test related data under the current test meets a first preset condition; S1-S3 are repeatedly executed. Therefore, when the networking module of the electronic equipment is tested, testers do not need to check or test manually at regular time, and only need to analyze the data recorded by the automatic test after the test is finished to know the problems occurring in the test.

Description

Automatic test method and related device
Technical Field
The present application relates to the field of communications technologies, and in particular, to an automatic test method and a related apparatus.
Background
With the explosion of the internet +, the object connection is also called the third wave of the development of the world information industry after the computer and the internet, in which case the reliability of the networking module is very important, and the networking module is a module that can be integrated into the target electronic system, and the networking is referred to as connecting to the network. Stability is the most important indicator of a networked module, and means that the module should maintain a normal working state during any normal use (e.g., long-term use, large data communication, various temperature conditions). In many cases, data is forwarded from a serial port to a network and from the network to the serial port at the same time, and the length of data forwarded at one time may be unknown, which requires that the networking module has a full-duplex and uninterrupted forwarding function. However, in actual design, due to design defects, sometimes the networking module cannot be networked after being restarted with a low probability, which affects the stability of the system, so that the electronic device cannot work normally and meet customer requirements.
Disclosure of Invention
The embodiment of the application provides an automatic detection method and a related device, which aim to automatically detect the networking performance of a networking module of electronic equipment.
In a first aspect, an embodiment of the present application provides an automatic detection method, which is applied to an electronic device, where the electronic device includes a networking module, and the method includes:
s1: after receiving an automatic test instruction, powering on the networking module;
s2: repeatedly testing the network condition of the electronic equipment, and recording test related data of each test;
s3: restarting the electronic equipment until the test related data under the current test meets a first preset condition;
S1-S3 are repeatedly executed.
With reference to the first aspect of the present application, in a possible implementation manner of the first aspect of the present application, the test-related data includes a test time, and the first preset condition includes: in the same repeated test, the difference value between the test time of the current test and the test time of the first test is a preset time interval.
With reference to the first aspect of the present application, in a possible implementation manner of the first aspect of the present application, the test-related data includes a test result of each test, and the first preset condition includes: and in the same repeated test, the passing times of the test are more than the preset times.
With reference to the first aspect of the present application, in a possible implementation manner of the first aspect of the present application, the test-related data includes a test result of each test, and before the restarting of the electronic device, the method further includes: calculating the probability of passing the test in the repeated test according to the test result; and judging whether the networking function of the networking module is reliable or not according to the probability that the test passes.
With reference to the first aspect of the present application, in a possible implementation manner of the first aspect of the present application, the test-related data further includes a factor that affects a test failure, and before the restarting the electronic device, the method further includes: and determining whether to restart the electronic equipment immediately according to factors influencing the test failure in the repeated test process.
With reference to the first aspect of the present application, in a possible implementation manner of the first aspect of the present application, the determining whether to restart the electronic device immediately according to a factor that affects a test failure in the retest process includes: classifying the factors which do not pass the influence test to obtain a plurality of factor groups; if the number of the factors in any one of the factor groups is larger than a preset threshold value, reserving a test interface and stopping the automatic test until an instruction for restarting the electronic equipment is received; and if the number of the factors in each factor group in the factor groups is not more than the preset threshold value, immediately restarting the electronic equipment.
With reference to the first aspect of the present application, in a possible implementation manner of the first aspect of the present application, the repeatedly testing the network condition of the electronic device includes: generating different test commands according to the network diagnostic tool, wherein the different test commands refer to different destination addresses accessed according to the different test commands; the different test commands are executed alternately.
With reference to the first aspect of the present application, in a possible implementation manner of the first aspect of the present application, after the networking module is powered on, a preset time is delayed, and then the retest is performed on the electronic device.
In a second aspect, an embodiment of the present application provides an automatic detection apparatus, which is applied to an electronic device, where the electronic device includes a networking module, and the apparatus includes:
the receiving instruction module is used for receiving an automatic test instruction and then powering on the networking module;
the repeated testing module is used for repeatedly testing the network condition of the electronic equipment and recording the testing result of each test;
and the restarting module is used for restarting the electronic equipment after the test result under the current test meets a first preset condition.
With reference to the second aspect of the present application, in a possible implementation manner of the second aspect of the present application, the test-related data includes a test time, and the first preset condition includes: in the same repeated test, the difference value between the test time of the current test and the test time of the first test is a preset time interval.
With reference to the second aspect of the present application, in a possible implementation manner of the second aspect of the present application, the test-related data includes a test result of each test, and the first preset condition includes: and in the same repeated test, the passing times of the test are more than the preset times.
With reference to the second aspect of the present application, in a possible implementation manner of the second aspect of the present application, the test-related data includes a test result of each test, and before the restarting of the electronic device, the method further includes: calculating the probability of passing the test in the repeated test according to the test result; and judging whether the networking function of the networking module is reliable or not according to the probability that the test passes.
With reference to the second aspect of the present application, in a possible implementation manner of the second aspect of the present application, the test-related data further includes a factor that affects a test failure, and before the restarting the electronic device, the method further includes: and determining whether to restart the electronic equipment immediately according to factors influencing the test failure in the repeated test process.
With reference to the second aspect of the present application, in a possible implementation manner of the second aspect of the present application, the determining whether to restart the electronic device immediately according to the factor that affects the test failure in the repeated test process includes: classifying the factors which do not pass the influence test to obtain a plurality of factor groups; if the number of the factors in any one of the factor groups is larger than a preset threshold value, reserving a test interface and stopping the automatic test until an instruction for restarting the electronic equipment is received; and if the number of the factors in each factor group in the factor groups is not more than the preset threshold value, immediately restarting the electronic equipment.
With reference to the second aspect of the present application, in a possible implementation manner of the second aspect of the present application, the repeatedly testing the network condition of the electronic device includes: generating different test commands according to the network diagnostic tool, wherein the different test commands refer to different destination addresses accessed according to the different test commands; the different test commands are executed alternately.
With reference to the second aspect of the present application, in a possible implementation manner of the second aspect of the present application, after the networking module is powered on, the electronic device is repeatedly tested after a preset time is delayed.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing steps in any method of the first aspect of the embodiment of the present application.
In a fourth aspect, the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange, where the computer program makes a computer perform part or all of the steps described in any one of the methods of the first aspect of the present application.
In a fifth aspect, the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform some or all of the steps as described in any one of the methods of the first aspect of the embodiments of the present application. The computer program product may be a software installation package.
It can be seen that, in the embodiment of the present application, first, the electronic device powers on the networking module after receiving the automatic test instruction, then, the network status of the electronic device is repeatedly tested, and test-related data of each test is recorded until the test-related data under the current test meets a first preset condition, the electronic device is restarted, and finally, the above steps are repeatedly executed until the automatic test is ended after a second preset condition is met. When testing the networking module of electronic equipment like this, the tester need not regularly to look over or carry out artifical test, only need carry out the analysis according to the data of automatic test record after the test just can know the problem that appears when testing, and the automatic switching on and shutting down test that goes on can realize the test of long-time high strength, improves efficiency of software testing.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic diagram of an automatic detection system provided by an embodiment of the present application;
fig. 2a is a schematic flow chart of an automatic detection method according to an embodiment of the present application;
fig. 2b is a schematic view of a detection interface of an automatic detection method according to an embodiment of the present disclosure;
fig. 3 is a block diagram illustrating functional units of an automatic detection apparatus according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some embodiments of the present invention, but not all 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 terms "first," "second," and the like in the description and claims of the present application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The networking module is a general name of a module associated with network communication, and comprises a 3G module, a 4G module, a 5G module, a wi-fi connection module and the like, for example, the 4G module refers to a general name of a product with high integration modularization of software and hardware, the hardware integrates radio frequency and baseband on a printed circuit board to complete wireless receiving, transmitting and baseband signal processing functions, and the software supports functions of voice dialing, short message receiving and sending, dialing networking and the like.
At present, when testing personnel are used for detecting the reliability of the networking performance of the networking module of the electronic equipment, the testing personnel are required to manually carry out the startup and shutdown test and carry out long-term manual observation, so that the test of a plurality of times for a long time is difficult to carry out, the problem of low probability is difficult to measure, and certain transient networking failure conditions are easy to leak in the long-term test process.
In view of the foregoing problems, embodiments of the present application provide an automatic testing method and a related apparatus, and the following describes embodiments of the present application with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a schematic view of an automatic detection system provided in an embodiment of the present application, where the automatic detection system includes an electronic device and a plurality of website servers, the electronic device includes a networking module, the networking module is used for functions such as dial-up networking of the electronic device, and when performing automatic detection, the networking module may access the website servers according to a network detection tool, and determine networking reliability of the networking module according to an obtained access feedback result, where the website servers are generally large servers in stable operation.
Referring to fig. 2a, fig. 2a is a schematic flow chart of an automatic detection method according to an embodiment of the present application, and as shown in the figure, the automatic detection method includes the following steps.
S1: and powering on the networking module after receiving the automatic test instruction.
The step of powering on the networking module means that the networking module in the electronic device is powered on after the electronic device is started, and the automatic test instruction is used for testing the networking stability of the networking module, so that when the networking module is powered on, the problems of power-on time sequence, power supply current and the like need to be noticed, and the influence of external factors on the networking performance of the networking module is avoided.
S2: and repeatedly testing the network condition of the electronic equipment, and recording test related data of each test.
Wherein, when the electronic equipment is repeatedly tested, the network detection tool can be used for testing the network condition of the electronic equipment, for example, an Internet Packet explorer (ping), which is a program for testing a network connection amount, is used to test a network connection status of a current electronic device according to the execution of a ping command, when executing the ping command, the ping command may be executed to a local Internet Protocol (IP) address, or may be executed to other IP in a local area network, a gateway IP, a remote IP, or a certain domain name executes the ping command, if the ping is successful, the test result of this time can be considered as the test passing, the data fed back after the ping command is executed and the related data during the test can be recorded in a log together, the test trace is reserved, and the follow-up technical personnel can conveniently check and solve the problems. The test related data includes test time, test times, test results, test feedback information, signal strength, Subscriber Identity Module (SIM) card status, network injection status, and the like during each test, and the recording of the test related data during each test means that the recording of the test related data during each test is required to record the related data existing during the execution of the test instruction and the related data obtained after the execution of the test instruction. The network test tool may also be a network Information statistics (netstat) command, where the netstat is a program that accesses a network connection state and related Information thereof in the kernel, and may also be a Domain Information searcher (dig), and the like.
Before the network condition of the electronic device is repeatedly tested, a period of time for power-on reset of the networking module needs to be reserved in advance, and the power-on reset can enable the system to enter an initial state so as to receive various instructions to work at any time, that is, after the networking module is powered on, a period of time needs to be delayed and then the testing is performed, and the length of the time can be determined according to the situation and can be generally 60 seconds.
The retest is that the network condition of the electronic device is tested once every other period of time under the condition that the electronic device is not turned off or restarted, for example, the electronic device is tested once every 10 seconds, when the retest is performed, the used test tools are the same, but the executed test commands can be different, for example, in the retest, ping commands are executed for different domain names, and the retest is that the tests performed by the electronic device are counted as a retest in the period of time after the networking module is powered on and until the electronic device is turned off or restarted.
S3: and restarting the electronic equipment until the test related data under the current test meets a first preset condition.
The condition for ending the repeated test once is that the test-related data meets a first preset condition, where the first preset condition may be embodied from the test result, or may be an objective external condition, for example, the number of tests reaches a certain number, or the test time reaches a certain value, or a certain data in the test-related data reaches a predetermined requirement or number, and the first preset condition may be determined according to a specific requirement or according to a test focus determined when the electronic device is tested.
The method for restarting the electronic equipment comprises the steps that the electronic equipment firstly sends a restart command to the micro control unit, then the micro control unit pulls the power key to shut down, the networking module is powered off after a certain time delay, then the electronic equipment is powered on again after a certain time delay, and then the power key is pulled to start up after a certain time delay. The time delay operation in the steps can provide sufficient reaction time for the electronic equipment, and the strict shutdown time sequence can also avoid the loss of the networking module program during shutdown and the influence on the normal work of the electronic equipment after startup.
S1-S3 are repeatedly executed.
The repeatedly executing S1-S3 means that after the electronic device is restarted, the electronic device receives the automatic test instruction again, powers on the networking module, repeatedly tests the network status of the electronic device, records test related data of each test until the test related data under the current test meet a first preset condition, ends the repeated tests, returns to restart the electronic device, and repeatedly executes the process without stop until the second preset condition is met. The repeated execution of S1-S3 may be finished after a second preset condition is met, and the step is continued to be repeated, which is equivalent to directly finishing the entire automatic test after the second preset condition is met, where the second preset condition may be directly receiving a stop instruction, that is, manually determining that the automatic test is finished, or the total duration of the automatic test reaches a certain condition, or the total number of times of the automatic test reaches a preset number of times, or the probability that the total test passes reaches a preset value, and the like, and the second preset condition may be set according to specific requirements or requirements of technicians, and the like, and the present application does not limit this.
It can be seen that, in this example, the electronic device powers on the networking module after receiving the automatic test instruction, then repeatedly tests the network status of the electronic device, records test-related data of each test until the test-related data under the current test meets a first preset condition, restarts the electronic device, and finally repeatedly executes the above steps. When testing the networking module of electronic equipment like this, the tester need not regularly to look over, only need carry out the analysis according to the data of automatic test record after the test just can know the problem that appears when testing, and the automatic switching on and shutting down test that goes on can realize the test of long-time high strength, improves efficiency of software testing.
In one possible example, the test-related data includes a test time, and the first preset condition includes: in the same repeated test, the difference value between the test time of the current test and the test time of the first test is a preset time interval.
The test time refers to a test time point of each test, for example, if the test time point of the current test is 10 points in beijing 56 minutes 25 seconds, the time point is the test time of the current test, and the preset time period is a time interval, for example, one hour. Therefore, if the difference between the current test time point and the test time point at the first test time, which is the first test in a repeat test, is one hour, it means that the first preset condition is satisfied.
It can be seen that, in this example, the first preset condition is set such that the difference between the test time of the current test and the test time of the first test is a preset time period, the test progress can be directly controlled in time, and the test result is analyzed according to the time parameter, so that the burden of the technician is reduced, and the analysis efficiency of the test result is improved.
In one possible example, the test-related data includes a test result of each test, and the first preset condition includes: and in the same repeated test, the passing times of the test are more than the preset times.
The test result means whether the test is passed or not when the network detection tool is used for testing, the test passing means that the network connection is normal, the electronic equipment can normally access other websites according to the networking module, the test result of each test can be recorded in an accumulated mode when the test related data are recorded, the times of passing and/or failing of the test in one repeated test are counted, and whether the repeated test is to be ended or not is determined according to the counted test result. Therefore, the first preset condition may also be a test failing the test, a total number of tests in one repeated test, and the like.
It can be seen that, in this example, the first preset condition is set to that, in the same repeated test, the number of times of passing the test is greater than the preset number of times, and the test is stopped when the number of times of passing the test reaches a certain number, so that accidental events can be avoided, such as the reason of the non-electronic device itself, the network disconnection in a certain time period, and the like, that affect the test result.
In one possible example, the test-related data includes a test result of each test, and before the restarting the electronic device, the method further includes: calculating the probability of passing the test in the repeated test according to the test result; and judging whether the networking function of the networking module is reliable or not according to the probability that the test passes.
The probability of passing the test may be a calculated probability of passing the test within a certain period of time, or a probability of passing the test in one repeated test, or a probability of passing the test in a certain number of tests, or the like. The judging whether the networking function of the networking module is reliable according to the probability that the test passes includes: and setting a preset probability, judging whether the probability of passing the test in one repeated test is greater than the preset probability, if so, determining that the networking function of the networking module is reliable, otherwise, determining that the networking module is unreliable. The determining whether the networking function of the networking module is reliable according to the probability that the test passes may further include: setting a preset probability, respectively calculating the passing probability of the tests in a plurality of repeated tests, averaging a plurality of probabilities to obtain an average probability, judging whether the average probability is greater than the preset probability, if so, the networking function of the networking module is reliable, otherwise, the networking module is unreliable. For example, the preset probability is 95%, and it is determined from the record that 360 tests are performed in an hour of the current one-time repeated test, wherein 350 tests are passed, and the calculated probability of passing the test is greater than 95%, so that it can be determined that the networking function of the current networking module is reliable.
Therefore, in the embodiment, whether the networking function of the networking module is reliable or not is judged according to the probability that the test passes, so that the test result can be intuitively known, the analysis time of technicians is saved, and the test efficiency is improved.
In one possible example, the test-related data further includes a factor affecting a test failure, and after the end of the repeated test and before the restarting of the electronic device, the method further includes: and determining whether to restart the electronic equipment immediately according to factors influencing the test failure in the repeated test process.
If the network state of the ping test is utilized, the factors influencing the test failure comprise that when a network detection tool is utilized to send data to a target website, the opposite website refuses to accept the data packet to cause the data packet loss, or the opposite side is provided with a firewall, the opposite side host computer does not exist or does not establish connection with the opposite side, and the reasons that the IP address cannot be analyzed because the opposite side host computer is not connected to a Domain Name System (DNS) server, or the IP address does not exist. When the test is carried out, the factors which influence the test failure can be fed back to the electronic equipment, and the factors are recorded so as to judge whether the electronic equipment needs to be restarted immediately after the repeated test is finished or not in the following process.
For example, as shown in fig. 2b, fig. 2b is a schematic view of a detection interface of an automatic detection method according to an embodiment of the present application, in a repeated test, an electronic device first executes a test command, and received feedback information includes the number of data packets sent by the electronic device, the number and the number of lost data packets received by an opposite website, and the longest time duration, the shortest time duration, and the average time duration used for data round trip, and it can be determined that a test result in the test is passed. It can be seen that, due to the repeated testing, after the result of the first testing is obtained, the electronic device performs the next testing, and then the received feedback information indicates that the host cannot be found, and it is obvious that the testing result of this time is that the testing fails, and the factor influencing the failure of the testing is that the host cannot be found.
When the condition of whether the electronic device is restarted immediately is determined, whether the electronic device needs to be restarted immediately can be determined by judging one of the recorded test related parameters, for example, the test related parameters include the time length used by each test, and if a certain number of the used time lengths are greater than a preset value, the electronic device can also be determined not to be restarted immediately.
Therefore, in the embodiment, whether the electronic equipment is restarted immediately or not is determined according to the factors influencing the test failure, the electronic equipment can be tested automatically more flexibly, and technicians can conveniently and accurately solve the problems in the test process in time.
In one possible example, the determining whether to restart the electronic device immediately according to the factors affecting the test failure in the repeated test process includes: classifying the factors which do not pass the influence test to obtain a plurality of factor groups; if the number of the factors in any one of the factor groups is larger than a preset threshold value, reserving a test interface and stopping the automatic test until an instruction for restarting the electronic equipment is received; and if the number of the factors in each factor group in the factor groups is not more than the preset threshold value, immediately restarting the electronic equipment.
The method comprises the steps that a plurality of factors influencing the failure of the test may exist in one repeated test, or only one factor influencing the failure of the test may exist, so that a plurality of factor groups may exist, or only one factor group may exist, when a plurality of factor groups exist, the number included in each factor group is determined, if the number of the factor groups is larger than a preset threshold value, the process of the automatic test is ended firstly, the factor groups stay in a test interface, a test site is reserved, the automatic test can be resumed after waiting for a certain time or after being confirmed by a technician, a restart instruction is received again, and if the number is not larger than the preset threshold value, the electronic equipment can be restarted immediately, so that the repeated test can be performed on the electronic equipment again. The method can also be characterized in that a plurality of factors which need special attention and influence the test failure are determined in advance, the factors which need special attention and influence the test failure are matched in the factor groups, if the matching is successful, whether the number of any factor group in the factor groups which are successfully matched is larger than a preset threshold value or not is determined, if the number of any factor group in the factor groups which are successfully matched is larger than the preset threshold value, the test interface is reserved, the automatic test is stopped, and otherwise, the electronic equipment is restarted immediately.
The factors affecting the test failure may be a problem at one end of a website server, for example, during the test, the number of users accessing the same website is too large, or may be a problem of the electronic device itself, for example, before the test, the power-on reset time of a networking module is not enough, or the power supply current is not enough, or may be a problem of a software flow, for example, when the system service is not started, dialing is performed, or the like.
In this example, if the number of any one of the factor groups is greater than the preset threshold, the test interface is retained and the automatic test is stopped until an instruction for restarting the electronic device is received, so that a specific problem can occur in the test process, or when some problems occur very frequently, a field can be retained first when the problems occur, and technicians can conveniently check the problems in time.
In one possible example, the repeatedly testing the network condition of the electronic device includes: generating different test commands according to the network diagnostic tool, wherein the different test commands refer to different destination addresses accessed according to the different test commands; the different test commands are executed alternately.
The network diagnostic tools may be ping, dig, netstat, etc., and in the same repeated test, at least two test commands are generated according to one of the network diagnostic tools, and the test commands are executed alternately during the repeated test, so that the continuously executed test commands are different, for example, ping is used during the test, and the generated test commands may be ping www.A.com and ping www.B.com, and the two commands need to be executed alternately during the repeated test.
Therefore, in this example, in a repeated test, the test command is executed alternately, so that the test result is prevented from being influenced by the situation of test failure caused by the problem of address access.
In a possible example, after the networking module is powered on, the electronic device is delayed for a preset time and then is subjected to the repeated test.
The repeated test of the electronic equipment is carried out after a period of preset time is delayed, on one hand, sufficient time is reserved for power-on reset, on the other hand, system service of the electronic equipment can be ensured to be started, and the situation that the networking module cannot be networked after being restarted due to the problem of the process is prevented.
Therefore, in the embodiment, the repeated test of the electronic equipment is carried out after a preset time is delayed, so that the influence on the networking reliability of the electronic equipment and the influence on the automatic test result due to some unnecessary internal factors can be avoided.
Referring to fig. 3, in accordance with the embodiment shown in fig. 2a, fig. 3 is a block diagram of functional units of an automatic detection apparatus provided in an embodiment of the present application, where the automatic detection apparatus 300 is applied to an electronic device, the electronic device includes a networking module, and the automatic detection apparatus 300 includes:
a receiving instruction module 310, configured to receive an automatic test instruction and then power on the networking module;
the repeated testing module 320 is configured to perform repeated testing on the network condition of the electronic device, and record a testing result of each test;
the restarting module 330 is configured to restart the electronic device after a test result under the current test meets a first preset condition.
It can be seen that, in this embodiment of the application, first, the request module 310 of the electronic device powers on the networking module after receiving the automatic test instruction, then the repeated test module 320 performs repeated tests on the network status of the electronic device, and records test related data of each test, then the restart module 330 restarts the electronic device after the test result under the current test meets a first preset condition, and finally, the above steps are repeatedly executed. When testing the networking module of electronic equipment like this, the tester need not regularly to look over, only need carry out the analysis according to the data of automatic test record after the test just can know the problem that appears when testing, and the automatic switching on and shutting down test that goes on can realize the test of long-time high strength, improves efficiency of software testing.
In one possible example, the test-related data includes a test time, and the first preset condition includes: in the same repeated test, the difference value between the test time of the current test and the test time of the first test is a preset time interval.
In one possible example, the test-related data includes a test result of each test, and the first preset condition includes: and in the same repeated test, the passing times of the test are more than the preset times.
In a possible example, the test-related data includes a test result of each test, and before the electronic device is restarted, the automatic detection apparatus 300 further includes a function determination module, configured to calculate, according to the test result, a probability that the test in the repeated test passes; and judging whether the networking function of the networking module is reliable or not according to the probability that the test passes.
In a possible example, the test-related data further includes a factor that affects the test failure, and after the repeated test is completed and before the electronic device is restarted, the automatic detection apparatus 300 further includes a restart determining module, which is configured to determine whether to restart the electronic device immediately according to the factor that affects the test failure in the repeated test process.
In one possible example, in the aspect of determining whether to restart the electronic device immediately according to the factor that does not pass the impact test in the repeated test process, the automatic detection apparatus 300 further includes a classification module, configured to classify the factor that does not pass the impact test to obtain a plurality of factor groups; if the number of the factors in any one of the factor groups is larger than a preset threshold value, reserving a test interface and stopping the automatic test until an instruction for restarting the electronic equipment is received; and if the number of the factors in each factor group in the factor groups is not more than the preset threshold value, immediately restarting the electronic equipment.
In a possible example, in the aspect of the repeated testing of the network condition of the electronic device, the automatic detection apparatus 300 further includes a command generation module, where the command generation module is configured to generate different test commands according to a network diagnostic tool, where the different test commands refer to different destination addresses accessed according to the different test commands; the different test commands are executed alternately.
In a possible example, after the networking module is powered on, the automatic detection apparatus 300 further includes a delay module, where the delay module is configured to delay a preset time period and then perform the retest on the electronic device.
In the present embodiment, the automatic detection apparatus 300 is presented in the form of a module. A "module" herein may refer to an application-specific integrated circuit (ASIC), a processor and memory that execute one or more software or firmware programs, an integrated logic circuit, and/or other devices that may provide the described functionality.
It can be understood that, since the method embodiment and the apparatus embodiment are different presentation forms of the same technical concept, the content of the method embodiment portion in the present application should be synchronously adapted to the apparatus embodiment portion, and is not described herein again.
Referring to fig. 4, in accordance with the embodiment shown in fig. 2a, fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application, and as shown in the drawing, the electronic device 400 includes a processor 410, a memory 420, a communication interface 430, and one or more programs 421, where the one or more programs 421 are stored in the memory 420 and configured to be executed by the processor 410, and the one or more programs 421 include instructions for executing any step in the foregoing method embodiment.
The communication unit is used for supporting the communication between the electronic equipment and other equipment. The terminal may further include a storage unit for storing program codes and data of the terminal.
The processing Unit may be a Processor 410 or a controller, such as a Central Processing Unit (CPU), a general purpose Processor, a Digital Signal Processor (DSP), an Application-Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs, and microprocessors, among others. The communication unit may be the communication interface 430, the transceiver, the transceiving circuit, etc., and the storage unit may be the memory 420.
In a specific implementation, the processor 410 is configured to perform any one of the steps performed by the electronic device in the above method embodiments, and when performing data transmission, such as sending, the communication interface 430 is optionally invoked to complete the corresponding operation. The details will be described below.
In one possible example, the instructions in the program 421 are to perform the following operations: s1: after receiving an automatic test instruction, powering on the networking module; s2: repeatedly testing the network condition of the electronic equipment, and recording test related data of each test; s3: restarting the electronic equipment until the test related data under the current test meets a first preset condition; S1-S3 are repeatedly executed.
In one possible example, the test-related data includes a test time, and the first preset condition includes: in the same repeated test, the difference value between the test time of the current test and the test time of the first test is a preset time interval.
In one possible example, the test-related data includes a test result of each test, and the first preset condition includes: and in the same repeated test, the passing times of the test are more than the preset times.
In one possible example, the test-related data includes a test result of each test, and before the electronic device is restarted, the instructions in the program 421 are used to perform the following operations: calculating the probability of passing the test in the repeated test according to the test result; and judging whether the networking function of the networking module is reliable or not according to the probability that the test passes.
In one possible example, the test-related data further includes factors that affect test failures, and after the end of the retest and before the reboot of the electronic device, the instructions in the program 421 are configured to: and determining whether to restart the electronic equipment immediately according to factors influencing the test failure in the repeated test process.
In one possible example, in the determining whether to restart the electronic device immediately according to the factors affecting the test failure in the retest process, the instructions in the program 421 are for: classifying the factors which do not pass the influence test to obtain a plurality of factor groups; if the number of the factors in any one of the factor groups is larger than a preset threshold value, reserving a test interface and stopping the automatic test until an instruction for restarting the electronic equipment is received; and if the number of the factors in each factor group in the factor groups is not more than the preset threshold value, immediately restarting the electronic equipment.
In one possible example, in the retest of network conditions of the electronic device, the instructions in the program 421 are to: generating different test commands according to the network diagnostic tool, wherein the different test commands refer to different destination addresses accessed according to the different test commands; the different test commands are executed alternately.
In one possible example, after the networking module is powered on, the instructions in the program 421 are used to: and delaying a preset time period and then carrying out the repeated test on the electronic equipment.
The above description has introduced the solution of the embodiment of the present application mainly from the perspective of the method-side implementation process. It is understood that the electronic device comprises corresponding hardware structures and/or software elements for performing the respective functions in order to implement the above-described functions. Those of skill in the art will readily appreciate that the present application is capable of being implemented in hardware or a combination of hardware and computer software to describe the various steps in connection with the embodiments presented herein. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, the electronic device may be divided into the functional units according to the method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. It should be noted that, in the embodiment of the present application, the division of the module is schematic, and is only one logic function division, and there may be another division manner in actual implementation.
Embodiments of the present application also provide a computer storage medium, where the computer storage medium stores a computer program for electronic data exchange, the computer program enabling a computer to execute part or all of the steps of any one of the methods described in the above method embodiments, and the computer includes an electronic device.
Embodiments of the present application also provide a computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods as described in the above method embodiments. The computer program product may be a software installation package, the computer comprising an electronic device.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the above-described division of the units is only one type of division of logical functions, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some interfaces, devices or units, and may be an electric or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit may be stored in a computer readable memory if it is implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a memory, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the above-mentioned method of the embodiments of the present application. And the aforementioned memory comprises: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable memory, which may include: flash Memory disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The foregoing detailed description of the embodiments of the present application has been presented to illustrate the principles and implementations of the present application, and the above description of the embodiments is only provided to help understand the method and the core concept of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. An automatic test method applied to an electronic device, wherein the electronic device comprises a networking module, the method comprising:
s1: after receiving an automatic test instruction, powering on the networking module;
s2: repeatedly testing the network condition of the electronic equipment, and recording test related data of each test;
s3: restarting the electronic equipment until the test related data under the current test meets a first preset condition;
S1-S3 are repeatedly executed.
2. The method according to claim 1, wherein the test-related data comprises a test time, and the first preset condition comprises: in the same repeated test, the difference value between the test time of the current test and the test time of the first test is a preset time interval.
3. The method of claim 1, wherein the test-related data includes a test result of each test, and the first preset condition includes: and in the same repeated test, the passing times of the test are more than the preset times.
4. The method according to any of claims 1-3, wherein said test related data comprises test results of said each test, and wherein before said restarting said electronic device, said method further comprises:
calculating the probability of passing the test in the repeated test according to the test result;
and judging whether the networking function of the networking module is reliable or not according to the probability that the test passes.
5. The method of claim 4, wherein the test-related data further includes factors that affect a test failure, and wherein prior to the restarting the electronic device, the method further comprises:
and determining whether to restart the electronic equipment immediately according to factors influencing the test failure in the repeated test process.
6. The method of claim 5, wherein the determining whether to restart the electronic device immediately according to the factors affecting the test failure in the repeated test process comprises:
classifying the factors which do not pass the influence test to obtain a plurality of factor groups;
if the number of the factors in any one of the factor groups is larger than a preset threshold value, reserving a test interface and stopping the automatic test until an instruction for restarting the electronic equipment is received;
and if the number of the factors in each factor group in the factor groups is not more than the preset threshold value, immediately restarting the electronic equipment.
7. The method of claim 5, wherein the retesting of the network condition of the electronic device comprises:
generating different test commands according to the network diagnostic tool, wherein the different test commands refer to different destination addresses accessed according to the different test commands;
the different test commands are executed alternately.
8. The method of claim 5, wherein the retesting of the electronic device is delayed for a predetermined period of time after the networking module is powered on.
9. An automatic test device, applied to an electronic device including a networking module, the device comprising:
the receiving instruction module is used for receiving an automatic test instruction and then powering on the networking module;
the repeated testing module is used for repeatedly testing the network condition of the electronic equipment and recording the testing result of each test;
and the restarting module is used for restarting the electronic equipment after the test result under the current test meets a first preset condition.
10. An electronic device comprising a processor, a memory, a communication interface, and one or more programs stored in the memory and configured to be executed by the processor, the programs comprising instructions for performing the steps in the method of any of claims 1-8.
CN202010359733.XA 2020-04-29 2020-04-29 Automatic test method and related device Active CN111585841B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010359733.XA CN111585841B (en) 2020-04-29 2020-04-29 Automatic test method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010359733.XA CN111585841B (en) 2020-04-29 2020-04-29 Automatic test method and related device

Publications (2)

Publication Number Publication Date
CN111585841A true CN111585841A (en) 2020-08-25
CN111585841B CN111585841B (en) 2022-01-07

Family

ID=72116878

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010359733.XA Active CN111585841B (en) 2020-04-29 2020-04-29 Automatic test method and related device

Country Status (1)

Country Link
CN (1) CN111585841B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112433894A (en) * 2020-10-27 2021-03-02 深圳市紫光同创电子有限公司 FPGA test method and test system
CN113472607A (en) * 2021-06-29 2021-10-01 未鲲(上海)科技服务有限公司 Application program network environment detection method, device, equipment and storage medium
CN116614675A (en) * 2023-07-19 2023-08-18 深圳市华曦达科技股份有限公司 Wi-Fi (wireless fidelity) back connection automatic detection method and system for smart television box and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109257249A (en) * 2018-08-20 2019-01-22 郑州云海信息技术有限公司 A kind of network interface card stability test method, apparatus, terminal and storage medium
CN109274555A (en) * 2018-10-11 2019-01-25 深圳市菲菱科思通信技术股份有限公司 Interchanger automatic test device and test method
US20190215383A1 (en) * 2016-09-14 2019-07-11 Microsoft Technology Licensing, Llc Iot hardware certification
CN110324195A (en) * 2018-03-30 2019-10-11 维沃移动通信有限公司 A kind of method of reseptance, sending method and communication equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190215383A1 (en) * 2016-09-14 2019-07-11 Microsoft Technology Licensing, Llc Iot hardware certification
CN110324195A (en) * 2018-03-30 2019-10-11 维沃移动通信有限公司 A kind of method of reseptance, sending method and communication equipment
CN109257249A (en) * 2018-08-20 2019-01-22 郑州云海信息技术有限公司 A kind of network interface card stability test method, apparatus, terminal and storage medium
CN109274555A (en) * 2018-10-11 2019-01-25 深圳市菲菱科思通信技术股份有限公司 Interchanger automatic test device and test method

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112433894A (en) * 2020-10-27 2021-03-02 深圳市紫光同创电子有限公司 FPGA test method and test system
CN113472607A (en) * 2021-06-29 2021-10-01 未鲲(上海)科技服务有限公司 Application program network environment detection method, device, equipment and storage medium
CN113472607B (en) * 2021-06-29 2023-05-02 未鲲(上海)科技服务有限公司 Application program network environment detection method, device, equipment and storage medium
CN116614675A (en) * 2023-07-19 2023-08-18 深圳市华曦达科技股份有限公司 Wi-Fi (wireless fidelity) back connection automatic detection method and system for smart television box and readable storage medium
CN116614675B (en) * 2023-07-19 2023-12-22 深圳市华曦达科技股份有限公司 Wi-Fi (wireless fidelity) back connection automatic detection method and system for smart television box and readable storage medium

Also Published As

Publication number Publication date
CN111585841B (en) 2022-01-07

Similar Documents

Publication Publication Date Title
CN111585841B (en) Automatic test method and related device
CN110719199B (en) Network automatic testing and fault positioning method and device
CN109510742B (en) Server network card remote test method, device, terminal and storage medium
CN113472607B (en) Application program network environment detection method, device, equipment and storage medium
CN110830332B (en) Test method, test device and computer readable storage medium
CN109714209A (en) A kind of diagnostic method and system of website visiting failure
CN111611021A (en) Log data transmission method and device, computer equipment and storage medium
CN106897219B (en) Method and device for testing stability of mobile terminal system
CN111786854B (en) Network card testing method and device, electronic equipment and readable storage medium
CN107193699A (en) One kind tests the wide time-delay method of HCA cassette tapes automatically by RDMA modes
CN110719359A (en) Terminal performance test method and system
CN105743707A (en) Method for testing BMC log analyzing function based on Redhat system
WO2016082543A1 (en) Device testing method and testing device
CN112787889B (en) Switch cold start testing method, system and medium
CN109150587B (en) Maintenance method and device
CN107426755B (en) Base station problem troubleshooting method and device, computer readable storage medium and computer equipment
CN110784364B (en) Data monitoring method and device, storage medium and terminal
CN110134558B (en) Method and device for detecting server
CN111866921A (en) Method, device and equipment for searching service fault of 5G base station and storage medium
CN113687992A (en) Onboard equipment power-on and power-off test method
CN113038499B (en) Terminal Wi-Fi compatibility testing method, device, system, equipment and medium
CN113687993A (en) Onboard equipment power-on and power-off test system
CN110581786A (en) Method, device, system and medium for testing communication stability of NCSI (network communication service) network
CN110995495A (en) Network fault detection method and device, electronic equipment and storage medium
CN112329021A (en) Method and device for checking application bugs, electronic device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant