Network equipment testing method, terminal simulator and computer program product
By reading the configuration file to generate a sequence of virtual terminals and behavioral instructions, the simulated terminal equipment sends network service requests to network devices, solving the problem that the prior art is difficult to comprehensively test multiple terminal equipment in complex network environments, and implementing a flexible and scalable network device testing method.
Patent Information
- Application Number
- CN202411931557.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-03-28
AI Technical Summary
The prior art is difficult to comprehensively test the high concurrency and different behaviors of multiple terminal devices in complex network environments, and lacks flexibility and scalability.
By reading the preset configuration files, a virtual terminal and corresponding behavioral instruction sequence is generated, the simulated terminal device sends a network service request to the network device to be tested, and the response result is obtained. This method supports multiple terminal device types and behavior simulations, and has good scalability.
It realizes testing to simulate high concurrency and multiple different behaviors of multiple terminal devices in complex network environments, with good flexibility and scalability, and can adapt to new device types and network behaviors that may appear in the future.
Smart Images

Figure CN119728508A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network technology, and in particular to a network device testing method, a terminal simulator, and a computer program product. Background Art
[0002] With the rapid development of network technology, the access and management of various terminal devices have become increasingly complex. In order to facilitate the testing, debugging and management of network devices, it is necessary to provide a method that can simulate the behavior of terminal devices in the network and a corresponding terminal simulator to verify the correctness of the network configuration of the network device, ensure that the terminal device can normally access network resources, resolve DNS normally, pass portal authentication, and upload or download files normally through FTP. Summary of the invention
[0003] One or more embodiments of the present specification provide a network device testing method, including: reading a pre-set configuration file; generating one or more virtual terminals based on terminal data provided by the configuration file; generating a behavior instruction sequence corresponding to the virtual terminal based on behavior data provided by the configuration file; executing behavior instructions in the behavior instruction sequence corresponding to the one or more virtual terminals to simulate the one or more virtual terminals sending a network service request to the network device under test; and obtaining a response result of the network device under test to the network service request of the virtual terminal.
[0004] According to the network device testing method provided by some embodiments of the present specification, the terminal data includes type data of the virtual terminal and quantity data of the virtual terminals corresponding to the type data of the virtual terminal.
[0005] According to the network device testing method provided by some embodiments of the present specification, generating one or more virtual terminals based on the terminal data provided by the configuration file includes: generating one or more virtual terminals whose types and quantities match the type data and the quantity data respectively.
[0006] According to the network device testing method provided in some embodiments of the present specification, the number of the configuration files is one or more; the generating of one or more virtual terminals based on the terminal data provided by the configuration files includes: generating one or more virtual terminal sets based on the one or more configuration files; the virtual terminal set includes one or more virtual terminals whose types and quantities respectively match the type data and the quantity data of the corresponding configuration files; the virtual terminal behavior instruction sequence in the same virtual terminal set is generated based on the behavior data in the corresponding configuration files.
[0007] According to the network device testing method provided in some embodiments of the present specification, the behavior data includes behavior execution count data and behavior execution logic data; the generation of a behavior instruction sequence corresponding to the virtual terminal based on the behavior data provided by the configuration file includes: combining behavior instructions based on the behavior execution count data and the behavior execution logic data to obtain the behavior instruction sequence.
[0008] According to the network device testing method provided in some embodiments of this specification, the behavior instruction includes an instruction to call a behavior module; the behavior module includes one or more of a DNS resolution module, a web access module, a portal authentication module, and an FTP upload and download module.
[0009] According to the network device testing method provided in some embodiments of the present specification, the executing of the behavioral instructions in the behavioral instruction sequence corresponding to the one or more virtual terminals to simulate the one or more virtual terminals sending a network service request to the network device under test includes: based on the behavioral instructions in the behavioral instruction sequence corresponding to the one or more virtual terminals, simulating the one or more virtual terminals sending a first network service request to the network device under test respectively; upon receiving a response result corresponding to the behavioral instruction returned by the network device under test, executing the next behavioral instruction in the behavioral instruction sequence of the virtual terminal to which the behavioral instruction belongs to simulate the virtual terminal sending a second network service request to the network device under test.
[0010] According to the network device testing method provided in some embodiments of the present specification, the behavior instructions in the behavior instruction sequence corresponding to the one or more virtual terminals are used to simulate the one or more virtual terminals sending the first network service request to the network device under test respectively, including: executing one behavior instruction in the behavior instruction sequence corresponding to the one or more virtual terminals in sequence to simulate the one or more virtual terminals sending the first network service request to the network device under test respectively.
[0011] According to the network device testing method provided in some embodiments of the present specification, the sequential execution of a behavior instruction in a behavior instruction sequence corresponding to the one or more virtual terminals includes: executing a behavior instruction in a behavior instruction sequence corresponding to one of the one or more virtual terminals and after a random time interval, executing a behavior instruction in a behavior instruction sequence corresponding to another virtual terminal of the one or more virtual terminals.
[0012] According to the network device testing method provided in some embodiments of the present specification, upon receiving a response result corresponding to the behavior instruction returned by the network device under test, executing the next behavior instruction in the behavior instruction sequence of the virtual terminal to which the behavior instruction belongs to simulate the virtual terminal sending a second network service request to the network device under test, includes: upon receiving a response result corresponding to the behavior instruction returned by the network device under test, executing the next behavior instruction in the behavior instruction sequence of the virtual terminal to which the behavior instruction belongs after a random interval of time.
[0013] According to the network device testing method provided by some embodiments of the present specification, the configuration file also includes an interval duration range, and the random duration is randomly selected from the interval duration range.
[0014] According to the network device testing method provided in some embodiments of the present specification, the response result includes: returning request data or responding to a request timeout; the method also includes: writing the response result and its corresponding virtual terminal and behavior instructions into a database according to a preset database structure; parsing the response result into data in a readable form.
[0015] According to the network equipment testing method provided in some embodiments of the present specification, the data in readable form includes: statistical data obtained based on the response result statistics; the statistical data includes one or more of the following information: the number of behavior instructions whose corresponding response result is a response request timeout, the virtual terminal whose corresponding response result is a response request timeout, the behavior instructions whose corresponding response result is a response request timeout, the number of behavior instructions that did not obtain expected results, the virtual terminal whose behavior instructions did not obtain expected results, and the behavior instructions that did not obtain expected results.
[0016] According to the network device testing method provided by some embodiments of the present specification, the writing of the response result and its corresponding virtual terminal and behavior instruction into the database according to a preset database structure includes: when the writing of the response result fails, recording in the database a mark reflecting the failure to write the response result.
[0017] According to the network device testing method provided by some embodiments of the present specification, the type data of the virtual terminal includes one or more of a computer type, a mobile phone type, a tablet computer type, and a network device type.
[0018] One or more embodiments of the present specification also provide a terminal simulator, comprising: a file reading module, used to read a pre-set configuration file; an instruction configuration module, used to generate one or more virtual terminals based on terminal data provided by the configuration file, and to generate a behavior instruction sequence corresponding to the virtual terminal based on the behavior data provided by the configuration file; a scheduling execution module, used to execute the behavior instructions in the behavior instruction sequence corresponding to the one or more virtual terminals, so as to simulate the one or more virtual terminals sending a network service request to the network device under test, and obtain a response result of the network device under test to the network service request of the virtual terminal.
[0019] The terminal simulator provided according to some embodiments of the present specification also includes: a data writing module, used to write the response result and its corresponding virtual terminal and behavior instructions into the database according to a preset database structure; and a parsing module, used to parse the response result into data in a readable form.
[0020] According to the terminal simulator provided in some embodiments of the present specification, the behavior instruction includes an instruction to call a behavior module, and the behavior module includes one or more of a DNS resolution module, a web access module, a portal authentication module, and an FTP upload and download module.
[0021] According to the terminal simulator provided in some embodiments of the present specification, the terminal data includes type data of the virtual terminal and quantity data of the virtual terminals corresponding to the type data of the virtual terminal, and the instruction configuration module is used to generate one or more virtual terminals whose types and quantities match the type data and the quantity data respectively.
[0022] According to the terminal simulator provided in some embodiments of the present specification, the file reading module is used to read the multiple configuration files; the instruction configuration module is used to generate one or more virtual terminal sets based on the one or more configuration files; the virtual terminal set includes one or more virtual terminals whose types and quantities respectively match the type data and the quantity data of the corresponding configuration files; the virtual terminal behavior instruction sequence in the same virtual terminal set is generated based on the behavior data in the corresponding configuration files.
[0023] According to the terminal simulator provided in some embodiments of the present specification, the scheduling execution module is further used to: based on the behavioral instructions in the behavioral instruction sequence corresponding to the one or more virtual terminals, simulate the one or more virtual terminals sending a first network service request to the network device under test respectively; when receiving a response result corresponding to the behavioral instruction returned by the network device under test, execute the next behavioral instruction in the behavioral instruction sequence of the virtual terminal to which the behavioral instruction belongs, so as to simulate the virtual terminal sending a second network service request to the network device under test.
[0024] According to the terminal emulator provided in some embodiments of the present specification, there are multiple scheduling execution modules, and the multiple scheduling execution modules are distributed on different cores of the processor.
[0025] According to the terminal emulator provided by some embodiments of the present specification, the instruction configuration module is further used to correspond the virtual terminal and its behavior instruction sequence to the scheduling execution modules on different cores.
[0026] One or more embodiments of the present specification further provide a computer program product, including computer codes, which can implement any of the above-mentioned network device testing methods when at least part of the computer codes is executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] This specification will be further explained by way of exemplary embodiments, which will be described in detail by way of the accompanying drawings. The same numbers in the drawings represent the same structures or steps.
[0028] Figure 1 It is an exemplary flow chart of a network device testing method according to some embodiments of this specification.
[0029] Figure 2 This is an exemplary flow chart of sending a network service request to a network device under test according to the network device testing method shown in some embodiments of this specification.
[0030] Figure 3 is an exemplary block diagram of a terminal emulator according to some embodiments of the present specification.
[0031] Figure 4 is an exemplary block diagram of a terminal emulator according to some embodiments of the present specification. DETAILED DESCRIPTION
[0032] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the embodiments will be described in detail below with reference to the accompanying drawings. Obviously, the contents described below are some examples or embodiments of this specification. For ordinary technicians in this field, without paying creative work, the technical solutions or means disclosed in this specification can also be applied to other scenarios based on these technical contents.
[0033] It should be understood that the "system", "device", "unit" and / or "module" used in this specification is a method for distinguishing different components, elements, parts, portions or assemblies at different levels. However, if other words can achieve the same purpose, the words can be replaced by other expressions.
[0034] Unless otherwise specified, technical terms used in this specification to describe components, elements, etc. do not refer to the singular, but may also include the plural. Generally speaking, terms such as "include", "comprise", etc. only indicate that the steps, elements, or components that have been clearly identified are included, and these steps, elements, and components do not constitute an exclusive list, such as the method or device described may also include other steps or components.
[0035] Flowcharts are used in this specification to illustrate the operation steps performed by the device or system of the relevant embodiments, but unless otherwise specified, the order used to describe these steps should not be understood as a limitation on the order in which the steps are performed. A person of ordinary skill in the art can adjust the order in which these steps are performed based on the knowledge and information conveyed by the embodiments of this specification, and the adjustment includes but is not limited to swapping the order, merging multiple steps, and splitting a certain step.
[0036] A network device refers to a hardware device or software component that can be used to build, connect, and manage a network. A network device can transmit data in a network, control network traffic, provide network security, etc. In some embodiments, a network device may include a router, a switch, a firewall, a bridge, a hub, a server (which can also be considered a network device in a network environment), etc. In some embodiments, network devices work together to ensure the normal operation of the network and the secure transmission of data.
[0037] The terminal device may be a device used directly by the user, and the terminal device may be used to access the network and perform various application operations. In some embodiments, the terminal device may include a computer, a mobile phone, a tablet computer, a network device, etc. In some embodiments, the network device as a terminal device may be a downstream device, for example, the terminal device may be an access controller (AC) downstream of the upper network, and another example is a wireless access point (AP) downstream of the access controller. In some embodiments, the terminal device may access the network (for example, the Internet or a local area network) through the network device in order to transmit data, access network resources, or perform other network activities (or behaviors).
[0038] With the rapid development of network technology, the access and management of various terminal devices have become increasingly complex. In order to facilitate the testing, debugging and management of network devices, it is necessary to provide a method that can simulate the behavior of terminal devices in the network and a corresponding terminal simulator to verify the correctness of the network configuration of the network device and ensure that the terminal device can normally access network resources, resolve DNS normally, pass portal authentication, and upload or download files normally through FTP.
[0039] In some related embodiments, the terminal simulator can simulate a single behavior of one or more single types of terminal devices by constructing a virtual terminal, such as simulating the behavior of one or more personal computers accessing a web page, or simulating the behavior of one or more smart phones performing portal authentication. However, it cannot meet the comprehensive testing requirements of multiple terminal devices performing multiple different behaviors in high concurrency in a complex network environment.
[0040] Based on this, one or more embodiments of this specification provide a network device testing method that can simulate multiple types of terminal devices to perform multiple different behaviors, and has good scalability and can easily adapt to new device type simulation requirements that may arise in the future.
[0041] Figure 1 is an exemplary flow chart of a network device testing method according to some embodiments of this specification. In some embodiments, Figure 1 The process shown can be implemented by an analog terminal 900 disposed on a processing device. Figure 1 As shown, the network device testing method provided by one or more embodiments of this specification may include the following steps.
[0042] Step 100 , reading a preset configuration file. In some embodiments, step 100 may be implemented by the file reading module 910 .
[0043] In one or more embodiments of the present specification, the configuration file may be a file pre-set by the tester before conducting the network device test according to the environment and requirements of the network device test. In some embodiments, the configuration file may provide the configuration parameters and settings of the virtual terminal required in the network device test, which may include various information required for the operation of the virtual terminal involved in the network device test. In some embodiments, the configuration file may include terminal data for determining the need to generate a virtual terminal in the test and behavior data for determining the behavior (e.g., network behavior) performed by the virtual terminal in the test.
[0044] In some embodiments, the number of configuration files may be one or more. In some embodiments, the terminal data and behavior data included in the multiple configuration files may be the same or different.
[0045] In some embodiments, the terminal data may include type data of the virtual terminal and quantity data of the virtual terminals corresponding to the type data of the virtual terminal. In some embodiments, the type data of the virtual terminal may include one or more of a computer type, a mobile phone type, a tablet type, a network device type (e.g., an access point (AP), an access controller (AC), etc.). In other embodiments, the type data of the virtual terminal may also include new device types that may appear in the future. In some embodiments, the quantity data of the virtual terminals may include the specific number of virtual terminals of a certain type. Exemplarily, the terminal data may include a number of NA (e.g., 1,000) of virtual terminals of type A, a number of NB (e.g., 300) of virtual terminals of type B, and a number of NC (e.g., 600) of virtual terminals of type C.
[0046] In some embodiments, the tester can provide the type data and quantity data of the virtual terminal according to the requirements of the network device test. Exemplarily, for a small-scale network device test, such as a network device test of an airplane wifi system (such as a stress test, etc.), the tester can set the type data of the virtual terminal in the configuration file to a mobile phone and / or a tablet computer, and set the quantity data of the virtual terminal in the configuration file based on the number of seats in the airplane. Exemplarily, for a large-scale network device test, such as a campus-wide network device test, the tester can set the type data of the virtual terminal in the configuration file to one or more of a computer, a mobile phone, and a tablet computer, and set the quantity data of the virtual terminal in the configuration file to 10,000 to 20,000 or more.
[0047] In some embodiments, the behavior data may include the number of times the behavior is executed and the execution logic data of the behavior. In some embodiments, the execution logic data of the behavior provides the logic of the behavior that the virtual terminal needs to execute (for example, the logic of accessing a certain webpage, or the logic of executing portal authentication). In some embodiments, the number of times the behavior is executed provides the number of times a certain behavior is executed (for example, accessing a certain webpage several times, and accessing another webpage several times, etc.).
[0048] In some embodiments, the tester can provide the execution frequency data of the behavior of the virtual terminal and the execution logic data of the behavior according to the environment and content of the network test equipment test. Exemplarily, for the network equipment test of the airport public wifi system, the behaviors that the user may involve may include portal authentication, DNS resolution, access to web pages, etc. Based on this, the execution logic data of the behavior of the virtual terminal provided by the tester may include first performing portal authentication, then performing DNS resolution, and then accessing the web page. In some embodiments, it may further include performing DNS resolution again and then accessing other web pages. The execution frequency data of the behavior of the virtual terminal provided by the tester corresponds to the specific behavior in the execution logic data, for example, it may include portal authentication once, DNS resolution once, and access to web pages multiple times. Exemplarily, for the network equipment test of file transfer between the client and the server involved in the office environment, the behaviors that the user may involve may include FTP upload and FTP download. Based on this, the execution logic data of the behavior of the virtual terminal provided by the tester and the corresponding execution frequency data of the behavior may include FTP upload once, FTP download several times, FTP download once, FTP upload several times, etc.
[0049] Step 200 , generating one or more virtual terminals based on the terminal data provided by the configuration file. In some embodiments, step 200 may be implemented by the instruction configuration module 920 .
[0050] In one or more embodiments of the present specification, step 200 may further include step 210 and step 220. It should be noted that the description order of step 210 and step 220 should not be understood as a limitation on the order of step execution. In some optional embodiments, either step 210 or step 220 may be omitted.
[0051] Step 210: Generate one or more virtual terminals whose types and quantities respectively match the type data and quantity data of the corresponding configuration file.
[0052] In one or more embodiments of the present specification, in step 210, continuing the previous example, NA virtual terminals of type A, NB virtual terminals of type B, and NC virtual terminals of type C may be generated. Exemplarily, the generated virtual terminals may include 8132 computers, 11235 mobile phones, and 2134 tablet computers. In some embodiments, each virtual terminal generated based on step 210 may be configured with a behavior instruction sequence accordingly. In some embodiments, each virtual terminal generated based on step 210 may have a different behavior instruction sequence, for example, including different behavior instructions and / or having different behavior instruction sequences, to simulate different network behaviors of a large number of users.
[0053] Step 220, one or more virtual terminal sets are generated based on one or more configuration files; the virtual terminal set includes one or more virtual terminals whose types and quantities match the type data and quantity data of the corresponding configuration files respectively; the virtual terminal behavior instruction sequence in the same virtual terminal set is generated based on the behavior data in the corresponding configuration file.
[0054] In one or more embodiments of the present specification, the tester may pre-set multiple configuration files. In some embodiments, based on the multiple configuration files, multiple virtual terminal sets whose number is consistent with the number of configuration files may be generated. In some embodiments, a virtual terminal set may include one virtual terminal or multiple virtual terminals. In some embodiments, the type and number of virtual terminals in a virtual terminal set may be determined by the type data and number data of the virtual terminals in the corresponding configuration files.
[0055] In some embodiments, a virtual terminal set can be generated based on a configuration file, and the behavior instruction sequence of the virtual terminals in the same virtual terminal set is generated based on the same configuration file, for example, based on the behavior data in the same configuration file. In some embodiments, the behavior instruction sequence may include one or more behavior instructions. In some embodiments, the virtual terminals in the same virtual terminal set may include at least a number of identical behavior instructions. In some embodiments, the virtual terminals in the same virtual terminal set may have the same behavior instruction sequence, i.e., include the same behavior instructions and have the same order of behavior instructions.
[0056] In some embodiments, the tester can set more configuration files according to actual needs, and more virtual terminal sets can be generated corresponding to more configuration files, thereby increasing the total number of virtual terminals in batches, so as to test the situation of network devices when a large number of virtual terminals request to access the network or perform data transmission. In some embodiments, in the future, when new and unknown network behaviors that users may operate may appear, the tester can adjust or add configuration files to generate new virtual terminals that can implement the new network behaviors, establish new behavior instructions corresponding to the new network behaviors based on the new behavior data in the configuration files, and obtain a behavior instruction sequence including the new behavior instructions, so as to perform corresponding tests.
[0057] Step 300 , generating a behavior instruction sequence corresponding to the virtual terminal based on the behavior data provided by the configuration file. In some embodiments, step 300 may be implemented by the instruction configuration module 920 .
[0058] In one or more embodiments of the present specification, step 300 may include step 310, combining behavior instructions based on behavior execution count data and behavior execution logic data provided by the configuration file to obtain a behavior instruction sequence.
[0059] In some embodiments, the behavior instruction may include an instruction to call a behavior module; the behavior module may include one or more of a DNS resolution module, a web access module, a portal authentication module, an FTP upload and download module. In some embodiments, a network service request may be sent to a network device through a behavior module to simulate the behavior of a virtual terminal. In some embodiments, the DNS resolution module may send a query request to a configured DNS server, thereby simulating the behavior of a virtual terminal requesting DNS resolution. In some embodiments, the web access module may establish a TCP connection with a corresponding server and send an HTTP request to the server to request web page content, thereby simulating the behavior of a virtual terminal accessing a web page. In some embodiments, the portal authentication module may redirect a user's access request to a portal authentication server, and enter the user name, password or other authentication information provided in the configuration file in the portal authentication page and submit it to the portal authentication server, thereby simulating the behavior of a virtual terminal performing portal authentication. In some embodiments, the FTP upload and download module may simulate the behavior of a virtual terminal performing FTP upload and / or FTP download.
[0060] In some embodiments, when new network behaviors (such as access behaviors or identity authentication behaviors under new communication protocols, etc.) may appear in the future, the tester can simulate the virtual terminal to perform new behaviors by adjusting or adding behavior modules.
[0061] In some embodiments, the virtual terminal can exist in the form of static data, and the behavior of the virtual terminal can be simulated through different behavior modules. In some embodiments, the behavior instruction calls the behavior module, thereby simulating the virtual terminal to send a request to the corresponding server. In step 310, a number of behavior instructions can be combined according to the behavior execution number data and behavior execution logic data provided by the configuration file preset by the tester, so as to obtain a behavior instruction sequence including the behavior instructions arranged in order.
[0062] In some embodiments, the virtual terminal can execute a series of behaviors in order based on a behavior instruction sequence, and the behavior instruction sequence determines the behavior order and behavior content of the series of behaviors. In some embodiments, the behavior order and behavior content of the series of behaviors can include the aforementioned virtual terminal first performing portal authentication, then performing DNS resolution, and then accessing a web page several times.
[0063] In some embodiments, several virtual terminals in the same virtual terminal set can perform a corresponding series of behaviors in the same order based on the same behavioral instruction sequence. For example, all 200 mobile phones in a virtual terminal set can first perform portal authentication once, then perform DNS resolution once, and then access a web page several times. For another example, all 300 tablet computers in another virtual terminal set can perform portal authentication once. In some embodiments, although the behavior order and behavior of several virtual terminals in the same virtual terminal set are the same, given that different virtual terminals can have different behavior start times, or two adjacent behaviors of different virtual terminals may have different time intervals, the behaviors performed by different virtual terminals at the same time point may be different, so it can simulate the irregular actual operation of a large number of users on a macro level.
[0064] Step 400, execute the behavior instructions in the behavior instruction sequence corresponding to one or more virtual terminals to simulate one or more virtual terminals sending a network service request to the network device under test. In some embodiments, step 400 can be implemented by the scheduling execution module 930. In some embodiments, according to the behavior instruction in the behavior instruction sequence, the behavior module corresponding to the behavior instruction can be called, and the network service request provided by the behavior module can be sent to the network device under test through the behavior module, thereby simulating the virtual terminal sending a network service request to the network device under test.
[0065] Figure 2 FIG. 1 is an exemplary flow chart of sending a network service request to a network device to be tested according to a network device testing method shown in some embodiments of this specification. Figure 2 As shown, in one or more embodiments of the present specification, step 400 may further include step 410 and step 420.
[0066] Step 410: Based on the behavior instructions in the behavior instruction sequence corresponding to the one or more virtual terminals, simulate the one or more virtual terminals to send a first network service request to the network device under test respectively.
[0067] Step 420, upon receiving a response result corresponding to the behavior instruction returned by the network device under test, executing the next behavior instruction in the behavior instruction sequence of the virtual terminal to which the behavior instruction belongs, so as to simulate the virtual terminal sending a second network service request to the network device under test.
[0068] In one or more embodiments of the present specification, multiple virtual terminals may be simulated to send first network service requests to the network device under test respectively through step 410. In some embodiments, after simulating a virtual terminal to send a first network service request to the network device under test, it is possible to directly simulate another virtual terminal to send another first network service request to the network device under test without waiting for a response result corresponding to the first network service request (i.e., a non-blocking operation mode).
[0069] In one or more embodiments of the present specification, step 410 may include sequentially executing one behavior instruction in a behavior instruction sequence corresponding to one or more virtual terminals to simulate one or more virtual terminals sending a first network service request to the network device under test respectively.
[0070] In some embodiments, one behavior instruction in a behavior instruction sequence corresponding to one or more virtual terminals is executed in sequence, and the behavior modules corresponding to the behavior instructions are called in sequence to simulate one or more virtual terminals sending first network service requests to the network device under test. Exemplarily, one behavior instruction in a behavior instruction sequence corresponding to the first virtual terminal is executed, and the behavior module corresponding to the behavior instruction of the first virtual terminal is called to simulate the first virtual terminal sending the first network service request to the network device under test; then one behavior instruction in a behavior instruction sequence corresponding to the second virtual terminal is executed, and the behavior module corresponding to the behavior instruction of the second virtual terminal is called to simulate the second virtual terminal sending the first network service request to the network device under test, and so on.
[0071] In some embodiments, it may be assumed that in a certain network device test, the tester pre-sets configuration file 1 and configuration file 2, wherein a virtual terminal set 1 can be generated based on configuration file 1, and virtual terminal set 1 can include 200 virtual terminals 1 (for example, 200 mobile phones), and configuration file 1 also provides a behavior instruction sequence 1 for virtual terminal 1, and behavior instruction sequence 1 can include behavior instruction 1a (for example, performing portal authentication), behavior instruction 1b (for example, performing DNS resolution), behavior instruction 1c (for example, accessing web page 1), and behavior instruction 1d (for example, accessing a sub-web page of web page 1); wherein, a virtual terminal set 2 can be generated based on configuration file 2, and virtual terminal set 2 can include 300 virtual terminals 2 (for example, 300 tablet computers), and configuration file 2 also provides a behavior instruction sequence 2 for virtual terminal 2, and behavior instruction sequence 2 can include, for example, behavior instruction 2a (for example, performing portal authentication).
[0072] In some embodiments, in step 410, the corresponding behavior instruction 1a1 may be executed based on one of the 200 mobile phones in the virtual terminal set 1, and the corresponding behavior instruction 1a2 may be executed based on another of the 200 mobile phones in the virtual terminal set 1, and the corresponding behavior instruction 2a1 may be executed based on one of the 300 tablet computers in the virtual terminal set 2, and the corresponding behavior instruction 1a3 may be executed based on another of the 200 mobile phones in the virtual terminal set 1, and so on. In short, in this embodiment, the order of executing the behavior instructions may be: 1a1→1a2→2a1→1a3.
[0073] In other embodiments, in step 410, the corresponding behavior instruction 1a1 may be executed based on one of the 200 mobile phones in the virtual terminal set 1, and then all the mobile phones in the virtual terminal set 1 are executed in sequence, and then one of the 300 tablet computers in the virtual terminal set 2 is executed with its corresponding behavior instruction 2a1, and then all the tablet computers in the virtual terminal set 2 are executed in sequence, and so on. In short, in this embodiment, the order of executing the behavior instructions may be: 1a1→1a2→1a3…→2a1→2a2→2a3….
[0074] It should be noted that, in the aforementioned notation, 1a in 1a1 refers to the first behavior instruction 1a in the behavior instruction sequence corresponding to virtual terminal set 1, and the subscript 1 refers to the first virtual terminal in virtual terminal set 1. In the following possible notations, for example, behavior instruction 3c6 may refer to the third behavior instruction in the behavior instruction sequence corresponding to the sixth virtual terminal in virtual terminal set 3.
[0075] In some embodiments, after executing behavior instruction 1a based on one of the 200 mobile phones in virtual terminal set 1, the corresponding behavior instruction 1a can be immediately executed based on another one of the 200 mobile phones in virtual terminal set 1 without waiting for the response result of behavior instruction 1a, and so on.
[0076] In one or more embodiments of the present specification, step 410 may also include: executing a behavior instruction in a behavior instruction sequence corresponding to one of the one or more virtual terminals and after a random interval, executing a behavior instruction in a behavior instruction sequence corresponding to another virtual terminal in the one or more virtual terminals.
[0077] In some embodiments, after executing a behavior instruction in the behavior instruction sequence corresponding to the first virtual terminal, a behavior instruction in the behavior instruction sequence corresponding to the second virtual terminal is executed after a random time interval. In some embodiments, after executing the corresponding behavior instruction 1a1 based on one of the 200 mobile phones in the virtual terminal set 1, after a first time interval, the corresponding behavior instruction 1a2 is executed based on another mobile phone in the 200 mobile phones in the virtual terminal set 1, and after a second time interval, the corresponding behavior instruction 2a1 is executed based on one of the 300 tablet computers in the virtual terminal set 2. In some embodiments, the first time and the second time can be equal or different. By simulating the time difference of the operations of two different users by arranging a random time interval between the two behavior instructions, the network equipment test can be closer to the actual operation of the user.
[0078] In some embodiments, in step 420, when a response result corresponding to a certain behavior instruction returned by the network device under test is received, the current task can be suspended (for example, pausing sending the first network service request of the next virtual terminal), and the next behavior instruction of the virtual terminal corresponding to the response result is executed to simulate the virtual terminal corresponding to the response result sending a second network service request to the network device under test, and returning to the aforementioned current task after the next behavior instruction is executed (for example, continuing to send the first network service request of the next virtual terminal).
[0079] Continuing with the previous example, in some embodiments, the corresponding behavior instruction 1a1 can be executed based on one of the 200 mobile phones in the virtual terminal set 1 (for example, mobile phone ph1), and then the corresponding behavior instruction 1a2 can be executed based on another of the 200 mobile phones in the virtual terminal set 1 (for example, mobile phone ph2), and then the corresponding behavior instruction 2a1 can be executed based on one of the 300 tablet computers in the virtual terminal set 2 (for example, tablet computer pad1). If the network device under test returns the response result res-1a1 corresponding to the behavior instruction 1a1 at this time, then the corresponding next behavior instruction 1b1 is executed based on one of the 200 mobile phones (for example, mobile phone ph1), and after execution, the current task is returned, that is, the corresponding behavior instruction 1a3 is executed based on another of the 200 mobile phones in the virtual terminal set 1 (for example, mobile phone ph3), and so on. In short, in this embodiment, the order of executing behavior instructions can be: 1a1→1a2→2a1→(response result res-1a1 of 1a1 is received)→1b1→1a3.
[0080] In some embodiments, since the time for the network device under test to return a response result is irregular, based on the above settings, the behavioral instructions that were originally executed regularly (for example, 1a1→1a2→2a1→1a3→1a4→2a2...) are disrupted after the response results are returned and the execution order is adjusted accordingly (for example, 1a1→1a2→2a1→1b1→1a3→1b2→1c1→1a4→1b4→2a2...), forming random, discrete user operations, and thus being able to simulate the irregular actual operation conditions of a large number of users on a macro level.
[0081] In one or more embodiments of the present specification, step 420 may include: upon receiving a response result corresponding to a behavior instruction returned by the network device under test, executing the next behavior instruction in the behavior instruction sequence of the virtual terminal to which the behavior instruction belongs after a random interval.
[0082] In some embodiments, when a response result corresponding to a certain behavior instruction returned by the network device to be tested is received, the current task can be suspended (for example, the first network service request of the next virtual terminal is suspended), and the next behavior instruction of the virtual terminal corresponding to the response result is executed after a random interval. The random interval between the response result and the next behavior instruction simulates the time difference of the next operation of the same user after receiving feedback, simulates the natural usage state of the user, and makes the network device test closer to the actual operation of the user.
[0083] In one or more embodiments of the present specification, the configuration file may further include an interval duration range, and the random duration may be randomly selected from the interval duration range. For example, the random duration in step 410 and / or the random duration in step 420 may be randomly selected from the interval duration range preset in the configuration file.
[0084] Step 500, obtaining a response result of the network device under test to the network service request of the virtual terminal. In some embodiments, step 500 may be implemented by the scheduling execution module 930. In some embodiments, step 500 may also be implemented by other modules independent of the scheduling execution module 930. In one or more embodiments of this specification, the response result of the network device under test to the network service request of the virtual terminal may include: returning request data or responding to request timeout.
[0085] In some embodiments, the network service request issued by the virtual terminal may be a request for portal authentication, and the response result corresponding to the network service request may be information on the success or failure of user authentication. In some embodiments, the network service request issued by the virtual terminal may be a request for DNS resolution, such as sending a query request for a domain name to a DNS server, and the response result corresponding to the network service request may be an IP address corresponding to the returned domain name. In some embodiments, the network service request issued by the virtual terminal may be a request to access a web page, such as an HTTP request sent to a server, and the response result corresponding to the network service request may be an HTTP response message returned by the server.
[0086] In some embodiments, when the virtual terminal does not receive the returned request data after a preset response time has passed after issuing a network service request, the response result is set as a response request timeout.
[0087] In some embodiments, an expected result can be set for the behavior of the virtual terminal, for example, for the behavior of the virtual terminal accessing a web page, the expected result can be the content of the web page obtained. In some embodiments, after obtaining the response result of the network device to be tested to the network service request of the virtual terminal, it can be checked whether the response result meets the expected result (for example, consistent with the expected result or falling within the range of the expected result) after the network device test is completed. In some embodiments, if all the response results meet the expected results, the test can be considered to have passed. In other embodiments, if most of the response results meet the expected results, the test can also be considered to have passed. In other embodiments, if more than a certain proportion of the response results do not meet the expected results, it is considered that the network device may have problems that need to be adjusted. In some embodiments, the content of the specific problems that need to be adjusted can be determined by checking which specific response results do not meet the expected results (for example, portal authentication is successful but DNS resolution fails, or portal is successful and DNS resolution is also successful but requesting web page data is not returned, etc.).
[0088] In some optional embodiments, Figure 1 The network device testing method shown may further include step 600 and step 700 shown in the dashed box. In some embodiments, step 600 and step 700 may be omitted, or step 700 may be omitted.
[0089] Step 600, write the response result and its corresponding virtual terminal and behavior instruction into the database according to the preset database structure. In some embodiments, step 600 can be implemented by the data writing module 940. In some embodiments, step 600 can also be implemented by other modules independent of the data writing module 940.
[0090] In one or more embodiments of the present specification, the tester may provide a custom database, and write the response result, the virtual terminal corresponding to the response result, the behavior instruction executed by the virtual terminal corresponding to the response result, and other information into the database according to the database structure of the database. In some embodiments, the expected result corresponding to the response result pre-set in the configuration file may also be written into the database. In some embodiments, by querying the database, it may be determined which behavior instructions of which virtual terminals did not obtain the expected results.
[0091] In one or more embodiments of the present specification, step 600 may include recording a mark reflecting the failure to write the response result in the database when the response result fails to be written, so that the tester can discard the information to avoid the information affecting the test result.
[0092] In some embodiments, the database may have a write failure problem. In some embodiments, the reason for the database write failure may include data format or type mismatch, such as field length exceeding the limit, etc., and may also include network failure, etc. In some embodiments, the database table structure may include a write status field. When a response result fails to be written, for example, when the response result res-1a1 corresponding to the behavior instruction 1a1 of the virtual terminal in the virtual terminal set 1 fails to be written, the write status field corresponding to the behavior instruction 1a1 is set to write failure.
[0093] Step 700, parse the response result into data in a readable form. In some embodiments, step 700 can be implemented by the parsing module 950. In some embodiments, step 700 can also be implemented by other modules independent of the parsing module 950.
[0094] In one or more embodiments of the present specification, the response result is parsed into data in a readable form to facilitate the tester to determine the test result. In some embodiments, the data in a readable form may include: statistical data obtained based on the response result statistics. In some embodiments, the statistical data may include one or more of the following information: the number of behavior instructions whose corresponding response result is a timeout in response to the request, the virtual terminal whose corresponding response result is a timeout in response to the request, the behavior instruction whose corresponding response result is a timeout in response to the request, the number of behavior instructions that did not obtain the expected result, the virtual terminal whose behavior instruction did not obtain the expected result, and the behavior instruction that did not obtain the expected result.
[0095] In some embodiments, the tester can first determine whether there is a case in which the response result of the behavior instruction is not the expected result (for example, the response request timed out, etc.) based on the readable data, and further find the corresponding virtual terminal and the corresponding behavior instruction based on other readable data corresponding to the case. In some embodiments, the tester can further consult the database based on the aforementioned information to determine the specific reason why the behavior instruction did not obtain the expected result.
[0096] Figure 3 is an exemplary block diagram of a terminal emulator according to some embodiments of the present specification. Figure 3 As shown, in some embodiments, the terminal simulator 900 may include: a file reading module 910, an instruction configuration module 920, and a scheduling execution module 930. The file reading module 910 is used to read a preset configuration file; the instruction configuration module 920 generates one or more virtual terminals based on the terminal data provided by the configuration file, and generates a behavior instruction sequence corresponding to the virtual terminal based on the behavior data provided by the configuration file; the scheduling execution module 930 is used to execute the behavior instructions in the behavior instruction sequence corresponding to the one or more virtual terminals, so as to simulate one or more virtual terminals sending a network service request to the network device under test, and obtain the response result of the network device under test to the network service request of the virtual terminal.
[0097] Continue to see Figure 3 In some optional embodiments, the terminal simulator 900 may further include: a data writing module 940 and a parsing module 950. The data writing module 940 is used to write the response result and its corresponding virtual terminal and behavior instruction into the database according to the preset database structure; the parsing module 950 is used to parse the response result into readable data. In some embodiments, the parsing module 950 can clearly present detailed information about the virtual terminal and the behavior instructions executed by the virtual terminal. The tester can independently view the detailed information of each virtual terminal, such as the status, configuration and history of the virtual terminal, and can also view the summary view. Figure 1 View the overview of all virtual terminals and behaviors. In some embodiments, the parsing module 950 can be implemented in the form of a command line.
[0098] In some embodiments, the virtual terminal may be a static data structure (for example, the virtual terminal is essentially simulated by static data, such as pre-set behavior data), and the scheduling execution module 930 executes the behavior instruction by scheduling the data structure corresponding to the virtual terminal. In some embodiments, the scheduling execution module 930 calls the corresponding behavior module according to the behavior instruction corresponding to the virtual terminal based on the data structure corresponding to the virtual terminal, sends a network service request to the network device under test, and obtains the response result of the network device under test to the network service request.
[0099] Figure 4 is an exemplary block diagram of a terminal simulator shown in other embodiments of this specification. Figure 4 As shown, the terminal emulator 900 may include a file reading module 910, an instruction configuration module 920, a scheduling execution module 930, a data writing module 940, and a parsing module 950. Further, the terminal emulator 900 may also include a behavior module, such as Figure 4 Behavior module a, behavior module b, behavior module c, etc., exemplarily, the behavior module may include one or more of a DNS resolution module, a web access module, a portal authentication module, and an FTP upload and download module. In some embodiments, a single behavior module corresponding to a single behavior instruction is called without collaboration between the behavior modules, thereby minimizing the coupling between the behavior modules, and the behavior modules are highly independent and substitutable. Based on this, when new network behaviors may appear in the future, the behavior module may further include new behavior modules, so the terminal emulator 900 has good scalability in handling events. Exemplarily, in some embodiments, newly added event types and optimization and upgrades of existing events can be quickly adjusted through the settings of configuration files, and the behavior modules corresponding to the newly added event types and optimization and upgrades of existing events can also be quickly integrated in a modular manner without completely changing the overall architecture.
[0100] In some embodiments, the scheduling execution module 930 may be represented as a scheduling process. In some embodiments, a scheduling process calls a behavior module corresponding to a behavior instruction in a behavior instruction sequence, sends a network service request to the network device under test, and obtains a response result of the network device under test to the network device request. In some embodiments, the number of scheduling execution modules 930 may be multiple, and multiple scheduling execution modules 930 may be distributed on different cores of the processor. In some embodiments, the instruction configuration module 920 may also be used to correspond the virtual terminal and its behavior instruction sequence to the scheduling execution modules 930 on different cores. Continuing with the previous example, in some embodiments, a scheduling process may be bound to a core of a processor and run separately, thereby reducing the overhead of migration and context switching of the same scheduling process between different cores, and improving the stability and response speed of the scheduling process. In some embodiments, multiple scheduling processes may be bound to multiple cores of a processor to run separately, so that multiple scheduling processes can run simultaneously at the same time, and each scheduling process occupies the computing resources of a core to make full use of the computing power of all cores, thereby improving the overall computing performance.
[0101] For more information about each module, see Figure 1~Figure 2 The relevant description of will not be repeated here. It should be understood that Figure 3 , Figure 4 The system and its modules shown can be implemented in various ways. For example, in some embodiments, the system and its modules can be implemented by hardware, software, or a combination of software and hardware. Among them, the hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. Those skilled in the art will understand that the above methods and systems can be implemented using computer executable instructions and / or control codes contained in a processor, such as a disk, CD or DVD-ROM, etc., and such codes are provided in a carrier medium or a memory of a programmable device. The system and its modules of this specification can not only be implemented by hardware circuits such as ultra-large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., but can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above hardware circuits and software (e.g., firmware).
[0102] It should be noted that the above description of the system and its modules is only for convenience of description and does not limit this specification to the scope of the embodiments. It is understandable that for those skilled in the art, after understanding the principle of the system, it is possible to arbitrarily combine the modules without deviating from this principle to form a subsystem connected to other modules. Or some modules may be split to obtain more modules or multiple units under the module. Such variations are all within the scope of the disclosure of this specification.
[0103] In one or more embodiments of the present specification, a computer program product is also provided, including computer instructions or computer codes, which can implement the above-mentioned network device testing method when at least part of the computer instructions or computer codes are executed by a processor. In some embodiments, the computer program product may only involve computer instructions or computer codes, which may be carried by a storage medium or a processing device. In other embodiments, the computer program product may also be a storage medium or a processing device containing the aforementioned computer instructions or computer codes. The processing device may include one or more processors, and a storage medium.
[0104] In some embodiments, the processor may be a combination of one or more of the following processors: a central processing unit (CPU), an application specific integrated circuit (ASIC), an application specific instruction set processor (ASIP), a graphics processing unit (GPU), a physical processing unit (PPU), a digital signal processor (DSP), a field programmable gate array (FPGA), a programmable logic device (PLD), a programmable logic controller (PLC), a reduced instruction set computer (RISC), and a microprocessor.
[0105] In some embodiments, the storage medium may include a combination of one or more of the following: a mass storage, a removable storage, a volatile read-write memory, and a read-only memory (ROM). Exemplary mass storage may include a magnetic disk, an optical disk, a solid-state hard disk, and the like. Exemplary removable storage may include a flash disk, a floppy disk, an optical disk, a memory card, a compressed hard disk, a magnetic tape, and the like. Exemplary volatile read-write memory may include a random access memory (RAM). Exemplary random access memory may include a dynamic random access memory (DRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), a static random access memory (SRAM), a thyristor random access memory (T-RAM), and a zero capacitance memory (Z-RAM), and the like. Exemplary read-only memory may include a masked read-only memory (MROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a compact disk read-only memory (CD-ROM), and a digital multifunction hard disk read-only memory, and the like.
[0106] The beneficial effects that may be brought about by the embodiments of this specification include but are not limited to: (1) providing a network device testing method that can simulate a variety of terminal devices such as computers, mobile phones, tablets, APs, ACs, etc., and has good scalability and can adapt to new device type simulation requirements that may appear in the future; (2) allowing testers to configure the number, sequence and logic of the network behavior to be simulated in detail by setting configuration files, providing a highly flexible behavior management method; (3) testers can customize complex event processes according to test or simulation requirements to meet simulation requirements in different scenarios; (4) having high performance characteristics, being able to support the simultaneous configuration of tens of thousands of terminal devices and the simulation of any number of network behaviors, ensuring that simulation tests in large-scale network environments can be carried out efficiently; (5) the independent behavior modules in the terminal simulator are highly independent and replaceable, simplifying subsequent expansion and maintenance work. (6) New behavior types or optimization and upgrading of existing behaviors can be quickly integrated in a modular way without completely changing the overall framework. It should be noted that different embodiments may produce different beneficial effects. In different embodiments, the beneficial effects that may be produced may be any one or a combination of the above, or any other beneficial effects that may be obtained.
[0107] The basic concepts have been described above. Obviously, for those skilled in the art, the above detailed disclosure is only for example and does not constitute a limitation of this specification. Although not explicitly stated here, those skilled in the art may make various modifications, improvements and corrections to this specification. Such modifications, improvements and corrections are taught in this specification, so such modifications, improvements and corrections still belong to the spirit and scope of the exemplary embodiments of this specification.
Claims
1. A network device testing method, characterized in that: include: Read the pre-set configuration file; Generate one or more virtual terminals based on the terminal data provided by the configuration file; Generate a behavior instruction sequence corresponding to the virtual terminal based on the behavior data provided by the configuration file; Executing the behavior instructions in the behavior instruction sequence corresponding to the one or more virtual terminals to simulate the one or more virtual terminals sending a network service request to the network device under test; Obtaining a response result of the network device under test to the network service request of the virtual terminal.
2. The network device testing method according to claim 1, characterized in that: The terminal data includes type data of the virtual terminal and quantity data of the virtual terminals corresponding to the type data of the virtual terminal.
3. The network device testing method according to claim 2, characterized in that: Generating one or more virtual terminals based on the terminal data provided by the configuration file includes: One or more virtual terminals are generated whose types and quantities match the type data and the quantity data respectively.
4. The network device testing method according to claim 2, characterized in that: The number of the configuration files is one or more; and the generating one or more virtual terminals based on the terminal data provided by the configuration files comprises: One or more virtual terminal sets are generated based on one or more configuration files; the virtual terminal set includes one or more virtual terminals whose types and quantities respectively match the type data and the quantity data of the corresponding configuration files; and the behavior instruction sequences of the virtual terminals in the same virtual terminal set are generated based on the behavior data in the corresponding configuration files.
5. The network device testing method according to claim 1, characterized in that: The behavior data includes the number of times the behavior is executed and the execution logic data of the behavior; The generating of a behavior instruction sequence corresponding to the virtual terminal based on the behavior data provided by the configuration file comprises: The behavior instructions are combined based on the execution frequency data of the behavior and the execution logic data of the behavior to obtain the behavior instruction sequence.
6. The network device testing method according to claim 5, characterized in that: The behavior instruction includes an instruction for calling a behavior module; the behavior module includes one or more of a DNS resolution module, a web access module, a portal authentication module, and an FTP upload and download module.
7. The network device testing method according to claim 1, characterized in that: The executing the behavior instructions in the behavior instruction sequence corresponding to the one or more virtual terminals to simulate the one or more virtual terminals sending a network service request to the network device under test includes: Based on the behavior instructions in the behavior instruction sequence corresponding to the one or more virtual terminals, simulating the one or more virtual terminals to send first network service requests to the network device under test respectively; When receiving a response result corresponding to the behavior instruction returned by the network device under test, executing the next behavior instruction in the behavior instruction sequence of the virtual terminal to which the behavior instruction belongs, so as to simulate the virtual terminal sending a second network service request to the network device under test.
8. The network device testing method according to claim 7, characterized in that: The step of simulating the one or more virtual terminals to send first network service requests to the network device under test respectively based on the behavior instructions in the behavior instruction sequence corresponding to the one or more virtual terminals includes: One behavior instruction in the behavior instruction sequence corresponding to the one or more virtual terminals is executed in sequence to simulate the one or more virtual terminals sending a first network service request to the network device to be tested respectively.
9. The network device testing method according to claim 8, characterized in that: The sequentially executing one behavior instruction in the behavior instruction sequence corresponding to the one or more virtual terminals includes: After executing a behavior instruction in a behavior instruction sequence corresponding to one of the one or more virtual terminals and after a random time interval, executing a behavior instruction in a behavior instruction sequence corresponding to another virtual terminal of the one or more virtual terminals.
10. The network device testing method according to claim 7, characterized in that: When receiving a response result corresponding to the behavior instruction returned by the network device under test, executing the next behavior instruction in the behavior instruction sequence of the virtual terminal to which the behavior instruction belongs, so as to simulate the virtual terminal sending a second network service request to the network device under test includes: When receiving a response result corresponding to the behavior instruction returned by the network device to be tested, after a random time interval, execute the next behavior instruction in the behavior instruction sequence of the virtual terminal to which the behavior instruction belongs; The configuration file also includes an interval duration range, and the random duration is randomly selected from the interval duration range.
11. The network device testing method according to claim 1, characterized in that: The response result includes: returning request data or responding to request timeout; The method further comprises: Writing the response result and its corresponding virtual terminal and behavior instruction into a database according to a preset database structure; Parsing the response result into readable data; The data in readable form includes: statistical data obtained based on the response results; the statistical data includes one or more of the following information: the number of behavior instructions whose corresponding response result is a response request timeout, the virtual terminal whose corresponding response result is a response request timeout, the behavior instructions whose corresponding response result is a response request timeout, the number of behavior instructions that did not obtain the expected results, the virtual terminal whose behavior instructions did not obtain the expected results, and the behavior instructions that did not obtain the expected results; The step of writing the response result and its corresponding virtual terminal and behavior instruction into a database according to a preset database structure includes: when the writing of the response result fails, recording a mark reflecting the failure of writing the response result into the database.
12. The network device testing method according to claim 1, characterized in that: The type data of the virtual terminal includes one or more of a computer type, a mobile phone type, a tablet computer type, and a network device type.
13. A terminal emulator, characterized in that: include: A file reading module is used to read a preset configuration file; An instruction configuration module generates one or more virtual terminals based on the terminal data provided by the configuration file, and generates a behavior instruction sequence corresponding to the virtual terminal based on the behavior data provided by the configuration file; The scheduling execution module is used to execute the behavior instructions in the behavior instruction sequence corresponding to the one or more virtual terminals to simulate the one or more virtual terminals sending a network service request to the network device under test, and obtain the response result of the network device under test to the network service request of the virtual terminal.
14. The terminal emulator according to claim 13, characterized in that: There are multiple scheduling execution modules, and the multiple scheduling execution modules are distributed on different cores of the processor; The instruction configuration module is also used to correspond the virtual terminal and its behavior instruction sequence to the scheduling execution modules on different cores.
15. A computer program product, comprising computer codes, which, when at least part of the computer codes are executed by a processor, can implement the network device testing method according to any one of claims 1 to 12.