A switch testing method and related components
By automatically determining the switch to be tested by a preset test device and sending test instructions, the problem of switching testing in the prior art requires a large amount of manpower to input instructions, and efficient and automated switch testing is achieved.
Patent Information
- Application Number
- CN202210751106.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-29
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2042-06-29
AI Technical Summary
In the prior art, switch production testing requires a large amount of manpower to input test instructions, which is cumbersome and prone to input errors, resulting in inefficient testing.
Provide a switch testing method, which communicates with multiple switches to be tested through a preset test device. After obtaining user identification instructions, it automatically determines the name of the item to be tested and sends corresponding test instructions to realize automated testing.
Without the need for user to manually enter test instructions, multiple switches can be tested in parallel and batch, with high automation, saving labor costs and improving production testing efficiency.
Smart Images

Figure CN115150681B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of testing technology, and in particular to a switch testing method and related components. Background Art
[0002] Switch production testing is a large and complex process. Specifically, after the switch is manufactured and the initial version of the basic firmware for booting is manually burned, a series of functional tests are required to detect whether it can work properly, such as firmware upgrade burning test, system installation test, routine test, reliability test and aging test.
[0003] In the prior art, a lot of manpower is required to realize the above-mentioned functional testing. Taking the firmware upgrade burning test as an example, in order to realize the online upgrade of the switch firmware, the developer needs to manually input the test instructions step by step, which is prone to input errors. As a result, this method is cumbersome and not conducive to actual production application, and wastes human resources. Summary of the invention
[0004] The purpose of the present invention is to provide a switch testing method and related components. The entire testing process does not require the user to manually input test instructions, and when S is greater than 1, multiple switches to be tested can obtain corresponding test instructions according to the names of the items they actually need to test, so that they can be tested in parallel and in batches. The degree of automation is high, labor costs are saved, and production test efficiency is improved.
[0005] In order to solve the above technical problems, the present invention provides a switch testing method, which is applied to a preset testing device, wherein the preset testing device is communicatively connected with S switches to be tested, wherein S is an integer not less than 1, and the method comprises:
[0006] Obtaining an identification instruction sent by a user indicating the start of testing of the i-th switch to be tested, where 1≤i≤S and i is an integer;
[0007] Determine the name of the project to be tested for the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-project name correspondence relationship;
[0008] Determine a test instruction corresponding to the j-th project name based on the j-th project name and a pre-stored name-instruction correspondence relationship, wherein 1≤j≤the total number of the project names;
[0009] Each of the test instructions is sent to the i-th switch to be tested, so that the i-th switch to be tested performs the test corresponding to each of the project names.
[0010] Preferably, the preset test device is also communicatively connected to a power supply module, an input interface of the power supply module is connected to a power source, and an output interface of the power supply module is connected to a power supply interface of each of the switches to be tested in a one-to-one correspondence;
[0011] After obtaining the identification instruction sent by the user indicating the start of testing the i-th switch to be tested, the method further includes:
[0012] Determine the output interface in the power supply module connected to the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-power supply interface correspondence relationship;
[0013] A power supply control signal is sent to the power supply module, so that the power supply module supplies power to the i-th switch to be tested through the output interface based on the power supply control signal.
[0014] Preferably, before determining the output interface in the power supply module connected to the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-power supply interface correspondence, the method further includes:
[0015] Sending a detection signal indicating the reliability of the network connection to the power supply module;
[0016] Determining whether a first feedback signal from the power supply module to the detection signal is received;
[0017] If so, the step of determining the output interface in the power supply module connected to the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-power supply interface correspondence relationship is entered.
[0018] Preferably, the preset test device is also communicatively connected to an MES device including an MES system;
[0019] Before determining the name of the project to be tested of the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-project name correspondence, the method further includes:
[0020] After receiving the second feedback signal indicating successful power supply fed back by the power supply module, sending a determination identification signal indicating whether to detect the i-th device to be tested to the MES device;
[0021] Determine whether a third feedback signal sent by the MES device is received, wherein the third feedback signal is obtained by the MES device determining whether the i-th switch to be tested is qualified for testing based on the determination identification signal and a pre-stored switch identification-permission identification correspondence relationship;
[0022] If so, the step of determining the name of the project to be tested for the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-project name correspondence is entered.
[0023] Preferably, the preset test device is also connected to the communication module, and the communication module is also connected to S switches to be tested;
[0024] The switch testing method further includes:
[0025] Receiving interface-operation information transmitted by the communication module;
[0026] The switch to be tested corresponding to the operation information is determined according to the interface-operation information and the pre-stored communication interface-switch identifier correspondence, and the operation information is saved in a storage module corresponding to the switch to be tested, wherein the operation information is the operation information of the switch to be tested when it is turned on and / or turned off.
[0027] Preferably, after sending each of the test instructions to the i-th switch to be tested, the method further includes:
[0028] Obtain the test log of the i-th switch to be tested and the test results of each of the project names;
[0029] Controlling the display module to display the test result;
[0030] The test log is saved in a storage module.
[0031] Preferably, after sending each of the test instructions to the i-th switch to be tested, the method further includes:
[0032] The test status corresponding to the i-th switch to be tested in the pre-stored switch identification-test status correspondence relationship is changed from a first identification bit indicating that it is not being tested to a second identification bit indicating that it is being tested;
[0033] When receiving a fourth feedback signal indicating the end of the test sent by the i-th switch to be tested, changing the test state corresponding to the i-th switch to be tested in the switch identifier-test state correspondence relationship from the second identifier to the first identifier;
[0034] Before determining the name of the project to be tested of the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-project name correspondence, the method further includes:
[0035] Determine whether the test status of the i-th switch to be tested is the first identification bit according to the identification instruction and the switch identification-test status correspondence relationship;
[0036] If so, the step of determining the name of the project to be tested for the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-project name correspondence is entered.
[0037] In order to solve the above technical problems, the present invention further provides a switch testing system, which is applied to a preset testing device, wherein the preset testing device is communicatively connected with S switches to be tested, wherein S is an integer not less than 1, and the system comprises:
[0038] An acquisition unit, configured to acquire an identification instruction sent by a user indicating that a test has started on the i-th switch to be tested, where 1≤i≤S and i is an integer;
[0039] A first determining unit, configured to determine the name of the project to be tested of the i-th switch to be tested according to the identification instruction and a pre-stored switch identification-project name correspondence relationship;
[0040] A second determining unit is used to determine a test instruction corresponding to the j-th project name based on the j-th project name and a pre-stored name-instruction correspondence relationship, wherein 1≤j≤the total number of the project names;
[0041] The sending unit is used to send each of the test instructions to the i-th switch to be tested, so that the i-th switch to be tested performs the test corresponding to each of the project names.
[0042] In order to solve the above technical problems, the present invention also provides a testing device, comprising:
[0043] Memory for storing computer programs;
[0044] The processor is used to execute the steps of the switch testing method as described above.
[0045] In order to solve the above technical problems, the present invention further provides a computer-readable storage medium, comprising:
[0046] The computer readable medium stores a computer program, and when the computer program is executed by a processor, the steps of the switch testing method described above are implemented.
[0047] The present application provides a switch testing method and related components, wherein a preset test device is connected to S switches to be tested in communication, and a name-command correspondence is established in advance, so that an identification instruction sent by a user to indicate the start of testing of the i-th switch to be tested is obtained, and the name of the project to be tested of the i-th switch to be tested can be determined according to the identification instruction and the pre-stored switch identification-project name correspondence, and then the test instructions corresponding to each project name are determined based on the name-command correspondence, and finally each test instruction is sent to the i-th switch to be tested so that it can perform the test corresponding to each project name. Compared with the prior art, the entire process does not require the user to manually input the test instruction, and when S is greater than 1, multiple switches to be tested can obtain the corresponding test instructions according to the project names they actually need to test, so as to perform tests in parallel and batches, with a high degree of automation, saving labor costs and improving production test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the prior art and the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0049] Figure 1 A flow chart of a switch testing method provided by the present invention;
[0050] Figure 2 A schematic diagram of the structure of a switch testing system provided by the present invention;
[0051] Figure 3 A structural schematic diagram of a testing device provided by the present invention. DETAILED DESCRIPTION
[0052] The core of the present invention is to provide a switch testing method and related components. The entire testing process does not require the user to manually input test instructions. When S is greater than 1, multiple switches to be tested can obtain corresponding test instructions according to the names of the items they actually need to test, thereby performing tests in parallel and in batches. The degree of automation is high, labor costs are saved, and production test efficiency is improved.
[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] Please refer to Figure 1 , Figure 1 A flow chart of a switch testing method provided by the present invention.
[0055] Switches can be classified into black box switches and white box switches according to system classification, wherein a white box switch is a switch whose hardware and software are independently developed, that is, the switch hardware is developed by the hardware manufacturer, and the operating system uses open source software. Secondary development can be carried out on the basis of the open source software to add and delete functions according to one's own needs. In this context, how to ensure that the produced switches function normally and minimize the input of manpower and reduce production costs has become an issue that needs attention. In this embodiment, considering that in order to realize the production test of the switch in the prior art, a large number of test instructions usually need to be manually input, and input errors are prone to occur. The method is too cumbersome and wastes human resources. In order to solve the above technical problems, the present application provides a switch testing method with a higher degree of automation. The entire testing process does not require additional human intervention, which saves labor costs to a certain extent.
[0056] The switch testing method is applied to a preset test device, the preset test device is communicatively connected with S switches to be tested, where S is an integer not less than 1, and the method comprises:
[0057] S11: Obtaining an identification instruction sent by a user indicating the start of testing of the i-th switch to be tested, where 1≤i≤S and i is an integer;
[0058] First of all, it should be noted that the communication connection between the preset test device and the S switches to be tested does not refer to the establishment of a physical connection line between the two, but a communication connection established so that the two are in the same communication network; corresponding to actual production, it means: plugging the first network cable into the network cable interface of the switch and the second network cable into the network cable interface of the preset test device so that the two are in the same communication network, thereby realizing subsequent uploading and downloading of data, files and other information. It can be seen that compared with the physical connection line, this setting method not only improves the flexibility of the placement of the switches to be tested, lays the foundation for multiple switches to be tested to receive test instructions for parallel and batch control testing, but also ensures the transmission speed of files, etc., which is convenient for practical application.
[0059] Specifically, the preset test device is essentially a computer device including a program system corresponding to the switch test method provided in this application, including but not limited to an industrial computer, which is not particularly limited here. It can be understood that when the identification instruction sent by the user indicating the end of the test of the i-th switch to be tested is obtained, the ongoing test should be terminated. Therefore, the implementation method of obtaining the identification instruction can be adopted in the following manner:
[0060] A UI (User Interface) for human-computer interaction is developed in advance, and users can operate on the UI interface, which is simple and convenient. Specifically, a start button and an end button are set for each switch to be tested. When the user clicks the start button on the UI interface, the identification instruction sent by the user indicating the start of the test of the switch to be tested can be obtained; when the user clicks the end button on the UI interface, the identification instruction sent by the user indicating the end of the test of the switch to be tested can be obtained; when the user clicks the start buttons corresponding to multiple switches to be tested at the same time, the parallel and batch tests of the multiple switches to be tested can be started. In addition, a total start button and a total end button can be set to save the number of user operations.
[0061] It should also be noted that the working mechanism behind the UI interface is further explained here: as a support for the UI interface, the back-end program (invisible to the user, the user can only operate the UI interface) is specifically implemented through the following three layers of calling logic: the first layer includes a calling API provided to the UI interface, so that when the user clicks the start button and / or the end button, the API is called; the second layer includes multi-threaded services. Since the present application points out that multiple switches to be tested should be able to be tested in parallel, the testing process involves the simultaneous calling of multiple programs. Therefore, the test of each switch to be tested uses multi-threaded services; the third layer is the test interface total entrance of the program system corresponding to the method designed in the present application. After confirming that the multi-threaded service is being performed, the test interface total entrance is called to start executing the specific logic of the method described in the present application.
[0062] S12: determining the project name to be tested for the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-project name correspondence relationship;
[0063] Specifically, the identification instruction is identification information related to the unique identification of the current switch to be tested, and the identification information includes but is not limited to unique identifications such as the SN (serial number) and MAC address of the switch; a switch identification-project name correspondence relationship is pre-stored. More specifically, assuming that the preset test device includes 8 test items in total, the first switch to be tested may only need to test 4 of them, and the second switch to be tested may need to test 8 of them. Therefore, the pre-stored switch identification-project name correspondence relationship can show this relationship. For example, for the convenience of storage, the following enable identification bit method can be used for storage: such as the first switch identification-11110000 (that is, it only needs to test the 1st, 2nd, 3rd and 4th items in the test items recorded in the preset test device), and the second switch identification-11111111 (that is, it needs to test the 1st, 2nd, 3rd, 4th, 5th, 6th, 7th and 8th items in the test items recorded in the preset test device). The item number of the items to be tested is known, and then the name of the item to be tested of the i-th switch to be tested is obtained.
[0064] S13: Determine a test instruction corresponding to the j-th project name based on the j-th project name and a pre-stored name-instruction correspondence relationship, where 1≤j≤the total number of project names;
[0065] Specifically, the corresponding test instructions when performing the same test item on different switches to be tested are all the same. Therefore, a name-instruction correspondence relationship is pre-stored in the present application, and the test instruction corresponding to the jth project name of the i-th switch to be tested is determined according to the project name, and there is no need to repeatedly store the corresponding test instructions for each switch to be tested, thereby reducing storage space.
[0066] S14: Send each test instruction to the i-th switch to be tested, so that the i-th switch to be tested performs the test corresponding to each project name.
[0067] Specifically, each switch to be tested can be batch tested simultaneously and in parallel, but the same switch to be tested can only be tested for one test item at a time.
[0068] It should also be noted that before the test, each switch to be tested has been pre-burned with the basic firmware required for booting offline, including but not limited to BIOS (Basic Input Output System), CPLD (Complex Programmable Logic Device), BMC (Baseboard Management Controller) and FPGA (Field Programmable Gate Array) and other basic firmware, which can be determined according to actual needs. And each switch to be tested also needs to install a pre-designed switch production diagnostic system (the production diagnostic system is the support for the program to realize the automatic production test of the switch to be tested) to execute the logic corresponding to the transmitted test instructions (the test instructions are specifically controlled by the switch production diagnostic system for execution and feedback). Further, a MES device including an MES system (Manufacturing Execution System) can be pre-set (the reason for this setting is that the MES system can realize information verification with only a login name and a password, which is convenient for actual migration application). The MES device is in communication connection with each switch to be tested and a preset test device (that is, it is in the same communication network). The MES device stores unique identification information such as the SN number or MAC address of each switch to be tested, and also stores the firmware version number, firmware image file and storage access path required when the switch to be tested performs a firmware upgrade burning test (of course, another server can also be set up to store the firmware image file required by each switch to be tested and the server should also be in the same communication network as described above). Therefore, for the i-th switch to be tested, assuming that it performs a firmware upgrade test, when performing the corresponding firmware upgrade test according to the test instruction, the firmware image file can be downloaded in the MES device (or the server) to perform the firmware upgrade burning test. In addition, when there is a performance test on whether the switch to be tested can access the peripheral storage device according to the test needs, a USB disk can be prepared and plugged into the USB interface of the switch to be tested. There is no special limitation here and it depends on actual needs.
[0069] It should also be noted that after sending the test instruction, the test results and test logs of each test item of each switch to be tested can be obtained in real time, the test logs can be stored (specifically, they can be stored in the preset test device, and can also be further stored in the above-mentioned MES device for flexible reading), and the test results can be displayed in real time using the status bar of the UI interface, etc. There is no special limitation here, and it depends on actual needs.
[0070] In addition, if a switch to be tested fails the test and needs to be repaired, it can be tested again according to the above steps after the repair.
[0071] In summary, the present application provides a switch testing method. Compared with the prior art, the user does not need to manually input test instructions during the entire testing process, and when S is greater than 1, multiple switches to be tested can obtain corresponding test instructions according to the names of the projects they actually need to test, thereby performing tests in parallel and in batches, with a high degree of automation, saving labor costs, and improving production testing efficiency.
[0072] Based on the above embodiments:
[0073] As a preferred embodiment, the preset test device is also connected to the power supply module in communication, the input interface of the power supply module is connected to the power supply, and the output interface of the power supply module is connected to the power supply interface of each switch to be tested in a one-to-one correspondence;
[0074] After obtaining the identification instruction sent by the user indicating the start of testing the i-th switch to be tested, the method further includes:
[0075] Determine the output interface in the power supply module connected to the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-power supply interface correspondence relationship;
[0076] A power supply control signal is sent to the power supply module, so that the power supply module supplies power to the i-th switch to be tested through the output interface based on the power supply control signal.
[0077] In this embodiment, in order to accurately power each switch to be tested, the preset test device is also connected to the power supply module, that is, the two are in the same communication network without the need for physical line connection. The switch identifier-power supply interface correspondence is pre-stored, and the output interface of the power supply module and the power supply interface of each switch to be tested need to be pre-connected one by one according to the switch identifier-power supply interface correspondence to ensure the accuracy of subsequent power supply, and then the power supply of the i-th switch to be tested can be realized by controlling according to the above steps.
[0078] It should be noted that the power supply module here includes but is not limited to an intelligent PDU device (Power Distribution Unit) that can support remote control of power on and off, and the specific number of intelligent PDU devices is set but is not limited to: a one-to-one correspondence with the total number S of switches to be tested, so the switch identifier-power supply interface correspondence can be simplified to the switch identifier-first IP address correspondence, and the first IP address is the unique IP address of each of the intelligent PDU devices.
[0079] It can be seen that the above method can simply and reliably realize accurate power supply to each switch to be tested, laying a foundation for subsequent functional testing.
[0080] As a preferred embodiment, before determining the output interface in the power supply module connected to the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-power supply interface correspondence, the method further includes:
[0081] Sending a detection signal indicating the reliability of the network connection to the power supply module;
[0082] Determine whether a first feedback signal of the power supply module to the detection signal is received;
[0083] If so, the step of determining the output interface in the power supply module connected to the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-power supply interface correspondence is entered.
[0084] In this embodiment, the inventor further considers that since there is a communication connection in this application, in order to detect the reliability of the network connection, so as to avoid repeated testing caused by test abnormalities due to unreliable network connection, the above network reliability determination logic can be executed, as described above, and will not be repeated here, so that when it is determined that the network connection is normal, the subsequent power-on operation of the switch to be tested is performed. Among them, the first feedback signal is generated by the power supply module based on the detection signal feedback.
[0085] It should also be noted that, in addition to the power supply module, the MES equipment described in the above embodiments, the server for storing firmware image files, and the communication module described in the following embodiments can all perform the network connection reliability detection performed in this embodiment to ensure that when a test abnormality occurs, network connection problems are eliminated as much as possible to ensure a correct testing environment.
[0086] In addition, if the above detection finds that a network connection abnormality occurs in the power supply equipment and / or the MES equipment and / or the communication module and / or the server, the abnormal situation can be displayed through the above-mentioned UI interface, such as displaying the name of the abnormal device, so that the user can perform subsequent processing.
[0087] As a preferred embodiment, the preset test device is also communicatively connected to the MES equipment including the MES system;
[0088] Before determining the name of the project to be tested of the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-project name correspondence, the method further includes:
[0089] After receiving the second feedback signal indicating that the power supply is successful, the MES device sends a determination identification signal indicating whether to detect the i-th device to be tested to the MES device;
[0090] Determine whether a third feedback signal sent by the MES device is received, wherein the third feedback signal is obtained by the MES device determining whether the i-th switch to be tested is qualified for testing based on the determination identification signal and a pre-stored switch identification-permission identification correspondence relationship;
[0091] If so, the step of determining the name of the project to be tested for the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-project name correspondence is entered.
[0092] In this embodiment, the inventor further considers that a switch identification-permission identification correspondence is pre-stored in the MES device. Specifically, the correspondence can be understood as follows: if a switch to be tested has a problem during the above test, it should be repaired later, and it is meaningful to test it after the repair is completed. Therefore, the correspondence reflects the above logic. For example, if it is assumed that the first switch to be tested has no problem and can be tested, the corresponding permission identification bit can be set to 0. If the first switch to be tested has a problem and needs to be repaired, the corresponding permission identification bit can be set to 1 first, so as not to perform meaningless detection before the repair is completed. Of course, as an example, the above is only a situation where the device to be tested cannot be tested. Other reasons may be encountered in actual production, but in essence, the MES device determines whether the i-th device to be tested is qualified for testing based on the determination identification signal (including the unique identification information of the i-th device to be tested for subsequent identification).
[0093] It is understandable that if it is determined that the i-th device to be tested is not qualified for testing, the MES device can feedback a signal to the preset test device to prohibit testing of the switch to be tested, and can further feedback the reason for not allowing the test, which is not particularly limited here.
[0094] It can be seen that the above configuration can effectively avoid redundant testing or repeated testing when the switch to be tested has not been repaired, which may easily damage the device.
[0095] As a preferred embodiment, the preset test device is also connected to the communication module, and the communication module is also connected to S switches to be tested;
[0096] The switch testing method further includes:
[0097] An interface for receiving communication module communication transmission - operation information;
[0098] The switch to be tested corresponding to the operation information is determined according to the interface-operation information and the pre-stored communication interface-switch identifier correspondence, and the operation information is saved in a storage module corresponding to the switch to be tested, wherein the operation information is the operation information of the switch to be tested when it is turned on and / or turned off.
[0099] In this embodiment, it is further considered that the network of the switch to be tested cannot be connected when it is turned on and off, which causes the above communication connection to fail and the inability to upload information. However, a large amount of operating data (such as printing information, etc.) will be generated during the process of turning on and off the switch to be tested, which is helpful for subsequent research and analysis. Therefore, a communication module is set up to connect the preset test device with the communication module (that is, the two are in the same communication network), and the interface of the communication module is also connected to the communication interface of the S switches to be tested in a one-to-one correspondence (here is a physical connection line, and it should be noted that the physical connection line here needs to be correctly connected according to the pre-stored communication interface-switch identification correspondence relationship to avoid subsequent data correspondence errors), so the operating information of the switch to be tested when it is turned on and / or shut down will be transmitted to the preset test device through the communication module, and subsequently stored for research.
[0100] It should also be noted that the communication module here includes but is not limited to a serial port server supporting data transmission, and the setting of the specific number of serial port servers includes but is not limited to: a one-to-one correspondence with the total number S of switches to be tested, so the communication interface-switch identifier correspondence can be simplified to a switch identifier-second IP address correspondence, and the second IP address is the unique IP address of each serial port server.
[0101] As a preferred embodiment, after sending each test instruction to the i-th switch to be tested, the method further includes:
[0102] Get the test log of the i-th switch to be tested and the test results of each project name;
[0103] Control the display module to display the test results;
[0104] Save the test log to the storage module.
[0105] In this embodiment, the inventor further considers that it is difficult to record the test results by the manual testing method in the prior art, resulting in no basis for subsequent analysis. Therefore, the test log of the i-th switch to be tested and the test results of each project name can be obtained. Then, the step of controlling the display module to display the test results can be specifically as follows: controlling the test status display bar corresponding to the i-th switch to be tested in the UI interface to display the test results in real time, such as when the test result of the first test item is passed, it is displayed as passed; if the test result of the first test item is failed, the project name of the test item and the test failure result are displayed so that the user can grasp it in time, and a total test pass result can be displayed when all the test items of the i-th switch to be tested are passed. No special limitation is made here, and it can be determined according to actual needs.
[0106] It should also be noted that, for ease of viewing, the test log corresponding to each test item of the i-th switch to be tested can be saved separately, so that the user can view the test log corresponding to any test item as needed. And after all the test items of the i-th switch to be tested are tested, if one or several tests fail, subsequent analysis can be performed and the analysis results can be displayed through the UI interface, so that the user can reliably locate the fault of the switch to be tested based on the analysis results.
[0107] It can be seen that the test results can be displayed more intuitively through the above method, which is convenient for users to intuitively grasp the test progress, and the saved test logs are also convenient for subsequent user analysis.
[0108] As a preferred embodiment, after sending each test instruction to the i-th switch to be tested, the method further includes:
[0109] The test status corresponding to the i-th switch to be tested in the pre-stored switch identification-test status correspondence relationship is changed from a first identification bit indicating that it is not being tested to a second identification bit indicating that it is being tested;
[0110] When receiving a fourth feedback signal indicating the end of the test sent by the i-th switch to be tested, changing the test state corresponding to the i-th switch to be tested in the switch identifier-test state correspondence relationship from the second identifier to the first identifier;
[0111] Before determining the name of the project to be tested of the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-project name correspondence, the method further includes:
[0112] Determine whether the test status of the i-th switch to be tested is the first identification bit according to the identification instruction and the switch identification-test status correspondence relationship;
[0113] If so, the step of determining the name of the project to be tested for the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-project name correspondence is entered.
[0114] In this embodiment, the inventor further considers the actual application. When a switch to be tested is in the state of being tested, even if an identification instruction sent by the user indicating the start of the test of the switch to be tested is subsequently received, no subsequent response should be made to avoid interfering with the test progress. Therefore, a switch identification-test status correspondence is pre-stored. The specific execution logic is described above and will not be repeated here. As an example, the first identification bit can be specifically a field such as finish, and the corresponding second identification bit can be specifically another field such as running; of course, the first identification bit can also be specifically a binary identification bit such as 0, and the corresponding second identification bit can also be specifically another binary identification bit such as 1. This application does not make any special restrictions here, and it can be determined according to actual needs.
[0115] It can be understood that, when it is determined that the test status of the i-th switch to be tested is not the first identification bit (i.e., the second identification bit), no subsequent response will be made to the identification instruction sent by the user this time to ensure that the original test is not affected. Only after the test is completed and the test request is received again, the user's test request for the switch to be tested can be responded to again.
[0116] It can be seen that the above settings ensure the test reliability of the switch to be tested, which is closer to actual application.
[0117] Please refer to Figure 2 , Figure 2 A schematic structural diagram of a switch testing system provided by the present invention.
[0118] The switch test system is applied to a preset test device, the preset test device is communicatively connected with S switches to be tested, where S is an integer not less than 1, and the system includes:
[0119] The acquisition unit 21 is used to acquire an identification instruction sent by a user indicating the start of testing of the i-th switch to be tested, where 1≤i≤S and i is an integer;
[0120] The first determining unit 22 is used to determine the project name to be tested for the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-project name correspondence relationship;
[0121] The second determining unit 23 is used to determine the test instruction corresponding to the j-th project name based on the j-th project name and the pre-stored name-instruction correspondence relationship, where 1≤j≤the total number of project names;
[0122] The sending unit 24 is used to send each test instruction to the i-th switch to be tested, so that the i-th switch to be tested performs the test corresponding to each item name.
[0123] For an introduction to the switch testing system provided in the present invention, please refer to the above-mentioned embodiment of the switch testing method, which will not be described in detail here.
[0124] As a preferred embodiment, the preset test device is also communicatively connected to a power supply module, an input interface of the power supply module is connected to a power source, and an output interface of the power supply module is connected to a power supply interface of each of the switches to be tested in a one-to-one correspondence;
[0125] The switch testing system further includes:
[0126] an output interface determination unit, configured to determine, after the acquisition unit 21, the output interface in the power supply module connected to the i-th switch to be tested according to the identification instruction and a pre-stored switch identification-power supply interface correspondence relationship;
[0127] The power supply control signal sending unit is used to send a power supply control signal to the power supply module, so that the power supply module supplies power to the i-th switch to be tested through the output interface based on the power supply control signal.
[0128] As a preferred embodiment, the switch testing system further includes:
[0129] A detection signal sending unit, used to send a detection signal indicating the reliability of the network connection to the power supply module before the output interface determination unit;
[0130] A first judging unit, configured to judge whether a first feedback signal of the power supply module to the detection signal is received; if so, triggering the output interface determining unit;
[0131] As a preferred embodiment, the preset test device is also communicatively connected to an MES device including an MES system;
[0132] The switch testing system further includes:
[0133] A determination identification signal sending unit, configured to send a determination identification signal indicating whether to detect the i-th device to be tested to the MES device after receiving a second feedback signal indicating successful power supply fed back by the power supply module before the first determination unit 22;
[0134] The second judgment unit is used to judge whether a third feedback signal sent by the MES device is received, wherein the third feedback signal is obtained by the MES device judging whether the i-th switch to be tested is qualified for testing based on the judgment identification signal and a pre-stored switch identification-permission identification correspondence relationship; if so, triggering the first determination unit 22.
[0135] As a preferred embodiment, the preset test device is also connected to the communication module, and the communication module is also connected to S switches to be tested;
[0136] The switch testing system further includes:
[0137] An operation information acquisition unit, used to receive the interface-operation information transmitted by the communication module;
[0138] The first storage unit is used to determine the switch to be tested corresponding to the operation information according to the interface-operation information and the pre-stored communication interface-switch identifier correspondence, and save the operation information to a storage module corresponding to the switch to be tested, wherein the operation information is the operation information of the switch to be tested when it is turned on and / or turned off.
[0139] As a preferred embodiment, the switch testing system further includes:
[0140] A test data acquisition unit, used to acquire the test log of the i-th switch to be tested and the test results of each of the project names after the sending unit 24;
[0141] A display unit, used to control the display module to display the test results;
[0142] The second storage unit is used to save the test log to the storage module.
[0143] As a preferred embodiment, the switch testing system further includes:
[0144] A first changing unit, configured to change, after the sending unit 24, the test status corresponding to the i-th switch to be tested in the pre-stored switch identifier-test status correspondence relationship from a first identifier indicating that it is not being tested to a second identifier indicating that it is being tested;
[0145] A second changing unit is configured to change the test status corresponding to the i-th switch to be tested in the switch identifier-test status correspondence relationship from the second identifier to the first identifier when receiving a fourth feedback signal sent by the i-th switch to be tested indicating that the test is finished;
[0146] The third judgment unit is used to judge whether the test status of the i-th switch to be tested is the first identification bit according to the identification instruction and the switch identification-test status correspondence before the first determination unit 22; if so, trigger the first determination unit 22.
[0147] Please refer to Figure 3 , Figure 3 A structural schematic diagram of a testing device provided by the present invention.
[0148] The test device comprises:
[0149] A memory 31, used for storing computer programs;
[0150] The processor 32 is used to execute the steps of the switch testing method as described above.
[0151] For an introduction to the testing device provided in the present invention, please refer to the embodiment of the switch testing method described above, which will not be described in detail here.
[0152] The present invention also provides a computer-readable storage medium, comprising:
[0153] A computer program is stored on the computer-readable medium, and when the computer program is executed by the processor, the steps of the switch testing method described above are implemented.
[0154] For an introduction to the computer-readable storage medium provided in the present invention, please refer to the above-mentioned embodiment of the switch testing method, which will not be described in detail here.
[0155] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0156] It is further appreciated by professionals that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A switch testing method, characterized in that: Applied to a preset test device, the preset test device is communicatively connected to S switches to be tested, where S is an integer not less than 1, and the method includes: Obtaining an identification instruction sent by a user indicating the start of testing of the i-th switch to be tested, where 1≤i≤S and i is an integer; Determine the name of the project to be tested for the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-project name correspondence relationship; Determine a test instruction corresponding to the j-th project name based on the j-th project name and a pre-stored name-instruction correspondence relationship, wherein 1≤j≤the total number of the project names; Sending each of the test instructions to the i-th switch to be tested, so that the i-th switch to be tested performs the test corresponding to each of the project names; The preset test device is also communicatively connected to the power supply module, the input interface of the power supply module is connected to the power supply, and the output interface of the power supply module is connected to the power supply interface of each of the switches to be tested in a one-to-one correspondence; After obtaining the identification instruction sent by the user indicating the start of testing the i-th switch to be tested, the method further includes: Determine the output interface in the power supply module connected to the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-power supply interface correspondence; send a power supply control signal to the power supply module, so that the power supply module supplies power to the i-th switch to be tested through the output interface based on the power supply control signal.
2. The switch testing method according to claim 1, characterized in that: Before determining the output interface in the power supply module connected to the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-power supply interface correspondence, the method further includes: Sending a detection signal indicating the reliability of the network connection to the power supply module; Determining whether a first feedback signal from the power supply module to the detection signal is received; If so, the step of determining the output interface in the power supply module connected to the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-power supply interface correspondence relationship is entered.
3. The switch testing method according to claim 1, characterized in that: The preset test device is also communicatively connected to the MES equipment including the MES system; Before determining the name of the project to be tested of the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-project name correspondence, the method further includes: After receiving the second feedback signal indicating successful power supply fed back by the power supply module, sending a determination identification signal indicating whether to detect the i-th device to be tested to the MES device; Determine whether a third feedback signal sent by the MES device is received, wherein the third feedback signal is obtained by the MES device determining whether the i-th switch to be tested is qualified for testing based on the determination identification signal and a pre-stored switch identification-permission identification correspondence relationship; If so, the step of determining the name of the project to be tested for the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-project name correspondence is entered.
4. The switch testing method according to claim 1, characterized in that: The preset test device is also connected to the communication module, and the communication module is also connected to S switches to be tested; The switch testing method further includes: Receiving interface-operation information transmitted by the communication module; The switch to be tested corresponding to the operation information is determined according to the interface-operation information and the pre-stored communication interface-switch identifier correspondence, and the operation information is saved in a storage module corresponding to the switch to be tested, wherein the operation information is the operation information of the switch to be tested when it is turned on and / or turned off.
5. The switch testing method according to claim 1, characterized in that: After sending each of the test instructions to the i-th switch to be tested, the method further includes: Obtain the test log of the i-th switch to be tested and the test results of each of the project names; Controlling the display module to display the test result; The test log is saved in a storage module.
6. The switch testing method according to any one of claims 1 to 5, characterized in that: After sending each of the test instructions to the i-th switch to be tested, the method further includes: The test status corresponding to the i-th switch to be tested in the pre-stored switch identification-test status correspondence relationship is changed from a first identification bit indicating that it is not being tested to a second identification bit indicating that it is being tested; When receiving a fourth feedback signal indicating the end of the test sent by the i-th switch to be tested, changing the test state corresponding to the i-th switch to be tested in the switch identifier-test state correspondence relationship from the second identifier to the first identifier; Before determining the name of the project to be tested of the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-project name correspondence, the method further includes: Determine whether the test status of the i-th switch to be tested is the first identification bit according to the identification instruction and the switch identification-test status correspondence relationship; If so, the step of determining the name of the project to be tested for the i-th switch to be tested according to the identification instruction and the pre-stored switch identification-project name correspondence is entered.
7. A switch testing system, characterized in that: Applied to a preset test device, the preset test device is communicatively connected with S switches to be tested, where S is an integer not less than 1, and the system includes: An acquisition unit, configured to acquire an identification instruction sent by a user indicating that a test has started on the i-th switch to be tested, where 1≤i≤S and i is an integer; A first determining unit, configured to determine the name of the project to be tested of the i-th switch to be tested according to the identification instruction and a pre-stored switch identification-project name correspondence relationship; A second determining unit is used to determine a test instruction corresponding to the j-th project name based on the j-th project name and a pre-stored name-instruction correspondence relationship, wherein 1≤j≤the total number of the project names; A sending unit, configured to send each of the test instructions to the i-th switch to be tested, so that the i-th switch to be tested performs the test corresponding to each of the project names; The switch testing system further includes: An output interface determination unit, configured to determine, after the acquisition unit, the output interface in the power supply module connected to the i-th switch to be tested according to the identification instruction and a pre-stored switch identification-power supply interface correspondence relationship; The power supply control signal sending unit is used to send a power supply control signal to the power supply module, so that the power supply module supplies power to the i-th switch to be tested through the output interface based on the power supply control signal.
8. A testing device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the steps of the switch testing method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: include: A computer program is stored on the computer-readable medium, and when the computer program is executed by a processor, the steps of the switch testing method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Test method, device and equipment and storage medium
CN109726107A
Terminal test method and device, storage medium and mobile terminal
CN112199246A