[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN115373916A - Abnormality detection method, abnormality detection device, electronic apparatus, and computer-readable storage medium - Google Patents

Abnormality detection method, abnormality detection device, electronic apparatus, and computer-readable storage medium Download PDF

Info

Publication number
CN115373916A
CN115373916A CN202210999587.6A CN202210999587A CN115373916A CN 115373916 A CN115373916 A CN 115373916A CN 202210999587 A CN202210999587 A CN 202210999587A CN 115373916 A CN115373916 A CN 115373916A
Authority
CN
China
Prior art keywords
abnormal
equipment
test
determining
exception
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.)
Pending
Application number
CN202210999587.6A
Other languages
Chinese (zh)
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.)
Hillstone Networks Co Ltd
Original Assignee
Hillstone Networks 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 Hillstone Networks Co Ltd filed Critical Hillstone Networks Co Ltd
Priority to CN202210999587.6A priority Critical patent/CN115373916A/en
Publication of CN115373916A publication Critical patent/CN115373916A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses an abnormality detection method, an abnormality detection device, electronic equipment and a computer-readable storage medium. Wherein, the method comprises the following steps: receiving a test instruction; in response to the test instruction, executing a plurality of first scripts in the first test script set in a traversing mode according to a preset sequence; under the condition that an exception occurs in the process of executing a preset script in a plurality of first scripts, determining abnormal equipment corresponding to the exception, equipment parameters corresponding to the abnormal equipment and a second test script set; replacing the abnormal equipment with the target equipment to obtain a target equipment group; and traversing and executing a plurality of second scripts in the second test script set according to a preset sequence, and determining an abnormal test result of the preset system. The invention solves the technical problem of low efficiency when the equipment group is abnormally tested in the related technology.

Description

Abnormality detection method, abnormality detection device, electronic apparatus, and computer-readable storage medium
Technical Field
The present invention relates to the field of computers, and in particular, to an anomaly detection method, an anomaly detection device, an electronic apparatus, and a computer-readable storage medium.
Background
At present, devices are widely applied in production and life, for example, a virtualized device has a higher and higher proportion in the market due to a series of advantages of high specific resource utilization rate, low management cost, high flexibility, strong expandability and the like, and it is important in the normal working process of a device group to timely detect and process device abnormalities in the device group, but in the related art, the detected abnormalities are mainly processed in an artificial abnormality processing manner, however, the problem of low efficiency often exists when the abnormalities are processed in this manner, and therefore, how to improve the detection and processing efficiency of the abnormalities in the device group is a difficult problem facing at present.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides an abnormality detection method, an abnormality detection device, electronic equipment and a computer-readable storage medium, which at least solve the technical problem of low efficiency in abnormality testing of equipment groups in the related art.
According to an aspect of an embodiment of the present invention, there is provided an anomaly testing method, including: receiving a test instruction, wherein the test instruction is used for testing an initial equipment group in a predetermined system; in response to the test instruction, traversing and executing a plurality of first scripts in a first test script set according to a preset sequence, wherein the first test script set is a script set corresponding to the initial equipment group, and the plurality of first scripts in the first test script set are used for testing the initial equipment group respectively; under the condition that an exception occurs in the process of executing a preset script in the plurality of first scripts, determining exception equipment corresponding to the exception, equipment parameters corresponding to the exception equipment and a second test script set, wherein the second test script set is a script set determined from the plurality of first scripts in the first test script set according to the preset script; replacing the abnormal equipment with target equipment to obtain a target equipment group, wherein the target equipment is determined based on the equipment parameters; and traversing and executing a plurality of second scripts in the second test script set according to the preset sequence, and determining the abnormal test result of the preset system.
Optionally, when an exception occurs during execution of a predetermined script in the plurality of first scripts, determining an exception device corresponding to the exception, a device parameter corresponding to the exception device, and a second test script set, where the determining includes: when the abnormity occurs in the process of executing the preset script in the plurality of first scripts, abnormity information corresponding to the abnormity is determined, wherein the abnormity information comprises abnormity equipment corresponding to the abnormity; extracting abnormal keywords of the abnormal information; determining the abnormal type of the abnormality according to the abnormal keyword; and under the condition that the abnormal type of the abnormal equipment is a first abnormal type, determining the equipment parameters corresponding to the abnormal equipment and the second test script set.
Optionally, the method further comprises: determining an exception handling mode corresponding to the exception according to the exception keyword under the condition that the exception type of the exception is a second exception type; and processing the exception according to the exception processing mode, and determining an exception processing result.
Optionally, the method further comprises: and determining the equipment parameters corresponding to the abnormal equipment and the second test script set under the condition that the abnormal processing result is processing failure.
Optionally, the replacing the abnormal device with the target device to obtain a target device group includes: configuring the network environment of the target equipment to obtain a target network environment; determining a security index for the target network environment; and under the condition that the safety index is larger than a preset threshold value, replacing the abnormal equipment with the target equipment to obtain the target equipment group.
Optionally, the method further comprises: determining replacement failure information in the case that the safety index is less than or equal to the predetermined threshold; and sending the replacement failure information to a preset terminal.
Optionally, before the receiving the test instruction, the method further includes: determining the initial device group and a pre-configured mode of the initial device group in the predetermined system; and determining the first test script set according to the pre-configuration mode.
According to an aspect of an embodiment of the present invention, there is provided an abnormality testing apparatus including: the device comprises a receiving module, a judging module and a judging module, wherein the receiving module is used for receiving a test instruction, and the test instruction is used for testing an initial equipment group in a predetermined system; a first testing module, configured to traverse, in response to the testing instruction, a plurality of first scripts in a first testing script set according to a predetermined sequence, where the first testing script set is a script set corresponding to the initial device group, and the plurality of first scripts in the first testing script set are used to test the initial device group respectively; the determining module is used for determining abnormal equipment corresponding to the abnormality, equipment parameters corresponding to the abnormal equipment and a second test script set under the condition that the abnormality occurs in the process of executing a preset script in the plurality of first scripts, wherein the second test script set is a script set determined from the plurality of first scripts in the first test script set according to the preset script; a replacing module, configured to replace the abnormal device with a target device to obtain a target device group, where the target device is determined based on the device parameter; and the second testing module is used for traversing and executing a plurality of second scripts in the second testing script set according to the preset sequence and determining the abnormal testing result of the preset system.
According to an aspect of an embodiment of the present invention, there is provided an electronic apparatus including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the anomaly testing method of any of the above.
According to an aspect of embodiments of the present invention, there is provided a computer-readable storage medium, in which instructions, when executed by a processor of an electronic device, enable the electronic device to perform an anomaly testing method as described in any one of the above.
In the embodiment of the invention, a test instruction for testing an initial device group in a predetermined system is received, a plurality of first scripts in a first test script set are executed in a traversing mode according to a predetermined sequence in response to the test instruction, abnormal devices corresponding to the abnormality, device parameters corresponding to the abnormal devices and a second test script set are determined under the condition that the abnormality occurs in the process of executing the predetermined scripts in the plurality of first scripts, the abnormal devices are replaced by target devices to obtain a target device group, and a plurality of second scripts in the second test script set are executed in a traversing mode according to the predetermined sequence to determine the abnormal test result of the predetermined system. Because the abnormality in the device group is processed in a mode that the target device replaces the abnormal device, the abnormality is not directly sent to a preset terminal after the abnormality is detected and the processing is waited. When an abnormality occurs, the second test scenario set is identified, and the first test scenario set is not continuously detected. By adopting the method to process the abnormity, the time for sending the abnormity information and waiting for processing can be saved, the efficiency of detecting the abnormity and processing the abnormity is improved, and the technical problem of low efficiency when the abnormity test is carried out on the equipment group in the related technology is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flow chart of an anomaly detection method according to an embodiment of the present invention;
FIG. 2 is a flow diagram of handling an automatically repairable exception as provided by an alternative embodiment of the present invention;
FIG. 3 is a flow diagram of handling a non-automatically repairable exception as provided by an alternative embodiment of the invention;
FIG. 4 is a schematic diagram of exception handling provided by an alternative embodiment of the present invention;
fig. 5 is a block diagram of the structure of an abnormality detection apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
In accordance with an embodiment of the present invention, there is provided an embodiment of an anomaly detection method, it is noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowchart, in some cases, the steps illustrated or described may be performed in an order different than that presented herein.
Fig. 1 is a flowchart of an abnormality detection method according to an embodiment of the present invention, as shown in fig. 1, the method including the steps of:
step S102, receiving a test instruction, wherein the test instruction is used for testing an initial equipment group in a predetermined system;
step S104, responding to the test instruction, and traversing and executing a plurality of first scripts in the first test script set according to a preset sequence;
step S106, under the condition that an exception occurs in the process of executing a preset script in a plurality of first scripts, determining abnormal equipment corresponding to the exception, equipment parameters corresponding to the abnormal equipment and a second test script set;
step S108, replacing the abnormal equipment with the target equipment to obtain a target equipment group;
step S110, traversing and executing a plurality of second scripts in the second test script set according to a predetermined sequence, and determining an abnormal test result of the predetermined system.
Through the steps, a test instruction for testing an initial device group in a predetermined system is received, a plurality of first scripts in a first test script set are executed in a traversing mode according to a predetermined sequence in response to the test instruction, abnormal devices corresponding to the abnormality, device parameters corresponding to the abnormal devices and a second test script set are determined under the condition that the abnormality occurs in the process of executing the predetermined scripts in the plurality of first scripts, the abnormal devices are replaced by target devices to obtain a target device group, and a plurality of second scripts in the second test script set are executed in a traversing mode according to the predetermined sequence to determine the abnormal test result of the predetermined system. Because the abnormality in the device group is processed in a mode that the target device replaces the abnormal device, the abnormality is not directly sent to a preset terminal after the abnormality is detected and the processing is waited. When an abnormality occurs, the second test scenario set is identified, and the first test scenario set is not continuously detected. By adopting the method to process the abnormity, the time for sending the abnormity information and waiting for processing can be saved, the efficiency of detecting the abnormity and processing the abnormity is improved, and the technical problem of low efficiency when the abnormity test is carried out on the equipment group in the related technology is solved.
It should be noted that, the predetermined system includes an initial device group and a networking between the initial device group and the initial device group, where the initial device group includes a Device Under Test (DUT) and an auxiliary device PC, and the device under test and the auxiliary device may be virtual devices created by a virtualization technology in addition to normal physical hardware devices. And running the test script under the test scene to test certain functions under the condition of ensuring smooth mutual communication between the device to be tested and the auxiliary testing device. And under the condition that the communication between the equipment to be detected and the auxiliary equipment is disconnected, the equipment can be detected and processed in time. And efficient and ordered test in the whole predetermined system is ensured.
As an alternative embodiment, an initial device group in the predetermined system is determined, and a pre-configured mode of the initial device group in the predetermined system is determined. The pre-configuration mode may also be referred to as a pre-configuration script, and refers to a network topology attribute of a predetermined device group and a network environment (networking structure) corresponding to the network topology attribute. A device group may have different network topology properties, and a network topology property may have different networking architectures, such as network protocols or configurations. For example, 2 DUTs and 2 PCs are required in the network topology of one test case, and the network topology attribute of the test case is D2P2. Under the condition that the network topology attributes are the same, different network protocols or configurations and other specific scenarios are often covered, such as testing IPV4 protocol or IPV6 protocol, testing network layer two or testing network layer three, and testing HA (high available) mechanism is also non-HA, and these different testing scenarios often need to issue different pre-configurations to the device first to complete the preparation of the basic testing environment. The above configuration is referred to as a pre-configured mode. For example, a D1P2 network topology IPV4 protocol related function test needs to be performed, a D1P2 network topology needs to be established, so as to ensure smooth network environment between devices, and meanwhile, the DUT and the PC are configured with IPV4 addresses, gateways, and the like, so as to ensure smooth mutual communication between the DUT and the 2 PCs. By determining the pre-configuration mode, whether an abnormality exists in the predetermined system under the test scene, the network topology attribute and the network environment corresponding to the network topology attribute can be determined, and the predetermined system under the pre-configuration mode can be subjected to targeted detection.
As an alternative embodiment, the first test script set is determined according to the preconfigured modes, where the first test script set includes a plurality of scripts for testing the predetermined system in the preconfigured modes, that is, each preconfigured mode may include a plurality of test scripts, so as to test some functions according to the test scripts to perform corresponding functional tests to check whether there is an abnormality. And determining the first test script set through the pre-configuration mode, so that the test function can be effectively executed on the predetermined system.
It should be noted that, since the preconfigured modes may be multiple, in the present application, the preconfigured modes to be tested may be ordered according to the predetermined rules for the predetermined system, and the test function is executed on the predetermined system in multiple preconfigured modes, that is, after the test function in one preconfigured mode is executed, the networking structure is updated, and the test function in the next preconfigured mode is executed. After the script set with the same network topology attribute is executed, the test function of the pre-configuration mode in the next network topology attribute is executed, and continuous test can be realized.
As an alternative embodiment, a test instruction is received, where the test instruction is used to test an initial set of devices in a predetermined system. After receiving the test instruction, in response to the test instruction, traversing and executing a plurality of first scripts in a first test script set according to a predetermined order, that is, executing the scripts in the first test script set one by one according to the predetermined order, where the first test script set is a script set corresponding to the initial device group, the plurality of first scripts in the first test script set are used to test the initial device group respectively, and the predetermined order may be set according to actual application and scenes, that is, according to a predetermined system, the rule of highest efficiency or shortest time, and the like. The plurality of first scripts are executed in a traversing mode according to the preset sequence, so that the test can be carried out orderly, the abnormity detection efficiency is effectively improved, and the abnormity detection time is shortened.
As an optional embodiment, when an exception occurs in the process of executing a predetermined script in a plurality of first scripts, the test operation of the subsequent script is not executed any more, and the test time is saved. After the predetermined script is abnormal, abnormal information corresponding to the abnormality can be determined, wherein the abnormal information comprises abnormal equipment corresponding to the abnormality. Extracting abnormal keywords of the abnormal information, and determining abnormal types according to the abnormal keywords, wherein the abnormal types comprise a first abnormal type which cannot be automatically repaired and a second abnormal type which can be automatically repaired. By means of keywords, the exception type can be determined quickly, and by exception classification, the exception can be automatically repaired under the condition that the exception can be automatically repaired, and more time is not consumed. And when the abnormity is incapable of automatically repairing the abnormity, executing subsequent operations such as determining the equipment parameters corresponding to the abnormal equipment, and performing targeted processing to try to repair the abnormity. And after the exception recovery is finished, executing the test operation of the subsequent script. By the content of the optional embodiment, different exception handling modes are adopted for exceptions of different exception types, so that the exception handling is more targeted.
As an optional embodiment, when the abnormal type of the abnormality is the first abnormal type, that is, when the abnormal type cannot be automatically repaired, the target device may be used to replace the abnormal device, so as to obtain a target device group, and the test may be continuously performed. In the process of determining the target device group, the determination may be made as follows: determining the device parameters corresponding to the abnormal devices, and determining the target devices based on the device parameters, wherein the process of determining the target devices based on the device parameters is equivalent to acquiring the image files of the abnormal devices, so that the process of creating the same devices is created. And under the condition that the abnormal equipment is abnormal, directly replacing the abnormal equipment, configuring the network environment of the target equipment, and obtaining the target network environment, so that the test operation of the untested script and the current abnormal script can be executed.
It should be noted that, after the target device group is obtained and the target network environment is obtained, the security index of the target network environment is also determined, that is, whether the target network environment can be used for subsequent testing or not is determined, and whether the subsequent testing is safe or not is executed. And under the condition that the safety index is larger than a preset threshold value, replacing the abnormal equipment with the target equipment to obtain a target equipment group. The normal and orderly proceeding of the subsequent tests can be ensured.
Optionally, in a case where the safety index is equal to or less than a predetermined threshold value, that is, in a case where the target device cannot be used in a predetermined system, the replacement failure information is determined, and the replacement failure information is sent to a predetermined terminal, so that a technician knows the replacement failure information, and thus the technician can handle the abnormality. In this case, the processing of the abnormality by replacing the abnormal device has failed, that is, the abnormality cannot be automatically processed, and sending information to a predetermined terminal enables the abnormality to be noticed in time for processing.
As an optional embodiment, when the exception type of the exception is the second exception type, that is, the exception can be repaired, the exception handling manner corresponding to the exception is determined according to the exception keyword. And processing the exception according to the exception processing mode, and determining an exception processing result. And when the exception processing result is processing failure, executing the same processing mode as the first exception type, namely determining an exception device corresponding to the exception and operating the device parameter corresponding to the exception device. According to the optional embodiment of the application, the second exception type exception can be directly processed according to the exception processing mode corresponding to the keyword, if the exception can be successfully processed through the mode, the time overhead of replacing exception equipment is avoided, and the exception processing flow is simplified.
As an optional embodiment, when an exception occurs in the process of executing a predetermined script in the plurality of first scripts, a second test script set may be determined, where the second test script set is a script set corresponding to the target device group, and the second test script set is a script set determined from the plurality of first scripts in the first test script set according to the predetermined script, that is, the second script set is a currently abnormal script and a plurality of untested scripts. And traversing and executing a plurality of second scripts in the second test script set according to a preset sequence, and determining an abnormal test result of the preset system, wherein the plurality of second scripts in the second test script set are used for respectively testing the target equipment group. And determining the second script set, and not executing the successfully executed first script in the first script set, thereby effectively avoiding time waste caused by repeatedly executing the successfully executed script.
It should be noted that, when the test function of the second test script set is executed, the same operation as that described above is performed when an exception occurs in a certain script of the plurality of second scripts, which is not described herein again. Finally, the abnormal test result of the preset system can be determined, and the test process is executed.
The optional embodiment of the present invention provides a method for rapidly detecting and handling an exception of a device group in a predetermined system, and explains the method provided in the optional embodiment of the present invention by taking a virtual device group in which an exception occurs as an example.
FIG. 2 is a flow chart of handling an automatically repairable exception according to an alternative embodiment of the present invention, as shown in FIG. 2, and described below:
s1, starting automatic repair;
s2, judging whether equipment (the same as the equipment with the second abnormal type) which can automatically repair the abnormal equipment exists;
s2.1, under the condition that the abnormal equipment capable of being automatically repaired does not exist, judging whether abnormal equipment (the same as the equipment with the first abnormal type) which cannot be automatically repaired exists or not;
s2.1.1, determining that the abnormal device fails to be repaired when the abnormal device cannot be automatically repaired exists, where the processing method is the same as the flow of fig. 3, and is not described herein again;
s2.1.2, determining that the abnormal equipment is successfully repaired under the condition that the abnormal equipment which cannot be automatically repaired does not exist;
s2.2, under the condition that abnormal equipment capable of being automatically repaired exists, identifying abnormal information keywords, and executing S3;
s3, selecting a corresponding keyword repairing scheme (the same as the abnormal processing mode) according to the abnormal keywords;
s4, judging whether the abnormal equipment is successfully repaired;
s4.1, under the condition that the abnormal equipment is successfully repaired, recovering the equipment configuration before the abnormality occurs, and then executing the step S2;
and S4.2, inserting an abnormal record which cannot be automatically repaired under the condition that the abnormal equipment is failed to be repaired, and then executing the step S2.
FIG. 3 is a flow chart of handling non-automatically repairable exceptions provided by an alternative embodiment of the present invention, where in FIG. 3: VDUT represents the virtual device under test in the device group, VPC represents the virtual auxiliary device, as shown in fig. 3, which is introduced below:
s1, starting exception handling, and recording the flow as a task 1 (namely traversing and executing a plurality of first scripts in a first test script set according to a preset sequence to detect an abnormal flow);
s2, judging whether unprocessed abnormal equipment exists or not;
s2.1, determining whether the abnormal equipment is a VDUT (virtual desktop terminal) under the condition that the unprocessed abnormal equipment exists;
s2.1.1, determining the abnormal VDUT configuration when the abnormal device is a VDUT, and creating a new VDUT on the server using the image file (i.e. the above process of replacing the abnormal device with the target device when the abnormal device is a VDUT);
s2.1.2, determining the abnormal device as VPC when the abnormal device is not VDUT, obtaining the configuration of the abnormal VPC, and applying for a new VPC (i.e. in case the abnormal device is VPC, the above process of replacing the abnormal device with the target device);
s2.1.3, determining whether the new virtual device environment check passes (i.e. the above process of determining the security index of the target network environment);
s2.1.3.1, in case the environment check passes (i.e. in case the above-mentioned safety index is greater than a predetermined threshold), recording new device information;
s2.1.3.2, in the case where the environment check does not pass (that is, in the case where the safety index is equal to or less than the predetermined threshold), replacing the abnormal device again, and determining whether or not the virtual device environment passes again;
s2.1.3.2.1, determining that task 1 fails when the abnormal device is replaced more than 3 times and the safety index is still less than the predetermined threshold, sending a replacement failure message to a predetermined terminal, and executing step S3;
s2.1.3.2.2, if the abnormal device is not replaced more than 3 times and the safety index is greater than the predetermined threshold, performing step S2.
S2.2, under the condition that unprocessed abnormal equipment does not exist, determining that the abnormal task 1 is successfully processed;
s2.2.1, creating a task 1-2 (see fig. 4 for the task 1-2, which is not described herein), and transferring the script that is not run by the task 1 and the current abnormal script to the task 1-2 (i.e., executing the second test script set);
s2.2.2, running task 1-2 using the newly complemented equipment (i.e., the target equipment) and the equipment not abnormal in task 1;
and S3, ending the task 1.
FIG. 4 is a schematic diagram of exception handling provided by an alternative embodiment of the present invention, as shown in FIG. 4: the topology represents the structure of the equipment group, the topology is determined by the number of the equipment to be tested, the number of the auxiliary equipment and the networking among the equipment to be tested and the auxiliary equipment, D1P2 represents that 1 equipment to be tested and 2 auxiliary equipment are arranged in the network, D2P4 represents that 2 equipment to be tested and 4 auxiliary equipment are arranged in the network, and D1P3 represents that 1 equipment to be tested and 3 auxiliary equipment are arranged in the network. And (3) when the equipment group in the topology 1 generates the automatic abnormal restoration in the process of executing the pre-configuration 1 script set in a traversal manner, stopping the traversal execution, performing the process shown in fig. 2, not repeatedly described herein, continuously executing the pre-configuration 1 script set after successfully processing the abnormal, and executing the pre-configuration 2 script set and the pre-configuration 3 script set in a traversal manner. In the process of traversal execution, when a device group in the topology 2 traverses and executes a pre-configured script set, that is, an automatically-unrepairable exception occurs in the process of pre-configured script set 2, traversal execution is stopped, the flow shown in fig. 3 is performed, which is not described herein again, after the exception is successfully processed, a task 1-2 is entered, and the pre-configured 2 script set and the pre-configured 3 script set are traversed and executed. And a pre-configured script set in topology 3. Until the execution is finished.
Through the above alternative embodiment, at least the following advantages can be achieved:
(1) Abnormal equipment which can be automatically repaired is quickly and automatically repaired, so that the test operation efficiency is improved, and the influence of test abnormality is reduced;
(2) For the more complicated abnormity which can not be automatically repaired, the current testing task is immediately ended, so that the invalid testing is avoided, and the testing resource and time are saved;
(3) After the abnormal equipment is eliminated, the script which is not tested due to the abnormality is automatically retested by using a new testing environment through automatic complementation of the virtual equipment, so that the stability and fault tolerance of the automatic testing are greatly improved.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method according to the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 2
According to an embodiment of the present invention, there is also provided an apparatus for implementing the above-mentioned abnormality detection method, and fig. 5 is a block diagram of a structure of the abnormality detection apparatus according to the embodiment of the present invention, as shown in fig. 5, the apparatus includes: a receiving module 502, a first testing module 504, a determining module 506, a replacing module 508 and a second testing module 510, which are described in detail below.
A receiving module 502, configured to receive a test instruction, where the test instruction is used to test an initial device group in a predetermined system; a first testing module 504, connected to the receiving module 502, configured to traverse, in response to a testing instruction, a plurality of first scripts in a first testing script set according to a predetermined sequence, where the first testing script set is a script set corresponding to an initial device group, and the plurality of first scripts in the first testing script set are used to test the initial device group respectively; a determining module 506, connected to the first testing module 504, configured to determine, when an exception occurs in a process of executing a predetermined script in the plurality of first scripts, an exception device corresponding to the exception, a device parameter corresponding to the exception device, and a second testing script set, where the second testing script set is a script set determined from the plurality of first scripts in the first testing script set according to the predetermined script; a replacing module 508, connected to the determining module 506, configured to replace the abnormal device with the target device to obtain a target device group, where the target device is determined based on the device parameter; the second testing module 510 is connected to the replacing module 508, and configured to traverse and execute a plurality of second scripts in the second testing script set according to a predetermined sequence, and determine an abnormal testing result of the predetermined system.
As an alternative embodiment, the determining module 506 further includes: the first determining submodule is used for determining abnormal information corresponding to an abnormality under the condition that the abnormality occurs in the process of executing a preset script in a plurality of first scripts, wherein the abnormal information comprises abnormal equipment corresponding to the abnormality; the extraction module is used for extracting abnormal keywords of the abnormal information; the second determining submodule is used for determining the abnormal type of the abnormality according to the abnormal keyword; and the third determining submodule is used for determining the equipment parameters corresponding to the abnormal equipment and the second test script set under the condition that the abnormal type of the abnormality is the first abnormal type.
As an alternative embodiment, the determining module 506 further includes: the fourth determining submodule is used for determining an exception handling mode corresponding to the exception according to the exception keyword under the condition that the exception type of the exception is the second exception type; and the fourth determining submodule is used for processing the exception according to the exception processing mode and determining an exception processing result.
As an optional embodiment, the fourth determining sub-module further includes: and the determining unit is used for determining the equipment parameters corresponding to the abnormal equipment and the second test script set under the condition that the abnormal processing result is processing failure.
As an alternative embodiment, the replacing module 508 further includes: the configuration module is used for configuring the network environment of the target equipment to obtain a target network environment; a fifth determining submodule, configured to determine a security index of the target network environment; and the first replacing submodule is used for replacing the abnormal equipment with the target equipment to obtain a target equipment group under the condition that the safety index is greater than the preset threshold value.
As an alternative embodiment, the replacing module 508 further includes: the second replacement submodule is used for determining replacement failure information under the condition that the safety index is smaller than or equal to a preset threshold value; and the sending module is used for sending the replacement failure information to the preset terminal.
As an alternative embodiment, the apparatus further includes a first initial determining module, configured to determine the initial device group and a pre-configuration mode of the initial device group in the predetermined system; and the second initial determination module is used for determining the first test script set according to the pre-configuration mode.
It should be noted here that the receiving module 502, the first testing module 504, the determining module 506, the replacing module 508 and the second testing module 510 correspond to steps S102 to S110 in implementing the anomaly detection method, and a plurality of modules are the same as the corresponding steps in the implementation example and the application scenario, but are not limited to the disclosure in the above embodiment 1.
Example 3
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including: a processor; a memory for storing processor-executable instructions, wherein the processor is configured to execute the instructions to implement the anomaly detection method of any one of the above.
Example 4
According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, wherein instructions of the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform any one of the above-mentioned abnormality detection methods.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the description of each embodiment has its own emphasis, and reference may be made to the related description of other embodiments for parts that are not described in detail in a certain embodiment.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be an indirect coupling or communication connection through some interfaces, units or modules, and may be electrical or in other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. An anomaly testing method, comprising:
receiving a test instruction, wherein the test instruction is used for testing an initial equipment group in a predetermined system;
in response to the test instruction, traversing and executing a plurality of first scripts in a first test script set according to a preset sequence, wherein the first test script set is a script set corresponding to the initial equipment group, and the plurality of first scripts in the first test script set are used for testing the initial equipment group respectively;
under the condition that an abnormality occurs in the process of executing a predetermined script in the plurality of first scripts, determining abnormal equipment corresponding to the abnormality, equipment parameters corresponding to the abnormal equipment and a second test script set, wherein the second test script set is a script set determined from the plurality of first scripts in the first test script set according to the predetermined script;
replacing the abnormal equipment with target equipment to obtain a target equipment group, wherein the target equipment is determined based on the equipment parameters;
and traversing and executing a plurality of second scripts in the second test script set according to the preset sequence, and determining the abnormal test result of the preset system.
2. The method according to claim 1, wherein in the case that an exception occurs during the execution of a predetermined script in the plurality of first scripts, determining an exception device corresponding to the exception, a device parameter corresponding to the exception device, and a second test script set include:
when the abnormity occurs in the process of executing the preset script in the plurality of first scripts, abnormity information corresponding to the abnormity is determined, wherein the abnormity information comprises abnormity equipment corresponding to the abnormity;
extracting abnormal keywords of the abnormal information;
determining the abnormal type of the abnormality according to the abnormal keyword;
and under the condition that the abnormal type is a first abnormal type, determining the equipment parameters corresponding to the abnormal equipment and the second test script set.
3. The method of claim 2, further comprising:
determining an exception handling mode corresponding to the exception according to the exception keyword under the condition that the exception type of the exception is a second exception type;
and processing the exception according to the exception processing mode, and determining an exception processing result.
4. The method of claim 3, further comprising:
and determining the equipment parameters corresponding to the abnormal equipment and the second test script set under the condition that the abnormal processing result is processing failure.
5. The method of claim 1, wherein replacing the abnormal device with the target device to obtain a target device group comprises:
configuring the network environment of the target equipment to obtain a target network environment;
determining a security index for the target network environment;
and under the condition that the safety index is larger than a preset threshold value, replacing the abnormal equipment with the target equipment to obtain the target equipment group.
6. The method of claim 5, further comprising:
determining replacement failure information in the case that the safety index is less than or equal to the predetermined threshold;
and sending the replacement failure information to a preset terminal.
7. The method according to any one of claims 1 to 6, wherein before receiving the test instruction, the method further comprises:
determining the initial device group and a pre-configured mode of the initial device group in the predetermined system;
and determining the first test script set according to the pre-configuration mode.
8. An abnormality testing device, comprising:
the device comprises a receiving module, a judging module and a judging module, wherein the receiving module is used for receiving a test instruction, and the test instruction is used for testing an initial equipment group in a predetermined system;
a first testing module, configured to traverse, in response to the testing instruction, a plurality of first scripts in a first testing script set according to a predetermined sequence, where the first testing script set is a script set corresponding to the initial device group, and the plurality of first scripts in the first testing script set are used to test the initial device group respectively;
the determining module is used for determining abnormal equipment corresponding to the abnormality, equipment parameters corresponding to the abnormal equipment and a second test script set under the condition that the abnormality occurs in the process of executing a preset script in the plurality of first scripts, wherein the second test script set is a script set determined from the plurality of first scripts in the first test script set according to the preset script;
a replacement module, configured to replace the abnormal device with a target device to obtain a target device group, where the target device is determined based on the device parameter;
and the second testing module is used for executing a plurality of second scripts in the second testing script set in a traversing manner according to the preset sequence and determining the abnormal testing result of the preset system.
9. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the anomaly testing method of any one of claims 1-7.
10. A computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the anomaly testing method of any of claims 1-7.
CN202210999587.6A 2022-08-19 2022-08-19 Abnormality detection method, abnormality detection device, electronic apparatus, and computer-readable storage medium Pending CN115373916A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210999587.6A CN115373916A (en) 2022-08-19 2022-08-19 Abnormality detection method, abnormality detection device, electronic apparatus, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210999587.6A CN115373916A (en) 2022-08-19 2022-08-19 Abnormality detection method, abnormality detection device, electronic apparatus, and computer-readable storage medium

Publications (1)

Publication Number Publication Date
CN115373916A true CN115373916A (en) 2022-11-22

Family

ID=84064871

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210999587.6A Pending CN115373916A (en) 2022-08-19 2022-08-19 Abnormality detection method, abnormality detection device, electronic apparatus, and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN115373916A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116340191A (en) * 2023-05-31 2023-06-27 合肥康芯威存储技术有限公司 Method, device, equipment and medium for testing memory firmware

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116340191A (en) * 2023-05-31 2023-06-27 合肥康芯威存储技术有限公司 Method, device, equipment and medium for testing memory firmware
CN116340191B (en) * 2023-05-31 2023-08-08 合肥康芯威存储技术有限公司 Method, device, equipment and medium for testing memory firmware

Similar Documents

Publication Publication Date Title
US8910172B2 (en) Application resource switchover systems and methods
CN105205003A (en) Automated testing method and device based on clustering system
CN107404522B (en) Cross-node virtual machine cluster high-availability implementation method and device
CN107516547A (en) The processing method and processing device of internal memory hard error
CN107506295B (en) Virtual machine backup testing method and device and computer readable storage medium
CN113704046B (en) Fault alarm processing method and device, equipment and storage medium
CN114281788A (en) BMC firmware data extraction method, device, terminal and storage medium
CN111988169B (en) Method, system, equipment and medium for cleaning and repairing abnormal disk of cloud platform
CN110311802A (en) Network operation method, device, electronic equipment and storage medium
CN115373916A (en) Abnormality detection method, abnormality detection device, electronic apparatus, and computer-readable storage medium
CN116016123A (en) Fault processing method, device, equipment and medium
CN107453888B (en) High-availability virtual machine cluster management method and device
CN105210043A (en) Information processing device
CN109150602A (en) A kind of method, apparatus, computer storage medium and the terminal of adaptation storage equipment
CN113297149A (en) Method and device for monitoring data processing request
CN110968456B (en) Method and device for processing fault disk in distributed storage system
CN111950640A (en) Switch fault processing method and device
CN117707870A (en) PCI-E link problem processing method, device, equipment and medium
CN111966599B (en) Virtualization platform reliability testing method, system, terminal and storage medium
CN110287066B (en) Server partition migration method and related device
CN114385428A (en) Terminal equipment testing method and related equipment
CN111831511A (en) Detection processing method, device and medium for service host of cloud service
CN107919980B (en) Evaluation method and device for clustered system
CN115484267B (en) Multi-cluster deployment processing method and device, electronic equipment and storage medium
JP7047054B2 (en) Test automation equipment, test methods, and programs

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