Fault level determination method and device and storage medium
By determining the port operating status and evaluating parameters in the switch, the target log file is generated, and network interruption caused by unclassified switch device log information is solved, achieving efficient fault-level processing and business continuity.
Patent Information
- Application Number
- CN202510639799.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2025-07-29
AI Technical Summary
In the prior art, the log information of the switch equipment is not sent in a classified manner, which may cause the network administrator to ignore the serious failure log information, resulting in network interruption and affecting business development.
By determining the operating status of the switch port and evaluating parameters, a target log file is generated, and the fault level is determined based on the target parameters, the user is displayed at different levels of log information, and high-level faults are given priority.
Effectively avoid network interruptions, ensure the normal development of related services, and improve the efficiency and accuracy of fault handling.
Smart Images

Figure CN120389942A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to a method, device, and storage medium for determining a fault level. Background Art
[0002] During the operation of a switch device, the switch device generates different log messages according to its own operation status or the change status of the network environment. Network administrators can analyze and judge whether the current network environment is stable based on these log messages, and whether each port on the switch device is working properly, and can determine corresponding solutions for faults.
[0003] In the prior art, all log messages are sent to the same log server for network administrators to analyze. However, during the process of sending log messages, the log messages are not classified, which may lead to the situation that network administrators ignore log messages reflecting serious faults or are unable to process them, resulting in network interruption and affecting the development of related services. Summary of the Invention
[0004] To solve the problems in the above prior art, embodiments of this application provide a method, device, and storage medium for determining a fault level, which are used to determine the fault level corresponding to each log message, so as to determine the corresponding log message sending method, enabling network administrators to give priority to handling high-level faults, avoiding network interruption, and thus ensuring the normal development of related services.
[0005] In a first aspect, an embodiment of this application provides a method for determining a fault level, and the method includes:
[0006] Receiving a target log file corresponding to a target parameter sent by a target switch; the target log file is generated after the operation status of any port in the target switch changes; the target parameter is determined based on evaluation parameters corresponding to at least one port whose operation status becomes a first state after change, and / or evaluation parameters corresponding to a port whose operation status becomes a second state after change; the evaluation parameter corresponding to each port is positively correlated with the operation status of each port and the core device connected to each port; the core device is a device that provides services for other devices except the core device connected to the target switch;
[0007] Determining the fault level corresponding to the target switch that generates the target log file based on the target parameter.
[0008] In the above manner, the corresponding fault level can be determined based on the target parameters of the target log file generated by the switch. The target parameters are determined according to the running status of each port in the switch and the evaluation parameters corresponding to each port. After the running status of any port in the target switch changes, the target log file and the corresponding target parameters can be sent to the log server. Then, the log server can determine the corresponding fault level based on the target parameters, and determine different methods of presenting to the user for different fault levels, so that the user can give priority to handling high-level faults and avoid network interruption, thus ensuring the normal development of related services.
[0009] In a possible implementation manner, after determining the fault level of the target switch corresponding to the target log file generated based on the target parameters, the method further includes:
[0010] If the fault level of the target switch is the first level, display the target log file and the identification information of the ports in the target switch corresponding to the target log file whose running status is the second status to the user;
[0011] If the fault level of the target switch is the second level, save the target log file to a temporary folder, and when the number of log files saved in the temporary folder reaches a set threshold, display the target parameters corresponding to each log file saved in the temporary folder and the identification information of the target switch to the user;
[0012] If the fault level of the target switch is the third level, save the target log file to a log folder; the log folder is used to display the identification information of each saved log file to the user after being accessed by the user.
[0013] Through the above method, different ways of displaying log files can be determined according to different fault levels of the target switch. For high-level faults, they can be directly displayed to the user, while for low-level faults, it can be determined whether to display them to the user according to different urgencies. This can enable the user to handle high-level faults in a timely manner, avoid network interruption, and thus ensure the normal development of related services.
[0014] In a possible implementation manner, after determining the fault level of the target switch corresponding to the target log file generated based on the target parameters, the method further includes:
[0015] Select a set number of historical log files from the historical log folder based on the similarity between the target log file and each historical log file saved in the historical log folder; multiple historical log files of different failure levels are saved in the historical log folder, and solutions to the failures corresponding to each historical log file are also saved.
[0016] Display the set number of historical log files and the solutions to the failures corresponding to the set number of historical log files to the user.
[0017] Through the above method, it is possible to utilize each historical log file generated before the target log file is generated, and analyze the solution to the target log file based on the solution corresponding to the historical log file, which to a certain extent increases the reusability rate of the solution analysis process and improves the efficiency of troubleshooting.
[0018] In a second aspect, an embodiment of the present application provides a method for determining a failure level, the method including:
[0019] After the operating state of any port changes, determine a target parameter based on the evaluation parameters corresponding to at least one port whose operating state after the change is the first state, and / or the evaluation parameters corresponding to a port whose operating state after the change is the second state, and generate a target log file corresponding to the target parameter; the evaluation parameter corresponding to each port is positively correlated with the operating state of each port and the core device connected to each port; the core device is a device that provides services for other devices except the core device connected to the target switch.
[0020] Send the target log file to the log server to determine the failure level corresponding to the target switch.
[0021] Through the above method, the target switch can generate a target log file and the corresponding target parameter. By determining the operating state of each port in the target switch and the evaluation parameter corresponding to each port, the corresponding target parameter is obtained, and then the target log file corresponding to the target parameter is sent to the corresponding processing device to determine the failure level corresponding to the target log file and perform subsequent processing, enabling the user to prioritize the handling of high-level failures and avoid network interruptions, thereby ensuring the normal development of related services.
[0022] In a possible implementation manner, the evaluation parameter corresponding to each port is determined in the following manner:
[0023] For any port, determine the evaluation parameters corresponding to the at least one core device based on the services provided by the at least one core device connected to the any port;
[0024] Determine the evaluation parameter corresponding to any port based on the evaluation parameter corresponding to the at least one core device;
[0025] The target parameter is determined in the following manner:
[0026] Determine the operation mode based on the operating state after the change of any port; the operation mode includes a first operation mode and a second operation mode;
[0027] Through the first operation mode, perform operations on the evaluation parameters corresponding to each port whose operating state after the change is the first state to obtain the target parameter, or,
[0028] Through the second operation mode, perform operations on the sum of the evaluation parameters corresponding to each port and the evaluation parameters corresponding to each port whose operating state after the change is the second state together to obtain the target parameter, or,
[0029] Through the first operation mode, perform operations on the previous target parameter and the evaluation parameters corresponding to each port whose operating state after the change is the first state together to obtain a first operation result; and through the second operation mode, perform operations on the first operation result and the evaluation parameters corresponding to each port whose operating state after the change is the second state together to obtain the target parameter; wherein the previous target parameter is the target parameter corresponding to the last log file generated before the target switch generates the target log file.
[0030] Through the above method, the operation process of the target parameter can be realized in multiple ways. Therefore, in the actual use process, multiple ways can be used to verify the determined target parameter, avoiding possible errors in the process of determining the target parameter.
[0031] In a possible implementation manner, the evaluation parameter corresponding to the at least one core device is determined in the following manner:
[0032] For any one of the at least one core device, execute:
[0033] Based on the service type provided by any one of the core devices, determine the corresponding first part of the evaluation parameter; wherein, core devices providing different service types correspond to different first parts of the evaluation parameter;
[0034] Based on the number of ordinary devices provided with services by any one of the core devices and the evaluation parameters corresponding to the ordinary devices, determine the second part of the evaluation parameter; the evaluation parameter corresponding to the ordinary device is less than the first part of the evaluation parameter corresponding to any one of the core devices;
[0035] Based on the first part of evaluation parameters and the second part of evaluation parameters, determine the evaluation parameters corresponding to any one of the core devices.
[0036] Through the above method, the evaluation parameters corresponding to each core device can be determined, so that the target parameters corresponding to the target switch can be determined based on the evaluation parameters corresponding to the core devices, which increases the accuracy of determining the target parameters corresponding to the target switch to a certain extent.
[0037] In a possible implementation manner, after sending the target log file to the log server, the method further includes:
[0038] If a repair instruction for the fault sent by the user is received within a set time period, after performing the actions corresponding to the repair instruction, return to the step of generating the target log file corresponding to the target parameters;
[0039] If a repair instruction for the fault sent by the user is not received within a set time period, re-enable any one of the ports whose status has changed, set the transmission rate of any one of the ports to be the same as that of the core device connected to any one of the ports, and return to the step of generating the target log file corresponding to the target parameters.
[0040] Through the above method, the repair process of the fault corresponding to the target log file can be further realized, and the repair can be performed after receiving the user's repair instruction, or the automatic repair can be performed after not receiving the user's repair instruction, which improves the efficiency of the fault repair process.
[0041] In a third aspect, an embodiment of the present application provides a fault level determination device, including:
[0042] A log file receiving unit, configured to receive a target log file corresponding to target parameters sent by a target switch; the target log file is generated after the operating status of any one of the ports in the target switch changes; the target parameters are determined based on evaluation parameters corresponding to at least one port whose operating status after change is in the first state, and / or evaluation parameters corresponding to a port whose operating status after change is in the second state; the evaluation parameter corresponding to each port is positively correlated with the operating status of each port and the core device connected to each port; the core device is a device for providing services to other devices except the core device connected to the target switch;
[0043] A fault level determination unit, configured to determine the fault level corresponding to the target switch that generates the target log file corresponding to the target parameters based on the target parameters.
[0044] Fourthly, an embodiment of the present application provides a fault level determination device, including:
[0045] A log file generation unit, configured to, after the operating state of any port changes, determine a target parameter based on evaluation parameters corresponding to at least one port whose operating state after the change is the first state, and / or evaluation parameters corresponding to a port whose operating state after the change is the second state, and generate a target log file corresponding to the target parameter; the evaluation parameter corresponding to each port is positively correlated with the operating state of each port and the core device connected to each port; the core device is a device for providing services to other devices except the core device connected to the target switch;
[0046] A log file sending unit, configured to send the target log file to the log server to determine the fault level corresponding to the target switch.
[0047] Fifthly, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the method described in the first aspect or the second aspect is implemented.
[0048] An embodiment of the present application provides a fault level determination method, device, and storage medium. The target switch can determine a target parameter according to the operating state of each port and the evaluation parameter corresponding to each port, where the target parameter is determined based on the evaluation parameters corresponding to the ports whose operating states after the change are the first state and / or the second state. After the operating state of any port in the target switch changes, the target log file and the corresponding target parameter can be sent to the log server. Then, the log server can determine the corresponding fault level based on the target parameter, and determine different methods for presenting to the user for different fault levels, so that the user can give priority to handling high-level faults and avoid network interruption, thereby ensuring the normal development of related services. Description of the Drawings
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0050] Figure 1 It is a schematic application scenario diagram of a fault level determination method provided by an embodiment of the present application;
[0051] Figure 2An interaction flowchart of a method for determining a fault level provided by an embodiment of the present application;
[0052] Figure 3 A specific interaction flowchart of a method for determining a fault level provided by an embodiment of the present application;
[0053] Figure 4 A schematic structural diagram of a device for determining a fault level provided by an embodiment of the present application;
[0054] Figure 5 A schematic structural diagram of another device for determining a fault level provided by an embodiment of the present application;
[0055] Figure 6 A schematic structural diagram of a log server provided by an embodiment of the present application;
[0056] Figure 7 A schematic structural diagram of a target switch provided by an embodiment of the present application. Detailed implementation manners
[0057] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Among them, the described embodiments are some but not all of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0058] In the description of the embodiments of the present application, unless otherwise specified, " / " means "or", for example, A / B may mean A or B; "and / or" in the text is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may mean: A exists alone, A and B exist simultaneously, and B exists alone.
[0059] Specifically, in the description of the present application, it should be understood that the terms "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", etc. indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present application. And, as used in the present application, "connection" and "coupling", unless otherwise specified, both include direct and indirect connection (coupling).
[0060] In addition, the terms "first" and "second" are only used for descriptive purposes and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of the said features. In the description of the present application, "a plurality" means two or more, unless otherwise specifically defined.
[0061] The present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0062] In a possible embodiment, Figure 1 FIG. shows a schematic diagram of an application scenario of a fault level determination method provided by an embodiment of the present application. Refer to Figure 1 as shown. Figure 1 It includes two switches, namely switch 110 and switch 120. Both switches are connected to the log server 200. Moreover, each switch can be connected to the router 300 through an uplink port to provide network services for the terminal devices 400, 410, and 420 connected through the downlink ports. Among them, the terminal devices 400, 410, and 420 can be, or can also be Graphics Processing Unit (GPU) servers, or other devices capable of data processing and computing. The present application does not make any limitations here. It should be noted that the number of switches and terminal devices can be selected according to different needs, and other core devices for providing services to terminal devices can also be connected through the uplink ports of the switches, not limited to routers.
[0063] Figure 1 The application scenario of... is only an example of an application scenario for implementing the embodiments of the present application, and the embodiments of the present application are not limited to the above Figure 1 described application scenario. The following describes the fault prediction method provided by the exemplary embodiment of the present application in conjunction with the above-described application scenario with reference to the accompanying drawings. It should be noted that the above application scenario is only shown for the convenience of understanding the spirit and principle of the present application, and the embodiments of the present application are not limited in this regard.
[0064] Figure 2 FIG. shows an interaction flowchart of a fault level determination method provided by an embodiment of the present application. As Figure 2 shown, the method may include the following steps:
[0065] Step S201: After the operating state of any port of the target switch changes, determine the target parameter and generate a target log file corresponding to the target parameter.
[0066] In a possible embodiment, the target switch can detect whether the operating state of any port has changed. If the operating state of any port in the target switch has changed, the target parameter can be determined based on the evaluation parameters corresponding to at least one port whose operating state becomes the first state after the change, and / or the evaluation parameters corresponding to the port whose operating state becomes the second state after the change.
[0067] Before determining the target parameter, it is necessary to first determine the evaluation parameter corresponding to each port in the following manner: for any port in the target switch, at least one evaluation parameter corresponding to at least one core device can be determined based on the services provided by the at least one core device connected to the port, and the evaluation parameter corresponding to any port can be determined based on the evaluation parameters corresponding to the at least one core device, where the core device is used to provide services for other devices except the core device connected to the target switch, such as devices like routers.
[0068] Specifically, for any core device, the corresponding first part of the evaluation parameter can be determined based on the service type provided by the core device, and then the second part of the evaluation parameter can be determined based on the number of ordinary devices receiving the service provided by the core device and the evaluation parameters corresponding to the ordinary devices. It should be noted that core devices providing different service types correspond to different first parts of the evaluation parameters, and the more important the service provided by the core device, the higher the corresponding first part of the evaluation parameter. Also, the evaluation parameter corresponding to an ordinary device is less than the first part of the evaluation parameter corresponding to any core device. For example, it can be set in advance that the first part of the evaluation parameter corresponding to a core device providing network services is 15, the first part of the evaluation parameter corresponding to a core device providing storage services is 12, and the evaluation parameter corresponding to an ordinary device is 0.5. If there is a core device that can provide network services for other ordinary devices connected to the switch, and the number of ordinary devices receiving the network services of this core device is 20, then the evaluation parameter corresponding to this switch can be determined as 15 + 20 * 0.5 = 25.
[0069] The evaluation parameter corresponding to each port in the target switch can be determined by the above method. After determining the evaluation parameter corresponding to each port in the target switch, the target parameter can be determined in the following manner:
[0070] Method 1: Through the first operation method, the evaluation parameters corresponding to each port whose operating state becomes the first state after change can be operated to obtain the target parameter. Among them, the port with the operating state of the first state can be the port with the operating state of being open, and the first operation method can be addition. That is to say, by adding the evaluation parameters corresponding to each port whose operating state becomes the first state after change, the target parameter can be obtained. For example, in Switch 1, the evaluation parameters corresponding to the ports whose operating state becomes the first state after change are 4, 7, and 13. Then it can be determined that the target parameter corresponding to Switch 1 is 24.
[0071] Method 2: Through the second operation method, the sum of the evaluation parameters corresponding to each port and the evaluation parameters corresponding to each port whose operating state becomes the second state after change can be operated together to obtain the target parameter. Among them, the port with the operating state of the second state can be the closed port, and the second operation method can be subtraction. Usually, before the target switch runs, the evaluation parameters corresponding to each port in the target switch can already be obtained. The evaluation parameters corresponding to each port are added together, and then the result obtained after addition is subtracted by the evaluation parameters corresponding to each port whose operating state becomes the second state after change, and the target parameter can be obtained. For example, in Switch 2, the sum of the evaluation parameters corresponding to each port is 33, and the evaluation parameters corresponding to the ports whose operating state becomes the second state after change are 3, 7, and 5 respectively. Then it can be determined that the target parameter corresponding to Switch 2 is 17.
[0072] Method 3: It is also possible to obtain the previous target parameter determined by the target switch, that is, the target parameter corresponding to the last log file generated before generating the target log file. After obtaining the previous target parameter, the previous target parameter and the evaluation parameters corresponding to each port whose operating state becomes the first state after change can be operated through the first operation method to obtain the first operation result. Then, through the second operation method, the first operation result and the evaluation parameters corresponding to each port whose operating state becomes the second state after change can be operated together to obtain the target parameter. For example, the previous target parameter corresponding to Switch 3 is 46. When generating the target log file, a port changes from the closed state to the open state, and the corresponding evaluation parameter is 5. Another port changes from the open state to the closed state, and the corresponding evaluation parameter is 9. Then it can be determined that the first operation result is 46 + 5 = 51. After obtaining the first operation result, it can be determined that the target parameter corresponding to Switch 3 based on the first operation result is 51 - 9 = 42.
[0073] In a possible embodiment, after determining the target parameter, a target log file corresponding to the target parameter can be generated. The target log file may or may not contain the target parameter. The target parameter can be a value bound to the target log file. Among them, the target log file can also contain the port information corresponding to each port in the target switch, the operating status of the port, and the evaluation parameter corresponding to the port. It can also contain the operating status of the port at different time periods, so that the user can make a judgment based on the previous data during the display to the user.
[0074] Step S202, the target switch sends the target log file to the log server.
[0075] In a possible embodiment, the target switch can send the target log file to the log server after generating the target log file corresponding to the target parameter.
[0076] Step S203, the log server receives the target log file corresponding to the target parameter sent by the target switch.
[0077] In a possible embodiment, the log server can receive the target log file corresponding to the target parameter sent by the target switch.
[0078] Step S204, the log server determines the fault level corresponding to the target switch that generates the target log file corresponding to the target parameter based on the target parameter.
[0079] In a possible embodiment, after the log server receives the target log file corresponding to the target parameter sent by the target switch, it can determine the fault level corresponding to the target switch that generates the target log file corresponding to the target parameter based on the target parameter. Specifically, it can determine the sum of the evaluation parameters corresponding to each port and the corresponding parameter threshold, so as to classify different target log files. For example, if the sum of the evaluation parameters corresponding to each port is 50, it can be considered that the fault level of the target switch reflected by the target log file with a target parameter greater than 40 is the third level, and it can be considered that the fault level of the target switch reflected by the target log file with a target parameter greater than 30 and less than 40 is the second level, and it can be considered that the fault level of the target switch reflected by the target log file with a target parameter less than 30 is the first level.
[0080] In a possible embodiment, different solutions can be adopted for different fault levels:
[0081] If the fault level corresponding to the target switch is the third level, it indicates that the fault level corresponding to the target switch is relatively low, and there may even be no fault. Therefore, the target log file can be saved to the log folder. The log files saved in the log folder will not be actively displayed to the user. Instead, when the user sends a viewing request to the log server, after the log server receives the viewing request sent by the user, it will display the identification information of each log file to the user. Among them, the identification information of the log file can include information such as the generation time of the log file and the target parameters corresponding to the log file.
[0082] If the fault level corresponding to the target switch is the second level, it indicates that the fault level corresponding to the target switch has reached the medium level, and there may be a fault that requires the user to actively repair, but the fault itself is not very serious. Therefore, the target log file can be saved in the temporary folder. The log server can monitor the number of log files saved in the temporary folder in real time. If the number of log files reaches the set threshold, it can display the target parameters corresponding to each log file saved in the temporary folder and the identification information of the target switch to the user. The user can process the corresponding fault according to the content displayed in the temporary folder.
[0083] If the fault level corresponding to the target switch is the first level, it indicates that the fault level corresponding to the target switch is relatively high, and there is a fault that requires the user to handle immediately. The target log file and the identification information of the ports in the second state of the running status in the target switch corresponding to the target log file can be directly displayed to the user. Moreover, after displaying the target log file to the user, based on the similarity between the target log file and each historical log file saved in the historical log folder, a set number of historical log files can be selected from the historical log folder, and the set number of historical log files and the solutions to the faults corresponding to the set number of historical log files can be displayed to the user. Among them, multiple historical log files of different fault levels and the solutions to the faults corresponding to each historical log file are saved in the historical folder. For example, log file 1 with ports 1, 2, and 3 closed at the same time and the corresponding solution are saved in the historical folder, as well as log file 2 with ports 2, 3, and 4 closed at the same time and the corresponding solution, and log file 3 with ports 1, 2, 3, and 4 closed at the same time and the corresponding solution. If the fault reflected by the target log file is that ports 2, 3, and 4 are closed at the same time, log file 2 and the corresponding solution can be extracted from the historical log folder and displayed to the user.
[0084] It should be noted that the fault levels are not limited to the above three levels, and can also be divided into more levels or fewer levels according to different needs. Different handling methods can also be adopted according to different levels, which are not limited to the above three handling methods either. This application does not make any limitations here.
[0085] In a possible embodiment, if within a set time period, the target switch receives a repair instruction for a fault sent by a user, the target switch can return to execute the step of generating a target log file corresponding to the target parameter after performing the actions corresponding to the repair instruction, that is, step S201; if within the set time period, the target switch does not receive a repair instruction for a fault sent by the user, the target switch can re-enable the ports whose states have changed. Usually, the ports whose states have changed are the ports that have changed from the open state to the closed state. After re-enabling, the transmission rate of the port is set to be the same as that of the core device connected to any port, and then return to execute the step of generating a target log file corresponding to the target parameter, that is, step S201.
[0086] In another possible embodiment, the fault level corresponding to the target switch may not be determined by the target parameter. During the process of the target switch generating a log file, the type of each log file can be determined. In a specific type of log file, the fault level corresponding to the log file can be saved. After the target switch sends the log file to the log server, the log server can use the findall function in the re module of the python programming language to identify the log information of the type ".*-[0-7]{1}:.*", and extract the fault level number therein. Further, different handling measures are determined according to the fault level. It should be noted that different switches may have different regular expressions. In addition to identifying the log information of the type ".*-[0-7]{1}:.*", the log information of the type ".*-[0-7]{1}-.*" can also be identified, and the log information of the type ".* / [0-7]{1} / .*" can also be identified. The technical means of determining the fault level can also be achieved.
[0087] The embodiments of the present application provide a method, apparatus, and storage medium for determining a fault level. The target switch can determine a target parameter based on the operating status of each port and the evaluation parameter corresponding to each port. Among them, the target parameter is determined based on the evaluation parameters corresponding to the ports whose operating status is the first state and / or the second state after the change. After the operating status of any port in the target switch changes, the target log file and the corresponding target parameter can be sent to the log server. Then, the log server can determine the corresponding fault level based on the target parameter, and determine different methods for presenting to the user for different fault levels, so that the user can prioritize the handling of high-level faults and avoid network interruption, thereby ensuring the normal development of related services.
[0088] In a specific embodiment, Figure 3 The specific flowchart of a method for determining a fault level provided by an embodiment of the present application is shown. As Figure 3 shown, the method may include the following steps:
[0089] Step S301, for any port, the target switch determines the evaluation parameters corresponding to at least one core device based on the services provided by at least one core device connected to the any port, and determines the evaluation parameter corresponding to the any port based on the evaluation parameters corresponding to the at least one core device.
[0090] Step S302, the target switch determines an operation method based on the operating status after the change of any port, and determines the target parameter based on the evaluation parameters corresponding to at least one port whose operating status is the first state after the change and / or the evaluation parameters corresponding to the port whose operating status is the second state after the change through the determined operation method.
[0091] Step S303, the target switch generates a target log file corresponding to the target parameter.
[0092] Step S304, the target switch sends the target log file to the target server.
[0093] Step S305, the target server receives the target log file.
[0094] Step S306, the target server determines the fault level corresponding to the target switch that generates the target log file corresponding to the target parameter based on the target parameter.
[0095] In a possible embodiment, if the fault level corresponding to the target switch is the first level, the target log file and the identification information of the port in the target switch corresponding to the target log file whose operating status is the second state are presented to the user;
[0096] If the fault level corresponding to the target switch is the second level, save the target log file to a temporary folder, and when the number of log files saved in the temporary folder reaches the set threshold, display the target parameters corresponding to each log file saved in the temporary folder and the identification information of the target switch to the user;
[0097] If the fault level corresponding to the target switch is the third level, save the target log file to a log folder; the log folder is used to display the identification information of each saved log file to the user after being accessed by the user.
[0098] Step S307, the target server selects a set number of historical log files from the historical log folder based on the similarity between the target log file and each historical log file saved in the historical log folder, and displays the set number of historical log files and the solutions to the faults corresponding to the set number of historical log files to the user.
[0099] Step S308, if the target switch receives a repair instruction for the fault sent by the user within the set time period, execute the action corresponding to the repair instruction.
[0100] Step S309, if the target switch does not receive a repair instruction for the fault sent by the user within the set time period, re-enable any one of the ports whose status has changed, and set the transmission rate of any one of the ports to be the same as that of the core device connected to any one of the ports.
[0101] Based on the same inventive concept, Figure 4 For the structural block diagram of a fault level determination device provided in an embodiment of the present application, as Figure 4 shown, the fault level determination device 400 may include:
[0102] A log file receiving unit 401, configured to receive a target log file corresponding to a target parameter sent by the target switch; the target log file is generated after the operating status of any one of the ports in the target switch changes; the target parameter is determined based on the evaluation parameters corresponding to at least one port whose operating status after change is the first state, and / or the evaluation parameters corresponding to a port whose operating status after change is the second state; the evaluation parameter corresponding to each port is positively correlated with the operating status of each port and the core device connected to each port; the core device is a device for providing services to other devices other than the core device connected to the target switch;
[0103] A fault level determination unit 402, configured to determine the fault level corresponding to the target switch that generates the target log file corresponding to the target parameter based on the target parameter.
[0104] In a possible implementation, the fault level determination unit 402 is further configured to, if the fault level corresponding to the target switch is the first level, display the target log file to the user, and the identification information of the ports in the second state among the running states of the target switch corresponding to the target log file;
[0105] If the fault level corresponding to the target switch is the second level, save the target log file to a temporary folder, and when the number of log files saved in the temporary folder reaches a set threshold, display the target parameters corresponding to each log file saved in the temporary folder and the identification information of the target switch to the user;
[0106] If the fault level corresponding to the target switch is the third level, save the target log file to a log folder; the log folder is used to display the identification information of each saved log file to the user after being accessed by the user.
[0107] In a possible implementation, the fault level determination unit 402 is further configured to select a set number of historical log files from the historical log folder based on the similarity between the target log file and each historical log file saved in the historical log folder; multiple historical log files of multiple fault levels and the solutions to the faults corresponding to each historical log file are saved in the historical log folder;
[0108] Display the set number of historical log files and the solutions to the faults corresponding to the set number of historical log files to the user.
[0109] Based on the same inventive concept, Figure 5 For another structural block diagram of the fault level determination device provided by the embodiments of the present application, as Figure 5 shown, the fault level determination device 500 may include:
[0110] A log file generation unit 501, configured to, after the running state of any port changes, determine target parameters based on the evaluation parameters corresponding to at least one port whose running state becomes the first state after the change, and / or the evaluation parameters corresponding to the port whose running state becomes the second state after the change, and generate a target log file corresponding to the target parameters; the evaluation parameter corresponding to each port is positively correlated with the running state of each port and the core device connected to each port; the core device is a device that provides services for other devices except the core device connected to the target switch;
[0111] A log file sending unit 502, configured to send the target log file to the log server to determine the fault level corresponding to the target switch.
[0112] In a possible implementation, the log file generation unit 501 is further configured to, for any port, determine evaluation parameters corresponding to at least one core device based on services provided by the at least one core device connected to the port;
[0113] Determine evaluation parameters corresponding to the port based on the evaluation parameters corresponding to the at least one core device;
[0114] The target parameter is determined in the following manner:
[0115] Determine an operation method based on the changed operating state of the port; the operation method includes a first operation method and a second operation method;
[0116] Through the first operation method, perform operations on the evaluation parameters corresponding to each port whose operating state after change is the first state to obtain the target parameter, or,
[0117] Through the second operation method, perform operations on the sum of the evaluation parameters corresponding to each port and the evaluation parameters corresponding to each port whose operating state after change is the second state to obtain the target parameter, or,
[0118] Through the first operation method, perform operations on the previous target parameter and the evaluation parameters corresponding to each port whose operating state after change is the first state to obtain a first operation result; and through the second operation method, perform operations on the first operation result and the evaluation parameters corresponding to each port whose operating state after change is the second state to obtain the target parameter; where the previous target parameter is the target parameter corresponding to the last log file generated before the target switch generates the target log file.
[0119] In a possible implementation, the log file generation unit 501 is further configured to execute, for any one of the at least one core devices:
[0120] Based on the service type provided by the core device, determine corresponding first part of evaluation parameters; where core devices providing different service types correspond to different first part of evaluation parameters;
[0121] Based on the number of ordinary devices provided with services by the core device and the evaluation parameters corresponding to the ordinary devices, determine second part of evaluation parameters; the evaluation parameters corresponding to the ordinary devices are less than the first part of evaluation parameters corresponding to the core device;
[0122] Based on the first part of evaluation parameters and the second part of evaluation parameters, determine the evaluation parameters corresponding to the core device.
[0123] In a possible implementation manner, the log file sending unit 502 is further configured to, if a repair instruction for a fault sent by a user is received within a set time period, return to execute the step of generating a target log file corresponding to target parameters after performing the action corresponding to the repair instruction;
[0124] If a repair instruction for a fault sent by a user is not received within a set time period, re-enable any one of the ports whose status has changed, set the transmission rate of the any one of the ports to be the same as that of the core device connected to the any one of the ports, and return to execute the step of generating a target log file corresponding to target parameters.
[0125] Based on the same inventive concept, an embodiment of the present application provides a log server, which can implement the functions of the fault level determination method described above. Please refer to Figure 6 , the log server 600 includes a memory 601, a processor 602, and a bus 603.
[0126] The memory 601 is used to store a computer program executed by the processor 602. The memory 601 may mainly include a program storage area and a data storage area. Among them, the program storage area may store an operating system and programs required to run the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.
[0127] The memory 601 may be a volatile memory, such as a random-access memory (RAM); the memory 601 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD), or the memory 601 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 601 may be a combination of the above memories.
[0128] The processor 602 may include one or more central processing units (CPUs) or be a digital processing unit, etc. The processor 602 is used to implement the fault level determination method in the above embodiment when calling the computer program stored in the memory 601.
[0129] In the embodiments of the present application, the specific connection medium between the memory 601 and the processor 602 is not limited. The embodiments of the present application are inFigure 6 In the figure, the medium is connected between the memory 601 and the processor 602 through a bus 603. The bus 603 is represented by a thick line in the figure. For the connection manners between other components, only schematic illustrations are provided and are not limiting. The bus 603 can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, Figure 6 in the figure, only a thick line is used to represent it, but it does not mean that there is only one bus or one type of bus. Figure 6
[0130] Based on the same inventive concept, an embodiment of the present application provides a target switch. The target switch can implement the functions of the fault level determination method discussed above. Please refer to Figure 7 , the target switch 700 includes a memory 701, a processor 702, and a bus 703.
[0131] The memory 701 is used to store computer programs executed by the processor 702. The memory 701 mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, programs required for running instant messaging functions, etc.; the data storage area can store various instant messaging information and operation instruction sets, etc.
[0132] The memory 701 can be a volatile memory, such as a random-access memory (RAM); the memory 701 can also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD), or the memory 701 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 701 can be a combination of the above memories.
[0133] The processor 702 can include one or more central processing units (CPUs) or be a digital processing unit, etc. The processor 702 is used to implement the fault level determination method in the above embodiment when calling the computer program stored in the memory 701.
[0134] In the embodiment of the present application, the specific connection medium between the above-mentioned memory 701 and the processor 702 is not limited. In the embodiment of the present application, Figure 7 the medium is connected between the memory 701 and the processor 702 through a bus 703. The bus 703 is represented by a thick line in the figure. Figure 7 is represented by a thick line. The connection manners between other components are only for illustrative purposes and are not limiting. The bus 703 can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 7 is only represented by a thick line in the figure, but it does not mean that there is only one bus or one type of bus.
[0135] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium. The computer program product includes: computer program code. When the computer program code runs on a computer, it causes the computer to execute the fault level determination method as described in any one of the foregoing discussions. Since the principle of solving problems by the above computer-readable storage medium is similar to that of the fault level determination method, the implementation of the above computer-readable storage medium can refer to the implementation of the method, and the repeated parts will not be described again.
[0136] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.
[0137] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0138] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including instruction means, and the instruction means implements the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0139] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus, so that a series of operation steps are performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions for implementing the steps specified in one process or multiple processes and / or blocks Figure 1 one process or multiple processes and / or blocks Figure 1 in one block or multiple blocks.
[0140] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.
Claims
1. A method for determining a fault level, characterized in that, The method includes: Receiving a target log file corresponding to a target parameter sent by a target switch; the target log file is generated after the operating state of any port in the target switch changes; the target parameter is determined based on evaluation parameters corresponding to at least one port whose operating state becomes the first state after the change, and / or evaluation parameters corresponding to a port whose operating state becomes the second state after the change; the evaluation parameter corresponding to each port is positively correlated with the operating state of each port and the core device connected to each port; the core device is used to provide services for other devices except the core device connected to the target switch; Determining the fault level corresponding to the target switch that generates the target log file corresponding to the target parameter based on the target parameter.
2. The method according to claim 1, wherein After determining the fault level corresponding to the target switch that generates the target log file corresponding to the target parameter based on the target parameter, the method further includes: If the fault level corresponding to the target switch is the first level, presenting the target log file to the user, and the identification information of the port whose operating state in the target switch corresponding to the target log file is the second state; If the fault level corresponding to the target switch is the second level, saving the target log file to a temporary folder, and when the number of log files saved in the temporary folder reaches a set threshold, presenting the target parameter corresponding to each log file saved in the temporary folder and the identification information of the target switch to the user; If the fault level corresponding to the target switch is the third level, saving the target log file to a log folder; the log folder is used to present the identification information of each saved log file to the user after being accessed by the user.
3. The method according to claim 1, characterized in that, After determining the fault level corresponding to the target switch that generates the target log file corresponding to the target parameter based on the target parameter, the method further includes: Selecting a set number of historical log files from the historical log folder based on the similarity between the target log file and each historical log file saved in the historical log folder; the historical log folder stores historical log files of multiple fault levels and solutions to the faults corresponding to each historical log file; Presenting the set number of historical log files and the solutions to the faults corresponding to the set number of historical log files to the user.
4. A method for determining a fault level, characterized in that The method includes: After the operating state of any port changes, determining a target parameter based on evaluation parameters corresponding to at least one port whose operating state becomes the first state after the change, and / or evaluation parameters corresponding to a port whose operating state becomes the second state after the change, and generating a target log file corresponding to the target parameter; the evaluation parameter corresponding to each port is positively correlated with the operating state of each port and the core device connected to each port; the core device is a device used to provide services for other devices except the core device connected to the target switch; Send the target log file to the log server to determine the fault level corresponding to the target switch.
5. The method according to claim 4, wherein The evaluation parameter corresponding to each port is determined in the following manner: For any port, determine the evaluation parameter corresponding to at least one core device based on the services provided by the at least one core device connected to the port; Determine the evaluation parameter corresponding to the port based on the evaluation parameter corresponding to the at least one core device; The target parameter is determined in the following manner: Determine the operation mode based on the changed operating state of the port; the operation mode includes a first operation mode and a second operation mode; Through the first operation mode, calculate the target parameter by calculating the evaluation parameters corresponding to the ports whose operating states change to the first state, or Through the second operation mode, calculate the target parameter by calculating the sum of the evaluation parameters corresponding to each port and the evaluation parameters corresponding to the ports whose operating states change to the second state together, or Through the first operation mode, calculate the first operation result by calculating the previous target parameter and the evaluation parameters corresponding to the ports whose operating states change to the first state together; and through the second operation mode, calculate the target parameter by calculating the first operation result and the evaluation parameters corresponding to the ports whose operating states change to the second state together; where the previous target parameter is the target parameter corresponding to the last log file generated before the target switch generates the target log file.
6. The method according to claim 5, wherein The evaluation parameter corresponding to the at least one core device is determined in the following manner: For any core device in the at least one core device, execute: Determine the corresponding first part of the evaluation parameter based on the service type provided by the core device; among them, core devices providing different service types correspond to different first parts of the evaluation parameter; Determine the second part of the evaluation parameter based on the number of ordinary devices provided with services by the core device and the evaluation parameter corresponding to the ordinary device; the evaluation parameter corresponding to the ordinary device is less than the first part of the evaluation parameter corresponding to the core device; Determine the evaluation parameter corresponding to the core device based on the first part of the evaluation parameter and the second part of the evaluation parameter.
7. The method according to claim 4, wherein After sending the target log file to the log server, the method further includes: If a repair instruction for the fault sent by the user is received within the set time period, after performing the action corresponding to the repair instruction, return to the step of generating the target log file corresponding to the target parameter; If a repair instruction for the fault sent by the user is not received within the set time period, re-enable any one of the ports whose states have changed, set the transmission rate of the port to be the same as that of the core device connected to the port, and return to the step of generating the target log file corresponding to the target parameter.
8. A fault level determination device, characterized in that Including: A log file receiving unit, configured to receive the target log file corresponding to the target parameter sent by the target switch; The target log file is generated after the operating state of any one port in the target switch changes; The target parameter is determined based on the evaluation parameter corresponding to at least one port whose operating state is the first state after the change, and / or the evaluation parameter corresponding to a port whose operating state is the second state after the change; the evaluation parameter corresponding to each port is positively correlated with the operating state of each port and the core device connected to each port; the core device is a device for providing services to other devices except the core device connected to the target switch; A fault level determination unit, configured to determine the fault level corresponding to the target switch that generates the target log file corresponding to the target parameter based on the target parameter.
9. A fault level determination device, characterized in that, Comprising: A log file generation unit, configured to, after the operating state of any one port changes, determine a target parameter based on the evaluation parameter corresponding to at least one port whose operating state is the first state after the change, and / or the evaluation parameter corresponding to a port whose operating state is the second state after the change, and generate a target log file corresponding to the target parameter; the evaluation parameter corresponding to each port is positively correlated with the operating state of each port and the core device connected to each port; the core device is a device for providing services to other devices except the core device connected to the target switch; A log file sending unit, configured to send the target log file to the log server to determine the fault level corresponding to the target switch.
10. A computer-readable storage medium storing a computer program therein, characterized in that: When the computer program is executed by a processor, it implements the method described in claims 1-3, or implements the method described in any one of claims 4-7.