Performance detection method of network equipment, network equipment and storage medium
By setting the mode button on the network device, the number of presses corresponds to the detection performance, the problem of convenience and low efficiency of network equipment performance detection in the prior art is solved, and efficient and convenient performance detection is achieved.
Patent Information
- Application Number
- CN202311433708.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-30
- Publication Date
- 2025-05-09
AI Technical Summary
The prior art lacks convenient methods when detecting network equipment performance, resulting in low detection efficiency of operation and maintenance personnel when they do not carry terminal equipment or the environment cannot be connected.
By setting the mode button on the network device, the number of presses corresponds to the detection performance one by one, obtain the number of target presses, determine the target detection performance, and perform corresponding performance detection.
It improves the convenience and efficiency of network equipment performance detection, so that users can conduct efficient inspections without carrying terminal equipment.
Smart Images

Figure CN119966863A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of performance detection, and in particular to a performance detection method for a network device, a network device, and a storage medium. Background Art
[0002] At present, when operation and maintenance personnel perform performance testing on network devices, they generally need to use terminal devices to perform performance testing on network devices. For example, the terminal device is connected to the serial port of the network device to perform corresponding performance testing operations on the network device. However, if the operation and maintenance personnel do not carry the terminal device or the connection between the terminal device and the network device cannot be established in the current environment, it is easy to cause the convenience of performance testing of the network device to be low, thereby reducing the efficiency of performance testing of the network device. Summary of the invention
[0003] The main purpose of the present application is to provide a performance detection method for a network device, a network device and a storage medium, aiming to solve the technical problems of low convenience and efficiency of performance detection of network devices.
[0004] In a first aspect, an embodiment of the present application provides a performance detection method for a network device, wherein a mode button is provided on the network device, and the number of times the mode button is pressed corresponds to the detection performance corresponding to the network device. The performance detection method includes:
[0005] Obtaining a target number of presses corresponding to the mode button;
[0006] determining target detection performance according to the number of target presses;
[0007] The network is tested according to the target detection performance to obtain a test result of the target detection performance.
[0008] In a second aspect, an embodiment of the present application further provides a network device, wherein a mode button is provided on the network device, and the number of times the mode button is pressed corresponds one-to-one to the detection performance corresponding to the network device.
[0009] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program can be executed by a processor, and the processor implements any performance detection method of a network device provided in the specification of the present application.
[0010] The embodiment of the present application provides a performance detection method of a network device, a network device and a storage medium. The network device is provided with a mode button, and the number of times the mode button is pressed corresponds to the detection performance corresponding to the network device. The embodiment of the present application obtains the target number of presses corresponding to the mode button; determines the target detection performance according to the target number of presses; and detects the network device according to the target detection performance to obtain the detection result of the target detection performance, which is conducive to improving the convenience of performance detection of the network device and improving the efficiency of performance detection of the network device. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0012] Figure 1 A flowchart of a performance detection method for a network device provided in an embodiment of the present application;
[0013] Figure 2 A schematic diagram of the structure of a network device provided for this application;
[0014] Figure 3 A flowchart of a method for detecting performance of a network device according to an embodiment of the present application is provided. DETAILED DESCRIPTION
[0015] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0016] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0017] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0018] The embodiment of the present application provides a performance detection method of a network device, an electronic device and a storage medium. The performance detection method of the network device can be applied to a network device. The network device can include a switch, a router, etc., which is not limited here.
[0019] Some embodiments of the present application are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0020] See also Figure 1 , Figure 1 The present invention provides a flow chart of a performance detection method for a network device according to an embodiment of the present invention. Exemplarily, the performance detection method for a network device is applied to a network device. The network device may include a switch, a router, and the like, which are not limited here.
[0021] like Figure 2 As shown, a mode button is provided on the network device, and the number of times the mode button is pressed corresponds one-to-one to the detection performance corresponding to the network device.
[0022] like Figure 1 As shown, the performance detection method of the network device includes steps S101 to S103.
[0023] Step S101: Obtain a target number of presses corresponding to a mode button.
[0024] For example, when a user needs to test the detection performance corresponding to the network device, the user can press a mode button set on the network device. The network device can obtain a target number of presses corresponding to the mode button in response to the user's pressing operation on the mode button.
[0025] Take the embedded operating system corresponding to the network device as an example. In the embedded operating system, an event number, such as MODE_BUTTON, can be pre-registered. The event number can be pre-registered with an associated callback function, such as mode_button_callback. The callback function is used to respond to specific events or conditions. For example, when the network device obtains a pressing operation on the mode button, the network device can trigger an event through hardware, such as triggering MODE_BUTTON, and call the callback function mode_button_callback corresponding to MODE_BUTTON. Based on the call of the callback function mode_button_callback, the target number of presses on the mode button can be obtained, such as determining mode_value. Among them, the embedded operating system can be provided with an interface for obtaining system time. The embedded operating system can respond to the obtained pressing operation on the mode button and obtain the system time corresponding to the pressing operation. Based on the determination of the system time corresponding to the pressing operation, the time interval between two pressing operations with adjacent pressing times can be calculated by the polling subtraction method. Of course, it is not limited to this and is not limited here.
[0026] In some embodiments, the target number of presses corresponding to the mode button can be obtained through the general purpose input and output (GPIO) interface of the network device. For example, in response to each press operation of the mode button by the user, the general purpose input and output (GPIO) interface of the network device is interrupted once. For example, when the GPIO interface is interrupted once, the statistical value of the counter corresponding to the GPIO interface increases by 1, and accordingly, the number of presses of the mode button obtained can also increase by 1. By analogy, when determining the target number of presses based on the obtained number of presses of the mode button, the target number of presses can be infinitely increased in response to the user's press operation on the mode button. Since the number of presses of the mode button corresponds one-to-one to the detection performance corresponding to the network device, the target number of presses corresponding to the mode button obtained can be used for subsequent determination of the target detection performance corresponding to the network device.
[0027] Of course, it is not limited to this. Since the number of times the mode button is pressed corresponds to the detection performance corresponding to the network device one by one, when the total number of detection performances corresponding to the network device is limited, the detection performances corresponding to the network device corresponding to different times of pressing the mode button can be the same. Based on this, the statistical value range of the counter corresponding to the GPIO interface can be set according to the total number of detection performances corresponding to the network device, so that the statistical value of the counter corresponding to the GPIO interface can be switched within the statistical value range in response to the user's pressing operation on the mode button, so as to obtain the target number of times the mode button is pressed according to the statistical value of the counter corresponding to the GPIO interface.
[0028] Take the detection performance corresponding to the network device as an example, which includes detection performance 1 to detection performance 10. When the number of times the mode button is pressed is 1, the detection performance corresponding to the number of presses and the network device is detection performance 1. When the number of times the mode button is pressed is 11, the detection performance corresponding to the number of presses and the network device is also detection performance 1. For example, the statistical value range of the counter corresponding to the GPIO interface can be set to 0 to 9. Among them, when the user presses the mode button for the first time, the statistical value of the counter corresponding to the GPIO interface is 0. When the user presses the mode button for the second time, the statistical value of the counter corresponding to the GPIO interface is 1. When the user presses the mode button for the tenth time, the statistical value of the counter corresponding to the GPIO interface is 9. When the user presses the mode button for the eleventh time, the statistical value of the counter corresponding to the GPIO interface is 0, and so on. When the statistical value of the counter corresponding to the GPIO interface is determined, the statistical value of the counter corresponding to the GPIO interface can be determined as the target number of presses corresponding to the mode button. For example, the target pressing times may be cyclically switched within a statistical value range in response to the user's pressing operation on the mode button. The determination of the target pressing times corresponding to the mode button can be used to subsequently determine the target detection performance corresponding to the network device.
[0029] For example, during the performance test of the network device, the time for the user to press the mode button may be discontinuous. For example, due to the influence of factors such as the user needing a certain time to think about whether to continue pressing the mode button, the network device needing a certain time to perform performance test, and the mode button needing a certain time to recover from the pressed state to the original state, the time interval between two adjacent pressing operations is usually not 0. Based on this, when obtaining the target number of pressing times for the mode button, the time interval between the pressing operations on the mode button can be comprehensively considered.
[0030] For example, the first preset time interval can be set based on the user's consideration of whether to continue pressing the mode button, whether the mode button is restored from the pressed state to the original state, and other factors. The first preset time interval allows the network device to obtain the number of presses corresponding to the pressing operation on the mode button within a time period. Take the first number of presses on the mode button determined according to the pressing operation obtained in time period 1, and the initial value of the first number of presses is 0 as an example. The time when the first pressing operation on the mode button is obtained can be used as the starting time of time period 1, and at this time, the first number of presses is 1. In response to each time the network device obtains a pressing operation on the mode button, the time interval between two adjacent pressing operations can be obtained. If the time interval between two adjacent pressing operations is less than or equal to the first preset time interval, the first number of presses increases by 1. If the time interval between two adjacent pressing operations is greater than the first preset time interval, the first number of presses remains unchanged. Furthermore, when the time interval between two adjacent pressing operations with a time interval greater than the first preset time interval exists, the end time of time period 1 can be determined based on the time of the previous pressing operation among the two adjacent pressing operations with a time interval greater than the first preset time interval. Accordingly, the time period after time period 1, such as the start time of time period 2, can be determined based on the time of the latter pressing operation among the two adjacent pressing operations with a time interval greater than the first preset time interval. In this way, the first number of pressings corresponding to the pressing operation of the mode button is obtained. Among them, with the determination of the first number of pressings, the target number of pressings for the mode button can be determined. Based on this, the first preset time interval can be used for the network device to obtain the target number of pressings for the mode button.
[0031] Accordingly, a second preset time interval may be set based on factors such as the performance detection of the network device. The second preset time interval may be used by the network device to obtain the number of presses corresponding to the pressing operation of the mode button in each of the two adjacent time periods, such as obtaining the first number of presses and the second number of presses, so as to obtain the target number of presses of the mode button. For example, the first number of presses of the mode button is determined according to the pressing operation obtained in time period 1, and the second number of presses of the mode button is determined according to the pressing operation obtained in time period 0, and time period 0 is located before time period 1. When the time interval between time period 1 and time period 0 is greater than the first preset time interval, the network device may determine the first number of presses according to the pressing operation of the mode button obtained in time period 1. The network device may also determine the second number of presses according to the pressing operation of the mode button obtained in time period 2. The manner of determining the first number of presses and the manner of determining the second number of presses are similar to those described above and will not be repeated here. For example, when the time interval between time period 1 and time period 0 is greater than the first preset time interval and less than or equal to the second preset time interval, the user can wait for the network device to perform performance detection after pressing the mode button a second number of times in time period 0. After the network device performs performance detection, if the user continues to press the mode button a first number of times in time period 1. Since the time interval between time period 0 and time period 1 is less than or equal to the second preset time interval, the user, for example, requires the network device to detect the detection performance after the detection performance corresponding to time period 0, and the target number of presses for the mode button can be determined based on the first number of presses and the second number of presses. Based on this, the first preset time interval and the second preset time interval can be used by the network device to obtain the target number of presses for the mode button.
[0032] In some embodiments, if a pressing operation on the mode button is not obtained again within a first preset time interval after a pressing operation on the mode button is obtained for a first number of times, and if a pressing operation on the mode button is not obtained within a second preset time interval before a pressing operation on the mode button is obtained for the first number of times of pressing, the first number of pressings is determined to be the target number of pressings; wherein, in the pressing operation of the first number of pressings, the time interval between two adjacent pressing operations is less than or equal to the first preset time interval, and the second preset time interval is greater than or equal to the product of the first preset time interval and the total number of detection performances corresponding to the network device.
[0033] For example, if the time period in which the mode button is pressed the first number of times is obtained as time period 1 and the first number of presses is 3, if the mode button is not pressed again within the first preset time interval after time period 1, and the mode button is not pressed within the second preset time interval before time period 1, the target number of presses can be determined to be 3. Of course, the present invention is not limited to this and is not limited here.
[0034] In some embodiments, if a pressing operation on the mode button is not obtained again within a first preset time interval after a pressing operation on the mode button is obtained for a first number of times, and a pressing operation on the mode button is obtained for a second number of times within a second preset time interval before a pressing operation on the mode button is obtained for the first number of times of pressing, the sum of the first number of presses and the second number of presses is determined as the target number of presses; wherein, in the pressing operation of the first number of presses and the pressing operation of the second number of presses, the time interval between two adjacent pressing operations is less than or equal to the first preset time interval, and the second preset time interval is greater than or equal to the product of the first preset time interval and the total number of detection performances corresponding to the network device.
[0035] Take the example that the time period corresponding to the first number of presses on the mode button is time period 1, the time period corresponding to the second number of presses on the mode button is time period 0, the first number of presses is 3, and the second number of presses is 2. If the time interval between time period 0 and time period 1 is less than or equal to the second preset time interval, it can be determined that 2 presses on the mode button are obtained within the second preset time interval between time period 1. And, if the mode button is not pressed again within the first preset time interval after time period 1, it can be determined that the first number of presses in time period 1 remains unchanged, that is, 3. Based on this, the sum of the first number of presses and the second number of presses can be determined as the target number of presses. For example, when the first number of presses and the second number of presses are 5, the target number of presses can be determined to be 5. Of course, it is not limited to this, and no limitation is made here.
[0036] In some implementations, the second preset time interval may be set to be greater than or equal to the first preset time interval. For example, the second preset time interval may be set to be greater than or equal to the product of the first preset time interval and the total number of detection capabilities corresponding to the network device.
[0037] For example, if the total number of detection performances corresponding to the network device is 10, the first number of presses is 3, the second number of presses is 2, the second number of presses on the mode button corresponds to the detection performance 2 corresponding to the network device, the third number of presses on the mode button corresponds to the detection performance 3 corresponding to the network device, and the fifth number of presses on the mode button corresponds to the detection performance 5 corresponding to the network device, in the case where the network device does not obtain the pressing operation of the mode button again within the first preset time interval after obtaining the 3 pressing operations on the mode button, and obtains 2 pressing operations on the mode button within the second preset time interval before obtaining the 3 pressing operations on the mode button, the user, for example, needs to switch the detection performance corresponding to the network device from detection performance 2 to detection performance 5. Since the second preset time interval is greater than or equal to the product of the first preset time interval and the total number of detection performances corresponding to the network device, if the network device does not obtain the pressing operation of the mode button again within the first preset time interval after obtaining the 2 pressing operations on the mode button, the network device will not reset the currently obtained number of presses. Accordingly, if the network device obtains three presses on the mode button again within the second preset time interval after obtaining two presses on the mode button, it can be determined that the detection performance corresponding to the network device is switched from detection performance 2 to detection performance 5. Based on this, when switching the detection performance corresponding to the network device from detection performance 2 to detection performance 5, the network device only needs to obtain three presses on the mode button again within the second preset time interval after obtaining two presses on the mode button, and does not need to obtain five presses on the mode button again after obtaining two presses on the mode button.
[0038] Based on the fact that the second preset time interval is greater than or equal to the product of the first preset time interval and the total number of detection performances corresponding to the network device, in the process of detecting the detection performances corresponding to the network device, sufficient time can be reserved for the user to view the detection results corresponding to the detection performances, and the target number of presses can be reset too quickly, which will result in an additional increase in the number of presses required for the user to determine the adjacent detection performances corresponding to the network device.
[0039] In some embodiments, in the process of obtaining the target number of presses for the mode button, the second number of presses obtained in each of the adjacent time periods whose time intervals before obtaining the first number of presses of the mode button are less than or equal to the second preset time interval can be comprehensively considered to obtain the target number of presses for the mode button.
[0040] For example, the network device obtains 5 press operations on the mode button in time period 1, 3 press operations on the mode button in time period 2, and 2 press operations on the mode button in time period 3. Taking time period 1 as an example, which is earlier than time period 2 and time period 2 as an example, the time interval between time period 1 and time period 2 is greater than the first preset time interval and less than or equal to the second preset time interval. The time interval between time period 2 and time period 3 is greater than the first preset time interval and less than or equal to the second preset time interval. Moreover, the time interval between two press operations of adjacent press times obtained in any time period from time period 1 to time period 3 is less than or equal to the first preset time interval. Based on this, the target number of presses corresponding to the mode button obtained by the network device in time period 2 may be the sum of the number of presses corresponding to time period 1 and the number of presses corresponding to time period 2. Accordingly, the target number of presses corresponding to the mode button obtained by the network device in time period 3 may be the sum of the target number of presses corresponding to the mode button obtained by the network device in time period 2 and the number of presses corresponding to time period 3, that is, the sum of the number of presses corresponding to time period 1, the number of presses corresponding to time period 2, and the number of presses corresponding to time period 3. Similarly, if a pressing operation of the mode button for a corresponding number of times is obtained within the second preset time interval before time period 1, the second number of presses may continue to be updated. If a pressing operation of the mode button for a corresponding number of times is not obtained within the second preset time interval before time period 1, the second number of presses may not be updated, that is, the final second number of presses is determined. This is not limited here.
[0041] In this way, by obtaining the target number of presses corresponding to the mode button, the target detection performance corresponding to the network device can be subsequently determined, thereby performing performance testing on the network device, which is conducive to improving the convenience of performance testing on the network device and improving the efficiency of performance testing on the network device.
[0042] Step S102: Determine the target detection performance according to the number of target pressing times.
[0043] For example, the target number of presses may be infinitely increased in response to the user's pressing operation on the mode button. Since the number of presses on the mode button corresponds one-to-one to the detection performance corresponding to the network device, and the detection performance corresponding to the network device is limited, that is, the total number of detection performances corresponding to the network device is limited, the target detection performance may be determined according to the target number of presses.
[0044] In some implementations, the target detection performance corresponding to the target number of presses is determined from a plurality of detection performances according to a preset correspondence relationship, where the preset correspondence relationship is the correspondence between the number of presses of the mode button and the detection performance.
[0045] For example, the target number of presses may change in accordance with the change of the statistical value of the counter corresponding to the GPIO interface.
[0046] Taking the total number of detection performances corresponding to the network device as 10 and the statistical value range of the counter corresponding to the GPIO interface as 0 to 9 as an example, a preset corresponding relationship can be established by establishing a corresponding relationship between the statistical value of the counter corresponding to the GPIO interface and the detection performance, that is, a corresponding relationship between the number of times the mode button is pressed and the detection performance is established. For example, the preset corresponding relationship can be shown in Table 1.
[0047]
[0048] Table 1
[0049] According to Table 1, when the target number of presses is 0, it can be used to indicate that the mode button is pressed 1 time, 11 times, 21 times, etc., and the target detection performance corresponding to the network device can be determined as the port link state, and so on.
[0050] Of course, it is not limited to this. In some embodiments, the target number of presses can be infinitely increased in response to the user's pressing operation on the mode button. For example, when the user presses the mode button for the first time, the target number of presses is 1. When the user presses the mode button for the second time, the target number of presses is 2, and so on. Based on this, the target detection performance can be determined according to the remainder obtained by dividing the target number of presses by the total number of detection performances corresponding to the network device.
[0051] Take the case where the detection performance corresponding to the network device includes detection performance 1 to detection performance 10, and the total number of detection performances corresponding to the network device is 10. When the target number of presses is 1, the remainder obtained by dividing the target number of presses by the total number of detection performances corresponding to the network device is 1, and the target detection performance can be determined to be detection performance 1. When the target number of presses is 2, the remainder obtained by dividing the target number of presses by the total number of detection performances corresponding to the network device is 2, and the target detection performance can be determined to be detection performance 2. When the target number of presses is 3, the remainder obtained by dividing the target number of presses by the total number of detection performances corresponding to the network device is 3, and the target detection performance can be determined to be detection performance 3. And so on.
[0052] In this way, the target detection performance is determined according to the number of target presses, and the network device can subsequently perform corresponding detection based on the target detection performance, which is conducive to improving the convenience of performance detection of network devices and improving the efficiency of performance detection of network devices.
[0053] like Figure 2As shown, the network device is provided with an indicator light corresponding to the detection performance. The indicator light can be used to indicate the target detection performance of the network device.
[0054] For example, the indicator lights may be arranged in sequence according to the order of the detection performances corresponding to the network devices. For example, according to the order of the detection performances corresponding to the network devices, the order of the indicator lights corresponding to the detection performances is determined.
[0055] Of course, it is not limited to this. For example, within the preset position range of the indicator light corresponding to the network device, identification information of the detection performance corresponding to the network device can be set. For example, the word "LINK" is displayed below the position of the first indicator light on the network device to indicate that the first indicator light corresponds to the detection performance of the port link state. The word "SPEED" is displayed below the position of the second indicator light on the network device to indicate that the second indicator light corresponds to the detection performance of the port speed. And so on.
[0056] In some implementations, based on the target number of presses, an indicator light corresponding to the target number of presses is lit to indicate that the current detection performance of the network device is the target detection performance.
[0057] Taking the detection performance corresponding to the network device as an example, including detection performance 1 to detection performance 10, 10 indicator lights can be set on the network device, and the arrangement order of the indicator lights corresponds one-to-one to the setting order of the detection performance. For example, when the target number of presses can be infinitely increased in response to the user's pressing operation on the mode button, according to the target number of presses being 1, the first indicator light can be lit to indicate that the current detection performance of the network device is detection performance 1, and detection performance 1 is the target detection performance. According to the target number of presses being 2, the second indicator light can be lit to indicate that the current detection performance of the network device is detection performance 2. And so on.
[0058] Of course, it is not limited to this. For example, when the target number of presses can be cyclically switched within the statistical value range corresponding to the statistical value of the counter corresponding to the GPIO interface in response to the user's pressing operation on the mode button, according to the target number of presses being 8, the 9th indicator light can be lit to indicate that the current detection performance of the network device is detection performance 9, and detection performance 9 is the target detection performance. According to the target number of presses being 9, the 10th indicator light can be lit to indicate that the current detection performance of the network device is detection performance 10. And so on.
[0059] Based on the setting of the indicator lights, when the user sees that the network device lights up the corresponding indicator lights, the user can determine that the current detection performance of the network device is the target detection performance determined according to the target press times based on the arrangement order of the indicator lights among all the indicator lights.
[0060] In this way, according to the number of target presses, the indicator light corresponding to the target press number is lit, which is conducive to improving the intuitiveness and convenience of the network device indicating the target detection performance, thereby helping to improve the user's performance detection experience of the network device.
[0061] Step S103: Detect the network device according to the target detection performance to obtain a detection result of the target detection performance.
[0062] For example, when the target detection performance is determined, the network device can perform corresponding detection according to the target detection performance to obtain a detection result of the target detection performance.
[0063] In some implementations, when the target detection performance is determined, the network device may call a performance detection function corresponding to the target detection performance to detect the network device, as shown in Table 2.
[0064]
[0065] Table 2
[0066] Taking the network device as an embedded operating system as an example, the embedded operating system can create a mode button process, such as mode_button_pro. The mode button process mode_button_pro can determine the target detection performance corresponding to the target number of presses mode_value according to the target number of presses mode_value obtained by the callback function mode_button_callback, so as to execute the performance detection function corresponding to the target detection performance. Of course, it is not limited to this and is not limited here.
[0067] For example, when a correspondence between the number of times a mode button is pressed and the detection performance, and a correspondence between the detection performance and the performance detection function is established, a correspondence between the number of times a mode button is pressed and the performance detection function can also be established, without limitation here.
[0068] In this way, the network equipment is tested according to the target detection performance to obtain the test results of the target detection performance, which is conducive to improving the convenience of performance testing of the network equipment and improving the efficiency of performance testing of the network equipment.
[0069] Exemplarily, when the detection result of the target detection performance is obtained, the detection result may also be displayed, so that the user can intuitively observe the detection result of the target detection performance.
[0070] In some embodiments, the test results are displayed by an indicator light.
[0071] For example, based on the detection results of the target detection performance, the network can control the number of indicator lights that are lit, the display color of the indicator lights, the number of times the indicator lights flash, etc., to indicate the detection results of the target detection performance to the user.
[0072] For example, when the detection result is a data result, a preset number of indicator lights corresponding to the data result are lit.
[0073] Taking the target detection performance as CPU occupancy as an example, the CPU occupancy read by the network device is, for example, 40%, that is, the detection result is a data result, and the data result is 40%. Based on this, when the detection performance corresponding to the network device is 10 and the number of indicator lights set on the network device is 10, the network device can light up 4 indicator lights to indicate to the user that the CPU occupancy of the network device is between 35% and 44%. Of course, it is not limited to this and is not limited here.
[0074] In other implementations, when the detection result is a data result, the network device may control the indicator light to flash with a preset number of flashes corresponding to the data result.
[0075] Taking the target detection performance as memory occupancy as an example, the memory occupancy read by the network device is, for example, 23%, that is, the detection result is a data result, and the data result is 23%. Based on this, the network device can control two of the indicator lights to light up, and control the indicator light arranged in the front position of the two indicator lights to be always on, and control the indicator light arranged in the back position of the two indicator lights to light up and go out alternately three times, so as to indicate to the user that the memory occupancy of the network device is 23%. Of course, it is not limited to this, and no limitation is made here.
[0076] For example, when the detection result is a status judgment result, the color of the display indicator light is a preset color corresponding to the status judgment result.
[0077] Taking the target detection performance as the port spanning tree state as an example, the network device determines that the port spanning tree state (STP state) is, for example, one of "forward" and "bolck", that is, the detection result is a state judgment result. Based on this, when the STP state is "forward", the color of the indicator light can be displayed as green. When the STP state is "block", the color of the indicator light can be displayed as yellow. Of course, it is not limited to this. Taking the target detection performance as the port link state (LINK state) as an example, if the LINK state of all ports is obtained to be "up", the color of the indicator light can be displayed as green. There is no limitation here.
[0078] The preset color corresponding to the status judgment result may be pre-set or set by the user, which is not limited here.
[0079] Of course, the method of displaying the test results is not limited to this. For example, a display screen may be provided on the network device to display the test results through the display, which is not limited here.
[0080] In this way, by displaying the test results through indicator lights, users can intuitively observe the test results of the target detection performance, which is conducive to improving the convenience of displaying the test results of the network equipment, thereby helping to improve the user's detection experience of the network equipment.
[0081] In some implementations, if no pressing operation on the mode button is obtained again within a second preset time interval after the detection result is obtained, the target number of pressing times corresponding to the mode button is reset.
[0082] For example, within the second preset time interval after the network device determines the test result of the target detection performance, if the network device fails to obtain the pressing operation of the mode button again, it can be determined that the user does not need to continue to perform performance detection on the network device. Based on this, the target number of presses corresponding to the mode button can be reset. For example, the target number of presses corresponding to the mode button is reset to 0. By resetting the target number of presses corresponding to the mode button, when other users subsequently press the mode button to test the detection performance of the network device, they can re-determine the target detection performance corresponding to the network device according to their own needs. This is conducive to improving the user's performance detection experience of the network device.
[0083] Exemplarily, a reset button is provided on the network device, and the reset button is used to reset the target number of presses corresponding to the mode button.
[0084] In some implementations, in response to a pressing operation on a reset button of the network device, a target number of pressing times corresponding to the reset mode button is reached.
[0085] For example, in the process of obtaining the target number of presses for the mode button, the user may perform an erroneous operation on the mode button, such as pressing it once more, twice more, etc. Based on this, the user may press the reset button of the network device, and the network device may reset the target number of presses corresponding to the mode button in response to the pressing of the reset button, such as resetting the target number of presses to 0. When the network device resets the target number of presses corresponding to the mode button, the user may re-press the mode button for a corresponding number of presses according to his or her own needs, so that the network device can re-acquire the target number of presses for the mode button.
[0086] Of course, it is not limited to this. For example, when the user only needs to obtain the test results corresponding to one or a few test performances of the network device, the user can press the reset button after obtaining the test results corresponding to the corresponding test performance, and the network device can respond to the pressing operation and reset the target number of presses corresponding to the mode button, which is conducive to improving the convenience of resetting the target number of presses corresponding to the mode button. For another example, during the performance test of the network device, if an abnormality occurs, the user can press the mode button, so that the network device responds to the pressing operation and resets the target number of presses corresponding to the mode button, so that the network device can return to normal. There is no limitation here.
[0087] In this way, based on the setting of the reset button on the network device, the user can press the reset button accordingly according to his or her needs for detecting new functions of the network device, which is conducive to improving the user's performance detection experience of the network device.
[0088] In an exemplary implementation, the process of the performance detection method of the network device is described by taking the detection performance of the network device including the detection performance shown in Table 1 as an example.
[0089] like Figure 3 As shown, the performance detection method of the network device includes steps S201 to S207.
[0090] Step S201, obtaining a target number of presses on a mode button.
[0091] For example, the initial value of the target number of presses is 0. In response to a press operation on the mode button, a GPIO interrupt is triggered, and the acquired target number of presses on the mode button is increased by 1.
[0092] Step S202, determining whether a pressing operation on the mode button is obtained again within the first preset time interval, if so, jump to step S201, if not, jump to step S203.
[0093] For example, if the user presses the mode button again within the first preset time interval, the target number of presses of the mode button is increased by 1. If the user does not press the mode button again within the first preset time interval, the target number of presses of the mode button remains unchanged.
[0094] Step S203, according to the target number of pressing times, light up the indicator light corresponding to the target number of pressing times to indicate that the current detection performance of the network device is the target detection performance.
[0095] For example, the indicator lights set on the network device can light up in sequence as the target number of presses increases. For example, the user presses the mode button four times in succession, and the time interval between two adjacent presses is less than or equal to the first preset time interval, and within the first preset time interval after obtaining the four presses of the mode button, no press operation on the mode button is obtained again, then it can be determined that the target number of presses is 4. Accordingly, the fourth indicator light on the network device can be lit. The word "STP" is displayed under the fourth indicator light to indicate that the fourth indicator light corresponds to the detection performance of the port spanning tree status. Among them, the first preset time interval can include 3 seconds, 4 seconds, 5 seconds, etc., which are not limited here.
[0096] Step S204: Detect the network device according to the target detection performance to obtain a detection result.
[0097] For example, the network device may first control the fourth indicator light to turn off, so as to indicate to detect the target detection performance corresponding to the network device, such as detecting the port spanning tree status of the network device, to obtain the detection result.
[0098] Step S205, displaying the detection result through the indicator light.
[0099] For example, when the port spanning tree status of the network device is obtained, that is, the detection result is obtained, the detection result can be displayed according to the indicator light. For example, when the port spanning tree status is "forward", the green light is on, and when the port spanning tree status is "block", the yellow light is on, indicating an abnormality.
[0100] Step S206, determining whether a pressing operation on the mode button is obtained again within the second preset time interval, if so, jump to step S201, if not, jump to step S207.
[0101] For example, within the second preset time interval after the fourth pressing operation of the mode button is obtained, if the pressing operation of the mode button is obtained again, the network device can switch the detection performance to the next detection performance of the port spanning tree state detection performance, such as the CPU occupancy detection performance, to detect the subsequent detection performance. The second preset time interval may include 3 minutes, 4 minutes, 5 minutes, etc., which are not limited here.
[0102] Step S207, resetting the target number of presses corresponding to the mode button and restoring the indicator light to an initial state.
[0103] For example, if the target number of presses corresponding to the reset mode button is 0, then when the performance test of the network device is subsequently performed, the target number of presses of the mode button can be re-acquired to re-determine the target detection performance. Accordingly, the indicator light can be restored to the initial state. For example, all indicator lights can be turned off. Of course, this is not limited to this and is not limited here.
[0104] The performance detection method for a network device provided in the above-mentioned embodiment is that a mode button is provided on the network device, and the number of times the mode button is pressed corresponds one-to-one to the detection performance corresponding to the network device, by obtaining a target number of presses corresponding to the mode button; determining the target detection performance according to the target number of presses; and detecting the network device according to the target detection performance to obtain a detection result of the target detection performance, thereby improving the convenience of performance detection of the network device and improving the efficiency of performance detection of the network device.
[0105] See also Figure 2 , Figure 2 A schematic diagram of the structure of a network device provided in an embodiment of the present application.
[0106] like Figure 2 As shown, the network device 100 is provided with a mode button 110 , and the number of times the mode button 110 is pressed corresponds to the detection performance corresponding to the network device 100 .
[0107] In some implementations, the network device 100 is used to obtain the target number of presses corresponding to the mode button 110, determine the target detection performance corresponding to the network device 100 based on the target number of presses, and detect the network device 100 based on the target detection performance to obtain a detection result of the target detection performance.
[0108] In some embodiments, Figure 2 As shown, an indicator light 120 corresponding to the detection performance is provided on the network device 100. The indicator light 120 lights up according to the target pressing times to indicate that the current detection performance of the network device 100 is the target detection performance, and displays the detection result of the target detection performance.
[0109] Those skilled in the art will understand that Figure 2 The structure shown in the figure is merely a block diagram of a partial structure related to the embodiment of the present application, and does not constitute a limitation on the network device 100 to which the embodiment of the present application is applied. The specific network device 100 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0110] It should be noted that technicians in the relevant field can clearly understand that for the convenience and simplicity of description, the specific working process of the network device 100 described above can refer to the corresponding process in the aforementioned network device performance detection method embodiment, and will not be repeated here.
[0111] The embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. The computer program can be executed by a processor, and the processor implements any performance detection method of a network device provided in the description of the embodiment of the present application.
[0112] The storage medium may be an internal storage unit of the network device described in the foregoing embodiment, such as a hard disk or memory of the network device. The storage medium may also be an external storage device of the network device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc., provided on the network device.
[0113] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware embodiment, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0114] It should be understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system 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 system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system including the element.
[0115] The serial numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments. The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A performance detection method for a network device, wherein the network device is provided with a mode button, and the number of times the mode button is pressed corresponds to the detection performance corresponding to the network device, and the performance detection method comprises: Obtaining a target number of presses corresponding to the mode button; determining target detection performance according to the number of target presses; The network device is detected according to the target detection performance to obtain a detection result of the target detection performance.
2. The performance detection method according to claim 1, characterized in that: The obtaining of the target number of presses corresponding to the mode button includes: In a case where no pressing operation on the mode button is obtained again within a first preset time interval after the pressing operation on the mode button is obtained for the first number of pressings, and no pressing operation on the mode button is obtained within a second preset time interval before the pressing operation on the mode button is obtained for the first number of pressings, determining the first number of pressings as the target number of pressings; Among them, in the pressing operation of the first number of pressing times, the time interval between two adjacent pressing operations is less than or equal to the first preset time interval, and the second preset time interval is greater than or equal to the product of the first preset time interval and the total number of detection performances corresponding to the network device.
3. The performance detection method according to claim 1, characterized in that: The obtaining of the target number of presses corresponding to the mode button includes: In a case where a pressing operation on the mode button is not obtained again within a first preset time interval after a pressing operation on the mode button is obtained for a first number of times, and a pressing operation on the mode button is obtained for a second number of times within a second preset time interval before a pressing operation on the mode button is obtained for the first number of times of times, a sum of the first number of times of pressing and the second number of times of pressing is determined as the target number of times of pressing; Among them, in the pressing operation of the first number of presses and the pressing operation of the second number of presses, the time interval between two adjacent pressing operations is less than or equal to the first preset time interval, and the second preset time interval is greater than or equal to the product of the first preset time interval and the total number of detection performances corresponding to the network device.
4. The performance detection method according to claim 1, characterized in that: After detecting the network device according to the target detection performance and obtaining the detection result, the method further includes: If no pressing operation on the mode button is obtained again within a second preset time interval after the detection result is obtained, the target number of pressing times corresponding to the mode button is reset.
5. The performance detection method according to claim 1, characterized in that: The network device is provided with a reset button; The performance detection method further includes: In response to a pressing operation on a reset button of the network device, a target number of pressing times corresponding to the mode button is reset.
6. The performance detection method according to any one of claims 1 to 5, characterized in that: Determining the target detection performance according to the number of target pressing times includes: According to a preset correspondence, the target detection performance corresponding to the target number of presses is determined from the plurality of detection performances, wherein the preset correspondence is the correspondence between the number of presses of the mode button and the detection performance.
7. The performance detection method according to any one of claims 1 to 5, characterized in that: The network device is provided with an indicator light corresponding to the detection performance; Determining the target detection performance according to the number of target pressing times includes: According to the target number of presses, an indicator light corresponding to the target number of presses is lit to indicate that the current detection performance of the network device is the target detection performance.
8. The performance detection method according to claim 7, characterized in that: After detecting the network device according to the target detection performance to obtain the detection result of the target detection performance, the method further includes: The detection result is displayed through the indicator light.
9. The performance detection method according to claim 8, characterized in that: The displaying of the detection result by the indicator light includes: When the detection result is a data result, a preset number of indicator lights corresponding to the data result are lit.
10. The performance detection method according to claim 8, characterized in that: The displaying of the detection result by the indicator light includes: In the case where the detection result is a status judgment result, the color of the indicator light is a preset color corresponding to the status judgment result.
11. A network device, characterized in that: The network device is provided with a mode button, and the number of times the mode button is pressed corresponds to the detection performance corresponding to the network device.
12. The network device according to claim 11, characterized in that: The network device is used to obtain the target number of presses corresponding to the mode button, determine the target detection performance corresponding to the network device according to the target number of presses, and detect the network device according to the target detection performance to obtain the detection result of the target detection performance.
13. The network device according to claim 11, characterized in that: The network device is provided with an indicator light corresponding to the detection performance; The indicator light lights up according to the target pressing times to indicate that the current detection performance of the network device is the target detection performance, and displays the detection result of the target detection performance.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program can be executed by a processor, and the processor implements the performance detection method of the network device according to any one of claims 1 to 10.