Method and system for testing network equipment, electronic equipment and storage medium
By deploying preset plug-ins in open network devices and calling open interfaces to obtain internal status data, the problem of the inability of existing technologies to effectively test open network devices is solved, and efficient and accurate testing and fault prediction are achieved.
Patent Information
- Application Number
- CN202410761053.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-10-01
AI Technical Summary
Existing network testing methods cannot effectively test open network equipment and lack internal status monitoring and control, resulting in insufficient testing efficiency and accuracy.
Call the open interface of the open network element through the preset plug-in to obtain internal status data, including chip status, operating system status and application status, to achieve testing and fault location of open network equipment.
It improves the accuracy and efficiency of testing, reduces the possibility of misjudgment, enhances the system's customization capabilities and adaptability, and supports automated testing and fault prediction.
Smart Images

Figure CN118740668A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of testing technology, and in particular to a method, system, electronic device and storage medium for testing network equipment. Background Art
[0002] With the development of science and technology, the Internet has become the infrastructure of the national economy. Network testing is required in the research and development of network chips and network equipment, the start and deployment of the network, and the operation and maintenance of the existing network.
[0003] At present, network testing methods are divided into two categories. One is the common network tester, which sends network traffic to the system under test under the operation of the user and detects the returned network traffic; the other is called active monitoring system, which is generally deployed in the existing network, copies network traffic like a probe, and dynamically analyzes various network information. The current testing method, whether it is a network tester or an active monitoring system, treats the system under test as a closed black box. The previous network equipment was a closed system. In addition to the operating interface opened by the equipment manufacturer, the user does not have any internal exploration and control over the equipment. Therefore, it is reasonable to test the network equipment and network as a black box. However, with the rise of open devices such as white box switches, more and more network elements will develop towards openness and programmability in the future, which means that users have more internal status monitoring and control over network element equipment, which will affect the testing method and testing efficiency.
[0004] Therefore, a method is needed to test network devices in an open network. Summary of the invention
[0005] The present application provides a method, system, electronic device and storage medium for testing network equipment, deploying a preset plug-in in an open network element, calling an open interface of the open network element through the preset plug-in to obtain the internal state of the open network element, thereby achieving the purpose of testing the network equipment in the open network.
[0006] In a first aspect of the present application, a method for testing a network device is provided, which is applied to a network testing platform, wherein the network testing platform includes a tester host and multiple open network elements, and the method includes: Calling a preset plug-in according to a combination of types of open interfaces of an open network element, and deploying the preset plug-in in the open network element; Sending a query instruction to the open network element to be tested through the tester host, and calling the corresponding open interface through the preset plug-in of the open network element to be tested to obtain the internal state data of the open network element to be tested, wherein the internal state data includes the state of the chip, the state of the operating system and the state of the application program; Whether the operating state of the open network element to be tested is normal is determined according to the internal state data.
[0007] By adopting the above technical solution, automated testing is realized based on preset plug-ins and query instructions, which improves the test efficiency. By calling different combinations of preset plug-ins, it can adapt to different types of network devices and different test requirements, and has good scalability. Judgment is made based on internal status data, avoiding the possibility of misjudgment and improving the accuracy of the test. By calling the corresponding open interface through the preset plug-in, the network device in the open network is tested, which improves the accuracy of the test.
[0008] Optionally, the method further includes: Register the corresponding sub-plugin according to the type of the open interface, and add the registered sub-plugin to the preset plug-in library.
[0009] By adopting the above technical solution, developers can register new sub-plugins as needed to meet specific testing requirements and enhance the system's customization capabilities. Through plug-in design, the coupling between components is reduced, and the maintainability and reusability of the system are improved. The preset plug-in library can manage all registered sub-plugins in a unified manner, making it easier to manage and maintain plug-ins.
[0010] Optionally, calling a preset plug-in according to a combination of types of open interfaces of open network elements includes: The type of the open interface of the open network element is obtained, and a corresponding sub-plug-in is matched in the preset plug-in library according to the type, and the matched sub-plug-ins are combined to form a plug-in.
[0011] By adopting the above technical solution, the corresponding sub-plug-in is selected according to the type of open interface, which ensures the pertinence and accuracy of the test and improves the test effect. By automatically matching and combining sub-plug-ins, the configuration process is simplified and the complexity of manual operation is reduced. According to actual needs, appropriate sub-plug-ins are selected for combination to avoid waste of resources and improve resource utilization efficiency. By dynamically combining sub-plug-ins, different test scenarios and demand changes can be adapted, enhancing the adaptability of the system.
[0012] Optionally, judging whether the operating status of the open network element to be tested is normal according to the internal status data includes: Matching the internal state data with preset reference state data, and when a data item in the internal state data is inconsistent with a corresponding data item in the preset reference state data, determining the problem of the open network element to be tested according to the inconsistent data item; The network data of the open network element to be tested is acquired, and the open network element to be tested is located according to the network data.
[0013] By adopting the above technical solution, the internal state data is matched with the preset reference state data, and the data items inconsistent with the reference data can be quickly found, which improves the accuracy of problem location. According to the inconsistent data items, the problems of the open network element to be tested can be determined, which provides a basis for subsequent troubleshooting and repair. By obtaining and analyzing the network data, the open network element to be tested can be located, further narrowing the scope of the problem and improving the efficiency of problem solving. Combining the internal state data and network data, the operating status of the open network element to be tested can be comprehensively evaluated, providing more comprehensive test results.
[0014] Optionally, the acquiring the internal state data of the open network element to be tested by calling a corresponding open interface through a preset plug-in of the open network element to be tested includes: The internal state data of the open network element to be tested is returned to the tester host according to the routing device at an upper level of the open network element to be tested.
[0015] By adopting the above technical solutions and using the upper-level routing equipment to return data, the integrity and accuracy of the data during transmission can be ensured. The use of mature communication protocols and routing mechanisms improves the reliability and stability of data transmission. As the network layers increase or decrease, this data return mechanism can be flexibly expanded or adjusted to adapt to different network structures. Due to the use of standardized communication interfaces and routing mechanisms, new devices or new applications can be more easily integrated into existing systems, reducing maintenance costs.
[0016] Optionally, judging whether the operating state of the open network element to be tested is normal according to the internal state data further includes: When the data items in the internal state data are consistent with the corresponding data items of the preset reference state data, the internal state data is input into a preset fault prediction model to obtain the probability of a fault occurring within a preset time.
[0017] By adopting the above technical solution, the internal state data is input into the preset fault prediction model, which can predict the probability of failure within the preset time, warn potential problems in advance, and improve the effect of preventive maintenance. The fault prediction model can perform intelligent data analysis to help discover subtle problem trends and improve the accuracy of problem discovery. Based on the results of fault prediction, targeted preventive maintenance measures can be taken to reduce the probability of failure and improve the stability and reliability of the system. It provides a basis for maintenance personnel to make more scientific and optimized decisions, thereby improving the efficiency and effectiveness of maintenance.
[0018] Optionally, the method further includes: Collecting first historical fault data, wherein the first historical fault data includes the time and cause of the fault occurrence; Preprocessing the first historical fault data to obtain second historical fault data, and extracting fault features from the second historical fault data, wherein the fault features include equipment operating status and environmental factors; Establishing a fault prediction model according to the fault characteristics, dividing the second historical fault data into a test set and a training set, and training the fault prediction model using the training set; The trained fault prediction model is tested using the test set, and when the test passes, the fault prediction model is used as a preset fault prediction model.
[0019] By adopting the above technical solution, collecting and analyzing historical fault data, a data-driven fault prediction model can be established to improve the accuracy of the prediction. Fault features such as equipment operating status and environmental factors are extracted from historical fault data. These features are of great significance for understanding the cause of the fault and predicting future faults. By testing the trained model with a test set, the generalization ability of the model is ensured so that it can adapt to different data distributions. Based on the fault prediction model, maintenance personnel can make more scientific and optimized decisions, thereby reducing the probability of faults. By predicting future faults, this method can help achieve preventive maintenance and improve the stability and reliability of the system.
[0020] In a second aspect of the present application, a system for testing a network device is provided, including a deployment module, a calling module, and a judgment module, wherein: A deployment module configured to call a preset plug-in according to a combination of types of open interfaces of an open network element, and deploy the preset plug-in in the open network element; A calling module configured to send a query instruction to the open network element to be tested through the tester host, and to call the corresponding open interface through the preset plug-in of the open network element to be tested to obtain the internal state data of the open network element to be tested, wherein the internal state data includes the state of the chip, the state of the operating system and the state of the application program; The judging module is configured to judge whether the operation status of the open network element to be tested is normal according to the internal status data.
[0021] In the third aspect of the present application, an electronic device is provided, including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are both used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes any one of the methods described above.
[0022] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores instructions, and when the instructions are executed, any of the methods described above is executed.
[0023] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. The corresponding open interface is called by the preset plug-in to test the network devices in the open network, which improves the accuracy of the test; 2. Automated testing is achieved based on preset plug-ins and query instructions, which improves testing efficiency; 3. By calling different combinations of preset plug-ins, it can adapt to different types of network devices and different testing requirements, and has good scalability; 4. Make judgments based on internal status data to avoid the possibility of misjudgment and improve the accuracy of the test. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a flowchart of a method for testing a network device disclosed in an embodiment of the present application; Figure 2 is a schematic diagram of a distributed deployment plug-in disclosed in an embodiment of the present application; Figure 3 It is a schematic diagram of a centralized deployment plug-in disclosed in an embodiment of the present application; Figure 4 It is a module schematic diagram of a system for testing network devices disclosed in an embodiment of the present application; Figure 5 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present application.
[0025] Explanation of the reference numerals: 401, deployment module; 402, calling module; 403, judgment module; 501, processor; 502, communication bus; 503, user interface; 504, network interface; 505, memory. DETAILED DESCRIPTION
[0026] In order to enable technicians in this field to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.
[0027] In the description of the embodiments of the present application, words such as "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "for example" or "for example" is intended to present related concepts in a specific way.
[0028] In the description of the embodiments of the present application, the meaning of the term "multiple" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0029] Just like the transition from closed traditional mainframes to open server devices, closed traditional network devices are also changing from black box mode to white box mode. Users can not only obtain information from the network application layer, but also obtain information from open interfaces or network OS (Operating System) layer and network bottom chip, making network devices more transparent for network testing and diagnosis. The embodiments of this application are mainly for testing network test equipment in open networks.
[0030] This embodiment discloses a method for testing a network device. Figure 1 is a flow chart of a method for testing a network device disclosed in an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps: S110, calling a preset plug-in according to a combination of types of open interfaces of an open network element, and deploying the preset plug-in in the open network element; In traditional testing methods, test instruments are used as testing instruments, and their applications are more focused on judging the quality of the tested device or network. The state of the tested system is judged by sending stimuli and collecting feedback, and the internal state of the tested system is difficult to know. It is okay for single device testing, but if a fault occurs in the existing network, the tested device or network needs to be temporarily disabled in order to locate and remove the faulty device, which has a relatively large impact. The embodiment of the present application can call the corresponding plug-in according to the type of the open interface of the open network element, and deploy the plug-in to the corresponding open network element to obtain the internal state of the open network element.
[0031] Optionally, the method further includes: Register the corresponding sub-plugin according to the type of the open interface, and add the registered sub-plugin to the preset plug-in library.
[0032] In order to avoid the need to redevelop a corresponding plug-in for each new open interface combination, a plug-in library can be set up, and all pre-set plug-ins can be registered in the plug-in library for unified management. For example, if the type of open interface is A, a corresponding sub-plug-in a can be created, and if the type of open interface is B, a corresponding sub-plug-in b can be created. The created sub-plug-ins a and b can be registered in the plug-in library for subsequent calls. Test and verification functions can be provided for each sub-plug-in to ensure the correctness and stability of the plug-in and improve the reliability of the system. Automatic upgrade and maintenance functions can be provided for sub-plug-ins to facilitate users to update and maintain sub-plug-ins and improve the maintainability of the system.
[0033] By registering sub-plugins, you can flexibly add or delete sub-plugins according to different test requirements and interface types, thereby enhancing the flexibility and scalability of the system. It can adapt to various different test scenarios and changes in requirements. Through the management of the preset plug-in library, plug-in registration, update, deletion and other operations can be completed automatically, reducing the complexity of manual operations and improving the degree of automation of testing, which helps to improve test efficiency and quality. By uniformly registering and managing sub-plugins, standardization and normalization can be ensured during the test. This helps to improve the accuracy and reliability of test results and reduce the possibility of misjudgment. Through the management of the preset plug-in library, sub-plugins can be easily maintained and updated, improving the reliability and stability of the test.
[0034] Optionally, calling a preset plug-in according to a combination of types of open interfaces of open network elements includes: The type of the open interface of the open network element is obtained, and a corresponding sub-plug-in is matched in the preset plug-in library according to the type, and the matched sub-plug-ins are combined to form a plug-in.
[0035] Get the type of the open interface of the open network element. For example, the types of the open interfaces of the current open network element include open interface A and open interface B. Match in the preset plug-in library according to these interface types. For example, sub-plug-in a is matched for open interface A; sub-plug-in b is matched for open interface B. Combine these matched sub-plug-ins. For example, sub-plug-in a and sub-plug-in b are combined to form a complete plug-in. The formed plug-in can be tested for compatibility and adjusted to avoid incompatibility between sub-plug-in a and sub-plug-in b. Perform corresponding tests on the open network element through the combined plug-in.
[0036] Because it is matched and combined based on the interface type, it can flexibly adapt to the interface requirements of different open network elements. When a new interface type appears, you only need to add a new sub-plug-in to the preset plug-in library without making major changes to the existing system. Through the management of the preset plug-in library, it ensures that the processing of various interface types is standardized, improving the accuracy and reliability of the test.
[0037] S120, sending a query instruction to the open network element to be tested through the tester host, and calling the corresponding open interface through the preset plug-in of the open network element to be tested to obtain the internal state data of the open network element to be tested, wherein the internal state data includes the state of the chip, the state of the operating system, and the state of the application program; Use the tester host to send a query instruction to the open network element to be tested. This instruction can be a specific query command used to request the internal status data of the open network element to be tested. After receiving the query instruction, the open network element to be tested calls the corresponding open interface through the preset plug-in. These interfaces may be APIs (application programming interfaces), RESTful interfaces, or other forms of communication interfaces. When the open interface is called, the open network element to be tested will collect and organize the relevant internal status data. In an embodiment of the present application, the internal status data includes the status of the chip (such as temperature, usage rate, etc.), the status of the operating system (such as system resource usage, task queues, etc.), and the status of the application (such as running status, error logs, etc.). The organized internal status data is returned to the tester host. These data can be returned in various forms, such as text, JSON, XML, or other formats.
[0038] Optionally, the acquiring the internal state data of the open network element to be tested by calling a corresponding open interface through a preset plug-in of the open network element to be tested includes: The internal state data of the open network element to be tested is returned to the tester host according to the routing device at an upper level of the open network element to be tested.
[0039] When there are many open network elements, the underlying open network elements can be managed through routing devices. After the internal status data of the open network element to be tested is obtained, the appropriate communication path is selected according to the routing device of the upper layer of the open network element to be tested to return this data to the tester host. The internal status data is sent to the network element or device of the upper layer through the preset communication interface (such as TCP / IP, UDP, etc.). The data can be processed in the routing device, and the processed data is sent back to the tester host. This process may involve data format conversion, compression, encryption and other processing to ensure the integrity and security of the data.
[0040] By returning data through the upper-level routing, the integrity and accuracy of the data during transmission can be ensured. During data transmission, checksums and other methods can be used to verify the integrity of the data to ensure that the data is accurate. As the network layers increase or decrease, this data return mechanism can be flexibly expanded or adjusted to adapt to different network structures.
[0041] S130: Determine whether the operating status of the open network element to be tested is normal according to the internal status data.
[0042] Optionally, judging whether the operating status of the open network element to be tested is normal according to the internal status data includes: Matching the internal state data with preset reference state data, and when a data item in the internal state data is inconsistent with a corresponding data item in the preset reference state data, determining the problem of the open network element to be tested according to the inconsistent data item; The network data of the open network element to be tested is acquired, and the open network element to be tested is located according to the network data.
[0043] The internal state data of the open network element to be tested is matched with the preset reference state data. This can be achieved by comparing each data item to find out whether there are inconsistent data items. The preset reference state data can be obtained based on historical data. The inconsistency in the embodiment of the present application refers to the data gap between the data item in the internal state data and the corresponding data item of the preset reference state data exceeding the threshold value, that is, even if the two data are not the same, but the data gap is within the threshold range, the two data can also be considered to be consistent. Once the data inconsistency is found, the problem of the open network element to be tested can be determined based on these inconsistent data items. For example, if the internal state data shows that the chip temperature is abnormally increased, and the chip temperature in the reference state data is normal, then it can be determined that there is a problem with the chip. The network data of the open network element to be tested can be obtained, and these network data may include network traffic, packet loss rate, delay, etc. The location and communication status of the open network element to be tested in the network can be analyzed based on the network data. For example, if the data traffic of a specific port is abnormally large or the packet loss rate is abnormally high, then it can be located that there is a problem with the port or the device near it.
[0044] By comparing with the preset benchmark status data, the inconsistency of the internal status data can be accurately identified, so as to accurately judge the problems of the network element. Combined with the analysis of network data, the open network element with problems and the corresponding problems can be accurately located, providing strong support for subsequent troubleshooting and repair. It can be applied to various types of open network elements to be tested, and only the corresponding benchmark status data settings and network data analysis are required according to the characteristics of different network elements.
[0045] Optionally, judging whether the operating state of the open network element to be tested is normal according to the internal state data further includes: When the data items in the internal state data are consistent with the corresponding data items of the preset reference state data, the internal state data is input into a preset fault prediction model to obtain the probability of a fault occurring within a preset time.
[0046] When the data items in the internal state data are consistent with the corresponding data items of the preset baseline state data, these internal state data are input into a preset fault prediction model. The fault prediction model is based on historical data and algorithms, and can predict the probability of failure of the open network element to be tested in the future. This model can be based on various factors, such as the length of time the equipment is in use, maintenance records, environmental conditions, etc. The fault prediction model outputs a probability value of failure within a preset time based on the input internal state data. This value can be a percentage or a specific number, indicating the possibility of failure of the network element in the future.
[0047] By using the fault prediction model, the probability of future failures can be predicted based on current and historical data, providing a basis for preventive maintenance and early repairs. Based on the prediction results, preventive maintenance measures can be taken in advance, such as replacing wearing parts and conducting regular inspections, thereby improving the reliability and stability of the equipment. By predicting the probability of failure, maintenance resources and budgets can be reasonably allocated to avoid over-maintenance or under-maintenance.
[0048] Optionally, the method further includes: Collecting first historical fault data, wherein the first historical fault data includes the time and cause of the fault occurrence; Preprocessing the first historical fault data to obtain second historical fault data, and extracting fault features from the second historical fault data, wherein the fault features include equipment operating status and environmental factors; Establishing a fault prediction model according to the fault characteristics, dividing the second historical fault data into a test set and a training set, and training the fault prediction model using the training set; The trained fault prediction model is tested using the test set, and when the test passes, the fault prediction model is used as a preset fault prediction model.
[0049] Collect the first historical fault data, which should include the time and cause of each fault. These data can be obtained through log files, maintenance records or other related systems. Preprocess the first historical fault data to obtain the second historical fault data. Preprocessing may include data cleaning, format conversion, outlier processing, etc. to ensure the quality and reliability of the data. Extract fault features from the second historical fault data, which include equipment operating status and environmental factors. For example, the operating status may include temperature, current, pressure, etc.; environmental factors may include temperature, humidity, dust, etc. Based on the extracted fault features, establish a fault prediction model. Various machine learning algorithms or statistical models can be selected for modeling, such as decision trees, random forests, support vector machines, etc. Divide the second historical fault data into a test set and a training set. The training set is used to train the fault prediction model, while the test set is used to evaluate the performance and accuracy of the model. Use the training set to train the fault prediction model, and adjust the model parameters and optimization methods to improve the prediction performance of the model. Test the trained fault prediction model through the test set to evaluate the accuracy and other indicators of the model. If the model performs well, the training can be considered successful. When the test passes, the fault prediction model is used as the preset fault prediction model for subsequent fault probability prediction.
[0050] By using historical fault data and appropriate algorithms, an accurate fault prediction model can be established to improve the accuracy of future fault predictions. This method can be adjusted and expanded according to the characteristics and needs of different network elements, simply by collecting more or updated historical fault data and processing it accordingly. The established fault prediction model can be adjusted and optimized according to actual needs, such as adjusting model parameters, changing algorithms, etc., to obtain better prediction performance.
[0051] The plug-in mainly performs two functions: 1. Communicate with the tester host, receive commands from the host, execute corresponding operations, and send operation results to the host; 2. Query the internal status of the machine through various open interfaces, including but not limited to the status of each major chip, the status of the operating system, and the status of each network-related application. Figure 2 is a schematic diagram of a distributed deployment plug-in disclosed in an embodiment of the present application, such as Figure 2 As shown in the figure, when there is only a single device in the network, the plug-in is deployed to the corresponding single device. When there are multiple devices in the network, the plug-in is deployed to each device. Deploying the plug-in to all open network elements is one of the deployment methods.
[0052] Optionally, with the development of open network systems, it is possible that a standard API for accepting external commands will be developed in the open network elements to complete the above two functions. In this case, detection and reporting become part of the standard behavior of the system. At this time, it is no longer necessary to deploy the plug-in to the open network element, but to deploy a test program on the tester host. Figure 3 is a schematic diagram of a centralized deployment plug-in disclosed in an embodiment of the present application, such as Figure 3 As shown in the figure, a test program is deployed on the tester host to traverse the state of the open network element when a fault occurs. In this deployment, no modification is required to the white box type open device. Figure 2 and Figure 3 The direct connection between each network element and the tester host is only schematic. In fact, it is completely feasible for a single tester host to manage hundreds or thousands of devices under test through layer-by-layer aggregation of switching devices.
[0053] The embodiments of the present application do not impose any restrictions on the open network devices and open interfaces of the network, programming languages, and the connection and communication methods between the tester host and the system under test, but they already have examples available for use, such as the standardized API openNSL of the chip interface layer, the programming language P4, and the network communication interface socket.
[0054] This embodiment also discloses a system for testing network equipment. Figure 4 is a schematic diagram of a module of a system for testing network devices disclosed in an embodiment of the present application, such as Figure 4 As shown, the system includes a deployment module 401, a calling module 402 and a judgment module 403, wherein: A deployment module 401, configured to call a preset plug-in according to a combination of types of open interfaces of an open network element, and deploy the preset plug-in in the open network element; The calling module 402 is configured to send a query instruction to the open network element to be tested through the tester host, and call the corresponding open interface through the preset plug-in of the open network element to be tested to obtain the internal state data of the open network element to be tested, wherein the internal state data includes the state of the chip, the state of the operating system and the state of the application program; The judgment module 403 is configured to judge whether the operation status of the open network element to be tested is normal according to the internal status data.
[0055] Optionally, the system further comprises a registration module, wherein the registration module is configured to: Register the corresponding sub-plugin according to the type of the open interface, and add the registered sub-plugin to the preset plug-in library.
[0056] Optionally, the deployment module 401 is further configured to: The type of the open interface of the open network element is obtained, and a corresponding sub-plug-in is matched in the preset plug-in library according to the type, and the matched sub-plug-ins are combined to form a plug-in.
[0057] Optionally, the determining module 403 is further configured to: Matching the internal state data with preset reference state data, and when a data item in the internal state data is inconsistent with a corresponding data item in the preset reference state data, determining the problem of the open network element to be tested according to the inconsistent data item; The network data of the open network element to be tested is acquired, and the open network element to be tested is located according to the network data.
[0058] Optionally, the calling module 402 is further configured to: The internal state data of the open network element to be tested is returned to the tester host according to the routing device at an upper level of the open network element to be tested.
[0059] Optionally, the determining module 403 is further configured to: When the data items in the internal state data are consistent with the corresponding data items of the preset reference state data, the internal state data is input into a preset fault prediction model to obtain the probability of a fault occurring within a preset time.
[0060] Optionally, the system further comprises a prediction module, wherein the prediction module is configured to: Collecting first historical fault data, wherein the first historical fault data includes the time and cause of the fault; Preprocessing the first historical fault data to obtain second historical fault data, and extracting fault features from the second historical fault data, wherein the fault features include equipment operating status and environmental factors; Establishing a fault prediction model according to the fault characteristics, dividing the second historical fault data into a test set and a training set, and training the fault prediction model using the training set; The trained fault prediction model is tested using the test set, and when the test passes, the fault prediction model is used as a preset fault prediction model.
[0061] It should be noted that: when the device provided in the above embodiment realizes its function, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0062] This embodiment also discloses an electronic device, referring to Figure 5 The electronic device may include: at least one processor 501 , at least one communication bus 502 , a user interface 503 , a network interface 504 , and at least one memory 505 .
[0063] The communication bus 502 is used to realize the connection and communication between these components.
[0064] The user interface 503 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 503 may also include a standard wired interface and a wireless interface.
[0065] The network interface 504 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0066] Among them, the processor 501 may include one or more processing cores. The processor 501 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 505, and calling data stored in the memory 505. Optionally, the processor 501 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 501 can integrate one or a combination of a central processing unit 501 (Central Processing Unit, CPU), an image processor 501 (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 501, but implemented separately through a chip.
[0067] Among them, the memory 505 may include a random access memory 505 (Random Access Memory, RAM), and may also include a read-only memory 505 (Read-Only Memory). Optionally, the memory 505 includes a non-transitory computer-readable storage medium. The memory 505 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 505 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory 505 may also be optionally at least one storage device located away from the aforementioned processor 501. As Figure 5 As shown, the memory 505 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an application program of a method for testing a network device.
[0068] exist Figure 5 In the electronic device shown, the user interface 503 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 501 can be used to call the application program stored in the memory 505 for the method of testing the network device. When executed by one or more processors 501, the electronic device executes one or more methods in the above-mentioned embodiments.
[0069] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.
[0070] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0071] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0072] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0073] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0074] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory 505. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory 505 and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned memory 505 includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk.
[0075] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the disclosure of the specification and the truth of practice, it will be easy for those skilled in the art to think of other embodiments of the present disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field that are not recorded in the present disclosure. The description and examples are regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. A method for testing a network device, characterized in that: Applied to a network test platform, the network test platform includes a tester host and multiple open network elements, the method includes: Calling a preset plug-in according to a combination of types of open interfaces of an open network element, and deploying the preset plug-in in the open network element; Sending a query instruction to the open network element to be tested through the tester host, and calling the corresponding open interface through the preset plug-in of the open network element to be tested to obtain the internal state data of the open network element to be tested, wherein the internal state data includes the state of the chip, the state of the operating system and the state of the application program; Whether the operating state of the open network element to be tested is normal is determined according to the internal state data.
2. The method for testing a network device according to claim 1, characterized in that: The method further comprises: Register the corresponding sub-plugin according to the type of the open interface, and add the registered sub-plugin to the preset plug-in library.
3. The method for testing a network device according to claim 2, characterized in that: The calling of the preset plug-in according to the combination of types of the open interfaces of the open network elements includes: The type of the open interface of the open network element is obtained, and a corresponding sub-plug-in is matched in the preset plug-in library according to the type, and the matched sub-plug-ins are combined to form a plug-in.
4. The method for testing a network device according to claim 1, characterized in that: The step of judging whether the operating state of the open network element to be tested is normal according to the internal state data includes: Matching the internal state data with preset reference state data, and when a data item in the internal state data is inconsistent with a corresponding data item in the preset reference state data, determining the problem of the open network element to be tested according to the inconsistent data item; The network data of the open network element to be tested is acquired, and the open network element to be tested is located according to the network data.
5. The method for testing a network device according to claim 4, characterized in that: The acquiring of the internal state data of the open network element to be tested by calling the corresponding open interface through the preset plug-in of the open network element to be tested comprises: The internal state data of the open network element to be tested is returned to the tester host according to the routing device at an upper level of the open network element to be tested.
6. The method for testing a network device according to claim 4, characterized in that: The step of judging whether the operating state of the open network element to be tested is normal according to the internal state data further comprises: When the data items in the internal state data are consistent with the corresponding data items of the preset reference state data, the internal state data is input into a preset fault prediction model to obtain the probability of a fault occurring within a preset time.
7. The method for testing a network device according to claim 6, characterized in that: The method further comprises: Collecting first historical fault data, wherein the first historical fault data includes the time and cause of the fault; Preprocessing the first historical fault data to obtain second historical fault data, and extracting fault features from the second historical fault data, wherein the fault features include equipment operating status and environmental factors; Establishing a fault prediction model according to the fault characteristics, dividing the second historical fault data into a test set and a training set, and training the fault prediction model using the training set; The trained fault prediction model is tested using the test set, and when the test passes, the fault prediction model is used as a preset fault prediction model.
8. A system for testing network equipment, characterized in that: It includes deployment module, calling module and judgment module, among which: A deployment module configured to call a preset plug-in according to a combination of types of open interfaces of an open network element, and deploy the preset plug-in in the open network element; A calling module configured to send a query instruction to the open network element to be tested through the tester host, and to call the corresponding open interface through the preset plug-in of the open network element to be tested to obtain the internal state data of the open network element to be tested, wherein the internal state data includes the state of the chip, the state of the operating system and the state of the application program; The judging module is configured to judge whether the operation status of the open network element to be tested is normal according to the internal status data.
9. An electronic device, characterized in that: It includes a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are both used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 7 is executed.
