CN107222332B - Test method, device, system and machine readable storage medium - Google Patents

Test method, device, system and machine readable storage medium Download PDF

Info

Publication number
CN107222332B
CN107222332B CN201710311424.3A CN201710311424A CN107222332B CN 107222332 B CN107222332 B CN 107222332B CN 201710311424 A CN201710311424 A CN 201710311424A CN 107222332 B CN107222332 B CN 107222332B
Authority
CN
China
Prior art keywords
test
strategy
data packet
processing mode
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710311424.3A
Other languages
Chinese (zh)
Other versions
CN107222332A (en
Inventor
张建华
周曙
江海标
王佺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sino Bridge Technology Co ltd
Original Assignee
Beijing Sino Bridge Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sino Bridge Technology Co ltd filed Critical Beijing Sino Bridge Technology Co ltd
Priority to CN201710311424.3A priority Critical patent/CN107222332B/en
Publication of CN107222332A publication Critical patent/CN107222332A/en
Application granted granted Critical
Publication of CN107222332B publication Critical patent/CN107222332B/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/202Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where processing functionality is redundant
    • G06F11/2023Failover techniques
    • G06F11/2033Failover techniques switching over of hardware resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Tests Of Electronic Circuits (AREA)

Abstract

The disclosure discloses a testing method, a testing device, a testing system and a machine-readable storage medium. The method comprises the following steps: receiving a test data packet; determining a processing mode of the test data packet according to a preset test strategy; and processing the test data packet according to the processing mode. By the method, the processing mode of the test data packet is determined by the preset test strategy, the processing mode can be flexibly determined according to the condition of the test data packet, the purpose of comprehensive test can be achieved, and time and labor are saved.

Description

Test method, device, system and machine readable storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a test method, device, system, and machine-readable storage medium.
Background
In the fields of network communication, data storage and the like, when any link causes a fault, such as network abnormality and the like, the fault condition needs to be determined in time and processed correspondingly. In internet applications, for example, network communication is an essential link, and typically occurs from system to system, application to application, and interface to interface. The communication protocol is typically based on TCP and UDP, and is carried out above the network transport layer. Although TCP is a reliable link, problems of packet loss, packet content transmission errors, transmission time-out between packets, etc. often occur in real networks. In addition, in the database storage service, for data security, a deployment manner of one master database and a plurality of slave databases is usually adopted, and when a fault occurs in the master database (for example, a network anomaly), the slave databases need to be automatically promoted to the master database to continue working. A system using such a database storage service architecture may be referred to as a master-slave database architecture based system. In order to perform the test of the database failover, it is necessary to simulate various database failure scenarios to trigger the execution of the database failover. For the scene of database failure caused by network abnormality, the simulation method in the prior art triggers the execution of automatic database failure switching by a method of artificially disconnecting the communication network of the database to cause network abnormality.
Disclosure of Invention
One aspect of the present disclosure provides a test method, including:
receiving a test data packet;
determining a processing mode of the test data packet according to a preset test strategy;
and processing the test data packet according to the processing mode.
Determining a processing mode of the test data packet according to a preset test strategy, wherein the processing mode comprises the following steps:
determining a current preset test strategy;
and when the current preset test strategy is a delay strategy, determining that the processing mode is to return a response result of the test data packet after delaying for a preset time.
Determining a processing mode of the test data packet according to a preset test strategy, wherein the processing mode comprises the following steps:
determining a current preset test strategy;
and when the current preset test strategy is a no-response strategy, determining that the processing mode is not to return a response result of the test data packet.
The determining the processing result of the test data packet according to the preset test strategy comprises:
determining a current preset test strategy;
and when the current preset test strategy is a return error strategy, determining that the processing mode is to return an error response result of the test data packet.
Wherein, the determining the processing mode of the test data packet according to the preset test strategy comprises:
extracting a first data feature from the test data packet;
detecting the extracted first data characteristic by using a preset data detection model;
and determining the processing mode of the test data packet according to the detection result.
The method further comprises the following steps:
acquiring a training sample and a processing mode corresponding to the training sample;
extracting a second data feature in the training sample;
training by utilizing the second data characteristics and the corresponding processing mode to obtain the preset data detection model; and the output of the data detection model is a processing mode suitable for the training sample.
In a second aspect of the present disclosure, there is also provided a test apparatus, including:
a receiving module configured to receive a test data packet;
the determining module is configured to determine a processing mode of the test data packet according to a preset test strategy;
and the processing module is configured to process the test data packet according to the processing mode.
In a third aspect of the present disclosure, a test system is provided, including:
one or more memories storing executable instructions; and
one or more processors executing the executable instructions to implement the test method described above.
In a fourth aspect of the disclosure, a machine-readable storage medium is provided, storing executable instructions, which when executed by a processor, implement the above-described testing method.
Drawings
For a more complete understanding of the present disclosure and the advantages thereof, reference is now made to the following descriptions taken in conjunction with the accompanying drawings, in which:
fig. 1 is a flow chart of a proposed testing method according to an exemplary embodiment of the present disclosure;
FIG. 2 is a method flowchart of step 102 of a testing method provided in accordance with an exemplary embodiment of the present disclosure;
FIG. 3 is a flowchart of a method for training a data detection model in a testing method provided in accordance with an exemplary embodiment of the present disclosure;
FIG. 4 is a block diagram of a test apparatus provided in accordance with an exemplary embodiment of the present disclosure;
FIG. 5 is a block diagram of a determination module 402 in a test method provided in accordance with an exemplary embodiment of the present disclosure;
FIG. 6 is a block diagram of another embodiment of a testing method provided in accordance with an exemplary embodiment of the present disclosure;
fig. 7 is a block diagram of a test apparatus provided in accordance with an exemplary embodiment of the present disclosure.
Detailed Description
Other aspects, advantages, and salient features of the disclosure will become apparent to those skilled in the art from the following detailed description, which, taken in conjunction with the annexed drawings, discloses exemplary embodiments of the disclosure.
In the present disclosure, the terms "include" and "comprise," as well as derivatives thereof, mean inclusion without limitation; the term "or" is inclusive, meaning and/or.
In this specification, the various embodiments described below which are used to describe the principles of the present disclosure are by way of illustration only and should not be construed in any way to limit the scope of the invention. The following description with reference to the accompanying drawings is provided to assist in a comprehensive understanding of exemplary embodiments of the present disclosure as defined by the claims and their equivalents. The following description includes various specific details to aid understanding, but such details are to be regarded as illustrative only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Moreover, descriptions of well-known functions and constructions are omitted for clarity and conciseness. Moreover, throughout the drawings, the same reference numerals are used for similar functions and operations.
Some block diagrams and/or flow diagrams are shown in the figures. It will be understood that some blocks of the block diagrams and/or flowchart illustrations, or combinations thereof, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the instructions, which execute via the processor, create means for implementing the functions/acts specified in the block diagrams and/or flowchart block or blocks.
Accordingly, the techniques of this disclosure may be implemented in hardware and/or software (including firmware, microcode, etc.). Additionally, the techniques of this disclosure may take the form of a computer program product on a computer-readable medium having instructions stored thereon for use by an instruction execution system. In the context of this disclosure, a computer-readable medium may be any medium that can contain, store, communicate, propagate, or transport the instructions. For example, the computer readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, device, or propagation medium. Specific examples of the computer readable medium include: magnetic storage devices, such as magnetic tape or Hard Disk Drives (HDDs); optical storage devices, such as compact disks (CD-ROMs); a memory, such as a Random Access Memory (RAM) or a flash memory; and/or wired/wireless communication links.
In order to enable services such as network communication and data storage to provide services for users better and more efficiently, the services need to be tested comprehensively before being released, and the services can be tested by simulating various fault situations in the testing process to determine an efficient fault judgment and processing method.
According to various embodiments of the present disclosure, a test method is provided, where after receiving a test data packet, the test method determines a processing mode of the test data packet according to a preset test policy; and then processing the test data packet according to the processing mode. By the method, the processing mode of the test data packet is determined by the preset test strategy, the processing mode can be flexibly determined according to the condition of the test data packet, the purpose of comprehensive test can be achieved, and time and labor are saved.
Fig. 1 is a flowchart of a proposed testing method according to an exemplary embodiment of the present disclosure. As shown in fig. 1, the testing method includes the following steps 101-103, wherein:
in step 101, receiving a test data packet;
in step 102, the method is used for determining a processing mode of the test data packet according to a preset test strategy;
in step 103, the processing module is configured to process the test packet according to the processing manner.
In this embodiment, in the test process, after receiving the test data packet, the processing mode of the test data packet is determined according to the preset test policy, and the test data packet is processed according to the determined processing mode. By the method, the test data packet can be processed according to the preset strategy, a test environment is simulated once, and the performance of the service is tested.
In one embodiment, the test packets may be user data generated on a client in a test environment, and for network communication testing, the test packets may be application test packets. And the proxy server can be arranged in the test environment and used for receiving the test data packet, determining the processing mode of the test data packet according to a preset test strategy and processing the test data packet according to the processing mode. That is to say, the test method in this embodiment is executed on the proxy server, and the data request end that sends the test data packet may perform fault processing or normal processing according to the processing manner of the proxy server on the test data packet. The preset test strategy can be preset, after the test data packet is received, when the test strategy is determined to be a fault strategy according to the test data packet, the test data packet is processed according to the corresponding fault strategy, after the data request end receives a normal request response of the test data packet, whether a fault occurs is determined, if the fault occurs, the corresponding fault processing is carried out, and then whether the fault processing mode is effective is tested according to the fault processing result. Certainly, when the preset test strategy is a non-failure strategy, the test data packet is normally processed, and after the data request end receives a normal request response, the failure processing is not performed.
In an embodiment, the preset test policy includes a failure policy and a non-failure policy, where in the failure policy, the processing mode of the test data packet is a mode of performing failure processing on the test data packet, and in the non-failure policy, the processing mode of the test data packet is a mode of performing normal processing on the test data packet. The failure policy may include a response delay policy, a no response policy, a response error policy, and the like. When the preset test strategy is a response delay strategy, the processing mode of the test data packet is to return a response result after delaying for a preset time; when the preset test strategy is a non-response strategy, the processing mode of the test data packet is that no response result is returned; and when the preset test strategy is a response error strategy, the processing mode of the test data packet is to return an error response result. Of course, it is understood that any other testing strategy can be set according to actual conditions so as to simulate various fault situations which can occur in a real environment.
In an embodiment, determining a processing mode of the test data packet according to a preset test policy includes: determining a current preset test strategy; and when the current preset test strategy is a delay strategy, determining that the processing mode is to return a response result of the test data packet after delaying for a preset time. In another embodiment, determining the processing mode of the test data packet according to a preset test policy includes: determining a current preset test strategy; and when the current preset test strategy is a no-response strategy, determining that the processing mode is not to return a response result of the test data packet. In another embodiment, determining the processing result of the test packet according to a preset test policy includes: determining a current preset test strategy; and when the current preset test strategy is a return error strategy, determining that the processing mode is to return an error response result of the test data packet.
In an embodiment, the preset test policy may be set according to a specific test, and for a network communication test, policies such as delayed response, no response, and error return may be adopted, and for other tests, different policies may also be set.
In an embodiment, when the method is executed, the selection of the preset test strategy may be performed according to specific situations, including randomly selecting one test strategy, or selecting a corresponding test strategy according to a certain sequence, time, and the like, or selecting a corresponding test strategy according to a calculation result of a preset function, and the like.
In an embodiment, the predetermined test policy may also be determined according to data characteristics in the test data packet. In some service tests, the occurrence of a failure may be related to the data characteristics in the data packet, i.e. certain data characteristics may cause the same failure. For such situations, a data detection model may be obtained by training a specific training sample, and the data detection model detects data features in a data packet to determine which test strategy the data packet is suitable for.
Fig. 2 is a flowchart of a method of step 102 in a testing method provided in accordance with an exemplary embodiment of the present disclosure. As shown in fig. 2, step 102 comprises the following steps 201 and 203, wherein:
in step 201, extracting a first data feature from the test data packet;
in step 202, detecting the extracted first data feature by using a preset data detection model;
in step 203, the processing method for determining the test data packet according to the detection result is used.
In this embodiment, the first data feature may be a feature value of some key information in the data packet, and may be, for example, a feature value calculated by some existing feature value calculation function, such as a destination, a source address, a data length, and a data content of the data packet. The preset data detection model can be a data model obtained through cluster learning, the input of the preset data detection model is data characteristics, the output of the preset data detection model is a test strategy, namely after the data characteristic value of a certain test data packet is input, the data detection model can determine which test strategy the test data packet is suitable for according to the data characteristic value, and then the processing mode of the test data packet can be determined according to the determined test strategy. By the method of the embodiment, the strategy can be tested according to the characteristics of the specific data packet, so that the test result is closer to the real situation, and the test effect is better.
Fig. 3 is a flowchart of a training method of a data detection model in a testing method according to an exemplary embodiment of the present disclosure. As shown in fig. 3, the testing method further comprises the following steps 301-303, wherein:
in step 301, the method is used to obtain a training sample and a processing mode corresponding to the training sample;
in step 302, extracting a second data feature in the training sample;
in step 303, the data detection model is obtained by training using the second data feature and a corresponding processing manner; and the output of the data detection model is a processing mode suitable for the training sample.
In this embodiment, a training sample in a real business environment is collected by an existing means, and a processing manner for responding to the training sample is provided. For example, in a database test environment, for a data packet a, if a storage error fault occurs when the data packet a is stored due to an unsatisfactory size or content, that is, the real processing response of the database to the data packet a is a processing result with a return error, in this case, the training sample is the data packet a, and the corresponding processing mode is a fault processing mode with a return error result. In this embodiment, a series of collected training samples are trained one by one, that is, for each training sample, a second data feature is extracted, where the second data feature is the same as the first data feature. And training the initial data detection model parameters by using the extracted second data characteristics, comparing the result obtained by the initial data detection model with the real processing mode corresponding to the training sample, and adjusting the data detection model parameters. After a series of training samples are trained, the training is stopped until the adjustment value of the data detection model parameter is smaller than a preset threshold value or the training times reach the maximum times, and a final data detection model is obtained.
By the embodiment of the disclosure, the service to be tested can be tested by simulating the testing environment, and the testing process is simplified by presetting the testing strategy, so that the testing cost is saved, and the testing precision is improved.
Fig. 4 is a block diagram of a test apparatus provided in accordance with an exemplary embodiment of the present disclosure. As shown in fig. 4, the test apparatus includes:
a receiving module 401 configured to receive a test data packet;
a determining module 402, configured to determine a processing manner of the test data packet according to a preset test policy;
a processing module 403 configured to process the test data packet according to the processing manner.
In this embodiment, in the test process, after receiving the test data packet, the processing mode of the test data packet is determined according to the preset test policy, and the test data packet is processed according to the determined processing mode. By the method, the test data packet can be processed according to the preset strategy, a test environment is simulated once, and the performance of the service is tested.
In one embodiment, the test packets may be user data generated on a client in a test environment, and for network communication testing, the test packets may be application test packets. And the proxy server can be arranged in the test environment and used for receiving the test data packet, determining the processing mode of the test data packet according to a preset test strategy and processing the test data packet according to the processing mode. That is to say, the test method in this embodiment is executed on the proxy server, and the data request end that sends the test data packet may perform fault processing or normal processing according to the processing manner of the proxy server on the test data packet. The preset test strategy can be preset, after the test data packet is received, when the test strategy is determined to be a fault strategy according to the test data packet, the test data packet is processed according to the corresponding fault strategy, after the data request end receives a normal request response of the test data packet, whether a fault occurs is determined, if the fault occurs, the corresponding fault processing is carried out, and then whether the fault processing mode is effective is tested according to the fault processing result. Certainly, when the preset test strategy is a non-failure strategy, the test data packet is normally processed, and after the data request end receives a normal request response, the failure processing is not performed.
In an embodiment, the preset test policy includes a failure policy and a non-failure policy, where in the failure policy, the processing mode of the test data packet is a mode of performing failure processing on the test data packet, and in the non-failure policy, the processing mode of the test data packet is a mode of performing normal processing on the test data packet. The failure policy may include a response delay policy, a no response policy, a response error policy, and the like. When the preset test strategy is a response delay strategy, the processing mode of the test data packet is to return a response result after delaying for a preset time; when the preset test strategy is a non-response strategy, the processing mode of the test data packet is that no response result is returned; and when the preset test strategy is a response error strategy, the processing mode of the test data packet is to return an error response result. Of course, it is understood that any other testing strategy can be set according to actual conditions so as to simulate various fault situations which can occur in a real environment.
In an embodiment, the preset test policy may be set according to a specific test, and for a network communication test, policies such as delayed response, no response, and error return may be adopted, and for other tests, different policies may also be set.
In an embodiment, the selection of the preset test strategy may be performed according to specific situations, including randomly selecting one test strategy, or selecting a corresponding test strategy according to a certain sequence, time, or the like, or selecting a corresponding test strategy according to a calculation result of a preset function, or the like.
In an embodiment, the predetermined test policy may also be determined according to data characteristics in the test data packet. In some service tests, the occurrence of a failure may be related to the data characteristics in the data packet, i.e. certain data characteristics may cause the same failure. For such situations, a data detection model may be obtained by training a specific training sample, and the data detection model detects data features in a data packet to determine which test strategy the data packet is suitable for.
Fig. 5 is a block diagram of a determination module 402 in a test method provided according to an exemplary embodiment of the present disclosure. As shown in fig. 5, the determining module 402 includes, among others:
an extraction submodule 501 configured to extract a first data feature from the test data packet;
a detection sub-module 502 configured to detect the extracted first data feature by using a preset data detection model;
the determining submodule 503 is configured to determine a processing manner of the test data packet according to the detection result.
In this embodiment, the first data feature may be a feature value of some key information in the data packet, and may be, for example, a feature value calculated by some existing feature value calculation function, such as a destination, a source address, a data length, and a data content of the data packet. The preset data detection model can be a data model obtained through cluster learning, the input of the preset data detection model is data characteristics, the output of the preset data detection model is a test strategy, namely after the data characteristic value of a certain test data packet is input, the data detection model can determine which test strategy the test data packet is suitable for according to the data characteristic value, and then the processing mode of the test data packet can be determined according to the determined test strategy. By the method of the embodiment, the strategy can be tested according to the characteristics of the specific data packet, so that the test result is closer to the real situation, and the test effect is better.
Fig. 6 is a block diagram of another embodiment of a testing method provided in accordance with an exemplary embodiment of the present disclosure. As shown in fig. 6, the test apparatus further includes:
an obtaining module 601 configured to obtain a training sample and a processing manner corresponding to the training sample;
an extraction module 602 configured to extract a second data feature in the training sample;
a training module 603 configured to train to obtain the data detection model by using the second data feature and a corresponding processing manner; and the output of the data detection model is a processing mode suitable for the training sample.
In this embodiment, a training sample in a real business environment is collected by an existing means, and a processing manner for responding to the training sample is provided. For example, in a database test environment, for a data packet a, if a storage error fault occurs when the data packet a is stored due to an unsatisfactory size or content, that is, the real processing response of the database to the data packet a is a processing result with a return error, in this case, the training sample is the data packet a, and the corresponding processing mode is a fault processing mode with a return error result. In this embodiment, a series of collected training samples are trained one by one, that is, for each training sample, a second data feature is extracted, where the second data feature is the same as the first data feature. And training the initial data detection model parameters by using the extracted second data characteristics, comparing the result obtained by the initial data detection model with the real processing mode corresponding to the training sample, and adjusting the data detection model parameters. After a series of training samples are trained, the training is stopped until the adjustment value of the data detection model parameter is smaller than a preset threshold value or the training times reach the maximum times, and a final data detection model is obtained.
By the embodiment of the disclosure, the service to be tested can be tested by simulating the testing environment, and the testing process is simplified by presetting the testing strategy, so that the testing cost is saved, and the testing precision is improved.
According to a third aspect of embodiments of the present disclosure, there is provided a test system, comprising:
one or more memories storing executable instructions; and
one or more processors executing the executable instructions to implement any of the following methods.
Wherein the processor is configured to:
receiving a test data packet;
determining a processing mode of the test data packet according to a preset test strategy;
and processing the test data packet according to the processing mode.
The processor may be further configured to:
determining a processing mode of the test data packet according to a preset test strategy, wherein the processing mode comprises the following steps:
determining a current preset test strategy;
and when the current preset test strategy is a delay strategy, determining that the processing mode is to return a response result of the test data packet after delaying for a preset time.
Determining a processing mode of the test data packet according to a preset test strategy, wherein the processing mode comprises the following steps:
determining a current preset test strategy;
and when the current preset test strategy is a no-response strategy, determining that the processing mode is not to return a response result of the test data packet.
Determining a processing result of the test data packet according to a preset test strategy, wherein the processing result comprises the following steps:
determining a current preset test strategy;
and when the current preset test strategy is a return error strategy, determining that the processing mode is to return an error response result of the test data packet.
The determining the processing mode of the test data packet according to the preset test strategy comprises the following steps:
extracting a first data feature from the test data packet;
detecting the extracted first data characteristic by using a preset data detection model;
and determining the processing mode of the test data packet according to the detection result.
The processor is further configured to:
acquiring a training sample and a processing mode corresponding to the training sample;
extracting a second data feature in the training sample;
training by utilizing the second data characteristics and the corresponding processing mode to obtain the preset data detection model; and the output of the data detection model is a processing mode suitable for the training sample.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 7 schematically shows a block diagram of a test apparatus according to an embodiment of the present disclosure.
As shown in fig. 7, a test apparatus according to an embodiment of the present disclosure includes a processor 710 and a computer-readable storage medium 720.
In particular, processor 710 may comprise, for example, a general purpose microprocessor, an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), and/or the like. The processor 710 may also include on-board memory for caching purposes. Processor 710 may be a single processing unit or a plurality of processing units for performing the different actions of the method flows described with reference to fig. 1-3, as well as other embodiments of the disclosure.
Computer-readable storage medium 720 may be, for example, any medium that can contain, store, communicate, propagate, or transport the instructions. For example, a readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, device, or propagation medium. Specific examples of the readable storage medium include: magnetic storage devices, such as magnetic tape or Hard Disk Drives (HDDs); optical storage devices, such as compact disks (CD-ROMs); a memory, such as a Random Access Memory (RAM) or a flash memory; and/or wired/wireless communication links.
The computer-readable storage medium 720 may include a computer program 721, which computer program 721 may include code/computer-executable instructions that, when executed by the processor 710, cause the processor 710 to perform the method flows described in the embodiments of the present disclosure and any variations thereof.
The computer program 721 may be configured with, for example, computer program code comprising computer program modules. For example, in an example embodiment, code in computer program 721 may include one or more program modules, including 721A, modules 721B, … …, for example. It should be noted that the division and number of the modules are not fixed, and those skilled in the art can use suitable program modules or program module combinations according to actual situations, and when the program modules are executed by the processor 710, the processor 710 can execute the method flows described in the embodiments of the present disclosure and any modifications thereof.
In accordance with embodiments of the present disclosure, the processor 710 may use the signal transmitter 730 and the signal receiver 740 to perform the method flows described by the embodiments of the present disclosure and any variations thereof.
The above methods, apparatuses, units and/or modules according to embodiments of the present disclosure may be implemented by an electronic device with computing capabilities executing software containing computer instructions. The system may include storage devices to implement the various storage described above. The computing-capable electronic device may include, but is not limited to, a general-purpose processor, a digital signal processor, a special-purpose processor, a reconfigurable processor, and the like capable of executing computer instructions. Execution of such instructions causes the electronic device to be configured to perform the operations described above in accordance with the present disclosure. The above devices and/or modules may be implemented in one electronic device, or may be implemented in different electronic devices. Such software may be stored in a computer readable storage medium. The computer readable storage medium stores one or more programs (software modules) comprising instructions which, when executed by one or more processors in an electronic device, cause the electronic device to perform the methods of the present disclosure.
Such software may be stored in the form of volatile memory or non-volatile storage (such as storage devices like ROM), whether erasable or rewritable, or in the form of memory (e.g. RAM, memory chips, devices or integrated circuits), or on optically or magnetically readable media (such as CD, DVD, magnetic disks or tapes, etc.). It should be appreciated that the storage devices and storage media are embodiments of machine-readable storage suitable for storing one or more programs that include instructions, which when executed, implement embodiments of the present disclosure. Embodiments provide a program and a machine-readable storage device storing such a program, the program comprising code for implementing the apparatus or method of any one of the claims of the present disclosure. Further, these programs may be delivered electronically via any medium (e.g., communication signals carried via a wired connection or a wireless connection), and embodiments suitably include these programs.
Methods, apparatus, units and/or modules according to embodiments of the present disclosure may also be implemented using hardware or firmware, or in any suitable combination of software, hardware and firmware implementations, for example, Field Programmable Gate Arrays (FPGAs), Programmable Logic Arrays (PLAs), system on a chip, system on a substrate, system on a package, Application Specific Integrated Circuits (ASICs), or in any other reasonable manner for integrating or packaging circuits. The system may include a storage device to implement the storage described above. When implemented in these manners, the software, hardware, and/or firmware used is programmed or designed to perform the corresponding above-described methods, steps, and/or functions according to the present disclosure. One skilled in the art can implement one or more of these systems and modules, or one or more portions thereof, using different implementations as appropriate to the actual needs. Such implementations are within the scope of the present disclosure.
A non-transitory computer readable storage medium having instructions therein which, when executed by a processor of a testing apparatus, enable the apparatus to perform the above-described testing method, the method comprising:
receiving a test data packet;
determining a processing mode of the test data packet according to a preset test strategy;
and processing the test data packet according to the processing mode.
Determining a processing mode of the test data packet according to a preset test strategy, wherein the processing mode comprises the following steps:
determining a current preset test strategy;
and when the current preset test strategy is a delay strategy, determining that the processing mode is to return a response result of the test data packet after delaying for a preset time.
Determining a processing mode of the test data packet according to a preset test strategy, wherein the processing mode comprises the following steps:
determining a current preset test strategy;
and when the current preset test strategy is a no-response strategy, determining that the processing mode is not to return a response result of the test data packet.
The determining the processing result of the test data packet according to the preset test strategy comprises:
determining a current preset test strategy;
and when the current preset test strategy is a return error strategy, determining that the processing mode is to return an error response result of the test data packet.
Wherein, the determining the processing mode of the test data packet according to the preset test strategy comprises:
extracting a first data feature from the test data packet;
detecting the extracted first data characteristic by using a preset data detection model;
and determining the processing mode of the test data packet according to the detection result.
The method further comprises the following steps:
acquiring a training sample and a processing mode corresponding to the training sample;
extracting a second data feature in the training sample;
training by utilizing the second data characteristics and the corresponding processing mode to obtain the preset data detection model; and the output of the data detection model is a processing mode suitable for the training sample.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (7)

1. A method of testing, comprising:
receiving a test data packet;
determining a processing mode of a test data packet according to a preset test strategy, wherein the preset test strategy comprises a fault strategy and a non-fault strategy, and the fault strategy comprises a response delay strategy, a no-response strategy and a response error strategy;
processing the test data packet according to the processing mode;
the determining the processing mode of the test data packet according to the preset test strategy comprises the following steps:
extracting a first data characteristic from the test data packet, wherein the first data characteristic refers to a characteristic value of key information in the test data packet, and the characteristic value is obtained through calculation of a characteristic value calculation function;
detecting the extracted first data characteristic by using a preset data detection model;
determining a processing mode of the test data packet according to the detection result;
the test method further comprises the following steps:
acquiring a training sample and a processing mode corresponding to the training sample;
extracting a second data feature in the training sample;
training by utilizing the second data characteristics and the corresponding processing mode to obtain the data detection model; and the output of the data detection model is a processing mode suitable for the training sample.
2. The method of claim 1, wherein determining the processing mode of the test data packet according to a preset test policy comprises:
determining a current preset test strategy;
and when the current preset test strategy is a delay strategy, determining that the processing mode is to return a response result of the test data packet after delaying for a preset time.
3. The method of claim 1, wherein determining the processing mode of the test data packet according to a preset test policy comprises:
determining a current preset test strategy;
and when the current preset test strategy is a no-response strategy, determining that the processing mode is not to return a response result of the test data packet.
4. The method of claim 1, determining a processing result of the test packet according to a preset test policy, comprising:
determining a current preset test strategy;
and when the current preset test strategy is a return error strategy, determining that the processing mode is to return an error response result of the test data packet.
5. A test apparatus, comprising:
a receiving module configured to receive a test data packet;
the device comprises a determining module, a processing module and a processing module, wherein the determining module is configured to determine a processing mode of a test data packet according to a preset test strategy, the preset test strategy comprises a fault strategy and a non-fault strategy, and the fault strategy comprises a response delay strategy, a non-response strategy and a response error strategy;
a processing module configured to process the test data packet according to the processing mode;
the determining module comprises:
the extraction submodule is configured to extract a first data feature from the test data packet, wherein the first data feature refers to a feature value of key information in the test data packet, and the feature value is obtained through calculation of a feature value calculation function;
the detection submodule is configured to detect the extracted first data feature by using a preset data detection model;
the determining submodule is configured to determine a processing mode of the test data packet according to the detection result;
the test device further comprises:
the acquisition module is configured to acquire a training sample and a processing mode corresponding to the training sample;
an extraction module configured to extract a second data feature in the training sample;
the training module is configured to train by using the second data characteristics and the corresponding processing mode to obtain the data detection model; and the output of the data detection model is a processing mode suitable for the training sample.
6. A test system, comprising:
one or more memories storing executable instructions; and
one or more processors executing the executable instructions to implement the method of any one of claims 1-4.
7. A machine-readable storage medium storing executable instructions which, when executed by a processor, implement the method of any one of claims 1-4.
CN201710311424.3A 2017-05-05 2017-05-05 Test method, device, system and machine readable storage medium Active CN107222332B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710311424.3A CN107222332B (en) 2017-05-05 2017-05-05 Test method, device, system and machine readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710311424.3A CN107222332B (en) 2017-05-05 2017-05-05 Test method, device, system and machine readable storage medium

Publications (2)

Publication Number Publication Date
CN107222332A CN107222332A (en) 2017-09-29
CN107222332B true CN107222332B (en) 2020-04-07

Family

ID=59943875

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710311424.3A Active CN107222332B (en) 2017-05-05 2017-05-05 Test method, device, system and machine readable storage medium

Country Status (1)

Country Link
CN (1) CN107222332B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110233779B (en) * 2019-07-16 2021-08-06 迈普通信技术股份有限公司 Test method, test system and computer readable storage medium
CN111385147B (en) * 2020-03-06 2021-07-27 腾讯科技(深圳)有限公司 Fault simulation method, device and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1336744A (en) * 2000-08-01 2002-02-20 上海龙林通信技术有限公司 Safe Ethernet constituting method
CN101540705A (en) * 2009-04-01 2009-09-23 中兴通讯股份有限公司 Message agent device and simulation-generation method of test environment
CN102325057A (en) * 2011-06-27 2012-01-18 中国商用飞机有限责任公司 Network testing device
CN106570513A (en) * 2015-10-13 2017-04-19 华为技术有限公司 Fault diagnosis method and apparatus for big data network system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020016937A1 (en) * 2000-08-02 2002-02-07 Henry Houh Method and apparatus for utilizing a network processor as part of a test system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1336744A (en) * 2000-08-01 2002-02-20 上海龙林通信技术有限公司 Safe Ethernet constituting method
CN101540705A (en) * 2009-04-01 2009-09-23 中兴通讯股份有限公司 Message agent device and simulation-generation method of test environment
CN102325057A (en) * 2011-06-27 2012-01-18 中国商用飞机有限责任公司 Network testing device
CN106570513A (en) * 2015-10-13 2017-04-19 华为技术有限公司 Fault diagnosis method and apparatus for big data network system

Also Published As

Publication number Publication date
CN107222332A (en) 2017-09-29

Similar Documents

Publication Publication Date Title
CN110414242B (en) Method, device, equipment and medium for detecting business logic loophole
CN108353004B (en) Method, system, and computer readable medium for testing Network Function Virtualization (NFV)
CN108075934B (en) Network quality monitoring method, device and system
CN113315744A (en) Programmable switch, flow statistic method, defense method and message processing method
US20150278517A1 (en) Method and system for comparing different versions of a cloud based application in a production environment using segregated backend systems
US20140337836A1 (en) Optimized resource allocation for virtual machines within a malware content detection system
CN108134816B (en) Access to data on remote device
US9218266B2 (en) Systems and methods for replication of test results in a network environment
US20150135018A1 (en) Analysis method, analysis apparatus, computer-readable storage medium storing analysis program
CN104767655B (en) A kind of analog result detection method and device
US10552278B2 (en) Non-destructive analysis to determine use history of processor
US20170310566A1 (en) System and method for detecting system's performance regression
CN105743732B (en) Method and system for recording transmission path and distribution condition of local area network files
CN107222332B (en) Test method, device, system and machine readable storage medium
CN109739527A (en) A kind of method, apparatus, server and the storage medium of the publication of client gray scale
US9922149B2 (en) Integration of functional analysis and common path pessimism removal in static timing analysis
CN107231271A (en) A kind of detection method and device of shared verification
CN109120468B (en) Method, device and storage medium for obtaining end-to-end network delay
CN111143151B (en) Service monitoring method and device and electronic equipment
CN115396501B (en) Information processing method and device, electronic equipment and readable storage medium
CN110912779A (en) Cluster host health detection method, system, equipment and readable storage medium
CN114039883B (en) Proxy testing method and device, electronic equipment and storage medium
US10055522B2 (en) Automated checker generation
CN109495330A (en) A kind of method and device realized UDP and intercept test
CN107819739B (en) Method and server for determining whether long-link connection exists in terminal

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